Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
feat(sdk): complete endpoint coverage and expose database SQL
Wolf Mermelstein5a2b6544943e
diff --git a/.agents/rules/sdk.md b/.agents/rules/sdk.mdindex 99455cc514..237492bb05 100644--- a/.agents/rules/sdk.md+++ b/.agents/rules/sdk.md@@ -20,6 +20,8 @@ pass the wrong kind of id and scatters operations away from the thing they act omethods on them (`entry.edit(...)`, `entry.remove()`).- The only id-taking entry point is `static byId(client, id)`, which mints a handle.+Separate the import block, top-level declarations, and class members with blank lines; place JSDoc above the member it documents.+Details and conventions: the `add-sdk-endpoint` skill.Check: no exported SDK method has a parameter or return type that is a bare iddiff --git a/Cargo.lock b/Cargo.lockindex 54c0235e9f..72755d2d57 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -1564,13 +1564,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "129397200fe83088e8a68407a8e2b1f826cf0086b21ccdb866a722c8bcd3a94f"dependencies = ["askama_parser",- "basic-toml","memchr","proc-macro2","quote","rustc-hash 2.1.2",- "serde",- "serde_derive","syn 2.0.117",]@@ -1581,8 +1578,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "d6ab5630b3d5eaf232620167977f95eb51f3432fc76852328774afbd242d4358"dependencies = ["memchr",- "serde",- "serde_derive","winnow 0.7.15",]@@ -3061,15 +3056,6 @@ version = "1.8.3"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06"-[[package]]-name = "basic-toml"-version = "0.1.10"-source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "ba62675e8242a4c4e806d12f11d136e626e6c8361d6b829310732241652a178a"-dependencies = [- "serde",-]-[[package]]name = "bcrypt-pbkdf"version = "0.11.0"@@ -5780,6 +5766,7 @@ dependencies = ["strum 0.27.2","thiserror 2.0.18","tokio",+ "utoipa","uuid","wasm-bindgen",]@@ -5866,6 +5853,7 @@ dependencies = ["ai_toolset","anyhow","async-trait",+ "axum","bot_id","chrono","contacts",@@ -5875,7 +5863,9 @@ dependencies = ["entity_access","filter_ast","item_filters",+ "macro_authorization","macro_user_id",+ "model-error-response","model_owner","models_databases","models_grouping",@@ -5889,7 +5879,9 @@ dependencies = ["soup","thiserror 2.0.18","tokio",+ "tower 0.5.3","tracing",+ "utoipa","uuid","workspace-hack",]@@ -6493,6 +6485,7 @@ dependencies = ["crm","database_webhooks","databases",+ "databases_sql","dictation","document_sub_type","documents",diff --git a/Cargo.toml b/Cargo.tomlindex b5cf6c8d84..97d341b726 100644--- a/Cargo.toml+++ b/Cargo.toml@@ -196,7 +196,8 @@ agent-client-protocol = { git = "https://github.com/agentclientprotocol/rust-sdk"unstable_elicitation",] }arboard = { version = "3.6.1", default-features = false, features = ["wayland-data-control"] }-askama = "0.14"+# Templates use built-in defaults; omit the unused config parser and basic-toml.+askama = { version = "0.14", default-features = false, features = ["derive", "std", "urlencode"] }async-graphql = "7.2.1"async-lock = "3"async-openai = { version = "0.36.1", features = [diff --git a/apps/web/src/lib/service-clients/service-cognition/generated/tools/schemas.ts b/apps/web/src/lib/service-clients/service-cognition/generated/tools/schemas.tsindex 69f62ad25a..9be507a316 100644--- a/apps/web/src/lib/service-clients/service-cognition/generated/tools/schemas.ts+++ b/apps/web/src/lib/service-clients/service-cognition/generated/tools/schemas.ts@@ -11003,6 +11003,7 @@ export const QueryDatabase = z.object({export const QueryDatabaseResponse = z.object({results: z.array(z.object({+ sourceTable: z.union([z.string().uuid(), z.null()]).optional(),columns: z.array(z.object({name: z.string(),diff --git a/apps/web/src/lib/service-clients/service-cognition/generated/tools/types.ts b/apps/web/src/lib/service-clients/service-cognition/generated/tools/types.tsindex 19d14ca54d..c13e355f77 100644--- a/apps/web/src/lib/service-clients/service-cognition/generated/tools/types.ts+++ b/apps/web/src/lib/service-clients/service-cognition/generated/tools/types.ts@@ -12021,6 +12021,10 @@ export interface QueryDatabaseResponse {* A `SELECT`'s rows, as the engine's typed cells.*/export interface ResultSet {+ /**+ * Table whose rows the result identities refer to; absent for aggregates.+ */+ sourceTable?: string | null;/*** The columns, in select-list order.*/diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/columnId.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/columnId.tsnew file mode 100644index 0000000000..1c8ea62a76--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/columnId.ts@@ -0,0 +1,11 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */++/**+ * Identifier of a column placement within a table.+ */+export type ColumnId = string;diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/databaseId.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/databaseId.tsnew file mode 100644index 0000000000..cd8b4f81bc--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/databaseId.ts@@ -0,0 +1,12 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */++/**+ * Identifier of reusable database storage. Its optional Macro entity uses+the same identity, so existing routes and grants keep their IDs.+ */+export type DatabaseId = string;diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/databaseQueryRequest.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/databaseQueryRequest.tsnew file mode 100644index 0000000000..4da88dd806--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/databaseQueryRequest.ts@@ -0,0 +1,19 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */+import type { DatabaseQueryRequestBaseVersions } from './databaseQueryRequestBaseVersions';+import type { DatabaseQueryRequestDatabaseId } from './databaseQueryRequestDatabaseId';++/**+ * One SQL statement with an optional default database and optimistic write guards.+ */+export interface DatabaseQueryRequest {+ /** Expected version for each table a subsequent statement writes. */+ baseVersions?: DatabaseQueryRequestBaseVersions;+ databaseId?: DatabaseQueryRequestDatabaseId;+ /** One supported SQL statement. Writes execute once, without automatic retries. */+ sql: string;+}diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/databaseQueryRequestBaseVersions.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/databaseQueryRequestBaseVersions.tsnew file mode 100644index 0000000000..c9cc453c2a--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/databaseQueryRequestBaseVersions.ts@@ -0,0 +1,12 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */+import type { TableVersion } from './tableVersion';++/**+ * Expected version for each table a subsequent statement writes.+ */+export type DatabaseQueryRequestBaseVersions = { [key: string]: TableVersion };diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/databaseQueryRequestDatabaseId.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/databaseQueryRequestDatabaseId.tsnew file mode 100644index 0000000000..1216f9b1d0--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/databaseQueryRequestDatabaseId.ts@@ -0,0 +1,9 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */+import type { DatabaseId } from './databaseId';++export type DatabaseQueryRequestDatabaseId = null | DatabaseId;diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/index.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/index.tsindex 8e40501d18..8937b5a32a 100644--- a/apps/web/src/lib/service-clients/service-storage/generated/schemas/index.ts+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/index.ts@@ -413,6 +413,7 @@ export * from './columnConversion';export * from './columnConversionRequest';export * from './columnDetail';export * from './columnDisplayName';+export * from './columnId';export * from './columnKind';export * from './columnKindOneOf';export * from './columnKindOneOfFive';@@ -625,6 +626,7 @@ export * from './crmTeamSettingsResponseLegacyStageIds';export * from './customSpeakerAssignment';export * from './database';export * from './databaseDetail';+export * from './databaseId';export * from './databaseOp';export * from './databaseOpOneOf';export * from './databaseOpOneOfFive';@@ -636,6 +638,9 @@ export * from './databaseOpOneOfSeven';export * from './databaseOpOneOfSevenKind';export * from './databaseOpOneOfThree';export * from './databaseOpOneOfThreeKind';+export * from './databaseQueryRequest';+export * from './databaseQueryRequestBaseVersions';+export * from './databaseQueryRequestDatabaseId';export * from './databaseTrashedAt';export * from './databaseView';export * from './databaseWebhookDeliveryResponse';@@ -1325,6 +1330,7 @@ export * from './opResultOneOfSeven';export * from './opResultOneOfSevenKind';export * from './opResultOneOfThree';export * from './opResultOneOfThreeKind';+export * from './optionId';export * from './optionRef';export * from './optionRefOneOf';export * from './optionRefOneOfTwo';@@ -1510,6 +1516,12 @@ export * from './resolveRequest';export * from './resolveRequestGrantedLevel';export * from './responseStatus';export * from './responseSummary';+export * from './resultColumn';+export * from './resultColumnRelatedTable';+export * from './resultColumnTarget';+export * from './resultSet';+export * from './resultSetRowsItemItem';+export * from './resultSetSourceTable';export * from './ringStatus';export * from './ringStatusResponse';export * from './rowChange';@@ -1829,6 +1841,42 @@ export * from './sourceIdentityOneOf';export * from './sourceIdentityOneOfKind';export * from './sourceIdentityOneOfThree';export * from './sourceIdentityOneOfThreeKind';+export * from './sqlCell';+export * from './sqlCellOneOf';+export * from './sqlCellOneOfFive';+export * from './sqlCellOneOfFiveType';+export * from './sqlCellOneOfNine';+export * from './sqlCellOneOfNineType';+export * from './sqlCellOneOfOneone';+export * from './sqlCellOneOfOneoneType';+export * from './sqlCellOneOfOnethree';+export * from './sqlCellOneOfOnethreeType';+export * from './sqlCellOneOfSeven';+export * from './sqlCellOneOfSevenType';+export * from './sqlCellOneOfThree';+export * from './sqlCellOneOfThreeType';+export * from './sqlCellOneOfType';+export * from './sqlEntityKind';+export * from './sqlOutcome';+export * from './sqlOutcomeKind';+export * from './sqlOutcomeNewVersions';+export * from './sqlOutcomeReadVersions';+export * from './sqlOutcomeResult';+export * from './sqlOutcomeTableDatabases';+export * from './sqlSelectOption';+export * from './sqlStatement';+export * from './sqlStatementOneOf';+export * from './sqlStatementOneOfFive';+export * from './sqlStatementOneOfFiveKind';+export * from './sqlStatementOneOfKind';+export * from './sqlStatementOneOfNine';+export * from './sqlStatementOneOfNineKind';+export * from './sqlStatementOneOfOneone';+export * from './sqlStatementOneOfOneoneKind';+export * from './sqlStatementOneOfSeven';+export * from './sqlStatementOneOfSevenKind';+export * from './sqlStatementOneOfThree';+export * from './sqlStatementOneOfThreeKind';export * from './starterDatabase';export * from './starterDatabaseDatabaseId';export * from './starterDatabaseTableId';@@ -1880,6 +1928,7 @@ export * from './tableChangeOneOfThree';export * from './tableChangeOneOfThreeKind';export * from './tableChanges';export * from './tableDetail';+export * from './tableId';export * from './tableResult';export * from './tableResultOneOf';export * from './tableResultOneOfFive';diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/optionId.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/optionId.tsnew file mode 100644index 0000000000..fe060e35ed--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/optionId.ts@@ -0,0 +1,11 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */++/**+ * Identifier of an option of a select or tag column.+ */+export type OptionId = string;diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/resultColumn.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/resultColumn.tsnew file mode 100644index 0000000000..09825def5b--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/resultColumn.ts@@ -0,0 +1,25 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */++import type { ResultColumnRelatedTable } from './resultColumnRelatedTable';+import type { ResultColumnTarget } from './resultColumnTarget';+import type { SqlOutcomeKind } from './sqlOutcomeKind';+import type { SqlSelectOption } from './sqlSelectOption';++/**+ * One result column, with what its cells mean.+ */+export interface ResultColumn {+ /** What its cells hold. */+ kind: SqlOutcomeKind;+ /** The name or alias the statement gave it. */+ name: string;+ /** For a select column, its options: its cells hold their ids. */+ options?: SqlSelectOption[];+ relatedTable?: ResultColumnRelatedTable;+ target?: ResultColumnTarget;+}diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/resultColumnRelatedTable.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/resultColumnRelatedTable.tsnew file mode 100644index 0000000000..03a918b4d2--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/resultColumnRelatedTable.ts@@ -0,0 +1,9 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */+import type { TableId } from './tableId';++export type ResultColumnRelatedTable = null | TableId;diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/resultColumnTarget.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/resultColumnTarget.tsnew file mode 100644index 0000000000..6bfef93fb7--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/resultColumnTarget.ts@@ -0,0 +1,9 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */+import type { SqlEntityKind } from './sqlEntityKind';++export type ResultColumnTarget = null | SqlEntityKind;diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/resultSet.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/resultSet.tsnew file mode 100644index 0000000000..db186350bd--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/resultSet.ts@@ -0,0 +1,24 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */+import type { ResultColumn } from './resultColumn';+import type { ResultSetRowsItemItem } from './resultSetRowsItemItem';+import type { ResultSetSourceTable } from './resultSetSourceTable';+import type { RowId } from './rowId';++/**+ * A `SELECT`'s rows, as the engine's typed cells.+ */+export interface ResultSet {+ /** The columns, in select-list order. */+ columns: ResultColumn[];+ /** For a row-shaped result, the id of the row behind each result row;+empty for an aggregate. */+ rowIds: RowId[];+ /** One cell per column per row; `null` is an empty cell. */+ rows: ResultSetRowsItemItem[][];+ sourceTable?: ResultSetSourceTable;+}diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/resultSetRowsItemItem.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/resultSetRowsItemItem.tsnew file mode 100644index 0000000000..f52dd05c0c--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/resultSetRowsItemItem.ts@@ -0,0 +1,9 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */+import type { SqlCell } from './sqlCell';++export type ResultSetRowsItemItem = null | SqlCell;diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/resultSetSourceTable.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/resultSetSourceTable.tsnew file mode 100644index 0000000000..a275f5093b--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/resultSetSourceTable.ts@@ -0,0 +1,9 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */+import type { TableId } from './tableId';++export type ResultSetSourceTable = null | TableId;diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlCell.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlCell.tsnew file mode 100644index 0000000000..11a14ee1b1--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlCell.ts@@ -0,0 +1,26 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */+import type { SqlCellOneOf } from './sqlCellOneOf';+import type { SqlCellOneOfFive } from './sqlCellOneOfFive';+import type { SqlCellOneOfNine } from './sqlCellOneOfNine';+import type { SqlCellOneOfOneone } from './sqlCellOneOfOneone';+import type { SqlCellOneOfOnethree } from './sqlCellOneOfOnethree';+import type { SqlCellOneOfSeven } from './sqlCellOneOfSeven';+import type { SqlCellOneOfThree } from './sqlCellOneOfThree';++/**+ * A cell as fetched. An absent cell is `NULL`; an absent multi-valued cell+is the empty set.+ */+export type SqlCell =+ | SqlCellOneOf+ | SqlCellOneOfThree+ | SqlCellOneOfFive+ | SqlCellOneOfSeven+ | SqlCellOneOfNine+ | SqlCellOneOfOneone+ | SqlCellOneOfOnethree;diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlCellOneOf.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlCellOneOf.tsnew file mode 100644index 0000000000..40a8f34f19--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlCellOneOf.ts@@ -0,0 +1,16 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */+import type { SqlCellOneOfType } from './sqlCellOneOfType';++/**+ * Text or link.+ */+export type SqlCellOneOf = {+ type: SqlCellOneOfType;+ /** Text or link. */+ value: string;+};diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlCellOneOfFive.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlCellOneOfFive.tsnew file mode 100644index 0000000000..5be15601f2--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlCellOneOfFive.ts@@ -0,0 +1,16 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */+import type { SqlCellOneOfFiveType } from './sqlCellOneOfFiveType';++/**+ * A checkbox.+ */+export type SqlCellOneOfFive = {+ type: SqlCellOneOfFiveType;+ /** A checkbox. */+ value: boolean;+};diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlCellOneOfFiveType.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlCellOneOfFiveType.tsnew file mode 100644index 0000000000..c64ebf6292--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlCellOneOfFiveType.ts@@ -0,0 +1,14 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */++export type SqlCellOneOfFiveType =+ (typeof SqlCellOneOfFiveType)[keyof typeof SqlCellOneOfFiveType];++// eslint-disable-next-line @typescript-eslint/no-redeclare+export const SqlCellOneOfFiveType = {+ bool: 'bool',+} as const;diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlCellOneOfNine.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlCellOneOfNine.tsnew file mode 100644index 0000000000..9644681c6c--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlCellOneOfNine.ts@@ -0,0 +1,18 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */++import type { OptionId } from './optionId';+import type { SqlCellOneOfNineType } from './sqlCellOneOfNineType';++/**+ * The selected option ids; one for single-select columns.+ */+export type SqlCellOneOfNine = {+ type: SqlCellOneOfNineType;+ /** The selected option ids; one for single-select columns. */+ value: OptionId[];+};diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlCellOneOfNineType.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlCellOneOfNineType.tsnew file mode 100644index 0000000000..23cc5ac97d--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlCellOneOfNineType.ts@@ -0,0 +1,14 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */++export type SqlCellOneOfNineType =+ (typeof SqlCellOneOfNineType)[keyof typeof SqlCellOneOfNineType];++// eslint-disable-next-line @typescript-eslint/no-redeclare+export const SqlCellOneOfNineType = {+ options: 'options',+} as const;diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlCellOneOfOneone.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlCellOneOfOneone.tsnew file mode 100644index 0000000000..40c0ae6c0b--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlCellOneOfOneone.ts@@ -0,0 +1,16 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */+import type { SqlCellOneOfOneoneType } from './sqlCellOneOfOneoneType';++/**+ * The referenced entity ids; one for single-valued columns.+ */+export type SqlCellOneOfOneone = {+ type: SqlCellOneOfOneoneType;+ /** The referenced entity ids; one for single-valued columns. */+ value: string[];+};diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlCellOneOfOneoneType.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlCellOneOfOneoneType.tsnew file mode 100644index 0000000000..723541763c--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlCellOneOfOneoneType.ts@@ -0,0 +1,14 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */++export type SqlCellOneOfOneoneType =+ (typeof SqlCellOneOfOneoneType)[keyof typeof SqlCellOneOfOneoneType];++// eslint-disable-next-line @typescript-eslint/no-redeclare+export const SqlCellOneOfOneoneType = {+ entities: 'entities',+} as const;diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlCellOneOfOnethree.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlCellOneOfOnethree.tsnew file mode 100644index 0000000000..401f431a8a--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlCellOneOfOnethree.ts@@ -0,0 +1,18 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */++import type { RowId } from './rowId';+import type { SqlCellOneOfOnethreeType } from './sqlCellOneOfOnethreeType';++/**+ * A table row's own id, the `row_id` column.+ */+export type SqlCellOneOfOnethree = {+ type: SqlCellOneOfOnethreeType;+ /** A table row's own id, the `row_id` column. */+ value: RowId;+};diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlCellOneOfOnethreeType.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlCellOneOfOnethreeType.tsnew file mode 100644index 0000000000..4a1723734a--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlCellOneOfOnethreeType.ts@@ -0,0 +1,14 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */++export type SqlCellOneOfOnethreeType =+ (typeof SqlCellOneOfOnethreeType)[keyof typeof SqlCellOneOfOnethreeType];++// eslint-disable-next-line @typescript-eslint/no-redeclare+export const SqlCellOneOfOnethreeType = {+ row: 'row',+} as const;diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlCellOneOfSeven.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlCellOneOfSeven.tsnew file mode 100644index 0000000000..3b255800f5--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlCellOneOfSeven.ts@@ -0,0 +1,16 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */+import type { SqlCellOneOfSevenType } from './sqlCellOneOfSevenType';++/**+ * A date-time.+ */+export type SqlCellOneOfSeven = {+ type: SqlCellOneOfSevenType;+ /** A date-time. */+ value: string;+};diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlCellOneOfSevenType.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlCellOneOfSevenType.tsnew file mode 100644index 0000000000..149c5ae124--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlCellOneOfSevenType.ts@@ -0,0 +1,14 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */++export type SqlCellOneOfSevenType =+ (typeof SqlCellOneOfSevenType)[keyof typeof SqlCellOneOfSevenType];++// eslint-disable-next-line @typescript-eslint/no-redeclare+export const SqlCellOneOfSevenType = {+ date: 'date',+} as const;diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlCellOneOfThree.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlCellOneOfThree.tsnew file mode 100644index 0000000000..aaa91b52d6--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlCellOneOfThree.ts@@ -0,0 +1,16 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */+import type { SqlCellOneOfThreeType } from './sqlCellOneOfThreeType';++/**+ * A number.+ */+export type SqlCellOneOfThree = {+ type: SqlCellOneOfThreeType;+ /** A number. */+ value: number;+};diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlCellOneOfThreeType.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlCellOneOfThreeType.tsnew file mode 100644index 0000000000..8a67ff925f--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlCellOneOfThreeType.ts@@ -0,0 +1,14 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */++export type SqlCellOneOfThreeType =+ (typeof SqlCellOneOfThreeType)[keyof typeof SqlCellOneOfThreeType];++// eslint-disable-next-line @typescript-eslint/no-redeclare+export const SqlCellOneOfThreeType = {+ number: 'number',+} as const;diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlCellOneOfType.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlCellOneOfType.tsnew file mode 100644index 0000000000..c57b0ca46c--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlCellOneOfType.ts@@ -0,0 +1,14 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */++export type SqlCellOneOfType =+ (typeof SqlCellOneOfType)[keyof typeof SqlCellOneOfType];++// eslint-disable-next-line @typescript-eslint/no-redeclare+export const SqlCellOneOfType = {+ text: 'text',+} as const;diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlEntityKind.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlEntityKind.tsnew file mode 100644index 0000000000..93f7a909ac--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlEntityKind.ts@@ -0,0 +1,33 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */++/**+ * What an entity column's references point at: a kind of Macro entity, or+the rows of another table for a relation.++Spelled as the properties system spells entity types (`USER`,+`DATABASE_ROW`), on the wire and in SQL, where it parses+case-insensitively.+ */+export type SqlEntityKind = (typeof SqlEntityKind)[keyof typeof SqlEntityKind];++// eslint-disable-next-line @typescript-eslint/no-redeclare+export const SqlEntityKind = {+ USER: 'USER',+ DOCUMENT: 'DOCUMENT',+ TASK: 'TASK',+ COMPANY: 'COMPANY',+ CONTACT: 'CONTACT',+ CALL_RECORD: 'CALL_RECORD',+ CHANNEL: 'CHANNEL',+ CHAT: 'CHAT',+ PROJECT: 'PROJECT',+ THREAD: 'THREAD',+ CALENDAR_EVENT: 'CALENDAR_EVENT',+ INITIATIVE: 'INITIATIVE',+ DATABASE_ROW: 'DATABASE_ROW',+} as const;diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlOutcome.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlOutcome.tsnew file mode 100644index 0000000000..04f1ae71f9--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlOutcome.ts@@ -0,0 +1,38 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */+import type { RowId } from './rowId';+import type { SqlOutcomeNewVersions } from './sqlOutcomeNewVersions';+import type { SqlOutcomeReadVersions } from './sqlOutcomeReadVersions';+import type { SqlOutcomeResult } from './sqlOutcomeResult';+import type { SqlOutcomeTableDatabases } from './sqlOutcomeTableDatabases';+import type { SqlStatement } from './sqlStatement';++/**+ * The answer to one statement.+ */+export interface SqlOutcome {+ /**+ * How many rows a write changed.+ * @minimum 0+ */+ changesApplied: number;+ /** The rows an `INSERT` created, in statement order. */+ insertedRowIds: RowId[];+ /** The new version of every table written. */+ newVersions: SqlOutcomeNewVersions;+ /** The version of every table read, for a follow-up write to guard on. */+ readVersions: SqlOutcomeReadVersions;+ result?: SqlOutcomeResult;+ /** What kind of statement ran, and what it wrote. */+ statement: SqlStatement;+ /** Owning database of each visible table referenced by this outcome. */+ tableDatabases: SqlOutcomeTableDatabases;+ /** Every table the statement read, when any read hit the engine's row+cap: the engine reports the cap per statement, so aggregates over any+of them may be partial. */+ truncatedTables: string[];+}diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlOutcomeKind.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlOutcomeKind.tsnew file mode 100644index 0000000000..0bbc441179--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlOutcomeKind.ts@@ -0,0 +1,23 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */++/**+ * The value kind of a result column.+ */+export type SqlOutcomeKind =+ (typeof SqlOutcomeKind)[keyof typeof SqlOutcomeKind];++// eslint-disable-next-line @typescript-eslint/no-redeclare+export const SqlOutcomeKind = {+ text: 'text',+ number: 'number',+ boolean: 'boolean',+ date: 'date',+ select: 'select',+ entity: 'entity',+ row: 'row',+} as const;diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlOutcomeNewVersions.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlOutcomeNewVersions.tsnew file mode 100644index 0000000000..abb84be5bd--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlOutcomeNewVersions.ts@@ -0,0 +1,12 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */+import type { TableVersion } from './tableVersion';++/**+ * The new version of every table written.+ */+export type SqlOutcomeNewVersions = { [key: string]: TableVersion };diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlOutcomeReadVersions.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlOutcomeReadVersions.tsnew file mode 100644index 0000000000..ace1979d88--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlOutcomeReadVersions.ts@@ -0,0 +1,12 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */+import type { TableVersion } from './tableVersion';++/**+ * The version of every table read, for a follow-up write to guard on.+ */+export type SqlOutcomeReadVersions = { [key: string]: TableVersion };diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlOutcomeResult.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlOutcomeResult.tsnew file mode 100644index 0000000000..c6e9481937--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlOutcomeResult.ts@@ -0,0 +1,9 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */+import type { ResultSet } from './resultSet';++export type SqlOutcomeResult = null | ResultSet;diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlOutcomeTableDatabases.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlOutcomeTableDatabases.tsnew file mode 100644index 0000000000..01ff2841b5--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlOutcomeTableDatabases.ts@@ -0,0 +1,12 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */+import type { DatabaseId } from './databaseId';++/**+ * Owning database of each visible table referenced by this outcome.+ */+export type SqlOutcomeTableDatabases = { [key: string]: DatabaseId };diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlSelectOption.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlSelectOption.tsnew file mode 100644index 0000000000..c8836ba477--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlSelectOption.ts@@ -0,0 +1,17 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */+import type { OptionId } from './optionId';++/**+ * One option of a select column.+ */+export interface SqlSelectOption {+ /** The option id. */+ id: OptionId;+ /** The label users type in SQL. */+ label: string;+}diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlStatement.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlStatement.tsnew file mode 100644index 0000000000..bd8ed34464--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlStatement.ts@@ -0,0 +1,24 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */+import type { SqlStatementOneOf } from './sqlStatementOneOf';+import type { SqlStatementOneOfFive } from './sqlStatementOneOfFive';+import type { SqlStatementOneOfNine } from './sqlStatementOneOfNine';+import type { SqlStatementOneOfOneone } from './sqlStatementOneOfOneone';+import type { SqlStatementOneOfSeven } from './sqlStatementOneOfSeven';+import type { SqlStatementOneOfThree } from './sqlStatementOneOfThree';++/**+ * The statement that ran: a read, or the table (and for a type change, the+column) it wrote.+ */+export type SqlStatement =+ | SqlStatementOneOf+ | SqlStatementOneOfThree+ | SqlStatementOneOfFive+ | SqlStatementOneOfSeven+ | SqlStatementOneOfNine+ | SqlStatementOneOfOneone;diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlStatementOneOf.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlStatementOneOf.tsnew file mode 100644index 0000000000..bb57e3e108--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlStatementOneOf.ts@@ -0,0 +1,19 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */+import type { DatabaseId } from './databaseId';+import type { SqlStatementOneOfKind } from './sqlStatementOneOfKind';++/**+ * A committed schema command. IDs remain available even without a follow-up read.+ */+export type SqlStatementOneOf = {+ /** Owning database. */+ databaseId: DatabaseId;+ kind: SqlStatementOneOfKind;+ /** What changed and how to read the resulting schema. */+ summary: string;+};diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlStatementOneOfFive.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlStatementOneOfFive.tsnew file mode 100644index 0000000000..d74a65dad6--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlStatementOneOfFive.ts@@ -0,0 +1,19 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */+import type { SqlStatementOneOfFiveKind } from './sqlStatementOneOfFiveKind';+import type { TableId } from './tableId';++/**+ * An `INSERT`.+ */+export type SqlStatementOneOfFive = {+ kind: SqlStatementOneOfFiveKind;+ /** The table written. */+ tableId: TableId;+ /** Its name. */+ tableName: string;+};diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlStatementOneOfFiveKind.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlStatementOneOfFiveKind.tsnew file mode 100644index 0000000000..81e02c3beb--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlStatementOneOfFiveKind.ts@@ -0,0 +1,14 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */++export type SqlStatementOneOfFiveKind =+ (typeof SqlStatementOneOfFiveKind)[keyof typeof SqlStatementOneOfFiveKind];++// eslint-disable-next-line @typescript-eslint/no-redeclare+export const SqlStatementOneOfFiveKind = {+ insert: 'insert',+} as const;diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlStatementOneOfKind.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlStatementOneOfKind.tsnew file mode 100644index 0000000000..bcc40731ab--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlStatementOneOfKind.ts@@ -0,0 +1,14 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */++export type SqlStatementOneOfKind =+ (typeof SqlStatementOneOfKind)[keyof typeof SqlStatementOneOfKind];++// eslint-disable-next-line @typescript-eslint/no-redeclare+export const SqlStatementOneOfKind = {+ schema: 'schema',+} as const;diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlStatementOneOfNine.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlStatementOneOfNine.tsnew file mode 100644index 0000000000..39fa9c1e67--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlStatementOneOfNine.ts@@ -0,0 +1,19 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */+import type { SqlStatementOneOfNineKind } from './sqlStatementOneOfNineKind';+import type { TableId } from './tableId';++/**+ * A `DELETE`.+ */+export type SqlStatementOneOfNine = {+ kind: SqlStatementOneOfNineKind;+ /** The table written. */+ tableId: TableId;+ /** Its name. */+ tableName: string;+};diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlStatementOneOfNineKind.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlStatementOneOfNineKind.tsnew file mode 100644index 0000000000..84ceb4d245--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlStatementOneOfNineKind.ts@@ -0,0 +1,14 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */++export type SqlStatementOneOfNineKind =+ (typeof SqlStatementOneOfNineKind)[keyof typeof SqlStatementOneOfNineKind];++// eslint-disable-next-line @typescript-eslint/no-redeclare+export const SqlStatementOneOfNineKind = {+ delete: 'delete',+} as const;diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlStatementOneOfOneone.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlStatementOneOfOneone.tsnew file mode 100644index 0000000000..3cfbd66886--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlStatementOneOfOneone.ts@@ -0,0 +1,26 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */+import type { ColumnId } from './columnId';+import type { SqlStatementOneOfOneoneKind } from './sqlStatementOneOfOneoneKind';+import type { TableId } from './tableId';++/**+ * An `ALTER COLUMN … TYPE`.+ */+export type SqlStatementOneOfOneone = {+ /** The column placement; its id survives the change. */+ columnId: ColumnId;+ /** The column's name. */+ columnName: string;+ kind: SqlStatementOneOfOneoneKind;+ /** The table. */+ tableId: TableId;+ /** Its name. */+ tableName: string;+ /** The type it became, as SQL spells it, e.g. `select[]`. */+ to: string;+};diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlStatementOneOfOneoneKind.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlStatementOneOfOneoneKind.tsnew file mode 100644index 0000000000..e1eda03fec--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlStatementOneOfOneoneKind.ts@@ -0,0 +1,14 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */++export type SqlStatementOneOfOneoneKind =+ (typeof SqlStatementOneOfOneoneKind)[keyof typeof SqlStatementOneOfOneoneKind];++// eslint-disable-next-line @typescript-eslint/no-redeclare+export const SqlStatementOneOfOneoneKind = {+ alterColumnType: 'alterColumnType',+} as const;diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlStatementOneOfSeven.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlStatementOneOfSeven.tsnew file mode 100644index 0000000000..0fab5fe1a6--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlStatementOneOfSeven.ts@@ -0,0 +1,19 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */+import type { SqlStatementOneOfSevenKind } from './sqlStatementOneOfSevenKind';+import type { TableId } from './tableId';++/**+ * An `UPDATE`.+ */+export type SqlStatementOneOfSeven = {+ kind: SqlStatementOneOfSevenKind;+ /** The table written. */+ tableId: TableId;+ /** Its name. */+ tableName: string;+};diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlStatementOneOfSevenKind.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlStatementOneOfSevenKind.tsnew file mode 100644index 0000000000..158f5d51e3--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlStatementOneOfSevenKind.ts@@ -0,0 +1,14 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */++export type SqlStatementOneOfSevenKind =+ (typeof SqlStatementOneOfSevenKind)[keyof typeof SqlStatementOneOfSevenKind];++// eslint-disable-next-line @typescript-eslint/no-redeclare+export const SqlStatementOneOfSevenKind = {+ update: 'update',+} as const;diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlStatementOneOfThree.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlStatementOneOfThree.tsnew file mode 100644index 0000000000..cb0dee7388--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlStatementOneOfThree.ts@@ -0,0 +1,14 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */+import type { SqlStatementOneOfThreeKind } from './sqlStatementOneOfThreeKind';++/**+ * A `SELECT`.+ */+export type SqlStatementOneOfThree = {+ kind: SqlStatementOneOfThreeKind;+};diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlStatementOneOfThreeKind.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlStatementOneOfThreeKind.tsnew file mode 100644index 0000000000..da96ffaf6a--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/sqlStatementOneOfThreeKind.ts@@ -0,0 +1,14 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */++export type SqlStatementOneOfThreeKind =+ (typeof SqlStatementOneOfThreeKind)[keyof typeof SqlStatementOneOfThreeKind];++// eslint-disable-next-line @typescript-eslint/no-redeclare+export const SqlStatementOneOfThreeKind = {+ select: 'select',+} as const;diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/tableId.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/tableId.tsnew file mode 100644index 0000000000..d24ebf8834--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/tableId.ts@@ -0,0 +1,11 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */++/**+ * Identifier of one table (tab) within a database.+ */+export type TableId = string;diff --git a/apps/web/src/lib/service-clients/service-storage/generated/zod.ts b/apps/web/src/lib/service-clients/service-storage/generated/zod.tsindex 0f7a52c4e0..29e77097e1 100644--- a/apps/web/src/lib/service-clients/service-storage/generated/zod.ts+++ b/apps/web/src/lib/service-clients/service-storage/generated/zod.ts@@ -9672,6 +9672,347 @@ export const getDatabaseQueryResponse = zod}).describe('A stored, immutable query. Editing a question saves a new one.');+/**+ * @summary Run one statement as the authenticated user. The viewer's catalog authorizes reads;+the SQL domain service obtains an edit receipt for every written database.+ */+export const queryDatabasesBody = zod+ .object({+ baseVersions: zod+ .record(+ zod.string(),+ zod+ .number()+ .describe(+ "Monotonic per-table version, bumped once by every committed change to a\ntable's schema or rows. Schema edits name the version they were made\nagainst, and change events carry the new one."+ )+ )+ .optional()+ .describe(+ 'Expected version for each table a subsequent statement writes.'+ ),+ databaseId: zod+ .union([+ zod.null(),+ zod+ .uuid()+ .describe(+ 'Identifier of reusable database storage. Its optional Macro entity uses\nthe same identity, so existing routes and grants keep their IDs.'+ ),+ ])+ .optional(),+ sql: zod+ .string()+ .describe(+ 'One supported SQL statement. Writes execute once, without automatic retries.'+ ),+ })+ .describe(+ 'One SQL statement with an optional default database and optimistic write guards.'+ );++export const queryDatabasesResponseChangesAppliedMin = 0;++export const queryDatabasesResponse = zod+ .object({+ changesApplied: zod+ .number()+ .min(queryDatabasesResponseChangesAppliedMin)+ .describe('How many rows a write changed.'),+ insertedRowIds: zod+ .array(zod.uuid().describe('Identifier of a row.'))+ .describe('The rows an `INSERT` created, in statement order.'),+ newVersions: zod+ .record(+ zod.string(),+ zod+ .number()+ .describe(+ "Monotonic per-table version, bumped once by every committed change to a\ntable's schema or rows. Schema edits name the version they were made\nagainst, and change events carry the new one."+ )+ )+ .describe('The new version of every table written.'),+ readVersions: zod+ .record(+ zod.string(),+ zod+ .number()+ .describe(+ "Monotonic per-table version, bumped once by every committed change to a\ntable's schema or rows. Schema edits name the version they were made\nagainst, and change events carry the new one."+ )+ )+ .describe(+ 'The version of every table read, for a follow-up write to guard on.'+ ),+ result: zod+ .union([+ zod.null(),+ zod+ .object({+ columns: zod+ .array(+ zod+ .object({+ kind: zod+ .enum([+ 'text',+ 'number',+ 'boolean',+ 'date',+ 'select',+ 'entity',+ 'row',+ ])+ .describe('The value kind of a result column.'),+ name: zod+ .string()+ .describe('The name or alias the statement gave it.'),+ options: zod+ .array(+ zod+ .object({+ id: zod+ .uuid()+ .describe(+ 'Identifier of an option of a select or tag column.'+ ),+ label: zod+ .string()+ .describe('The label users type in SQL.'),+ })+ .describe('One option of a select column.')+ )+ .optional()+ .describe(+ 'For a select column, its options: its cells hold their ids.'+ ),+ relatedTable: zod+ .union([+ zod.null(),+ zod+ .uuid()+ .describe(+ 'Identifier of one table (tab) within a database.'+ ),+ ])+ .optional(),+ target: zod+ .union([+ zod.null(),+ zod+ .enum([+ 'USER',+ 'DOCUMENT',+ 'TASK',+ 'COMPANY',+ 'CONTACT',+ 'CALL_RECORD',+ 'CHANNEL',+ 'CHAT',+ 'PROJECT',+ 'THREAD',+ 'CALENDAR_EVENT',+ 'INITIATIVE',+ 'DATABASE_ROW',+ ])+ .describe(+ "What an entity column's references point at: a kind of Macro entity, or\nthe rows of another table for a relation.\n\nSpelled as the properties system spells entity types (`USER`,\n`DATABASE_ROW`), on the wire and in SQL, where it parses\ncase-insensitively."+ ),+ ])+ .optional(),+ })+ .describe('One result column, with what its cells mean.')+ )+ .describe('The columns, in select-list order.'),+ rowIds: zod+ .array(zod.uuid().describe('Identifier of a row.'))+ .describe(+ 'For a row-shaped result, the id of the row behind each result row;\nempty for an aggregate.'+ ),+ rows: zod+ .array(+ zod.array(+ zod.union([+ zod.null(),+ zod+ .union([+ zod+ .object({+ type: zod.enum(['text']),+ value: zod.string().describe('Text or link.'),+ })+ .describe('Text or link.'),+ zod+ .object({+ type: zod.enum(['number']),+ value: zod.number().describe('A number.'),+ })+ .describe('A number.'),+ zod+ .object({+ type: zod.enum(['bool']),+ value: zod.boolean().describe('A checkbox.'),+ })+ .describe('A checkbox.'),+ zod+ .object({+ type: zod.enum(['date']),+ value: zod.iso+ .datetime({})+ .describe('A date-time.'),+ })+ .describe('A date-time.'),+ zod+ .object({+ type: zod.enum(['options']),+ value: zod+ .array(+ zod+ .uuid()+ .describe(+ 'Identifier of an option of a select or tag column.'+ )+ )+ .describe(+ 'The selected option ids; one for single-select columns.'+ ),+ })+ .describe(+ 'The selected option ids; one for single-select columns.'+ ),+ zod+ .object({+ type: zod.enum(['entities']),+ value: zod+ .array(zod.string())+ .describe(+ 'The referenced entity ids; one for single-valued columns.'+ ),+ })+ .describe(+ 'The referenced entity ids; one for single-valued columns.'+ ),+ zod+ .object({+ type: zod.enum(['row']),+ value: zod.uuid().describe('Identifier of a row.'),+ })+ .describe(+ "A table row's own id, the `row_id` column."+ ),+ ])+ .describe(+ 'A cell as fetched. An absent cell is `NULL`; an absent multi-valued cell\nis the empty set.'+ ),+ ])+ )+ )+ .describe(+ 'One cell per column per row; `null` is an empty cell.'+ ),+ sourceTable: zod+ .union([+ zod.null(),+ zod+ .uuid()+ .describe('Identifier of one table (tab) within a database.'),+ ])+ .optional(),+ })+ .describe("A `SELECT`'s rows, as the engine's typed cells."),+ ])+ .optional(),+ statement: zod+ .union([+ zod+ .object({+ databaseId: zod+ .uuid()+ .describe(+ 'Identifier of reusable database storage. Its optional Macro entity uses\nthe same identity, so existing routes and grants keep their IDs.'+ ),+ kind: zod.enum(['schema']),+ summary: zod+ .string()+ .describe('What changed and how to read the resulting schema.'),+ })+ .describe(+ 'A committed schema command. IDs remain available even without a follow-up read.'+ ),+ zod+ .object({+ kind: zod.enum(['select']),+ })+ .describe('A `SELECT`.'),+ zod+ .object({+ kind: zod.enum(['insert']),+ tableId: zod+ .uuid()+ .describe('Identifier of one table (tab) within a database.'),+ tableName: zod.string().describe('Its name.'),+ })+ .describe('An `INSERT`.'),+ zod+ .object({+ kind: zod.enum(['update']),+ tableId: zod+ .uuid()+ .describe('Identifier of one table (tab) within a database.'),+ tableName: zod.string().describe('Its name.'),+ })+ .describe('An `UPDATE`.'),+ zod+ .object({+ kind: zod.enum(['delete']),+ tableId: zod+ .uuid()+ .describe('Identifier of one table (tab) within a database.'),+ tableName: zod.string().describe('Its name.'),+ })+ .describe('A `DELETE`.'),+ zod+ .object({+ columnId: zod+ .uuid()+ .describe('Identifier of a column placement within a table.'),+ columnName: zod.string().describe("The column's name."),+ kind: zod.enum(['alterColumnType']),+ tableId: zod+ .uuid()+ .describe('Identifier of one table (tab) within a database.'),+ tableName: zod.string().describe('Its name.'),+ to: zod+ .string()+ .describe(+ 'The type it became, as SQL spells it, e.g. `select[]`.'+ ),+ })+ .describe('An `ALTER COLUMN … TYPE`.'),+ ])+ .describe(+ 'The statement that ran: a read, or the table (and for a type change, the\ncolumn) it wrote.'+ ),+ tableDatabases: zod+ .record(+ zod.string(),+ zod+ .uuid()+ .describe(+ 'Identifier of reusable database storage. Its optional Macro entity uses\nthe same identity, so existing routes and grants keep their IDs.'+ )+ )+ .describe(+ 'Owning database of each visible table referenced by this outcome.'+ ),+ truncatedTables: zod+ .array(zod.string())+ .describe(+ "Every table the statement read, when any read hit the engine's row\ncap: the engine reports the cap per statement, so aggregates over any\nof them may be partial."+ ),+ })+ .describe('The answer to one statement.');+/*** @summary Create a small example once for the authenticated user, if they have no databases.*/diff --git a/apps/web/src/lib/service-clients/service-storage/openapi.json b/apps/web/src/lib/service-clients/service-storage/openapi.jsonindex 321a0bb121..0f1b56dbfd 100644--- a/apps/web/src/lib/service-clients/service-storage/openapi.json+++ b/apps/web/src/lib/service-clients/service-storage/openapi.json@@ -7100,6 +7100,95 @@}}},+ "/databases/query": {+ "post": {+ "tags": ["databases"],+ "summary": "Run one statement as the authenticated user. The viewer's catalog authorizes reads;\nthe SQL domain service obtains an edit receipt for every written database.",+ "operationId": "query_databases",+ "requestBody": {+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/DatabaseQueryRequest"+ }+ }+ },+ "required": true+ },+ "responses": {+ "200": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/SqlOutcome"+ }+ }+ }+ },+ "400": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ErrorResponse"+ }+ }+ }+ },+ "401": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ErrorResponse"+ }+ }+ }+ },+ "403": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ErrorResponse"+ }+ }+ }+ },+ "404": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ErrorResponse"+ }+ }+ }+ },+ "409": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ErrorResponse"+ }+ }+ }+ },+ "500": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ErrorResponse"+ }+ }+ }+ }+ }+ }+ },"/databases/starter": {"post": {"tags": ["databases"],@@ -23291,6 +23380,11 @@}}},+ "ColumnId": {+ "type": "string",+ "format": "uuid",+ "description": "Identifier of a column placement within a table."+ },"ColumnKind": {"oneOf": [{@@ -25483,6 +25577,11 @@}}},+ "DatabaseId": {+ "type": "string",+ "format": "uuid",+ "description": "Identifier of reusable database storage. Its optional Macro entity uses\nthe same identity, so existing routes and grants keep their IDs."+ },"DatabaseOp": {"oneOf": [{@@ -25597,6 +25696,40 @@],"description": "One write to a database: its tables, columns, options, rows or views,\ngrouped by the resource it changes. A request's ops apply in order and\ntogether, or not at all, and every op names a table of the database the\nrequest is for (or, creating one, adds it there)."},+ "DatabaseQueryRequest": {+ "type": "object",+ "description": "One SQL statement with an optional default database and optimistic write guards.",+ "required": ["sql"],+ "properties": {+ "baseVersions": {+ "type": "object",+ "description": "Expected version for each table a subsequent statement writes.",+ "additionalProperties": {+ "$ref": "#/components/schemas/TableVersion"+ },+ "propertyNames": {+ "type": "string",+ "format": "uuid",+ "description": "Identifier of one table (tab) within a database."+ }+ },+ "databaseId": {+ "oneOf": [+ {+ "type": "null"+ },+ {+ "$ref": "#/components/schemas/DatabaseId",+ "description": "Default database for resolving unqualified table names; other visible databases remain joinable."+ }+ ]+ },+ "sql": {+ "type": "string",+ "description": "One supported SQL statement. Writes execute once, without automatic retries."+ }+ }+ },"DatabaseView": {"type": "object","description": "A view of one table, as stored.",@@ -33823,6 +33956,11 @@"description": "An arithmetic operator.","enum": ["add", "subtract", "multiply", "divide"]},+ "OptionId": {+ "type": "string",+ "format": "uuid",+ "description": "Identifier of an option of a select or tag column."+ },"OptionRef": {"oneOf": [{@@ -35739,6 +35877,99 @@}}},+ "ResultColumn": {+ "type": "object",+ "description": "One result column, with what its cells mean.",+ "required": ["name", "kind"],+ "properties": {+ "kind": {+ "$ref": "#/components/schemas/SqlOutcomeKind",+ "description": "What its cells hold."+ },+ "name": {+ "type": "string",+ "description": "The name or alias the statement gave it."+ },+ "options": {+ "type": "array",+ "items": {+ "$ref": "#/components/schemas/SqlSelectOption"+ },+ "description": "For a select column, its options: its cells hold their ids."+ },+ "relatedTable": {+ "oneOf": [+ {+ "type": "null"+ },+ {+ "$ref": "#/components/schemas/TableId",+ "description": "For a relation, the table its rows belong to; for `row_id`, the\ntable read."+ }+ ]+ },+ "target": {+ "oneOf": [+ {+ "type": "null"+ },+ {+ "$ref": "#/components/schemas/SqlEntityKind",+ "description": "For an entity column, what its ids point at; `DATABASE_ROW` for a\nrelation, whose ids are rows of another table."+ }+ ]+ }+ }+ },+ "ResultSet": {+ "type": "object",+ "description": "A `SELECT`'s rows, as the engine's typed cells.",+ "required": ["columns", "rows", "rowIds"],+ "properties": {+ "columns": {+ "type": "array",+ "items": {+ "$ref": "#/components/schemas/ResultColumn"+ },+ "description": "The columns, in select-list order."+ },+ "rowIds": {+ "type": "array",+ "items": {+ "$ref": "#/components/schemas/RowId"+ },+ "description": "For a row-shaped result, the id of the row behind each result row;\nempty for an aggregate."+ },+ "rows": {+ "type": "array",+ "items": {+ "type": "array",+ "items": {+ "oneOf": [+ {+ "type": "null"+ },+ {+ "$ref": "#/components/schemas/SqlCell"+ }+ ]+ }+ },+ "description": "One cell per column per row; `null` is an empty cell."+ },+ "sourceTable": {+ "oneOf": [+ {+ "type": "null"+ },+ {+ "$ref": "#/components/schemas/TableId",+ "description": "Table whose rows the result identities refer to; absent for aggregates."+ }+ ]+ }+ }+ },"RingStatus": {"type": "string","description": "Per-user status of an incoming-call ring, as reported by the\nring-status endpoint while a native client is ringing.",@@ -38995,6 +39226,378 @@],"description": "Source identity supplied when creating a job. One binding per Macro team in v1."},+ "SqlCell": {+ "oneOf": [+ {+ "type": "object",+ "description": "Text or link.",+ "required": ["value", "type"],+ "properties": {+ "type": {+ "type": "string",+ "enum": ["text"]+ },+ "value": {+ "type": "string",+ "description": "Text or link."+ }+ }+ },+ {+ "type": "object",+ "description": "A number.",+ "required": ["value", "type"],+ "properties": {+ "type": {+ "type": "string",+ "enum": ["number"]+ },+ "value": {+ "type": "number",+ "format": "double",+ "description": "A number."+ }+ }+ },+ {+ "type": "object",+ "description": "A checkbox.",+ "required": ["value", "type"],+ "properties": {+ "type": {+ "type": "string",+ "enum": ["bool"]+ },+ "value": {+ "type": "boolean",+ "description": "A checkbox."+ }+ }+ },+ {+ "type": "object",+ "description": "A date-time.",+ "required": ["value", "type"],+ "properties": {+ "type": {+ "type": "string",+ "enum": ["date"]+ },+ "value": {+ "type": "string",+ "format": "date-time",+ "description": "A date-time."+ }+ }+ },+ {+ "type": "object",+ "description": "The selected option ids; one for single-select columns.",+ "required": ["value", "type"],+ "properties": {+ "type": {+ "type": "string",+ "enum": ["options"]+ },+ "value": {+ "type": "array",+ "items": {+ "$ref": "#/components/schemas/OptionId"+ },+ "description": "The selected option ids; one for single-select columns."+ }+ }+ },+ {+ "type": "object",+ "description": "The referenced entity ids; one for single-valued columns.",+ "required": ["value", "type"],+ "properties": {+ "type": {+ "type": "string",+ "enum": ["entities"]+ },+ "value": {+ "type": "array",+ "items": {+ "type": "string"+ },+ "description": "The referenced entity ids; one for single-valued columns."+ }+ }+ },+ {+ "type": "object",+ "description": "A table row's own id, the `row_id` column.",+ "required": ["value", "type"],+ "properties": {+ "type": {+ "type": "string",+ "enum": ["row"]+ },+ "value": {+ "$ref": "#/components/schemas/RowId",+ "description": "A table row's own id, the `row_id` column."+ }+ }+ }+ ],+ "description": "A cell as fetched. An absent cell is `NULL`; an absent multi-valued cell\nis the empty set."+ },+ "SqlEntityKind": {+ "type": "string",+ "description": "What an entity column's references point at: a kind of Macro entity, or\nthe rows of another table for a relation.\n\nSpelled as the properties system spells entity types (`USER`,\n`DATABASE_ROW`), on the wire and in SQL, where it parses\ncase-insensitively.",+ "enum": [+ "USER",+ "DOCUMENT",+ "TASK",+ "COMPANY",+ "CONTACT",+ "CALL_RECORD",+ "CHANNEL",+ "CHAT",+ "PROJECT",+ "THREAD",+ "CALENDAR_EVENT",+ "INITIATIVE",+ "DATABASE_ROW"+ ]+ },+ "SqlOutcome": {+ "type": "object",+ "description": "The answer to one statement.",+ "required": [+ "tableDatabases",+ "changesApplied",+ "insertedRowIds",+ "newVersions",+ "readVersions",+ "truncatedTables",+ "statement"+ ],+ "properties": {+ "changesApplied": {+ "type": "integer",+ "description": "How many rows a write changed.",+ "minimum": 0+ },+ "insertedRowIds": {+ "type": "array",+ "items": {+ "$ref": "#/components/schemas/RowId"+ },+ "description": "The rows an `INSERT` created, in statement order."+ },+ "newVersions": {+ "type": "object",+ "description": "The new version of every table written.",+ "additionalProperties": {+ "$ref": "#/components/schemas/TableVersion"+ },+ "propertyNames": {+ "type": "string",+ "format": "uuid",+ "description": "Identifier of one table (tab) within a database."+ }+ },+ "readVersions": {+ "type": "object",+ "description": "The version of every table read, for a follow-up write to guard on.",+ "additionalProperties": {+ "$ref": "#/components/schemas/TableVersion"+ },+ "propertyNames": {+ "type": "string",+ "format": "uuid",+ "description": "Identifier of one table (tab) within a database."+ }+ },+ "result": {+ "oneOf": [+ {+ "type": "null"+ },+ {+ "$ref": "#/components/schemas/ResultSet",+ "description": "The rows a `SELECT` returned; `None` for a write."+ }+ ]+ },+ "statement": {+ "$ref": "#/components/schemas/SqlStatement",+ "description": "What kind of statement ran, and what it wrote."+ },+ "tableDatabases": {+ "type": "object",+ "description": "Owning database of each visible table referenced by this outcome.",+ "additionalProperties": {+ "$ref": "#/components/schemas/DatabaseId"+ },+ "propertyNames": {+ "type": "string",+ "format": "uuid",+ "description": "Identifier of one table (tab) within a database."+ }+ },+ "truncatedTables": {+ "type": "array",+ "items": {+ "type": "string"+ },+ "description": "Every table the statement read, when any read hit the engine's row\ncap: the engine reports the cap per statement, so aggregates over any\nof them may be partial."+ }+ }+ },+ "SqlOutcomeKind": {+ "type": "string",+ "description": "The value kind of a result column.",+ "enum": ["text", "number", "boolean", "date", "select", "entity", "row"]+ },+ "SqlSelectOption": {+ "type": "object",+ "description": "One option of a select column.",+ "required": ["id", "label"],+ "properties": {+ "id": {+ "$ref": "#/components/schemas/OptionId",+ "description": "The option id."+ },+ "label": {+ "type": "string",+ "description": "The label users type in SQL."+ }+ }+ },+ "SqlStatement": {+ "oneOf": [+ {+ "type": "object",+ "description": "A committed schema command. IDs remain available even without a follow-up read.",+ "required": ["databaseId", "summary", "kind"],+ "properties": {+ "databaseId": {+ "$ref": "#/components/schemas/DatabaseId",+ "description": "Owning database."+ },+ "kind": {+ "type": "string",+ "enum": ["schema"]+ },+ "summary": {+ "type": "string",+ "description": "What changed and how to read the resulting schema."+ }+ }+ },+ {+ "type": "object",+ "description": "A `SELECT`.",+ "required": ["kind"],+ "properties": {+ "kind": {+ "type": "string",+ "enum": ["select"]+ }+ }+ },+ {+ "type": "object",+ "description": "An `INSERT`.",+ "required": ["tableId", "tableName", "kind"],+ "properties": {+ "kind": {+ "type": "string",+ "enum": ["insert"]+ },+ "tableId": {+ "$ref": "#/components/schemas/TableId",+ "description": "The table written."+ },+ "tableName": {+ "type": "string",+ "description": "Its name."+ }+ }+ },+ {+ "type": "object",+ "description": "An `UPDATE`.",+ "required": ["tableId", "tableName", "kind"],+ "properties": {+ "kind": {+ "type": "string",+ "enum": ["update"]+ },+ "tableId": {+ "$ref": "#/components/schemas/TableId",+ "description": "The table written."+ },+ "tableName": {+ "type": "string",+ "description": "Its name."+ }+ }+ },+ {+ "type": "object",+ "description": "A `DELETE`.",+ "required": ["tableId", "tableName", "kind"],+ "properties": {+ "kind": {+ "type": "string",+ "enum": ["delete"]+ },+ "tableId": {+ "$ref": "#/components/schemas/TableId",+ "description": "The table written."+ },+ "tableName": {+ "type": "string",+ "description": "Its name."+ }+ }+ },+ {+ "type": "object",+ "description": "An `ALTER COLUMN … TYPE`.",+ "required": [+ "tableId",+ "tableName",+ "columnId",+ "columnName",+ "to",+ "kind"+ ],+ "properties": {+ "columnId": {+ "$ref": "#/components/schemas/ColumnId",+ "description": "The column placement; its id survives the change."+ },+ "columnName": {+ "type": "string",+ "description": "The column's name."+ },+ "kind": {+ "type": "string",+ "enum": ["alterColumnType"]+ },+ "tableId": {+ "$ref": "#/components/schemas/TableId",+ "description": "The table."+ },+ "tableName": {+ "type": "string",+ "description": "Its name."+ },+ "to": {+ "type": "string",+ "description": "The type it became, as SQL spells it, e.g. `select[]`."+ }+ }+ }+ ],+ "description": "The statement that ran: a read, or the table (and for a type change, the\ncolumn) it wrote."+ },"StarterDatabase": {"type": "object","description": "Starter result. A missing database means the user already started or removed it.",@@ -39598,6 +40201,11 @@}}},+ "TableId": {+ "type": "string",+ "format": "uuid",+ "description": "Identifier of one table (tab) within a database."+ },"TableResult": {"oneOf": [{diff --git a/crates/agent_code_mode/AGENTS.md b/crates/agent_code_mode/AGENTS.mdindex ec07e4d848..9ed84c44b7 100644--- a/crates/agent_code_mode/AGENTS.md+++ b/crates/agent_code_mode/AGENTS.md@@ -26,5 +26,6 @@ session presentation. Never replay an uncertain submitted action.- `cargo test -p agent_code_mode --lib` from the repository root, with live localdatabase configuration and `SQLX_OFFLINE` unset.+- Keep generated discovery topics within the classifier's 32-question limit.- Regenerate SDK documentation through `packages/code-mode-sdk`; never edit`src/domain/documentation.json` by hand.diff --git a/crates/agent_code_mode/src/domain/documentation.json b/crates/agent_code_mode/src/domain/documentation.jsonindex ebaf470c17..d31a0d8e05 100644--- a/crates/agent_code_mode/src/domain/documentation.json+++ b/crates/agent_code_mode/src/domain/documentation.json@@ -3,13 +3,61 @@"name": "agentSessions","description": "Create and inspect agent sessions, saved code executions, and editable email or calendar review stacks.","overview": "<!-- src/entities/agent-sessions/agent-session/type-aliases/CreateManagedSessionOptions.md -->\n# Type Alias: CreateManagedSessionOptions\n\n> **CreateManagedSessionOptions** = \\{ `instructions?`: `string`; `model?`: `string`; `prompt?`: `string`; `repoBranch?`: `string`; `repoUrl?`: `string`; \\}\n\nWhat a managed session is created with.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-instructions\"></a> `instructions?` | `string` | Instructions the session's runtime works under, fixed for its life. |\n| <a id=\"property-model\"></a> `model?` | `string` | The model the session runs on, instead of its persona's. The session's model from creation, read back as [AgentSession.model](../classes/AgentSession.md#property-model). |\n| <a id=\"property-prompt\"></a> `prompt?` | `string` | First prompt to deliver once the session is running. |\n| <a id=\"property-repobranch\"></a> `repoBranch?` | `string` | The branch the session starts on; needs `repoUrl`. Omitted, the repository's default branch. |\n| <a id=\"property-repourl\"></a> `repoUrl?` | `string` | The repository the session works on, as one of the URLs [AgentSession.repositories](../classes/AgentSession.md#repositories) lists for the caller. Omitted, the runtime chooses from the prompt. Honored for Cursor sessions. |\n\n\n<!-- src/entities/agent-sessions/agent-session/type-aliases/SelectableRepository.md -->\n# Type Alias: SelectableRepository\n\n> **SelectableRepository** = \\{ `defaultBranch?`: `string`; `url`: `string`; \\}\n\nA GitHub repository the caller can point a managed session at.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-defaultbranch\"></a> `defaultBranch?` | `string` | The branch its clones check out, and where a session starts unless `createManaged` names another. Absent for a repository with no commits. |\n| <a id=\"property-url\"></a> `url` | `string` | The canonical `https://github.com/owner/name` URL, as `createManaged` takes it. |\n\n\n<!-- src/entities/agent-sessions/namespace/classes/AgentSessionNamespace.md -->\n# Class: AgentSessionNamespace\n\nEntry point for coding-agent sessions.\n\n## Constructors\n\n### Constructor\n\n> **new AgentSessionNamespace**(`client`): `AgentSessionNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`AgentSessionNamespace`\n\n## Methods\n\n### byId()\n\n> **byId**(`id`): [`AgentSession`](../../agent-session/classes/AgentSession.md)\n\nA handle to an agent session by id. Details load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`AgentSession`](../../agent-session/classes/AgentSession.md)\n\n***\n\n### codingPreferences()\n\n> **codingPreferences**(): `Promise`\\<[`CodingPreferencesBody`](../../../../../generated/agent-harness/types.gen/type-aliases/CodingPreferencesBody.md)\\>\n\nWhat the caller's new coding sessions are told to do beyond their assignment.\n\n#### Returns\n\n`Promise`\\<[`CodingPreferencesBody`](../../../../../generated/agent-harness/types.gen/type-aliases/CodingPreferencesBody.md)\\>\n\n***\n\n### createManaged()\n\n> **createManaged**(`opts?`): `Promise`\\<[`AgentSession`](../../agent-session/classes/AgentSession.md)\\>\n\nCreate a managed agent session.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts?` | [`CreateManagedSessionOptions`](../../agent-session/type-aliases/CreateManagedSessionOptions.md) |\n\n#### Returns\n\n`Promise`\\<[`AgentSession`](../../agent-session/classes/AgentSession.md)\\>\n\n***\n\n### defaultSandboxSize()\n\n> **defaultSandboxSize**(): `Promise`\\<[`SandboxSize`](../../../../../generated/agent-harness/types.gen/type-aliases/SandboxSize.md)\\>\n\nThe caller's default sandbox size for new `@coder` sessions.\n\n#### Returns\n\n`Promise`\\<[`SandboxSize`](../../../../../generated/agent-harness/types.gen/type-aliases/SandboxSize.md)\\>\n\n***\n\n### forPullRequest()\n\n> **forPullRequest**(`url`): `Promise`\\<[`AgentSession`](../../agent-session/classes/AgentSession.md)[]\\>\n\nThe sessions linked to the GitHub pull request at `url` that the caller\ncan view.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `url` | `string` |\n\n#### Returns\n\n`Promise`\\<[`AgentSession`](../../agent-session/classes/AgentSession.md)[]\\>\n\n***\n\n### repositories()\n\n> **repositories**(): `Promise`\\<[`SelectableRepository`](../../agent-session/type-aliases/SelectableRepository.md)[]\\>\n\nThe GitHub repositories the caller can hand a managed session, with the\nbranch each one's sessions start on by default.\n\n#### Returns\n\n`Promise`\\<[`SelectableRepository`](../../agent-session/type-aliases/SelectableRepository.md)[]\\>\n\n***\n\n### repositoryBranches()\n\n> **repositoryBranches**(`repoUrl`): `Promise`\\<`string`[]\\>\n\nBranch names on one repository the caller can start a managed session\nfrom. `repoUrl` is one of the URLs [AgentSessionNamespace.repositories](#repositories)\nlists.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `repoUrl` | `string` |\n\n#### Returns\n\n`Promise`\\<`string`[]\\>\n\n***\n\n### setCodingPreferences()\n\n> **setCodingPreferences**(`preferences`): `Promise`\\<[`CodingPreferencesBody`](../../../../../generated/agent-harness/types.gen/type-aliases/CodingPreferencesBody.md)\\>\n\nReplace the caller's coding preferences.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `preferences` | [`CodingPreferencesBody`](../../../../../generated/agent-harness/types.gen/type-aliases/CodingPreferencesBody.md) |\n\n#### Returns\n\n`Promise`\\<[`CodingPreferencesBody`](../../../../../generated/agent-harness/types.gen/type-aliases/CodingPreferencesBody.md)\\>\n\n***\n\n### setDefaultSandboxSize()\n\n> **setDefaultSandboxSize**(`size`): `Promise`\\<[`SandboxSize`](../../../../../generated/agent-harness/types.gen/type-aliases/SandboxSize.md)\\>\n\nSet the caller's default sandbox size for the next `@coder` mention.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `size` | [`SandboxSize`](../../../../../generated/agent-harness/types.gen/type-aliases/SandboxSize.md) |\n\n#### Returns\n\n`Promise`\\<[`SandboxSize`](../../../../../generated/agent-harness/types.gen/type-aliases/SandboxSize.md)\\>\n",- "documentation": "# Macro SDK: agentSessions\n\nGenerated by TypeDoc. Paths below refer to the canonical Markdown hierarchy. Other entity handles are documented in their named section; request core for shared SDK helpers.\n\n<!-- generated/agent-harness/types.gen/type-aliases/AgentAction.md -->\n# Type Alias: AgentAction\n\n> **AgentAction** = [`AgentPromptAction`](AgentPromptAction.md) & \\{ `type`: `\"prompt\"`; \\} \\| [`AgentSetModelAction`](AgentSetModelAction.md) & \\{ `type`: `\"setModel\"`; \\} \\| [`AgentSetConfigOptionAction`](AgentSetConfigOptionAction.md) & \\{ `type`: `\"setConfigOption\"`; \\} \\| \\{ `type`: `\"compact\"`; \\} \\| \\{ `type`: `\"stop\"`; \\} \\| [`AgentRespondElicitationAction`](AgentRespondElicitationAction.md) & \\{ `type`: `\"respondElicitation\"`; \\} \\| [`AgentPermissionAction`](AgentPermissionAction.md) & \\{ `type`: `\"respondToPermission\"`; \\}\n\nOne thing a caller wants an agent to do.\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/AgentActionId.md -->\n# Type Alias: AgentActionId\n\n> **AgentActionId** = `string`\n\nIdentifies one accepted [`AgentAction`] end to end: returned by the\ncontrol endpoint, written as the JSON-RPC request id on the action's wire\nframe, and read back off that frame as `request_id` on the folded message\nit derives.\n\nA v7 uuid, so ids sort by mint time. Minted by the server at accept time,\nor by a client that speculated the action and named it in the control\nrequest - either way the server is the only writer of runtime-bound\nframes, so a uuid-shaped request id remains the whole ownership test. The\nmachine's own handshake request ids (`agent_session:{session}:{n}`) are\nnot uuids and stay `None`.\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/AgentPermissionAction.md -->\n# Type Alias: AgentPermissionAction\n\n> **AgentPermissionAction** = \\{ `answer`: [`PermissionAnswer`](PermissionAnswer.md); `requestId`: `unknown`; \\}\n\nA user's answer to the agent's `session/request_permission`.\n\nUnlike every other action this is not a new request but the reply to one\nthe agent made, so it carries the agent's own request id rather than\nreceiving a server-minted one.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-answer\"></a> `answer` | [`PermissionAnswer`](PermissionAnswer.md) | What the user decided. |\n| <a id=\"property-requestid\"></a> `requestId` | `unknown` | The agent's JSON-RPC request id, echoed verbatim from the folded permission part. A string or a number on the wire; agents mint both, and `7` does not answer `\"7\"`. |\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/AgentPromptAction.md -->\n# Type Alias: AgentPromptAction\n\n> **AgentPromptAction** = \\{ `attachments?`: [`PromptAttachment`](PromptAttachment.md)[]; `prompt`: `string`; \\}\n\nAsk the agent to work on something.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-attachments\"></a> `attachments?` | [`PromptAttachment`](PromptAttachment.md)[] | Files the prompt refers to, in the order the user attached them. Delivered after the text as one `resource_link` block each. |\n| <a id=\"property-prompt\"></a> `prompt` | `string` | What to tell the agent. |\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/AgentRespondElicitationAction.md -->\n# Type Alias: AgentRespondElicitationAction\n\n> **AgentRespondElicitationAction** = [`ElicitationAnswer`](ElicitationAnswer.md) & \\{ `requestId`: [`ElicitationRequestId`](ElicitationRequestId.md); \\}\n\nAnswer an elicitation the agent is waiting on.\n\n## Type Declaration\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `requestId` | [`ElicitationRequestId`](ElicitationRequestId.md) | The agent's `elicitation/create` request id - not an [`AgentActionId`], because the agent minted it. |\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/AgentSessionChangesResponse.md -->\n# Type Alias: AgentSessionChangesResponse\n\n> **AgentSessionChangesResponse** = \\{ `attempt?`: `null` \\| [`CaptureAttemptDto`](CaptureAttemptDto.md); `capturing`: `boolean`; `changeset?`: `null` \\| [`ChangesetDto`](ChangesetDto.md); \\}\n\nResponse body for `GET /agent-sessions/{session_id}/changes`.\n\nClients deserialize this, so both derives are used.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-attempt\"></a> `attempt?` | `null` \\| [`CaptureAttemptDto`](CaptureAttemptDto.md) | - |\n| <a id=\"property-capturing\"></a> `capturing` | `boolean` | A capture is running right now. |\n| <a id=\"property-changeset\"></a> `changeset?` | `null` \\| [`ChangesetDto`](ChangesetDto.md) | - |\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/AgentSessionLogEntryDto.md -->\n# Type Alias: AgentSessionLogEntryDto\n\n> **AgentSessionLogEntryDto** = [`LogFrameDto`](LogFrameDto.md) & \\{ `createdAt`: `string`; `id`: `string`; `userId?`: `string` \\| `null`; \\}\n\nOne entry of a session's protocol log.\n\nSerializes as `{\"userId\": ..., \"direction\": ..., \"content\": ...}` - the\nframe's own two fields, flattened in beside the attribution, which is the\nsame shape a recorded session's JSONL carries. A reader can deserialize the\n`direction`/`content` pair straight back into the fold's own log type\nrather than through a transport vocabulary of its own.\n\n`agentSessionId` is not repeated per entry: every entry in a response\nbelongs to the session named once at the top.\n\n`Deserialize` is for the wire-contract tests only - nothing server-side\ndecodes its own response type.\n\n## Type Declaration\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `createdAt` | `string` | When the log recorded the frame. The frame itself carries no time, so this comes from the log row. It is what a reader has to order these against anything else it is showing beside them - the fold derives an order among the messages of one session and nothing more. |\n| `id` | `string` | Durable transport row identity; together with `createdAt`, its order cursor. |\n| `userId?` | `string` \\| `null` | The user whose action produced the frame, absent when no user did. Only prompts carry one, and only when the frame was attributed at the time - a replayed or recorded session's are anonymous. |\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/AgentSessionLogResponse.md -->\n# Type Alias: AgentSessionLogResponse\n\n> **AgentSessionLogResponse** = \\{ `bot`: [`SessionBot`](SessionBot.md); `entries`: [`AgentSessionLogEntryDto`](AgentSessionLogEntryDto.md)[]; \\}\n\nResponse body for one session's raw protocol log.\n\nA wrapper rather than a bare array so that anything which is about the\nresponse rather than about a frame has somewhere to go later without\nbreaking every client.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-bot\"></a> `bot` | [`SessionBot`](SessionBot.md) | The agent whose messages the log derives. Here because a client renders those messages and cannot otherwise work out who sent them: the sender of an agent message is this session's bot, and nothing else names it. |\n| <a id=\"property-entries\"></a> `entries` | [`AgentSessionLogEntryDto`](AgentSessionLogEntryDto.md)[] | Effective history in ascending `(createdAt, id)` order. The first row is the inclusive history boundary cursor: buffered rows before it are obsolete. Reconcile snapshot overlap by row ID, never content. An empty history has no boundary or overlapping rows. |\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/AgentSessionResponse.md -->\n# Type Alias: AgentSessionResponse\n\n> **AgentSessionResponse** = \\{ `acpSessionId?`: `string` \\| `null`; `botId`: `string`; `canEdit`: `boolean`; `createdAt`: `string`; `external?`: `null` \\| [`ExternalSessionResponse`](ExternalSessionResponse.md); `harness`: `string`; `id`: `string`; `instructions?`: `string` \\| `null`; `isArchived`: `boolean`; `model`: `string`; `modifiedAt`: `string`; `name`: `string`; `originatingMessageId?`: `string` \\| `null`; `ownerId`: `string`; `pullRequestUrl?`: `string` \\| `null`; `repoUrl?`: `string` \\| `null`; `sandboxSize`: [`SandboxSize`](SandboxSize.md); `status`: [`SessionStatusDto`](SessionStatusDto.md); `taskId?`: `string` \\| `null`; `threadChannelId?`: `string` \\| `null`; `threadId?`: `string` \\| `null`; `threadParent?`: `null` \\| [`MessageParent`](MessageParent.md); `workspace`: `string`; \\}\n\nResponse body describing an agent session.\n\nClients deserialize this, so both derives are used.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-acpsessionid\"></a> `acpSessionId?` | `string` \\| `null` | The ACP session id, if one exists. |\n| <a id=\"property-botid\"></a> `botId` | `string` | The bot running the agent. |\n| <a id=\"property-canedit\"></a> `canEdit` | `boolean` | Whether the caller may drive the session - prompt it, answer its questions, stop it - rather than only watch. Edit access; the creator owns the session, so a create response always says so. |\n| <a id=\"property-createdat\"></a> `createdAt` | `string` | When the session was created. |\n| <a id=\"property-external\"></a> `external?` | `null` \\| [`ExternalSessionResponse`](ExternalSessionResponse.md) | - |\n| <a id=\"property-harness\"></a> `harness` | `string` | Harness slug. |\n| <a id=\"property-id\"></a> `id` | `string` | The session id. |\n| <a id=\"property-instructions\"></a> `instructions?` | `string` \\| `null` | Instructions the session's runtime works under, when any were stated at creation. Absent otherwise, so existing payloads are unchanged. |\n| <a id=\"property-isarchived\"></a> `isArchived` | `boolean` | Whether the session is archived and read-only. |\n| <a id=\"property-model\"></a> `model` | `string` | Model slug. |\n| <a id=\"property-modifiedat\"></a> `modifiedAt` | `string` | When the session was last modified. |\n| <a id=\"property-name\"></a> `name` | `string` | User-facing session name. |\n| <a id=\"property-originatingmessageid\"></a> `originatingMessageId?` | `string` \\| `null` | The exact message that invoked the bot, if any. |\n| <a id=\"property-ownerid\"></a> `ownerId` | `string` | The user who created and owns the session. |\n| <a id=\"property-pullrequesturl\"></a> `pullRequestUrl?` | `string` \\| `null` | The session's linked pull request. |\n| <a id=\"property-repourl\"></a> `repoUrl?` | `string` \\| `null` | The repository the session works with, when one was stated. |\n| <a id=\"property-sandboxsize\"></a> `sandboxSize` | [`SandboxSize`](SandboxSize.md) | Compute tier of the managed sandbox. |\n| <a id=\"property-status\"></a> `status` | [`SessionStatusDto`](SessionStatusDto.md) | The session's status. |\n| <a id=\"property-taskid\"></a> `taskId?` | `string` \\| `null` | The Macro task the session was linked to. |\n| <a id=\"property-threadchannelid\"></a> `threadChannelId?` | `string` \\| `null` | The channel `thread_id` lives in, when the session was spawned from a channel thread. Derived from `thread_parent`. |\n| <a id=\"property-threadid\"></a> `threadId?` | `string` \\| `null` | The root message of the thread the session was created from, if any. |\n| <a id=\"property-threadparent\"></a> `threadParent?` | `null` \\| [`MessageParent`](MessageParent.md) | - |\n| <a id=\"property-workspace\"></a> `workspace` | `string` | The directory the session's harness runs in on its runtime. |\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/AgentSetConfigOptionAction.md -->\n# Type Alias: AgentSetConfigOptionAction\n\n> **AgentSetConfigOptionAction** = \\{ `configId`: `string`; `value`: `string`; \\}\n\nAsk the agent to change one advertised select-style session setting.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-configid\"></a> `configId` | `string` | Opaque ACP config id advertised by the agent. |\n| <a id=\"property-value\"></a> `value` | `string` | Opaque select value advertised for that config option. |\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/AgentSetModelAction.md -->\n# Type Alias: AgentSetModelAction\n\n> **AgentSetModelAction** = \\{ `model`: `string`; \\}\n\nAsk the agent to run on a different model from here on.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-model\"></a> `model` | `string` | The model slug the agent should switch to. |\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/BotId.md -->\n# Type Alias: BotId\n\n> **BotId** = `string`\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/CaptureAttemptDto.md -->\n# Type Alias: CaptureAttemptDto\n\n> **CaptureAttemptDto** = \\{ `error?`: `string` \\| `null`; `finishedAt?`: `string` \\| `null`; `outcome?`: `null` \\| [`CaptureOutcomeDto`](CaptureOutcomeDto.md); `startedAt`: `string`; \\}\n\nThe latest capture attempt.\n\nClients deserialize this, so both derives are used.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-error\"></a> `error?` | `string` \\| `null` | Why it did not capture, in a sentence the user can read. |\n| <a id=\"property-finishedat\"></a> `finishedAt?` | `string` \\| `null` | When it ended; absent while it runs. |\n| <a id=\"property-outcome\"></a> `outcome?` | `null` \\| [`CaptureOutcomeDto`](CaptureOutcomeDto.md) | - |\n| <a id=\"property-startedat\"></a> `startedAt` | `string` | When it started. |\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/CaptureOutcomeDto.md -->\n# Type Alias: CaptureOutcomeDto\n\n> **CaptureOutcomeDto** = `\"captured\"` \\| `\"not_ready\"` \\| `\"failed\"`\n\nHow the latest capture attempt ended, on the wire.\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/ChangedFileDto.md -->\n# Type Alias: ChangedFileDto\n\n> **ChangedFileDto** = \\{ `additions`: `number`; `binary`: `boolean`; `deletions`: `number`; `kind`: [`FileChangeKindDto`](FileChangeKindDto.md); `patchOmitted`: `boolean`; `path`: `string`; `previousPath?`: `string` \\| `null`; \\}\n\nOne changed file.\n\nClients deserialize this, so both derives are used.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-additions\"></a> `additions` | `number` | Lines added. |\n| <a id=\"property-binary\"></a> `binary` | `boolean` | The diff carries no text for this file. |\n| <a id=\"property-deletions\"></a> `deletions` | `number` | Lines removed. |\n| <a id=\"property-kind\"></a> `kind` | [`FileChangeKindDto`](FileChangeKindDto.md) | What happened to the file. |\n| <a id=\"property-patchomitted\"></a> `patchOmitted` | `boolean` | The file's hunks were left out of the patch to fit the size budget. |\n| <a id=\"property-path\"></a> `path` | `string` | The file's path after the change, or before it for a deletion. |\n| <a id=\"property-previouspath\"></a> `previousPath?` | `string` \\| `null` | Where a renamed file came from. |\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/ChangesetDto.md -->\n# Type Alias: ChangesetDto\n\n> **ChangesetDto** = \\{ `additions`: `number`; `base`: [`GitRefDto`](GitRefDto.md); `capturedAt`: `string`; `deletions`: `number`; `files`: [`ChangedFileDto`](ChangedFileDto.md)[]; `head`: [`GitRefDto`](GitRefDto.md); `id`: `string`; `patchBytes`: `number`; `repository?`: `string` \\| `null`; `source`: [`ChangesetSourceDto`](ChangesetSourceDto.md); `truncated`: `boolean`; \\}\n\nOne changeset: the files a patch touches and what happened to each.\n\nClients deserialize this, so both derives are used.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-additions\"></a> `additions` | `number` | Lines added across all files. |\n| <a id=\"property-base\"></a> `base` | [`GitRefDto`](GitRefDto.md) | The side the work started from. |\n| <a id=\"property-capturedat\"></a> `capturedAt` | `string` | When the diff was taken. |\n| <a id=\"property-deletions\"></a> `deletions` | `number` | Lines removed across all files. |\n| <a id=\"property-files\"></a> `files` | [`ChangedFileDto`](ChangedFileDto.md)[] | Every changed file, in patch order. |\n| <a id=\"property-head\"></a> `head` | [`GitRefDto`](GitRefDto.md) | The side carrying the work. |\n| <a id=\"property-id\"></a> `id` | `string` | The changeset's id; a different id means different changes. |\n| <a id=\"property-patchbytes\"></a> `patchBytes` | `number` | Size of the patch the matching patch route serves; zero when nothing changed. |\n| <a id=\"property-repository\"></a> `repository?` | `string` \\| `null` | `https://github.com/owner/name`, when known. |\n| <a id=\"property-source\"></a> `source` | [`ChangesetSourceDto`](ChangesetSourceDto.md) | Where the diff was read from. |\n| <a id=\"property-truncated\"></a> `truncated` | `boolean` | Some files' hunks were left out of the patch. |\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/ChangesetSourceDto.md -->\n# Type Alias: ChangesetSourceDto\n\n> **ChangesetSourceDto** = `\"github_pull_request\"`\n\nThe source of a changeset's diff, on the wire.\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/CodingPreferencesBody.md -->\n# Type Alias: CodingPreferencesBody\n\n> **CodingPreferencesBody** = \\{ `createTasks`: `boolean`; `openPullRequests`: `boolean`; \\}\n\nRequest or response body for the caller's coding preferences.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-createtasks\"></a> `createTasks` | `boolean` | Whether new coding sessions research prior work and link a Macro task. |\n| <a id=\"property-openpullrequests\"></a> `openPullRequests` | `boolean` | Whether new coding sessions deliver their work as a pull request. |\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/ControlResponse.md -->\n# Type Alias: ControlResponse\n\n> **ControlResponse** = \\{ `actionId`: [`AgentActionId`](AgentActionId.md); `status`: [`ControlStatusDto`](ControlStatusDto.md); \\}\n\nResponse body for a control operation.\n\nClients deserialize this, so both derives are used.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-actionid\"></a> `actionId` | [`AgentActionId`](AgentActionId.md) | Matches `requestId` on the folded message this action derives once it dispatches, and names the queue entry until then. The caller's own `actionId` when it supplied one; a freshly minted id otherwise. |\n| <a id=\"property-status\"></a> `status` | [`ControlStatusDto`](ControlStatusDto.md) | Whether the action went out or waits in the queue. |\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/ControlStatusDto.md -->\n# Type Alias: ControlStatusDto\n\n> **ControlStatusDto** = `\"sent\"` \\| `\"queued\"`\n\nWhat accepting a control operation did with it, on the wire.\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/DocumentId.md -->\n# Type Alias: DocumentId\n\n> **DocumentId** = `string`\n\nA validated document identifier. Historical document ids need not be UUIDs.\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/ElicitationAnswer.md -->\n# Type Alias: ElicitationAnswer\n\n> **ElicitationAnswer** = \\{ `action`: `\"accept\"`; `content?`: \\{\\[`key`: `string`\\]: [`ElicitationContentValue`](ElicitationContentValue.md); \\} \\| `null`; \\} \\| \\{ `action`: `\"decline\"`; \\} \\| \\{ `action`: `\"cancel\"`; \\}\n\nWhat the user decided about an elicitation. Mirrors ACP's three actions;\nthere is no `Other` because we never originate an action we do not know.\n\n## Union Members\n\n### Type Literal\n\n\\{ `action`: `\"accept\"`; `content?`: \\{\\[`key`: `string`\\]: [`ElicitationContentValue`](ElicitationContentValue.md); \\} \\| `null`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `action` | `\"accept\"` | - |\n| `content?` | \\{\\[`key`: `string`\\]: [`ElicitationContentValue`](ElicitationContentValue.md); \\} \\| `null` | Form: the submitted values keyed by property. URL: omitted. |\n\n***\n\n### Type Literal\n\n\\{ `action`: `\"decline\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `action`: `\"cancel\"`; \\}\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/ElicitationContentValue.md -->\n# Type Alias: ElicitationContentValue\n\n> **ElicitationContentValue** = `string` \\| `boolean` \\| `number` \\| `number` \\| `string`[]\n\nA value ACP accepts in an elicitation answer.\n\nMirrors ACP's `ElicitationContentValue` so that the contract a caller\nanswers against is the closed union ACP will accept, rather than arbitrary\nJSON narrowed on the way out. An object, a null, or a mixed array is\nrefused when the request is deserialized - where the caller learns of it -\ninstead of at send time, when the elicitation slot has already been\nreleased.\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/ElicitationRequestId.md -->\n# Type Alias: ElicitationRequestId\n\n> **ElicitationRequestId** = `number` \\| `string`\n\nThe JSON-RPC id of an agent's `elicitation/create` request, carried whole\nso the answer echoes exactly what the agent sent.\n\nAgents pick these, not us: Claude Code counts from `0`, others use\nstrings. `null` is not a legal id for a request that expects a response,\nso it is not representable here.\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/ExecutionActivity.md -->\n# Type Alias: ExecutionActivity\n\n> **ExecutionActivity** = \\{ `id`: `number`; `label`: `string`; `status`: [`RecordedCallStatus`](RecordedCallStatus.md); \\}\n\nA bounded SDK operation observed during execution; not an authorization or write receipt.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-id\"></a> `id` | `number` | Request identity within the execution. |\n| <a id=\"property-label\"></a> `label` | `string` | Server-selected label from the generated operation catalog. |\n| <a id=\"property-status\"></a> `status` | [`RecordedCallStatus`](RecordedCallStatus.md) | Observed request state; unfinished operations have unknown outcomes. |\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/ExecutionId.md -->\n# Type Alias: ExecutionId\n\n> **ExecutionId** = `string`\n\nCaller-selected UUID persisted in tool input before execution begins.\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/ExecutionRecord.md -->\n# Type Alias: ExecutionRecord\n\n> **ExecutionRecord** = \\{ `activity?`: [`ExecutionActivity`](ExecutionActivity.md)[]; `activityTruncated?`: `boolean`; `calls`: [`RecordedToolCall`](RecordedToolCall.md)[]; `error?`: `string` \\| `null`; `executionId`: [`ExecutionId`](ExecutionId.md); `result?`: `unknown`; `source`: `string`; `status`: [`ExecutionStatus`](ExecutionStatus.md); \\}\n\nDurable source and final outcome, with historical bridge calls when present.\nThe full journal is not included in the model's tool result.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-activity\"></a> `activity?` | [`ExecutionActivity`](ExecutionActivity.md)[] | Advisory SDK operation activity, without arguments or response contents. |\n| <a id=\"property-activitytruncated\"></a> `activityTruncated?` | `boolean` | Additional request activity was omitted at the bounded observation limit. |\n| <a id=\"property-calls\"></a> `calls` | [`RecordedToolCall`](RecordedToolCall.md)[] | Historical bridge calls. Direct HTTP executions leave this empty. |\n| <a id=\"property-error\"></a> `error?` | `string` \\| `null` | Safe execution failure text. |\n| <a id=\"property-executionid\"></a> `executionId` | [`ExecutionId`](ExecutionId.md) | Execution identity. |\n| <a id=\"property-result\"></a> `result?` | `unknown` | JSON returned by the program, if successful. |\n| <a id=\"property-source\"></a> `source` | `string` | The submitted JavaScript module. |\n| <a id=\"property-status\"></a> `status` | [`ExecutionStatus`](ExecutionStatus.md) | Overall execution state. |\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/ExecutionStatus.md -->\n# Type Alias: ExecutionStatus\n\n> **ExecutionStatus** = `\"running\"` \\| `\"succeeded\"` \\| `\"failed\"` \\| `\"cancelled\"` \\| `\"timed_out\"`\n\nThe recorded outcome of a program.\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/ExternalSessionResponse.md -->\n# Type Alias: ExternalSessionResponse\n\n> **ExternalSessionResponse** = \\{ `name?`: `string` \\| `null`; `provider`: `string`; `url?`: `string` \\| `null`; \\}\n\nThe provider-side identity of an externally-served session.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-name\"></a> `name?` | `string` \\| `null` | The provider's display name for the agent, when it reported one. |\n| <a id=\"property-provider\"></a> `provider` | `string` | Which provider serves the session, e.g. `cursor`. |\n| <a id=\"property-url\"></a> `url?` | `string` \\| `null` | The agent's page on the provider's site, for a client to link out to. |\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/FileChangeKindDto.md -->\n# Type Alias: FileChangeKindDto\n\n> **FileChangeKindDto** = `\"added\"` \\| `\"modified\"` \\| `\"deleted\"` \\| `\"renamed\"`\n\nWhat happened to a file, on the wire.\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/GitRefDto.md -->\n# Type Alias: GitRefDto\n\n> **GitRefDto** = \\{ `name?`: `string` \\| `null`; `sha?`: `string` \\| `null`; \\}\n\nOne end of the compared range.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-name\"></a> `name?` | `string` \\| `null` | The branch name, when known. |\n| <a id=\"property-sha\"></a> `sha?` | `string` \\| `null` | The commit, when known. |\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/LogDirectionDto.md -->\n# Type Alias: LogDirectionDto\n\n> **LogDirectionDto** = `\"to_server\"` \\| `\"to_runtime\"`\n\nWhich way a logged frame travelled, mirroring [`Message`]'s discriminant.\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/LogFrameDto.md -->\n# Type Alias: LogFrameDto\n\n> **LogFrameDto** = \\{ `content`: \\{\\[`key`: `string`\\]: `unknown`; \\}; `direction`: [`LogDirectionDto`](LogDirectionDto.md); \\}\n\nThe two fields [`AgentSessionLogEntryDto`] flattens in.\n\nSchema only. Nothing constructs one: the entry serializes through\n[`Message`], and this exists so the generated clients see `direction` and\n`content` as named fields instead of an open map. A hand-built copy could\ndrift from the fold's wire format, and the point of the endpoint is that it\ncannot - so this describes that format without being able to produce it.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-content\"></a> `content` | \\{\\[`key`: `string`\\]: `unknown`; \\} | The protocol envelope, verbatim. Opaque here: it is Agent Runtime Protocol, whose shape belongs to the fold rather than this endpoint. |\n| <a id=\"property-direction\"></a> `direction` | [`LogDirectionDto`](LogDirectionDto.md) | Which way the frame travelled. |\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/MessageParent.md -->\n# Type Alias: MessageParent\n\n> **MessageParent** = \\{ `id`: `string`; `type`: `\"channel\"`; \\} \\| \\{ `id`: [`DocumentId`](DocumentId.md); `type`: `\"document\"`; \\} \\| \\{ `id`: `string`; `type`: `\"initiative\"`; \\} \\| \\{ `id`: `string`; `type`: `\"crm_company\"`; \\} \\| \\{ `id`: `string`; `type`: `\"crm_contact\"`; \\} \\| \\{ `id`: `string`; `type`: `\"call\"`; \\}\n\nThe entity whose permissions and lifecycle govern a message.\n\n## Union Members\n\n### Type Literal\n\n\\{ `id`: `string`; `type`: `\"channel\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | A channel, including direct messages. |\n| `type` | `\"channel\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: [`DocumentId`](DocumentId.md); `type`: `\"document\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | [`DocumentId`](DocumentId.md) | A document, including tasks and PDFs. |\n| `type` | `\"document\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: `string`; `type`: `\"initiative\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | An initiative, presented as a project in the application. |\n| `type` | `\"initiative\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: `string`; `type`: `\"crm_company\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | A CRM company. |\n| `type` | `\"crm_company\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: `string`; `type`: `\"crm_contact\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | A CRM contact. |\n| `type` | `\"crm_contact\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: `string`; `type`: `\"call\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | A video call and its persistent chat thread. |\n| `type` | `\"call\"` | - |\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/PermissionAnswer.md -->\n# Type Alias: PermissionAnswer\n\n> **PermissionAnswer** = \\{ `kind`: `\"selected\"`; `optionId`: `string`; \\} \\| \\{ `kind`: `\"cancelled\"`; \\}\n\nThe decision carried by an [`AgentPermissionAction`].\n\n## Union Members\n\n### Type Literal\n\n\\{ `kind`: `\"selected\"`; `optionId`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"selected\"` | - |\n| `optionId` | `string` | The chosen option's id, as the agent listed it. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"cancelled\"`; \\}\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/PromptAttachment.md -->\n# Type Alias: PromptAttachment\n\n> **PromptAttachment** = \\{ `mimeType?`: `string` \\| `null`; `name`: `string`; `size?`: `number` \\| `null`; `uri`: `string`; \\}\n\nA file the prompt refers to, by where the agent can fetch it.\n\nMirrors ACP's `resource_link` content block, which every agent must\naccept: bytes never ride the prompt, only a URI (a static file service URL\nin practice) with enough metadata for a client to render a chip and for\nthe agent to decide whether to fetch it. Keeping the wire shape ACP-native\nmeans the harness translates without resolving anything, and the fold\nreads the same fields back off the logged frame.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-mimetype\"></a> `mimeType?` | `string` \\| `null` | The file's media type, when known. |\n| <a id=\"property-name\"></a> `name` | `string` | Display name, typically the original file name. |\n| <a id=\"property-size\"></a> `size?` | `number` \\| `null` | Size in bytes, when known. |\n| <a id=\"property-uri\"></a> `uri` | `string` | Where the agent can fetch the file. |\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/PullRequestLinkSource.md -->\n# Type Alias: PullRequestLinkSource\n\n> **PullRequestLinkSource** = `\"agent\"` \\| `\"user\"`\n\nWho associated a pull request with a session.\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/QueuedActionDto.md -->\n# Type Alias: QueuedActionDto\n\n> **QueuedActionDto** = \\{ `actionId`: [`AgentActionId`](AgentActionId.md); `actorUserId?`: `string` \\| `null`; `attachments?`: [`PromptAttachment`](PromptAttachment.md)[]; `createdAt`: `string`; `kind`: `string`; `prompt?`: `string` \\| `null`; \\}\n\nOne action waiting in a session's queue.\n\nClients deserialize this, so both derives are used.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-actionid\"></a> `actionId` | [`AgentActionId`](AgentActionId.md) | The id the action was accepted under. |\n| <a id=\"property-actoruserid\"></a> `actorUserId?` | `string` \\| `null` | The user who queued it, absent when a bot acted on nobody's behalf. |\n| <a id=\"property-attachments\"></a> `attachments?` | [`PromptAttachment`](PromptAttachment.md)[] | Files the prompt refers to, for prompts only. Kept through an edit, which replaces the text alone. |\n| <a id=\"property-createdat\"></a> `createdAt` | `string` | When it was accepted. |\n| <a id=\"property-kind\"></a> `kind` | `string` | What kind of action waits - `prompt` or `compact`; only turn-occupying actions are ever queued. |\n| <a id=\"property-prompt\"></a> `prompt?` | `string` \\| `null` | The prompt's raw text, present for prompts only. What an edit replaces. |\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/RecordedCallStatus.md -->\n# Type Alias: RecordedCallStatus\n\n> **RecordedCallStatus** = `\"running\"` \\| `\"completed\"` \\| `\"failed\"` \\| `\"unknown\"`\n\nA dispatch result; unfinished work is never reported as success.\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/RecordedToolCall.md -->\n# Type Alias: RecordedToolCall\n\n> **RecordedToolCall** = \\{ `error?`: `string` \\| `null`; `id`: `string`; `input`: `unknown`; `name`: `string`; `output?`: `unknown`; `outputOmitted`: `boolean`; `status`: [`RecordedCallStatus`](RecordedCallStatus.md); \\}\n\nA real inner call, recorded by trusted dispatch for the existing renderers.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-error\"></a> `error?` | `string` \\| `null` | Safe tool failure, if one was returned. |\n| <a id=\"property-id\"></a> `id` | `string` | Stable, execution-scoped component identity. |\n| <a id=\"property-input\"></a> `input` | `unknown` | Arguments passed to the actual tool. |\n| <a id=\"property-name\"></a> `name` | `string` | Canonical Macro tool name from the allowlisted registry. |\n| <a id=\"property-output\"></a> `output?` | `unknown` | Original tool output, retained independently of the program's return value. |\n| <a id=\"property-outputomitted\"></a> `outputOmitted` | `boolean` | Whether the response was omitted to keep the durable journal bounded. |\n| <a id=\"property-status\"></a> `status` | [`RecordedCallStatus`](RecordedCallStatus.md) | A started call that never replied has an unknown side-effect outcome. |\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/ReviewId.md -->\n# Type Alias: ReviewId\n\n> **ReviewId** = `string`\n\nPersisted review identity.\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/ReviewItem.md -->\n# Type Alias: ReviewItem\n\n> **ReviewItem** = \\{ `draft`: `unknown`; `error?`: `string` \\| `null`; `id`: `string`; `result?`: `unknown`; `status`: [`ReviewItemStatus`](ReviewItemStatus.md); \\}\n\nOne editable item and its durable outcome.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-draft\"></a> `draft` | `unknown` | Validated arguments for the existing composer/action. |\n| <a id=\"property-error\"></a> `error?` | `string` \\| `null` | Failure or uncertainty description. |\n| <a id=\"property-id\"></a> `id` | `string` | Stable item identity across stack navigation and edits. |\n| <a id=\"property-result\"></a> `result?` | `unknown` | Actual backend response, never a model assertion. |\n| <a id=\"property-status\"></a> `status` | [`ReviewItemStatus`](ReviewItemStatus.md) | Current outcome. |\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/ReviewItemStatus.md -->\n# Type Alias: ReviewItemStatus\n\n> **ReviewItemStatus** = `\"pending\"` \\| `\"submitting\"` \\| `\"completed\"` \\| `\"dismissed\"` \\| `\"unknown\"`\n\nA review item never retries an ambiguous external result automatically.\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/ReviewKind.md -->\n# Type Alias: ReviewKind\n\n> **ReviewKind** = `\"email\"` \\| `\"calendar\"`\n\nThe component and action used to finish a review.\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/ReviewRecord.md -->\n# Type Alias: ReviewRecord\n\n> **ReviewRecord** = \\{ `executionId?`: `null` \\| [`ExecutionId`](ExecutionId.md); `id`: [`ReviewId`](ReviewId.md); `items`: [`ReviewItem`](ReviewItem.md)[]; `kind`: [`ReviewKind`](ReviewKind.md); `notificationAttemptAt?`: `number` \\| `null`; `notificationId?`: `string` \\| `null`; `presentedAt?`: `number` \\| `null`; `revision`: `number`; `sessionId`: `string`; `title`: `string`; `updatedAt`: `number`; \\}\n\nFull UI record, fetched outside the model context.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-executionid\"></a> `executionId?` | `null` \\| [`ExecutionId`](ExecutionId.md) | - |\n| <a id=\"property-id\"></a> `id` | [`ReviewId`](ReviewId.md) | Review identity. |\n| <a id=\"property-items\"></a> `items` | [`ReviewItem`](ReviewItem.md)[] | Drafts and per-item outcomes. |\n| <a id=\"property-kind\"></a> `kind` | [`ReviewKind`](ReviewKind.md) | Component kind. |\n| <a id=\"property-notificationattemptat\"></a> `notificationAttemptAt?` | `number` \\| `null` | Most recent delivery claim, allowing retry after a replica stops. |\n| <a id=\"property-notificationid\"></a> `notificationId?` | `string` \\| `null` | Stable queued-action identity until the outcome has reached the session. A failed notification may be retried without repeating external actions. |\n| <a id=\"property-presentedat\"></a> `presentedAt?` | `number` \\| `null` | Durable presentation acknowledgment, separate from user decisions. |\n| <a id=\"property-revision\"></a> `revision` | `number` | Compare-and-swap revision for edits and submissions. |\n| <a id=\"property-sessionid\"></a> `sessionId` | `string` | Owning session. |\n| <a id=\"property-title\"></a> `title` | `string` | Stack label. |\n| <a id=\"property-updatedat\"></a> `updatedAt` | `number` | Milliseconds since epoch of the last state change. |\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/SandboxSize.md -->\n# Type Alias: SandboxSize\n\n> **SandboxSize** = `\"small\"` \\| `\"default\"` \\| `\"large\"`\n\nNamed compute tier for a managed sandbox.\n\nThe API and database store the name. CPU, RAM, and disk live in\n`crates/agent_harness/sandbox_sizes.json`.\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/SessionBot.md -->\n# Type Alias: SessionBot\n\n> **SessionBot** = \\{ `avatarUrl?`: `string` \\| `null`; `handle`: `string`; `id`: [`BotId`](BotId.md); `name`: `string`; \\}\n\nThe agent behind a session, as much of it as rendering a message needs.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-avatarurl\"></a> `avatarUrl?` | `string` \\| `null` | Avatar, when it has one. |\n| <a id=\"property-handle\"></a> `handle` | `string` | Stable `@` handle, without a leading `@`. |\n| <a id=\"property-id\"></a> `id` | [`BotId`](BotId.md) | The bot's id. A message it sent has `\"bot\\|{id}\"` as its sender. |\n| <a id=\"property-name\"></a> `name` | `string` | Display name. |\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/SessionStatusDto.md -->\n# Type Alias: SessionStatusDto\n\n> **SessionStatusDto** = \\{ `kind`: `\"no_messages\"`; \\} \\| \\{ `event`: `string`; `kind`: `\"event\"`; \\} \\| \\{ `kind`: `\"disconnected\"`; \\}\n\nTransport representation of a session's status, mirroring\n[`SessionStatus`].\n\n## Union Members\n\n### Type Literal\n\n\\{ `kind`: `\"no_messages\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `event`: `string`; `kind`: `\"event\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `event` | `string` | The wire name of the system event, e.g. `acp_ready`. |\n| `kind` | `\"event\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"disconnected\"`; \\}\n\n\n<!-- generated/calendar/types.gen/type-aliases/EventTime.md -->\n# Type Alias: EventTime\n\n> **EventTime** = \\{ `endsAt`: `string`; `kind`: `\"timed\"`; `startsAt`: `string`; `timeZone?`: `string` \\| `null`; \\} \\| \\{ `endDate`: `string`; `kind`: `\"allDay\"`; `startDate`: `string`; \\}\n\nThe mutually exclusive time shape of a calendar event.\n\nFields are renamed per variant rather than with `rename_all_fields`\nbecause utoipa only honors variant-level serde renames when it\nderives the OpenAPI schema.\n\n## Union Members\n\n### Type Literal\n\n\\{ `endsAt`: `string`; `kind`: `\"timed\"`; `startsAt`: `string`; `timeZone?`: `string` \\| `null`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `endsAt` | `string` | Exclusive end instant; equal to the start for an imported point event. |\n| `kind` | `\"timed\"` | - |\n| `startsAt` | `string` | Inclusive start instant. |\n| `timeZone?` | `string` \\| `null` | Original IANA time-zone identifier, when supplied. |\n\n***\n\n### Type Literal\n\n\\{ `endDate`: `string`; `kind`: `\"allDay\"`; `startDate`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `endDate` | `string` | Exclusive local end date. |\n| `kind` | `\"allDay\"` | - |\n| `startDate` | `string` | Inclusive local start date. |\n\n\n<!-- src/entities/agent-sessions/agent-session/classes/AgentSession.md -->\n# Class: AgentSession\n\nA managed or externally hosted coding-agent session.\n\n## Extends\n\n- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\\<[`AgentSessionResponse`](../../../../../generated/agent-harness/types.gen/type-aliases/AgentSessionResponse.md)\\>\n\n## Properties\n\n| Property | Modifier | Type | Description | Inherited from |\n| ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-codeexecutions\"></a> `codeExecutions` | `readonly` | \\{ `byId`: (`id`) => [`CodeExecution`](../../code-execution/classes/CodeExecution.md); \\} | Saved code executions scoped to this session. Handle construction makes no request. | - |\n| `codeExecutions.byId` | `public` | (`id`) => [`CodeExecution`](../../code-execution/classes/CodeExecution.md) | - | - |\n| <a id=\"property-createdat\"></a> `createdAt` | `readonly` | () => `Promise`\\<`string`\\> | When the session was created. | - |\n| <a id=\"property-harness\"></a> `harness` | `readonly` | () => `Promise`\\<`string`\\> | The agent harness implementation serving the session. | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |\n| <a id=\"property-instructions\"></a> `instructions` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | Instructions the session's runtime works under, when any were stated at creation. Fixed for the session's life. | - |\n| <a id=\"property-isarchived\"></a> `isArchived` | `readonly` | () => `Promise`\\<`boolean`\\> | Whether the session is archived and read-only. | - |\n| <a id=\"property-model\"></a> `model` | `readonly` | () => `Promise`\\<`string`\\> | The model currently configured for the session. | - |\n| <a id=\"property-modifiedat\"></a> `modifiedAt` | `readonly` | () => `Promise`\\<`string`\\> | When the session was last modified. | - |\n| <a id=\"property-name\"></a> `name` | `readonly` | () => `Promise`\\<`string`\\> | The session's user-facing display name. | - |\n| <a id=\"property-repourl\"></a> `repoUrl` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | The repository the agent works with, when one was supplied. | - |\n| <a id=\"property-reviews\"></a> `reviews` | `readonly` | \\{ `byId`: (`id`) => [`SessionReview`](../../review/classes/SessionReview.md); `create`: (`input`) => `Promise`\\<[`SessionReview`](../../review/classes/SessionReview.md)\\>; \\} | Persisted reviews scoped to this session, with or without a code execution. | - |\n| `reviews.byId` | `public` | (`id`) => [`SessionReview`](../../review/classes/SessionReview.md) | - | - |\n| `reviews.create` | `public` | (`input`) => `Promise`\\<[`SessionReview`](../../review/classes/SessionReview.md)\\> | - | - |\n| <a id=\"property-sandboxsize\"></a> `sandboxSize` | `readonly` | () => `Promise`\\<[`SandboxSize`](../../../../../generated/agent-harness/types.gen/type-aliases/SandboxSize.md)\\> | Compute tier of the managed sandbox. | - |\n| <a id=\"property-status\"></a> `status` | `readonly` | () => `Promise`\\<[`SessionStatusDto`](../../../../../generated/agent-harness/types.gen/type-aliases/SessionStatusDto.md)\\> | The session's latest runtime status. | - |\n| <a id=\"property-workspace\"></a> `workspace` | `readonly` | () => `Promise`\\<`string`\\> | The directory in which the agent harness runs. | - |\n\n## Methods\n\n### archive()\n\n> **archive**(): `Promise`\\<`void`\\>\n\nArchive this session, making it read-only until unarchived.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### changes()\n\n> **changes**(): `Promise`\\<[`AgentSessionChangesResponse`](../../../../../generated/agent-harness/types.gen/type-aliases/AgentSessionChangesResponse.md)\\>\n\nRead the latest captured GitHub pull request changes and capture status.\n\n#### Returns\n\n`Promise`\\<[`AgentSessionChangesResponse`](../../../../../generated/agent-harness/types.gen/type-aliases/AgentSessionChangesResponse.md)\\>\n\n***\n\n### changesPatch()\n\n> **changesPatch**(): `Promise`\\<`string`\\>\n\nRead the unified diff of the latest captured changeset.\n\n#### Returns\n\n`Promise`\\<`string`\\>\n\n***\n\n### control()\n\n> **control**(`action`): `Promise`\\<[`ControlResponse`](../../../../../generated/agent-harness/types.gen/type-aliases/ControlResponse.md)\\>\n\nSend a prompt or lifecycle operation to the live agent session.\n\nThe returned `actionId` matches `requestId` on the folded message the\naction derives once it dispatches. A `queued` status means a turn was\nrunning: the action waits in the session's queue ([queue](#queue)) and\ndispatches when that turn ends.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `action` | [`AgentAction`](../../../../../generated/agent-harness/types.gen/type-aliases/AgentAction.md) |\n\n#### Returns\n\n`Promise`\\<[`ControlResponse`](../../../../../generated/agent-harness/types.gen/type-aliases/ControlResponse.md)\\>\n\n***\n\n### delete()\n\n> **delete**(): `Promise`\\<`void`\\>\n\nDelete this session and any live resources it owns.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### linkPullRequest()\n\n> **linkPullRequest**(`url`): `Promise`\\<`void`\\>\n\nLink the GitHub pull request at `url` to this session. Linking one that\nis already linked changes nothing.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `url` | `string` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### log()\n\n> **log**(): `Promise`\\<[`AgentSessionLogResponse`](../../../../../generated/agent-harness/types.gen/type-aliases/AgentSessionLogResponse.md)\\>\n\nRead the complete raw protocol log for this session.\n\n#### Returns\n\n`Promise`\\<[`AgentSessionLogResponse`](../../../../../generated/agent-harness/types.gen/type-aliases/AgentSessionLogResponse.md)\\>\n\n***\n\n### prompt()\n\n> **prompt**(`text`, `attachments?`): `Promise`\\<[`ControlResponse`](../../../../../generated/agent-harness/types.gen/type-aliases/ControlResponse.md)\\>\n\nSend a prompt to the session — sugar over [control](#control).\n\n`attachments` are files the prompt refers to, each by a URL the agent\ncan fetch (a static file service URL in practice); they reach the agent\nas ACP `resource_link` blocks after the text.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `text` | `string` |\n| `attachments?` | [`PromptAttachment`](../../../../../generated/agent-harness/types.gen/type-aliases/PromptAttachment.md)[] |\n\n#### Returns\n\n`Promise`\\<[`ControlResponse`](../../../../../generated/agent-harness/types.gen/type-aliases/ControlResponse.md)\\>\n\n***\n\n### pullRequests()\n\n> **pullRequests**(): `Promise`\\<[`SessionPullRequest`](../type-aliases/SessionPullRequest.md)[]\\>\n\nThe GitHub pull requests linked to this session: the one its agent\nopened and any a person linked, oldest first.\n\n#### Returns\n\n`Promise`\\<[`SessionPullRequest`](../type-aliases/SessionPullRequest.md)[]\\>\n\n***\n\n### queue()\n\n> **queue**(): `Promise`\\<[`QueuedAction`](../../queued-action/classes/QueuedAction.md)[]\\>\n\nThe actions waiting to dispatch in this session, oldest first. Each can\nbe edited or removed until it dispatches.\n\n#### Returns\n\n`Promise`\\<[`QueuedAction`](../../queued-action/classes/QueuedAction.md)[]\\>\n\n***\n\n### refreshChanges()\n\n> **refreshChanges**(): `Promise`\\<[`AgentSessionChangesResponse`](../../../../../generated/agent-harness/types.gen/type-aliases/AgentSessionChangesResponse.md)\\>\n\nRequest a fresh capture and return the current state while it runs.\n\n#### Returns\n\n`Promise`\\<[`AgentSessionChangesResponse`](../../../../../generated/agent-harness/types.gen/type-aliases/AgentSessionChangesResponse.md)\\>\n\n***\n\n### rename()\n\n> **rename**(`name`): `Promise`\\<`void`\\>\n\nRename this session.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `name` | `string` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### setSandboxSize()\n\n> **setSandboxSize**(`size`): `Promise`\\<[`SandboxSize`](../../../../../generated/agent-harness/types.gen/type-aliases/SandboxSize.md)\\>\n\nResize this session's sandbox and remember the size as the owner's default.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `size` | [`SandboxSize`](../../../../../generated/agent-harness/types.gen/type-aliases/SandboxSize.md) |\n\n#### Returns\n\n`Promise`\\<[`SandboxSize`](../../../../../generated/agent-harness/types.gen/type-aliases/SandboxSize.md)\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`AgentSessionResponse`](../../../../../generated/agent-harness/types.gen/type-aliases/AgentSessionResponse.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`AgentSessionResponse`](../../../../../generated/agent-harness/types.gen/type-aliases/AgentSessionResponse.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`AgentSessionResponse`](../../../../../generated/agent-harness/types.gen/type-aliases/AgentSessionResponse.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)\n\n***\n\n### unarchive()\n\n> **unarchive**(): `Promise`\\<`void`\\>\n\nRestore an archived session so it can be edited and prompted again.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### unlinkPullRequest()\n\n> **unlinkPullRequest**(`url`): `Promise`\\<`void`\\>\n\nUnlink a GitHub pull request a person linked to this session. The pull\nrequest the session's agent opened stays linked.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `url` | `string` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `id`): `AgentSession`\n\nA handle to an agent session by id. Details load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `id` | `string` |\n\n#### Returns\n\n`AgentSession`\n\n***\n\n### codingPreferences()\n\n> `static` **codingPreferences**(`client`): `Promise`\\<[`CodingPreferencesBody`](../../../../../generated/agent-harness/types.gen/type-aliases/CodingPreferencesBody.md)\\>\n\nWhat the caller's new coding sessions are told to do beyond their assignment.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`Promise`\\<[`CodingPreferencesBody`](../../../../../generated/agent-harness/types.gen/type-aliases/CodingPreferencesBody.md)\\>\n\n***\n\n### createManaged()\n\n> `static` **createManaged**(`client`, `opts?`): `Promise`\\<`AgentSession`\\>\n\nCreate a managed session, optionally delivering its first prompt.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `opts?` | [`CreateManagedSessionOptions`](../type-aliases/CreateManagedSessionOptions.md) |\n\n#### Returns\n\n`Promise`\\<`AgentSession`\\>\n\n***\n\n### defaultSandboxSize()\n\n> `static` **defaultSandboxSize**(`client`): `Promise`\\<[`SandboxSize`](../../../../../generated/agent-harness/types.gen/type-aliases/SandboxSize.md)\\>\n\nThe caller's default sandbox size for new `@coder` sessions.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`Promise`\\<[`SandboxSize`](../../../../../generated/agent-harness/types.gen/type-aliases/SandboxSize.md)\\>\n\n***\n\n### forPullRequest()\n\n> `static` **forPullRequest**(`client`, `url`): `Promise`\\<`AgentSession`[]\\>\n\nThe sessions linked to the GitHub pull request at `url` that the caller\ncan view, oldest link first.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `url` | `string` |\n\n#### Returns\n\n`Promise`\\<`AgentSession`[]\\>\n\n***\n\n### repositories()\n\n> `static` **repositories**(`client`): `Promise`\\<[`SelectableRepository`](../type-aliases/SelectableRepository.md)[]\\>\n\nThe GitHub repositories the caller can hand a managed session: every\nrepository under an installation of Macro's GitHub App they or their\nteams made, sorted by `owner/name`. Empty when the App is installed\nnowhere they reach.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`Promise`\\<[`SelectableRepository`](../type-aliases/SelectableRepository.md)[]\\>\n\n***\n\n### repositoryBranches()\n\n> `static` **repositoryBranches**(`client`, `repoUrl`): `Promise`\\<`string`[]\\>\n\nBranch names on one repository the caller can start a managed session\nfrom, in the order GitHub listed them. Empty when the repository has\nno commits yet. `repoUrl` is one of the URLs [AgentSession.repositories](#repositories)\nlists.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `repoUrl` | `string` |\n\n#### Returns\n\n`Promise`\\<`string`[]\\>\n\n***\n\n### setCodingPreferences()\n\n> `static` **setCodingPreferences**(`client`, `preferences`): `Promise`\\<[`CodingPreferencesBody`](../../../../../generated/agent-harness/types.gen/type-aliases/CodingPreferencesBody.md)\\>\n\nReplace the caller's coding preferences.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `preferences` | [`CodingPreferencesBody`](../../../../../generated/agent-harness/types.gen/type-aliases/CodingPreferencesBody.md) |\n\n#### Returns\n\n`Promise`\\<[`CodingPreferencesBody`](../../../../../generated/agent-harness/types.gen/type-aliases/CodingPreferencesBody.md)\\>\n\n***\n\n### setDefaultSandboxSize()\n\n> `static` **setDefaultSandboxSize**(`client`, `size`): `Promise`\\<[`SandboxSize`](../../../../../generated/agent-harness/types.gen/type-aliases/SandboxSize.md)\\>\n\nSet the caller's default sandbox size for the next `@coder` mention.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `size` | [`SandboxSize`](../../../../../generated/agent-harness/types.gen/type-aliases/SandboxSize.md) |\n\n#### Returns\n\n`Promise`\\<[`SandboxSize`](../../../../../generated/agent-harness/types.gen/type-aliases/SandboxSize.md)\\>\n\n\n<!-- src/entities/agent-sessions/agent-session/type-aliases/CreateManagedSessionOptions.md -->\n# Type Alias: CreateManagedSessionOptions\n\n> **CreateManagedSessionOptions** = \\{ `instructions?`: `string`; `model?`: `string`; `prompt?`: `string`; `repoBranch?`: `string`; `repoUrl?`: `string`; \\}\n\nWhat a managed session is created with.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-instructions\"></a> `instructions?` | `string` | Instructions the session's runtime works under, fixed for its life. |\n| <a id=\"property-model\"></a> `model?` | `string` | The model the session runs on, instead of its persona's. The session's model from creation, read back as [AgentSession.model](../classes/AgentSession.md#property-model). |\n| <a id=\"property-prompt\"></a> `prompt?` | `string` | First prompt to deliver once the session is running. |\n| <a id=\"property-repobranch\"></a> `repoBranch?` | `string` | The branch the session starts on; needs `repoUrl`. Omitted, the repository's default branch. |\n| <a id=\"property-repourl\"></a> `repoUrl?` | `string` | The repository the session works on, as one of the URLs [AgentSession.repositories](../classes/AgentSession.md#repositories) lists for the caller. Omitted, the runtime chooses from the prompt. Honored for Cursor sessions. |\n\n\n<!-- src/entities/agent-sessions/agent-session/type-aliases/SelectableRepository.md -->\n# Type Alias: SelectableRepository\n\n> **SelectableRepository** = \\{ `defaultBranch?`: `string`; `url`: `string`; \\}\n\nA GitHub repository the caller can point a managed session at.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-defaultbranch\"></a> `defaultBranch?` | `string` | The branch its clones check out, and where a session starts unless `createManaged` names another. Absent for a repository with no commits. |\n| <a id=\"property-url\"></a> `url` | `string` | The canonical `https://github.com/owner/name` URL, as `createManaged` takes it. |\n\n\n<!-- src/entities/agent-sessions/agent-session/type-aliases/SessionPullRequest.md -->\n# Type Alias: SessionPullRequest\n\n> **SessionPullRequest** = \\{ `createdAt`: `string`; `githubKey`: `string`; `linkedBy?`: [`User`](../../../users/user/classes/User.md); `source`: [`PullRequestLinkSource`](../../../../../generated/agent-harness/types.gen/type-aliases/PullRequestLinkSource.md); `url`: `string`; \\}\n\nA GitHub pull request linked to a session.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-createdat\"></a> `createdAt` | `string` | When it was linked. |\n| <a id=\"property-githubkey\"></a> `githubKey` | `string` | The pull request's `owner/repo/pull/number` key. |\n| <a id=\"property-linkedby\"></a> `linkedBy?` | [`User`](../../../users/user/classes/User.md) | Who linked it, for pull requests a person linked. |\n| <a id=\"property-source\"></a> `source` | [`PullRequestLinkSource`](../../../../../generated/agent-harness/types.gen/type-aliases/PullRequestLinkSource.md) | Whether the session's agent opened it or a person linked it. |\n| <a id=\"property-url\"></a> `url` | `string` | The pull request's GitHub URL. |\n\n\n<!-- src/entities/agent-sessions/code-execution/classes/CodeExecution.md -->\n# Class: CodeExecution\n\nA saved code execution belonging to one agent session.\n\n## Extends\n\n- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\\<[`ExecutionRecord`](../../../../../generated/agent-harness/types.gen/type-aliases/ExecutionRecord.md)\\>\n\n## Properties\n\n| Property | Modifier | Type | Description | Inherited from |\n| ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-calls\"></a> `calls` | `readonly` | () => `Promise`\\<[`RecordedToolCall`](../../../../../generated/agent-harness/types.gen/type-aliases/RecordedToolCall.md)[]\\> | Legacy bridge calls; direct HTTP executions leave this empty. | - |\n| <a id=\"property-error\"></a> `error` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | Execution failure text, when present. | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |\n| <a id=\"property-reviews\"></a> `reviews` | `readonly` | \\{ `create`: (`input`) => `Promise`\\<[`SessionReview`](../../review/classes/SessionReview.md)\\>; `list`: () => `Promise`\\<[`SessionReview`](../../review/classes/SessionReview.md)[]\\>; \\} | Persistent UI blocks, independent of the execution lifetime. | - |\n| `reviews.create` | `public` | (`input`) => `Promise`\\<[`SessionReview`](../../review/classes/SessionReview.md)\\> | - | - |\n| `reviews.list` | `public` | () => `Promise`\\<[`SessionReview`](../../review/classes/SessionReview.md)[]\\> | - | - |\n| <a id=\"property-source\"></a> `source` | `readonly` | () => `Promise`\\<`string`\\> | The submitted JavaScript module source. | - |\n| <a id=\"property-status\"></a> `status` | `readonly` | () => `Promise`\\<[`ExecutionStatus`](../../../../../generated/agent-harness/types.gen/type-aliases/ExecutionStatus.md)\\> | Saved execution state. Call refresh to observe subsequent changes. | - |\n\n## Methods\n\n### refresh()\n\n> **refresh**(): `Promise`\\<`CodeExecution`\\>\n\nReload the saved state, for example after a running execution completes.\n\n#### Returns\n\n`Promise`\\<`CodeExecution`\\>\n\n***\n\n### result()\n\n> **result**(): `Promise`\\<`unknown`\\>\n\nThe program's returned JSON; preserves an explicit null result.\n\n#### Returns\n\n`Promise`\\<`unknown`\\>\n\n***\n\n### session()\n\n> **session**(): [`AgentSession`](../../agent-session/classes/AgentSession.md)\n\nThe session this execution belongs to.\n\n#### Returns\n\n[`AgentSession`](../../agent-session/classes/AgentSession.md)\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`ExecutionRecord`](../../../../../generated/agent-harness/types.gen/type-aliases/ExecutionRecord.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`ExecutionRecord`](../../../../../generated/agent-harness/types.gen/type-aliases/ExecutionRecord.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`ExecutionRecord`](../../../../../generated/agent-harness/types.gen/type-aliases/ExecutionRecord.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `session`, `id`): `CodeExecution`\n\nConstruct a lazy execution handle within its owning session.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `session` | [`AgentSession`](../../agent-session/classes/AgentSession.md) |\n| `id` | `string` |\n\n#### Returns\n\n`CodeExecution`\n\n\n<!-- src/entities/agent-sessions/code-execution/type-aliases/CodeResult.md -->\n# Type Alias: CodeResult\n\n> **CodeResult** = \\{ `data`: [`JsonValue`](JsonValue.md); `reviews`: \\{ `id`: `string`; `kind`: `\"email\"` \\| `\"calendar\"`; \\}[]; \\}\n\nJSON data returned to the model, plus references to independently saved UI.\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-data\"></a> `data` | [`JsonValue`](JsonValue.md) |\n| <a id=\"property-reviews\"></a> `reviews` | \\{ `id`: `string`; `kind`: `\"email\"` \\| `\"calendar\"`; \\}[] |\n\n\n<!-- src/entities/agent-sessions/code-execution/type-aliases/JsonValue.md -->\n# Type Alias: JsonValue\n\n> **JsonValue** = `null` \\| `boolean` \\| `number` \\| `string` \\| `JsonValue`[] \\| \\{\\[`key`: `string`\\]: `JsonValue`; \\}\n\n\n<!-- src/entities/agent-sessions/namespace/classes/AgentSessionNamespace.md -->\n# Class: AgentSessionNamespace\n\nEntry point for coding-agent sessions.\n\n## Constructors\n\n### Constructor\n\n> **new AgentSessionNamespace**(`client`): `AgentSessionNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`AgentSessionNamespace`\n\n## Methods\n\n### byId()\n\n> **byId**(`id`): [`AgentSession`](../../agent-session/classes/AgentSession.md)\n\nA handle to an agent session by id. Details load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`AgentSession`](../../agent-session/classes/AgentSession.md)\n\n***\n\n### codingPreferences()\n\n> **codingPreferences**(): `Promise`\\<[`CodingPreferencesBody`](../../../../../generated/agent-harness/types.gen/type-aliases/CodingPreferencesBody.md)\\>\n\nWhat the caller's new coding sessions are told to do beyond their assignment.\n\n#### Returns\n\n`Promise`\\<[`CodingPreferencesBody`](../../../../../generated/agent-harness/types.gen/type-aliases/CodingPreferencesBody.md)\\>\n\n***\n\n### createManaged()\n\n> **createManaged**(`opts?`): `Promise`\\<[`AgentSession`](../../agent-session/classes/AgentSession.md)\\>\n\nCreate a managed agent session.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts?` | [`CreateManagedSessionOptions`](../../agent-session/type-aliases/CreateManagedSessionOptions.md) |\n\n#### Returns\n\n`Promise`\\<[`AgentSession`](../../agent-session/classes/AgentSession.md)\\>\n\n***\n\n### defaultSandboxSize()\n\n> **defaultSandboxSize**(): `Promise`\\<[`SandboxSize`](../../../../../generated/agent-harness/types.gen/type-aliases/SandboxSize.md)\\>\n\nThe caller's default sandbox size for new `@coder` sessions.\n\n#### Returns\n\n`Promise`\\<[`SandboxSize`](../../../../../generated/agent-harness/types.gen/type-aliases/SandboxSize.md)\\>\n\n***\n\n### forPullRequest()\n\n> **forPullRequest**(`url`): `Promise`\\<[`AgentSession`](../../agent-session/classes/AgentSession.md)[]\\>\n\nThe sessions linked to the GitHub pull request at `url` that the caller\ncan view.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `url` | `string` |\n\n#### Returns\n\n`Promise`\\<[`AgentSession`](../../agent-session/classes/AgentSession.md)[]\\>\n\n***\n\n### repositories()\n\n> **repositories**(): `Promise`\\<[`SelectableRepository`](../../agent-session/type-aliases/SelectableRepository.md)[]\\>\n\nThe GitHub repositories the caller can hand a managed session, with the\nbranch each one's sessions start on by default.\n\n#### Returns\n\n`Promise`\\<[`SelectableRepository`](../../agent-session/type-aliases/SelectableRepository.md)[]\\>\n\n***\n\n### repositoryBranches()\n\n> **repositoryBranches**(`repoUrl`): `Promise`\\<`string`[]\\>\n\nBranch names on one repository the caller can start a managed session\nfrom. `repoUrl` is one of the URLs [AgentSessionNamespace.repositories](#repositories)\nlists.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `repoUrl` | `string` |\n\n#### Returns\n\n`Promise`\\<`string`[]\\>\n\n***\n\n### setCodingPreferences()\n\n> **setCodingPreferences**(`preferences`): `Promise`\\<[`CodingPreferencesBody`](../../../../../generated/agent-harness/types.gen/type-aliases/CodingPreferencesBody.md)\\>\n\nReplace the caller's coding preferences.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `preferences` | [`CodingPreferencesBody`](../../../../../generated/agent-harness/types.gen/type-aliases/CodingPreferencesBody.md) |\n\n#### Returns\n\n`Promise`\\<[`CodingPreferencesBody`](../../../../../generated/agent-harness/types.gen/type-aliases/CodingPreferencesBody.md)\\>\n\n***\n\n### setDefaultSandboxSize()\n\n> **setDefaultSandboxSize**(`size`): `Promise`\\<[`SandboxSize`](../../../../../generated/agent-harness/types.gen/type-aliases/SandboxSize.md)\\>\n\nSet the caller's default sandbox size for the next `@coder` mention.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `size` | [`SandboxSize`](../../../../../generated/agent-harness/types.gen/type-aliases/SandboxSize.md) |\n\n#### Returns\n\n`Promise`\\<[`SandboxSize`](../../../../../generated/agent-harness/types.gen/type-aliases/SandboxSize.md)\\>\n\n\n<!-- src/entities/agent-sessions/queued-action/classes/QueuedAction.md -->\n# Class: QueuedAction\n\nOne action waiting in an agent session's server-side queue: a prompt or a\ncompact accepted while a turn was running, dispatching when that turn\nends. Until then it can be edited (prompts only), steered, or removed; once\nit has dispatched, these actions answer 404 — there is no un-sending.\n\nList-sourced only - there is no per-action GET, only the queue snapshot -\nso this wraps whatever DTO the caller already has, the same shape\n`CrmComment` wraps a list-sourced record, rather than `MacroEntity`'s\nlazy-fetch-by-id.\n\n## Accessors\n\n### actionId\n\n#### Get Signature\n\n> **get** **actionId**(): `string`\n\nThe id the action was accepted under. Once it dispatches, this equals\n`requestId` on the folded message the action derives.\n\n##### Returns\n\n`string`\n\n***\n\n### actorUserId\n\n#### Get Signature\n\n> **get** **actorUserId**(): `string` \\| `undefined`\n\nThe user who queued it, absent when a bot acted on nobody's behalf.\n\n##### Returns\n\n`string` \\| `undefined`\n\n***\n\n### attachments\n\n#### Get Signature\n\n> **get** **attachments**(): [`PromptAttachment`](../../../../../generated/agent-harness/types.gen/type-aliases/PromptAttachment.md)[]\n\nFiles the prompt refers to; empty for a compact. Kept through an edit.\n\n##### Returns\n\n[`PromptAttachment`](../../../../../generated/agent-harness/types.gen/type-aliases/PromptAttachment.md)[]\n\n***\n\n### createdAt\n\n#### Get Signature\n\n> **get** **createdAt**(): `string`\n\nWhen the action was accepted, as an RFC 3339 timestamp.\n\n##### Returns\n\n`string`\n\n***\n\n### kind\n\n#### Get Signature\n\n> **get** **kind**(): `string`\n\n`prompt` or `compact`; only turn-occupying actions are ever queued.\n\n##### Returns\n\n`string`\n\n***\n\n### prompt\n\n#### Get Signature\n\n> **get** **prompt**(): `string` \\| `undefined`\n\nThe prompt's raw text, present for prompts only. What an edit replaces.\n\n##### Returns\n\n`string` \\| `undefined`\n\n## Methods\n\n### edit()\n\n> **edit**(`prompt`): `Promise`\\<`QueuedAction`\\>\n\nReplace this queued prompt's text before it dispatches. Returns this\nhandle for chaining; the edit endpoint answers 204, so `prompt` is\napplied locally rather than reread from a response body.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `prompt` | `string` |\n\n#### Returns\n\n`Promise`\\<`QueuedAction`\\>\n\n***\n\n### remove()\n\n> **remove**(): `Promise`\\<`void`\\>\n\nRemove this action from the queue before it dispatches.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### steer()\n\n> **steer**(): `Promise`\\<`void`\\>\n\nMove this action to the front and interrupt the current turn to run it next.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### from()\n\n> `static` **from**(`client`, `sessionId`, `dto`): `QueuedAction`\n\nWrap a queue entry already in hand (e.g. from `AgentSession.queue()`).\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `sessionId` | `string` |\n| `dto` | [`QueuedActionDto`](../../../../../generated/agent-harness/types.gen/type-aliases/QueuedActionDto.md) |\n\n#### Returns\n\n`QueuedAction`\n\n\n<!-- src/entities/agent-sessions/review/classes/ReviewItem.md -->\n# Class: ReviewItem\n\nAn item handle scopes edits and decisions to its persisted review.\n\n## Constructors\n\n### Constructor\n\n> **new ReviewItem**(`snapshot`, `actions`): `ReviewItem`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `snapshot` | [`ReviewItem`](../../../../../generated/agent-harness/types.gen/type-aliases/ReviewItem.md) |\n| `actions` | \\{ `dismiss`: () => `Promise`\\<`void`\\>; `edit`: (`draft`) => `Promise`\\<`void`\\>; `submit`: () => `Promise`\\<`void`\\>; \\} |\n| `actions.dismiss` | () => `Promise`\\<`void`\\> |\n| `actions.edit` | (`draft`) => `Promise`\\<`void`\\> |\n| `actions.submit` | () => `Promise`\\<`void`\\> |\n\n#### Returns\n\n`ReviewItem`\n\n## Accessors\n\n### draft\n\n#### Get Signature\n\n> **get** **draft**(): `unknown`\n\n##### Returns\n\n`unknown`\n\n***\n\n### id\n\n#### Get Signature\n\n> **get** **id**(): `string`\n\n##### Returns\n\n`string`\n\n***\n\n### result\n\n#### Get Signature\n\n> **get** **result**(): `unknown`\n\n##### Returns\n\n`unknown`\n\n***\n\n### status\n\n#### Get Signature\n\n> **get** **status**(): [`ReviewItemStatus`](../../../../../generated/agent-harness/types.gen/type-aliases/ReviewItemStatus.md)\n\n##### Returns\n\n[`ReviewItemStatus`](../../../../../generated/agent-harness/types.gen/type-aliases/ReviewItemStatus.md)\n\n## Methods\n\n### dismiss()\n\n> **dismiss**(): `Promise`\\<`void`\\>\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### edit()\n\n> **edit**(`draft`): `Promise`\\<`void`\\>\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `draft` | `unknown` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### submit()\n\n> **submit**(): `Promise`\\<`void`\\>\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n\n<!-- src/entities/agent-sessions/review/classes/SessionReview.md -->\n# Class: SessionReview\n\nA persistent review remains actionable after the code execution ends.\n\n## Extends\n\n- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\\<[`ReviewRecord`](../../../../../generated/agent-harness/types.gen/type-aliases/ReviewRecord.md)\\>\n\n## Properties\n\n| Property | Modifier | Type | Inherited from |\n| ------ | ------ | ------ | ------ |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |\n| <a id=\"property-kind\"></a> `kind` | `readonly` | () => `Promise`\\<[`ReviewKind`](../../../../../generated/agent-harness/types.gen/type-aliases/ReviewKind.md)\\> | - |\n| <a id=\"property-title\"></a> `title` | `readonly` | () => `Promise`\\<`string`\\> | - |\n\n## Methods\n\n### dismissAll()\n\n> **dismissAll**(): `Promise`\\<`void`\\>\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### items()\n\n> **items**(): `Promise`\\<[`ReviewItem`](ReviewItem.md)[]\\>\n\n#### Returns\n\n`Promise`\\<[`ReviewItem`](ReviewItem.md)[]\\>\n\n***\n\n### reference()\n\n> **reference**(): `Promise`\\<\\{ `id`: `string`; `kind`: [`ReviewKind`](../../../../../generated/agent-harness/types.gen/type-aliases/ReviewKind.md); \\}\\>\n\nCompact reference for main()'s returned reviews array.\n\n#### Returns\n\n`Promise`\\<\\{ `id`: `string`; `kind`: [`ReviewKind`](../../../../../generated/agent-harness/types.gen/type-aliases/ReviewKind.md); \\}\\>\n\n***\n\n### refresh()\n\n> **refresh**(): `Promise`\\<`SessionReview`\\>\n\n#### Returns\n\n`Promise`\\<`SessionReview`\\>\n\n***\n\n### session()\n\n> **session**(): [`AgentSession`](../../agent-session/classes/AgentSession.md)\n\n#### Returns\n\n[`AgentSession`](../../agent-session/classes/AgentSession.md)\n\n***\n\n### submitAll()\n\n> **submitAll**(): `Promise`\\<`void`\\>\n\nSubmit the saved pending drafts. Never retries a conflict or ambiguous send.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`ReviewRecord`](../../../../../generated/agent-harness/types.gen/type-aliases/ReviewRecord.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`ReviewRecord`](../../../../../generated/agent-harness/types.gen/type-aliases/ReviewRecord.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`ReviewRecord`](../../../../../generated/agent-harness/types.gen/type-aliases/ReviewRecord.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `session`, `id`): `SessionReview`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `session` | [`AgentSession`](../../agent-session/classes/AgentSession.md) |\n| `id` | `string` |\n\n#### Returns\n\n`SessionReview`\n\n***\n\n### create()\n\n> `static` **create**(`client`, `execution`, `input`): `Promise`\\<`SessionReview`\\>\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `execution` | [`CodeExecution`](../../code-execution/classes/CodeExecution.md) |\n| `input` | [`CreateReviewOptions`](../type-aliases/CreateReviewOptions.md) |\n\n#### Returns\n\n`Promise`\\<`SessionReview`\\>\n\n***\n\n### createForSession()\n\n> `static` **createForSession**(`client`, `session`, `input`, `execution?`): `Promise`\\<`SessionReview`\\>\n\nPresent a review in a session without requiring a code execution.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `session` | [`AgentSession`](../../agent-session/classes/AgentSession.md) |\n| `input` | [`CreateReviewOptions`](../type-aliases/CreateReviewOptions.md) |\n| `execution?` | [`CodeExecution`](../../code-execution/classes/CodeExecution.md) |\n\n#### Returns\n\n`Promise`\\<`SessionReview`\\>\n\n***\n\n### fromRecord()\n\n> `static` **fromRecord**(`client`, `session`, `record`): `SessionReview`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `session` | [`AgentSession`](../../agent-session/classes/AgentSession.md) |\n| `record` | [`ReviewRecord`](../../../../../generated/agent-harness/types.gen/type-aliases/ReviewRecord.md) |\n\n#### Returns\n\n`SessionReview`\n\n***\n\n### list()\n\n> `static` **list**(`client`, `execution`): `Promise`\\<`SessionReview`[]\\>\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `execution` | [`CodeExecution`](../../code-execution/classes/CodeExecution.md) |\n\n#### Returns\n\n`Promise`\\<`SessionReview`[]\\>\n\n\n<!-- src/entities/agent-sessions/review/type-aliases/CreateReviewOptions.md -->\n# Type Alias: CreateReviewOptions\n\n> **CreateReviewOptions** = \\{ `drafts`: [`ReviewEmailDraft`](ReviewEmailDraft.md)[]; `kind`: `\"email\"`; `title`: `string`; \\} \\| \\{ `drafts`: [`ReviewCalendarDraft`](ReviewCalendarDraft.md)[]; `kind`: `\"calendar\"`; `title`: `string`; \\}\n\n\n<!-- src/entities/agent-sessions/review/type-aliases/ReviewCalendarDraft.md -->\n# Type Alias: ReviewCalendarDraft\n\n> **ReviewCalendarDraft** = \\{ `addGoogleMeet?`: `boolean`; `addMacroCall?`: `boolean`; `attendees?`: \\{ `email`: `string`; `isOptional?`: `boolean`; \\}[]; `calendarId?`: `string` \\| `null`; `description?`: `string` \\| `null`; `eventType?`: `\"default\"` \\| `\"out_of_office\"`; `location?`: `string` \\| `null`; `outOfOffice?`: \\{ `autoDeclineMode?`: `\"decline_none\"` \\| `\"decline_all\"` \\| `\"decline_new_only\"`; `declineMessage?`: `string` \\| `null`; \\} \\| `null`; `recurrenceLines?`: `string`[]; `reminders?`: \\{ `overrides?`: \\{ `method`: `string`; `minutes`: `number`; \\}[]; `useDefault`: `boolean`; \\} \\| `null`; `time`: [`EventTime`](../../../../../generated/calendar/types.gen/type-aliases/EventTime.md); `title`: `string`; \\}\n\nCalendar drafts use the existing calendar composer and creation action.\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-addgooglemeet\"></a> `addGoogleMeet?` | `boolean` |\n| <a id=\"property-addmacrocall\"></a> `addMacroCall?` | `boolean` |\n| <a id=\"property-attendees\"></a> `attendees?` | \\{ `email`: `string`; `isOptional?`: `boolean`; \\}[] |\n| <a id=\"property-calendarid\"></a> `calendarId?` | `string` \\| `null` |\n| <a id=\"property-description\"></a> `description?` | `string` \\| `null` |\n| <a id=\"property-eventtype\"></a> `eventType?` | `\"default\"` \\| `\"out_of_office\"` |\n| <a id=\"property-location\"></a> `location?` | `string` \\| `null` |\n| <a id=\"property-outofoffice\"></a> `outOfOffice?` | \\{ `autoDeclineMode?`: `\"decline_none\"` \\| `\"decline_all\"` \\| `\"decline_new_only\"`; `declineMessage?`: `string` \\| `null`; \\} \\| `null` |\n| <a id=\"property-recurrencelines\"></a> `recurrenceLines?` | `string`[] |\n| <a id=\"property-reminders\"></a> `reminders?` | \\{ `overrides?`: \\{ `method`: `string`; `minutes`: `number`; \\}[]; `useDefault`: `boolean`; \\} \\| `null` |\n| <a id=\"property-time\"></a> `time` | [`EventTime`](../../../../../generated/calendar/types.gen/type-aliases/EventTime.md) |\n| <a id=\"property-title\"></a> `title` | `string` |\n\n\n<!-- src/entities/agent-sessions/review/type-aliases/ReviewEmailDraft.md -->\n# Type Alias: ReviewEmailDraft\n\n> **ReviewEmailDraft** = \\{ `attachments?`: \\{ `documentId`: `string`; \\}[]; `bcc?`: \\{ `email`: `string`; `name?`: `string` \\| `null`; \\}[]; `body`: `string`; `cc?`: \\{ `email`: `string`; `name?`: `string` \\| `null`; \\}[]; `includeSignature?`: `boolean` \\| `null`; `replyingToId?`: `string` \\| `null`; `subject`: `string`; `to`: \\{ `email`: `string`; `name?`: `string` \\| `null`; \\}[]; \\}\n\nMarkdown is rendered by the ordinary email action; the UI can edit each draft.\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-attachments\"></a> `attachments?` | \\{ `documentId`: `string`; \\}[] |\n| <a id=\"property-bcc\"></a> `bcc?` | \\{ `email`: `string`; `name?`: `string` \\| `null`; \\}[] |\n| <a id=\"property-body\"></a> `body` | `string` |\n| <a id=\"property-cc\"></a> `cc?` | \\{ `email`: `string`; `name?`: `string` \\| `null`; \\}[] |\n| <a id=\"property-includesignature\"></a> `includeSignature?` | `boolean` \\| `null` |\n| <a id=\"property-replyingtoid\"></a> `replyingToId?` | `string` \\| `null` |\n| <a id=\"property-subject\"></a> `subject` | `string` |\n| <a id=\"property-to\"></a> `to` | \\{ `email`: `string`; `name?`: `string` \\| `null`; \\}[] |\n"+ "documentation": "# Macro SDK: agentSessions\n\nGenerated by TypeDoc. Paths below refer to the canonical Markdown hierarchy. Other entity handles are documented in their named section; request core for shared SDK helpers.\n\n<!-- generated/agent-harness/types.gen/type-aliases/AccessLevel.md -->\n# Type Alias: AccessLevel\n\n> **AccessLevel** = `\"view\"` \\| `\"comment\"` \\| `\"edit\"` \\| `\"owner\"`\n\nOrdered from least to most access top -> bottom\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/AgentAction.md -->\n# Type Alias: AgentAction\n\n> **AgentAction** = [`AgentPromptAction`](AgentPromptAction.md) & \\{ `type`: `\"prompt\"`; \\} \\| [`AgentSetModelAction`](AgentSetModelAction.md) & \\{ `type`: `\"setModel\"`; \\} \\| [`AgentSetConfigOptionAction`](AgentSetConfigOptionAction.md) & \\{ `type`: `\"setConfigOption\"`; \\} \\| \\{ `type`: `\"compact\"`; \\} \\| \\{ `type`: `\"stop\"`; \\} \\| [`AgentRespondElicitationAction`](AgentRespondElicitationAction.md) & \\{ `type`: `\"respondElicitation\"`; \\} \\| [`AgentPermissionAction`](AgentPermissionAction.md) & \\{ `type`: `\"respondToPermission\"`; \\}\n\nOne thing a caller wants an agent to do.\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/AgentActionId.md -->\n# Type Alias: AgentActionId\n\n> **AgentActionId** = `string`\n\nIdentifies one accepted [`AgentAction`] end to end: returned by the\ncontrol endpoint, written as the JSON-RPC request id on the action's wire\nframe, and read back off that frame as `request_id` on the folded message\nit derives.\n\nA v7 uuid, so ids sort by mint time. Minted by the server at accept time,\nor by a client that speculated the action and named it in the control\nrequest - either way the server is the only writer of runtime-bound\nframes, so a uuid-shaped request id remains the whole ownership test. The\nmachine's own handshake request ids (`agent_session:{session}:{n}`) are\nnot uuids and stay `None`.\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/AgentConversationDto.md -->\n# Type Alias: AgentConversationDto\n\n> **AgentConversationDto** = \\{ `available`: `boolean`; `avatarUrl?`: `string` \\| `null`; `botId`: `string`; `channelId`: `string`; `name`: `string`; `sessions`: [`AgentConversationSessionDto`](AgentConversationSessionDto.md)[]; `settingsChanged`: `boolean`; `turns`: [`AgentConversationTurnDto`](AgentConversationTurnDto.md)[]; \\}\n\nAn agent's conversation in a channel, as the person it is with sees it.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-available\"></a> `available` | `boolean` | Whether the caller may currently send a new prompt. |\n| <a id=\"property-avatarurl\"></a> `avatarUrl?` | `string` \\| `null` | Optional persona avatar. |\n| <a id=\"property-botid\"></a> `botId` | `string` | Persona id (without the bot principal prefix). |\n| <a id=\"property-channelid\"></a> `channelId` | `string` | The channel containing the visible transcript. |\n| <a id=\"property-name\"></a> `name` | `string` | Persona's historical display name. |\n| <a id=\"property-sessions\"></a> `sessions` | [`AgentConversationSessionDto`](AgentConversationSessionDto.md)[] | The sessions the conversation has run on, oldest first. |\n| <a id=\"property-settingschanged\"></a> `settingsChanged` | `boolean` | Whether new persona settings are available to adopt explicitly. |\n| <a id=\"property-turns\"></a> `turns` | [`AgentConversationTurnDto`](AgentConversationTurnDto.md)[] | Persistent state of each accepted message and its current attempt. |\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/AgentConversationSessionDto.md -->\n# Type Alias: AgentConversationSessionDto\n\n> **AgentConversationSessionDto** = \\{ `createdAt`: `string`; `isCurrent`: `boolean`; `sessionId`: `string`; \\}\n\nOne session a conversation has run on; every channel message stays visible.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-createdat\"></a> `createdAt` | `string` | When the session began. |\n| <a id=\"property-iscurrent\"></a> `isCurrent` | `boolean` | Whether this is the current agent context. |\n| <a id=\"property-sessionid\"></a> `sessionId` | `string` | Session whose controls and live events belong to this context. |\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/AgentConversationTurnDto.md -->\n# Type Alias: AgentConversationTurnDto\n\n> **AgentConversationTurnDto** = \\{ `actionId`: `string`; `createdAt`: `string`; `replyMessageId?`: `string` \\| `null`; `retryable`: `boolean`; `sessionId`: `string`; `sourceMessageId`: `string`; `state`: [`ConversationTurnState`](ConversationTurnState.md); \\}\n\nExecution status without exposing the persona prompt or stored credentials.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-actionid\"></a> `actionId` | `string` | Current runtime attempt identity. |\n| <a id=\"property-createdat\"></a> `createdAt` | `string` | When the source message was first accepted. |\n| <a id=\"property-replymessageid\"></a> `replyMessageId?` | `string` \\| `null` | The associated agent reply, if it has been posted. |\n| <a id=\"property-retryable\"></a> `retryable` | `boolean` | Whether Retry would be accepted now. A failed attempt is not retryable until its reply says how it ended. |\n| <a id=\"property-sessionid\"></a> `sessionId` | `string` | Session carrying this turn. |\n| <a id=\"property-sourcemessageid\"></a> `sourceMessageId` | `string` | The user's message in the channel timeline. |\n| <a id=\"property-state\"></a> `state` | [`ConversationTurnState`](ConversationTurnState.md) | Durable execution state. |\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/AgentPermissionAction.md -->\n# Type Alias: AgentPermissionAction\n\n> **AgentPermissionAction** = \\{ `answer`: [`PermissionAnswer`](PermissionAnswer.md); `requestId`: `unknown`; \\}\n\nA user's answer to the agent's `session/request_permission`.\n\nUnlike every other action this is not a new request but the reply to one\nthe agent made, so it carries the agent's own request id rather than\nreceiving a server-minted one.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-answer\"></a> `answer` | [`PermissionAnswer`](PermissionAnswer.md) | What the user decided. |\n| <a id=\"property-requestid\"></a> `requestId` | `unknown` | The agent's JSON-RPC request id, echoed verbatim from the folded permission part. A string or a number on the wire; agents mint both, and `7` does not answer `\"7\"`. |\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/AgentPromptAction.md -->\n# Type Alias: AgentPromptAction\n\n> **AgentPromptAction** = \\{ `attachments?`: [`PromptAttachment`](PromptAttachment.md)[]; `prompt`: `string`; \\}\n\nAsk the agent to work on something.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-attachments\"></a> `attachments?` | [`PromptAttachment`](PromptAttachment.md)[] | Files the prompt refers to, in the order the user attached them. Delivered after the text as one `resource_link` block each. |\n| <a id=\"property-prompt\"></a> `prompt` | `string` | What to tell the agent. |\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/AgentRespondElicitationAction.md -->\n# Type Alias: AgentRespondElicitationAction\n\n> **AgentRespondElicitationAction** = [`ElicitationAnswer`](ElicitationAnswer.md) & \\{ `requestId`: [`ElicitationRequestId`](ElicitationRequestId.md); \\}\n\nAnswer an elicitation the agent is waiting on.\n\n## Type Declaration\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `requestId` | [`ElicitationRequestId`](ElicitationRequestId.md) | The agent's `elicitation/create` request id - not an [`AgentActionId`], because the agent minted it. |\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/AgentSessionChangesResponse.md -->\n# Type Alias: AgentSessionChangesResponse\n\n> **AgentSessionChangesResponse** = \\{ `attempt?`: `null` \\| [`CaptureAttemptDto`](CaptureAttemptDto.md); `capturing`: `boolean`; `changeset?`: `null` \\| [`ChangesetDto`](ChangesetDto.md); \\}\n\nResponse body for `GET /agent-sessions/{session_id}/changes`.\n\nClients deserialize this, so both derives are used.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-attempt\"></a> `attempt?` | `null` \\| [`CaptureAttemptDto`](CaptureAttemptDto.md) | - |\n| <a id=\"property-capturing\"></a> `capturing` | `boolean` | A capture is running right now. |\n| <a id=\"property-changeset\"></a> `changeset?` | `null` \\| [`ChangesetDto`](ChangesetDto.md) | - |\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/AgentSessionLogEntryDto.md -->\n# Type Alias: AgentSessionLogEntryDto\n\n> **AgentSessionLogEntryDto** = [`LogFrameDto`](LogFrameDto.md) & \\{ `createdAt`: `string`; `id`: `string`; `userId?`: `string` \\| `null`; \\}\n\nOne entry of a session's protocol log.\n\nSerializes as `{\"userId\": ..., \"direction\": ..., \"content\": ...}` - the\nframe's own two fields, flattened in beside the attribution, which is the\nsame shape a recorded session's JSONL carries. A reader can deserialize the\n`direction`/`content` pair straight back into the fold's own log type\nrather than through a transport vocabulary of its own.\n\n`agentSessionId` is not repeated per entry: every entry in a response\nbelongs to the session named once at the top.\n\n`Deserialize` is for the wire-contract tests only - nothing server-side\ndecodes its own response type.\n\n## Type Declaration\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `createdAt` | `string` | When the log recorded the frame. The frame itself carries no time, so this comes from the log row. It is what a reader has to order these against anything else it is showing beside them - the fold derives an order among the messages of one session and nothing more. |\n| `id` | `string` | Durable transport row identity; together with `createdAt`, its order cursor. |\n| `userId?` | `string` \\| `null` | The user whose action produced the frame, absent when no user did. Only prompts carry one, and only when the frame was attributed at the time - a replayed or recorded session's are anonymous. |\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/AgentSessionLogResponse.md -->\n# Type Alias: AgentSessionLogResponse\n\n> **AgentSessionLogResponse** = \\{ `bot`: [`SessionBot`](SessionBot.md); `entries`: [`AgentSessionLogEntryDto`](AgentSessionLogEntryDto.md)[]; \\}\n\nResponse body for one session's raw protocol log.\n\nA wrapper rather than a bare array so that anything which is about the\nresponse rather than about a frame has somewhere to go later without\nbreaking every client.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-bot\"></a> `bot` | [`SessionBot`](SessionBot.md) | The agent whose messages the log derives. Here because a client renders those messages and cannot otherwise work out who sent them: the sender of an agent message is this session's bot, and nothing else names it. |\n| <a id=\"property-entries\"></a> `entries` | [`AgentSessionLogEntryDto`](AgentSessionLogEntryDto.md)[] | Effective history in ascending `(createdAt, id)` order. The first row is the inclusive history boundary cursor: buffered rows before it are obsolete. Reconcile snapshot overlap by row ID, never content. An empty history has no boundary or overlapping rows. |\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/AgentSessionResponse.md -->\n# Type Alias: AgentSessionResponse\n\n> **AgentSessionResponse** = \\{ `acpSessionId?`: `string` \\| `null`; `botId`: `string`; `canEdit`: `boolean`; `createdAt`: `string`; `external?`: `null` \\| [`ExternalSessionResponse`](ExternalSessionResponse.md); `harness`: `string`; `id`: `string`; `instructions?`: `string` \\| `null`; `isArchived`: `boolean`; `model`: `string`; `modifiedAt`: `string`; `name`: `string`; `originatingMessageId?`: `string` \\| `null`; `ownerId`: `string`; `pullRequestUrl?`: `string` \\| `null`; `repoUrl?`: `string` \\| `null`; `sandboxSize`: [`SandboxSize`](SandboxSize.md); `status`: [`SessionStatusDto`](SessionStatusDto.md); `taskId?`: `string` \\| `null`; `threadChannelId?`: `string` \\| `null`; `threadId?`: `string` \\| `null`; `threadParent?`: `null` \\| [`MessageParent`](MessageParent.md); `workspace`: `string`; \\}\n\nResponse body describing an agent session.\n\nClients deserialize this, so both derives are used.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-acpsessionid\"></a> `acpSessionId?` | `string` \\| `null` | The ACP session id, if one exists. |\n| <a id=\"property-botid\"></a> `botId` | `string` | The bot running the agent. |\n| <a id=\"property-canedit\"></a> `canEdit` | `boolean` | Whether the caller may drive the session - prompt it, answer its questions, stop it - rather than only watch. Edit access; the creator owns the session, so a create response always says so. |\n| <a id=\"property-createdat\"></a> `createdAt` | `string` | When the session was created. |\n| <a id=\"property-external\"></a> `external?` | `null` \\| [`ExternalSessionResponse`](ExternalSessionResponse.md) | - |\n| <a id=\"property-harness\"></a> `harness` | `string` | Harness slug. |\n| <a id=\"property-id\"></a> `id` | `string` | The session id. |\n| <a id=\"property-instructions\"></a> `instructions?` | `string` \\| `null` | Instructions the session's runtime works under, when any were stated at creation. Absent otherwise, so existing payloads are unchanged. |\n| <a id=\"property-isarchived\"></a> `isArchived` | `boolean` | Whether the session is archived and read-only. |\n| <a id=\"property-model\"></a> `model` | `string` | Model slug. |\n| <a id=\"property-modifiedat\"></a> `modifiedAt` | `string` | When the session was last modified. |\n| <a id=\"property-name\"></a> `name` | `string` | User-facing session name. |\n| <a id=\"property-originatingmessageid\"></a> `originatingMessageId?` | `string` \\| `null` | The exact message that invoked the bot, if any. |\n| <a id=\"property-ownerid\"></a> `ownerId` | `string` | The user who created and owns the session. |\n| <a id=\"property-pullrequesturl\"></a> `pullRequestUrl?` | `string` \\| `null` | The session's linked pull request. |\n| <a id=\"property-repourl\"></a> `repoUrl?` | `string` \\| `null` | The repository the session works with, when one was stated. |\n| <a id=\"property-sandboxsize\"></a> `sandboxSize` | [`SandboxSize`](SandboxSize.md) | Compute tier of the managed sandbox. |\n| <a id=\"property-status\"></a> `status` | [`SessionStatusDto`](SessionStatusDto.md) | The session's status. |\n| <a id=\"property-taskid\"></a> `taskId?` | `string` \\| `null` | The Macro task the session was linked to. |\n| <a id=\"property-threadchannelid\"></a> `threadChannelId?` | `string` \\| `null` | The channel `thread_id` lives in, when the session was spawned from a channel thread. Derived from `thread_parent`. |\n| <a id=\"property-threadid\"></a> `threadId?` | `string` \\| `null` | The root message of the thread the session was created from, if any. |\n| <a id=\"property-threadparent\"></a> `threadParent?` | `null` \\| [`MessageParent`](MessageParent.md) | - |\n| <a id=\"property-workspace\"></a> `workspace` | `string` | The directory the session's harness runs in on its runtime. |\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/AgentSetConfigOptionAction.md -->\n# Type Alias: AgentSetConfigOptionAction\n\n> **AgentSetConfigOptionAction** = \\{ `configId`: `string`; `value`: `string`; \\}\n\nAsk the agent to change one advertised select-style session setting.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-configid\"></a> `configId` | `string` | Opaque ACP config id advertised by the agent. |\n| <a id=\"property-value\"></a> `value` | `string` | Opaque select value advertised for that config option. |\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/AgentSetModelAction.md -->\n# Type Alias: AgentSetModelAction\n\n> **AgentSetModelAction** = \\{ `model`: `string`; \\}\n\nAsk the agent to run on a different model from here on.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-model\"></a> `model` | `string` | The model slug the agent should switch to. |\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/AnswerToolApprovalResponse.md -->\n# Type Alias: AnswerToolApprovalResponse\n\n> **AnswerToolApprovalResponse** = \\{ `status`: [`ToolApprovalStatusDto`](ToolApprovalStatusDto.md); \\}\n\nResponse body for answering a held tool call.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-status\"></a> `status` | [`ToolApprovalStatusDto`](ToolApprovalStatusDto.md) | Where the call stands now. |\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/BotId.md -->\n# Type Alias: BotId\n\n> **BotId** = `string`\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/CaptureAttemptDto.md -->\n# Type Alias: CaptureAttemptDto\n\n> **CaptureAttemptDto** = \\{ `error?`: `string` \\| `null`; `finishedAt?`: `string` \\| `null`; `outcome?`: `null` \\| [`CaptureOutcomeDto`](CaptureOutcomeDto.md); `startedAt`: `string`; \\}\n\nThe latest capture attempt.\n\nClients deserialize this, so both derives are used.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-error\"></a> `error?` | `string` \\| `null` | Why it did not capture, in a sentence the user can read. |\n| <a id=\"property-finishedat\"></a> `finishedAt?` | `string` \\| `null` | When it ended; absent while it runs. |\n| <a id=\"property-outcome\"></a> `outcome?` | `null` \\| [`CaptureOutcomeDto`](CaptureOutcomeDto.md) | - |\n| <a id=\"property-startedat\"></a> `startedAt` | `string` | When it started. |\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/CaptureOutcomeDto.md -->\n# Type Alias: CaptureOutcomeDto\n\n> **CaptureOutcomeDto** = `\"captured\"` \\| `\"not_ready\"` \\| `\"failed\"`\n\nHow the latest capture attempt ended, on the wire.\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/ChangedFileDto.md -->\n# Type Alias: ChangedFileDto\n\n> **ChangedFileDto** = \\{ `additions`: `number`; `binary`: `boolean`; `deletions`: `number`; `kind`: [`FileChangeKindDto`](FileChangeKindDto.md); `patchOmitted`: `boolean`; `path`: `string`; `previousPath?`: `string` \\| `null`; \\}\n\nOne changed file.\n\nClients deserialize this, so both derives are used.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-additions\"></a> `additions` | `number` | Lines added. |\n| <a id=\"property-binary\"></a> `binary` | `boolean` | The diff carries no text for this file. |\n| <a id=\"property-deletions\"></a> `deletions` | `number` | Lines removed. |\n| <a id=\"property-kind\"></a> `kind` | [`FileChangeKindDto`](FileChangeKindDto.md) | What happened to the file. |\n| <a id=\"property-patchomitted\"></a> `patchOmitted` | `boolean` | The file's hunks were left out of the patch to fit the size budget. |\n| <a id=\"property-path\"></a> `path` | `string` | The file's path after the change, or before it for a deletion. |\n| <a id=\"property-previouspath\"></a> `previousPath?` | `string` \\| `null` | Where a renamed file came from. |\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/ChangesetDto.md -->\n# Type Alias: ChangesetDto\n\n> **ChangesetDto** = \\{ `additions`: `number`; `base`: [`GitRefDto`](GitRefDto.md); `capturedAt`: `string`; `deletions`: `number`; `files`: [`ChangedFileDto`](ChangedFileDto.md)[]; `head`: [`GitRefDto`](GitRefDto.md); `id`: `string`; `patchBytes`: `number`; `repository?`: `string` \\| `null`; `source`: [`ChangesetSourceDto`](ChangesetSourceDto.md); `truncated`: `boolean`; \\}\n\nOne changeset: the files a patch touches and what happened to each.\n\nClients deserialize this, so both derives are used.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-additions\"></a> `additions` | `number` | Lines added across all files. |\n| <a id=\"property-base\"></a> `base` | [`GitRefDto`](GitRefDto.md) | The side the work started from. |\n| <a id=\"property-capturedat\"></a> `capturedAt` | `string` | When the diff was taken. |\n| <a id=\"property-deletions\"></a> `deletions` | `number` | Lines removed across all files. |\n| <a id=\"property-files\"></a> `files` | [`ChangedFileDto`](ChangedFileDto.md)[] | Every changed file, in patch order. |\n| <a id=\"property-head\"></a> `head` | [`GitRefDto`](GitRefDto.md) | The side carrying the work. |\n| <a id=\"property-id\"></a> `id` | `string` | The changeset's id; a different id means different changes. |\n| <a id=\"property-patchbytes\"></a> `patchBytes` | `number` | Size of the patch the matching patch route serves; zero when nothing changed. |\n| <a id=\"property-repository\"></a> `repository?` | `string` \\| `null` | `https://github.com/owner/name`, when known. |\n| <a id=\"property-source\"></a> `source` | [`ChangesetSourceDto`](ChangesetSourceDto.md) | Where the diff was read from. |\n| <a id=\"property-truncated\"></a> `truncated` | `boolean` | Some files' hunks were left out of the patch. |\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/ChangesetSourceDto.md -->\n# Type Alias: ChangesetSourceDto\n\n> **ChangesetSourceDto** = `\"github_pull_request\"`\n\nThe source of a changeset's diff, on the wire.\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/ChannelSharePermission.md -->\n# Type Alias: ChannelSharePermission\n\n> **ChannelSharePermission** = \\{ `access_level`: [`AccessLevel`](AccessLevel.md); `channel_id`: `string`; \\}\n\nThe channel share permission\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-access_level\"></a> `access_level` | [`AccessLevel`](AccessLevel.md) | The access level for the channel |\n| <a id=\"property-channel_id\"></a> `channel_id` | `string` | The channel id |\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/CodingPreferencesBody.md -->\n# Type Alias: CodingPreferencesBody\n\n> **CodingPreferencesBody** = \\{ `createTasks`: `boolean`; `openPullRequests`: `boolean`; \\}\n\nRequest or response body for the caller's coding preferences.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-createtasks\"></a> `createTasks` | `boolean` | Whether new coding sessions research prior work and link a Macro task. |\n| <a id=\"property-openpullrequests\"></a> `openPullRequests` | `boolean` | Whether new coding sessions deliver their work as a pull request. |\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/ControlResponse.md -->\n# Type Alias: ControlResponse\n\n> **ControlResponse** = \\{ `actionId`: [`AgentActionId`](AgentActionId.md); `status`: [`ControlStatusDto`](ControlStatusDto.md); \\}\n\nResponse body for a control operation.\n\nClients deserialize this, so both derives are used.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-actionid\"></a> `actionId` | [`AgentActionId`](AgentActionId.md) | Matches `requestId` on the folded message this action derives once it dispatches, and names the queue entry until then. The caller's own `actionId` when it supplied one; a freshly minted id otherwise. |\n| <a id=\"property-status\"></a> `status` | [`ControlStatusDto`](ControlStatusDto.md) | Whether the action went out or waits in the queue. |\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/ControlStatusDto.md -->\n# Type Alias: ControlStatusDto\n\n> **ControlStatusDto** = `\"sent\"` \\| `\"queued\"`\n\nWhat accepting a control operation did with it, on the wire.\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/ConversationTurnState.md -->\n# Type Alias: ConversationTurnState\n\n> **ConversationTurnState** = `\"queued\"` \\| `\"running\"` \\| `\"succeeded\"` \\| `\"failed\"` \\| `\"stopped\"` \\| `\"interrupted\"`\n\nThe state of one source message, retained after completion for deduplication.\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/DocumentId.md -->\n# Type Alias: DocumentId\n\n> **DocumentId** = `string`\n\nA validated document identifier. Historical document ids need not be UUIDs.\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/ElicitationAnswer.md -->\n# Type Alias: ElicitationAnswer\n\n> **ElicitationAnswer** = \\{ `action`: `\"accept\"`; `content?`: \\{\\[`key`: `string`\\]: [`ElicitationContentValue`](ElicitationContentValue.md); \\} \\| `null`; \\} \\| \\{ `action`: `\"decline\"`; \\} \\| \\{ `action`: `\"cancel\"`; \\}\n\nWhat the user decided about an elicitation. Mirrors ACP's three actions;\nthere is no `Other` because we never originate an action we do not know.\n\n## Union Members\n\n### Type Literal\n\n\\{ `action`: `\"accept\"`; `content?`: \\{\\[`key`: `string`\\]: [`ElicitationContentValue`](ElicitationContentValue.md); \\} \\| `null`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `action` | `\"accept\"` | - |\n| `content?` | \\{\\[`key`: `string`\\]: [`ElicitationContentValue`](ElicitationContentValue.md); \\} \\| `null` | Form: the submitted values keyed by property. URL: omitted. |\n\n***\n\n### Type Literal\n\n\\{ `action`: `\"decline\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `action`: `\"cancel\"`; \\}\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/ElicitationContentValue.md -->\n# Type Alias: ElicitationContentValue\n\n> **ElicitationContentValue** = `string` \\| `boolean` \\| `number` \\| `number` \\| `string`[]\n\nA value ACP accepts in an elicitation answer.\n\nMirrors ACP's `ElicitationContentValue` so that the contract a caller\nanswers against is the closed union ACP will accept, rather than arbitrary\nJSON narrowed on the way out. An object, a null, or a mixed array is\nrefused when the request is deserialized - where the caller learns of it -\ninstead of at send time, when the elicitation slot has already been\nreleased.\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/ElicitationRequestId.md -->\n# Type Alias: ElicitationRequestId\n\n> **ElicitationRequestId** = `number` \\| `string`\n\nThe JSON-RPC id of an agent's `elicitation/create` request, carried whole\nso the answer echoes exactly what the agent sent.\n\nAgents pick these, not us: Claude Code counts from `0`, others use\nstrings. `null` is not a legal id for a request that expects a response,\nso it is not representable here.\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/ExecutionActivity.md -->\n# Type Alias: ExecutionActivity\n\n> **ExecutionActivity** = \\{ `id`: `number`; `label`: `string`; `status`: [`RecordedCallStatus`](RecordedCallStatus.md); \\}\n\nA bounded SDK operation observed during execution; not an authorization or write receipt.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-id\"></a> `id` | `number` | Request identity within the execution. |\n| <a id=\"property-label\"></a> `label` | `string` | Server-selected label from the generated operation catalog. |\n| <a id=\"property-status\"></a> `status` | [`RecordedCallStatus`](RecordedCallStatus.md) | Observed request state; unfinished operations have unknown outcomes. |\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/ExecutionId.md -->\n# Type Alias: ExecutionId\n\n> **ExecutionId** = `string`\n\nCaller-selected UUID persisted in tool input before execution begins.\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/ExecutionRecord.md -->\n# Type Alias: ExecutionRecord\n\n> **ExecutionRecord** = \\{ `activity?`: [`ExecutionActivity`](ExecutionActivity.md)[]; `activityTruncated?`: `boolean`; `calls`: [`RecordedToolCall`](RecordedToolCall.md)[]; `error?`: `string` \\| `null`; `executionId`: [`ExecutionId`](ExecutionId.md); `result?`: `unknown`; `source`: `string`; `status`: [`ExecutionStatus`](ExecutionStatus.md); \\}\n\nDurable source and final outcome, with historical bridge calls when present.\nThe full journal is not included in the model's tool result.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-activity\"></a> `activity?` | [`ExecutionActivity`](ExecutionActivity.md)[] | Advisory SDK operation activity, without arguments or response contents. |\n| <a id=\"property-activitytruncated\"></a> `activityTruncated?` | `boolean` | Additional request activity was omitted at the bounded observation limit. |\n| <a id=\"property-calls\"></a> `calls` | [`RecordedToolCall`](RecordedToolCall.md)[] | Historical bridge calls. Direct HTTP executions leave this empty. |\n| <a id=\"property-error\"></a> `error?` | `string` \\| `null` | Safe execution failure text. |\n| <a id=\"property-executionid\"></a> `executionId` | [`ExecutionId`](ExecutionId.md) | Execution identity. |\n| <a id=\"property-result\"></a> `result?` | `unknown` | JSON returned by the program, if successful. |\n| <a id=\"property-source\"></a> `source` | `string` | The submitted JavaScript module. |\n| <a id=\"property-status\"></a> `status` | [`ExecutionStatus`](ExecutionStatus.md) | Overall execution state. |\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/ExecutionStatus.md -->\n# Type Alias: ExecutionStatus\n\n> **ExecutionStatus** = `\"running\"` \\| `\"succeeded\"` \\| `\"failed\"` \\| `\"cancelled\"` \\| `\"timed_out\"`\n\nThe recorded outcome of a program.\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/ExternalSessionResponse.md -->\n# Type Alias: ExternalSessionResponse\n\n> **ExternalSessionResponse** = \\{ `name?`: `string` \\| `null`; `provider`: `string`; `url?`: `string` \\| `null`; \\}\n\nThe provider-side identity of an externally-served session.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-name\"></a> `name?` | `string` \\| `null` | The provider's display name for the agent, when it reported one. |\n| <a id=\"property-provider\"></a> `provider` | `string` | Which provider serves the session, e.g. `cursor`. |\n| <a id=\"property-url\"></a> `url?` | `string` \\| `null` | The agent's page on the provider's site, for a client to link out to. |\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/FileChangeKindDto.md -->\n# Type Alias: FileChangeKindDto\n\n> **FileChangeKindDto** = `\"added\"` \\| `\"modified\"` \\| `\"deleted\"` \\| `\"renamed\"`\n\nWhat happened to a file, on the wire.\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/GitRefDto.md -->\n# Type Alias: GitRefDto\n\n> **GitRefDto** = \\{ `name?`: `string` \\| `null`; `sha?`: `string` \\| `null`; \\}\n\nOne end of the compared range.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-name\"></a> `name?` | `string` \\| `null` | The branch name, when known. |\n| <a id=\"property-sha\"></a> `sha?` | `string` \\| `null` | The commit, when known. |\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/LinkShare.md -->\n# Type Alias: LinkShare\n\n> **LinkShare** = `\"PUBLIC\"` \\| `\"TEAM\"`\n\nDefines who can access an item through its share link.\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/LogDirectionDto.md -->\n# Type Alias: LogDirectionDto\n\n> **LogDirectionDto** = `\"to_server\"` \\| `\"to_runtime\"`\n\nWhich way a logged frame travelled, mirroring [`Message`]'s discriminant.\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/LogFrameDto.md -->\n# Type Alias: LogFrameDto\n\n> **LogFrameDto** = \\{ `content`: \\{\\[`key`: `string`\\]: `unknown`; \\}; `direction`: [`LogDirectionDto`](LogDirectionDto.md); \\}\n\nThe two fields [`AgentSessionLogEntryDto`] flattens in.\n\nSchema only. Nothing constructs one: the entry serializes through\n[`Message`], and this exists so the generated clients see `direction` and\n`content` as named fields instead of an open map. A hand-built copy could\ndrift from the fold's wire format, and the point of the endpoint is that it\ncannot - so this describes that format without being able to produce it.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-content\"></a> `content` | \\{\\[`key`: `string`\\]: `unknown`; \\} | The protocol envelope, verbatim. Opaque here: it is Agent Runtime Protocol, whose shape belongs to the fold rather than this endpoint. |\n| <a id=\"property-direction\"></a> `direction` | [`LogDirectionDto`](LogDirectionDto.md) | Which way the frame travelled. |\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/MessageParent.md -->\n# Type Alias: MessageParent\n\n> **MessageParent** = \\{ `id`: `string`; `type`: `\"channel\"`; \\} \\| \\{ `id`: [`DocumentId`](DocumentId.md); `type`: `\"document\"`; \\} \\| \\{ `id`: `string`; `type`: `\"initiative\"`; \\} \\| \\{ `id`: `string`; `type`: `\"crm_company\"`; \\} \\| \\{ `id`: `string`; `type`: `\"crm_contact\"`; \\} \\| \\{ `id`: `string`; `type`: `\"call\"`; \\}\n\nThe entity whose permissions and lifecycle govern a message.\n\n## Union Members\n\n### Type Literal\n\n\\{ `id`: `string`; `type`: `\"channel\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | A channel, including direct messages. |\n| `type` | `\"channel\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: [`DocumentId`](DocumentId.md); `type`: `\"document\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | [`DocumentId`](DocumentId.md) | A document, including tasks and PDFs. |\n| `type` | `\"document\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: `string`; `type`: `\"initiative\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | An initiative, presented as a project in the application. |\n| `type` | `\"initiative\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: `string`; `type`: `\"crm_company\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | A CRM company. |\n| `type` | `\"crm_company\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: `string`; `type`: `\"crm_contact\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | A CRM contact. |\n| `type` | `\"crm_contact\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: `string`; `type`: `\"call\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | A video call and its persistent chat thread. |\n| `type` | `\"call\"` | - |\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/PermissionAnswer.md -->\n# Type Alias: PermissionAnswer\n\n> **PermissionAnswer** = \\{ `kind`: `\"selected\"`; `optionId`: `string`; \\} \\| \\{ `kind`: `\"cancelled\"`; \\}\n\nThe decision carried by an [`AgentPermissionAction`].\n\n## Union Members\n\n### Type Literal\n\n\\{ `kind`: `\"selected\"`; `optionId`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"selected\"` | - |\n| `optionId` | `string` | The chosen option's id, as the agent listed it. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"cancelled\"`; \\}\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/PromptAttachment.md -->\n# Type Alias: PromptAttachment\n\n> **PromptAttachment** = \\{ `mimeType?`: `string` \\| `null`; `name`: `string`; `size?`: `number` \\| `null`; `uri`: `string`; \\}\n\nA file the prompt refers to, by where the agent can fetch it.\n\nMirrors ACP's `resource_link` content block, which every agent must\naccept: bytes never ride the prompt, only a URI (a static file service URL\nin practice) with enough metadata for a client to render a chip and for\nthe agent to decide whether to fetch it. Keeping the wire shape ACP-native\nmeans the harness translates without resolving anything, and the fold\nreads the same fields back off the logged frame.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-mimetype\"></a> `mimeType?` | `string` \\| `null` | The file's media type, when known. |\n| <a id=\"property-name\"></a> `name` | `string` | Display name, typically the original file name. |\n| <a id=\"property-size\"></a> `size?` | `number` \\| `null` | Size in bytes, when known. |\n| <a id=\"property-uri\"></a> `uri` | `string` | Where the agent can fetch the file. |\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/PullRequestLinkSource.md -->\n# Type Alias: PullRequestLinkSource\n\n> **PullRequestLinkSource** = `\"agent\"` \\| `\"user\"`\n\nWho associated a pull request with a session.\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/QueuedActionDto.md -->\n# Type Alias: QueuedActionDto\n\n> **QueuedActionDto** = \\{ `actionId`: [`AgentActionId`](AgentActionId.md); `actorUserId?`: `string` \\| `null`; `attachments?`: [`PromptAttachment`](PromptAttachment.md)[]; `createdAt`: `string`; `kind`: `string`; `prompt?`: `string` \\| `null`; \\}\n\nOne action waiting in a session's queue.\n\nClients deserialize this, so both derives are used.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-actionid\"></a> `actionId` | [`AgentActionId`](AgentActionId.md) | The id the action was accepted under. |\n| <a id=\"property-actoruserid\"></a> `actorUserId?` | `string` \\| `null` | The user who queued it, absent when a bot acted on nobody's behalf. |\n| <a id=\"property-attachments\"></a> `attachments?` | [`PromptAttachment`](PromptAttachment.md)[] | Files the prompt refers to, for prompts only. Kept through an edit, which replaces the text alone. |\n| <a id=\"property-createdat\"></a> `createdAt` | `string` | When it was accepted. |\n| <a id=\"property-kind\"></a> `kind` | `string` | What kind of action waits - `prompt` or `compact`; only turn-occupying actions are ever queued. |\n| <a id=\"property-prompt\"></a> `prompt?` | `string` \\| `null` | The prompt's raw text, present for prompts only. What an edit replaces. |\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/RecordedCallStatus.md -->\n# Type Alias: RecordedCallStatus\n\n> **RecordedCallStatus** = `\"running\"` \\| `\"completed\"` \\| `\"failed\"` \\| `\"unknown\"`\n\nA dispatch result; unfinished work is never reported as success.\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/RecordedToolCall.md -->\n# Type Alias: RecordedToolCall\n\n> **RecordedToolCall** = \\{ `error?`: `string` \\| `null`; `id`: `string`; `input`: `unknown`; `name`: `string`; `output?`: `unknown`; `outputOmitted`: `boolean`; `status`: [`RecordedCallStatus`](RecordedCallStatus.md); \\}\n\nA real inner call, recorded by trusted dispatch for the existing renderers.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-error\"></a> `error?` | `string` \\| `null` | Safe tool failure, if one was returned. |\n| <a id=\"property-id\"></a> `id` | `string` | Stable, execution-scoped component identity. |\n| <a id=\"property-input\"></a> `input` | `unknown` | Arguments passed to the actual tool. |\n| <a id=\"property-name\"></a> `name` | `string` | Canonical Macro tool name from the allowlisted registry. |\n| <a id=\"property-output\"></a> `output?` | `unknown` | Original tool output, retained independently of the program's return value. |\n| <a id=\"property-outputomitted\"></a> `outputOmitted` | `boolean` | Whether the response was omitted to keep the durable journal bounded. |\n| <a id=\"property-status\"></a> `status` | [`RecordedCallStatus`](RecordedCallStatus.md) | A started call that never replied has an unknown side-effect outcome. |\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/ReviewId.md -->\n# Type Alias: ReviewId\n\n> **ReviewId** = `string`\n\nPersisted review identity.\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/ReviewItem.md -->\n# Type Alias: ReviewItem\n\n> **ReviewItem** = \\{ `draft`: `unknown`; `error?`: `string` \\| `null`; `id`: `string`; `result?`: `unknown`; `status`: [`ReviewItemStatus`](ReviewItemStatus.md); \\}\n\nOne editable item and its durable outcome.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-draft\"></a> `draft` | `unknown` | Validated arguments for the existing composer/action. |\n| <a id=\"property-error\"></a> `error?` | `string` \\| `null` | Failure or uncertainty description. |\n| <a id=\"property-id\"></a> `id` | `string` | Stable item identity across stack navigation and edits. |\n| <a id=\"property-result\"></a> `result?` | `unknown` | Actual backend response, never a model assertion. |\n| <a id=\"property-status\"></a> `status` | [`ReviewItemStatus`](ReviewItemStatus.md) | Current outcome. |\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/ReviewItemStatus.md -->\n# Type Alias: ReviewItemStatus\n\n> **ReviewItemStatus** = `\"pending\"` \\| `\"submitting\"` \\| `\"completed\"` \\| `\"dismissed\"` \\| `\"unknown\"`\n\nA review item never retries an ambiguous external result automatically.\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/ReviewKind.md -->\n# Type Alias: ReviewKind\n\n> **ReviewKind** = `\"email\"` \\| `\"calendar\"`\n\nThe component and action used to finish a review.\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/ReviewRecord.md -->\n# Type Alias: ReviewRecord\n\n> **ReviewRecord** = \\{ `executionId?`: `null` \\| [`ExecutionId`](ExecutionId.md); `id`: [`ReviewId`](ReviewId.md); `items`: [`ReviewItem`](ReviewItem.md)[]; `kind`: [`ReviewKind`](ReviewKind.md); `notificationAttemptAt?`: `number` \\| `null`; `notificationId?`: `string` \\| `null`; `presentedAt?`: `number` \\| `null`; `revision`: `number`; `sessionId`: `string`; `title`: `string`; `updatedAt`: `number`; \\}\n\nFull UI record, fetched outside the model context.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-executionid\"></a> `executionId?` | `null` \\| [`ExecutionId`](ExecutionId.md) | - |\n| <a id=\"property-id\"></a> `id` | [`ReviewId`](ReviewId.md) | Review identity. |\n| <a id=\"property-items\"></a> `items` | [`ReviewItem`](ReviewItem.md)[] | Drafts and per-item outcomes. |\n| <a id=\"property-kind\"></a> `kind` | [`ReviewKind`](ReviewKind.md) | Component kind. |\n| <a id=\"property-notificationattemptat\"></a> `notificationAttemptAt?` | `number` \\| `null` | Most recent delivery claim, allowing retry after a replica stops. |\n| <a id=\"property-notificationid\"></a> `notificationId?` | `string` \\| `null` | Stable queued-action identity until the outcome has reached the session. A failed notification may be retried without repeating external actions. |\n| <a id=\"property-presentedat\"></a> `presentedAt?` | `number` \\| `null` | Durable presentation acknowledgment, separate from user decisions. |\n| <a id=\"property-revision\"></a> `revision` | `number` | Compare-and-swap revision for edits and submissions. |\n| <a id=\"property-sessionid\"></a> `sessionId` | `string` | Owning session. |\n| <a id=\"property-title\"></a> `title` | `string` | Stack label. |\n| <a id=\"property-updatedat\"></a> `updatedAt` | `number` | Milliseconds since epoch of the last state change. |\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/SandboxSize.md -->\n# Type Alias: SandboxSize\n\n> **SandboxSize** = `\"small\"` \\| `\"default\"` \\| `\"large\"`\n\nNamed compute tier for a managed sandbox.\n\nThe API and database store the name. CPU, RAM, and disk live in\n`crates/agent_harness/sandbox_sizes.json`.\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/SessionBot.md -->\n# Type Alias: SessionBot\n\n> **SessionBot** = \\{ `avatarUrl?`: `string` \\| `null`; `handle`: `string`; `id`: [`BotId`](BotId.md); `name`: `string`; \\}\n\nThe agent behind a session, as much of it as rendering a message needs.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-avatarurl\"></a> `avatarUrl?` | `string` \\| `null` | Avatar, when it has one. |\n| <a id=\"property-handle\"></a> `handle` | `string` | Stable `@` handle, without a leading `@`. |\n| <a id=\"property-id\"></a> `id` | [`BotId`](BotId.md) | The bot's id. A message it sent has `\"bot\\|{id}\"` as its sender. |\n| <a id=\"property-name\"></a> `name` | `string` | Display name. |\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/SessionStatusDto.md -->\n# Type Alias: SessionStatusDto\n\n> **SessionStatusDto** = \\{ `kind`: `\"no_messages\"`; \\} \\| \\{ `event`: `string`; `kind`: `\"event\"`; \\} \\| \\{ `kind`: `\"disconnected\"`; \\}\n\nTransport representation of a session's status, mirroring\n[`SessionStatus`].\n\n## Union Members\n\n### Type Literal\n\n\\{ `kind`: `\"no_messages\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `event`: `string`; `kind`: `\"event\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `event` | `string` | The wire name of the system event, e.g. `acp_ready`. |\n| `kind` | `\"event\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"disconnected\"`; \\}\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/SharePermissionV2.md -->\n# Type Alias: SharePermissionV2\n\n> **SharePermissionV2** = \\{ `channelSharePermissions?`: [`ChannelSharePermission`](ChannelSharePermission.md)[] \\| `null`; `id`: `string`; `linkShare?`: `null` \\| [`LinkShare`](LinkShare.md); `linkShareAccessLevel?`: `null` \\| [`AccessLevel`](AccessLevel.md); `owner`: `string`; `teamShareAccessLevel?`: `null` \\| [`AccessLevel`](AccessLevel.md); \\}\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-channelsharepermissions\"></a> `channelSharePermissions?` | [`ChannelSharePermission`](ChannelSharePermission.md)[] \\| `null` | The channel share permissions for the item |\n| <a id=\"property-id\"></a> `id` | `string` | The share permission id |\n| <a id=\"property-linkshare\"></a> `linkShare?` | `null` \\| [`LinkShare`](LinkShare.md) | - |\n| <a id=\"property-linkshareaccesslevel\"></a> `linkShareAccessLevel?` | `null` \\| [`AccessLevel`](AccessLevel.md) | - |\n| <a id=\"property-owner\"></a> `owner` | `string` | The owner of the item |\n| <a id=\"property-teamshareaccesslevel\"></a> `teamShareAccessLevel?` | `null` \\| [`AccessLevel`](AccessLevel.md) | - |\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/ToolApprovalAnswerDto.md -->\n# Type Alias: ToolApprovalAnswerDto\n\n> **ToolApprovalAnswerDto** = `\"approve\"` \\| `\"approve_and_remember\"` \\| `\"deny\"` \\| `\"cancel\"`\n\nHow a person answers a held tool call.\n\n\n<!-- generated/agent-harness/types.gen/type-aliases/ToolApprovalStatusDto.md -->\n# Type Alias: ToolApprovalStatusDto\n\n> **ToolApprovalStatusDto** = `\"pending\"` \\| `\"approved\"` \\| `\"denied\"` \\| `\"cancelled\"` \\| `\"expired\"`\n\nWhere a held tool call stands once answered.\n\n\n<!-- generated/calendar/types.gen/type-aliases/EventTime.md -->\n# Type Alias: EventTime\n\n> **EventTime** = \\{ `endsAt`: `string`; `kind`: `\"timed\"`; `startsAt`: `string`; `timeZone?`: `string` \\| `null`; \\} \\| \\{ `endDate`: `string`; `kind`: `\"allDay\"`; `startDate`: `string`; \\}\n\nThe mutually exclusive time shape of a calendar event.\n\nFields are renamed per variant rather than with `rename_all_fields`\nbecause utoipa only honors variant-level serde renames when it\nderives the OpenAPI schema.\n\n## Union Members\n\n### Type Literal\n\n\\{ `endsAt`: `string`; `kind`: `\"timed\"`; `startsAt`: `string`; `timeZone?`: `string` \\| `null`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `endsAt` | `string` | Exclusive end instant; equal to the start for an imported point event. |\n| `kind` | `\"timed\"` | - |\n| `startsAt` | `string` | Inclusive start instant. |\n| `timeZone?` | `string` \\| `null` | Original IANA time-zone identifier, when supplied. |\n\n***\n\n### Type Literal\n\n\\{ `endDate`: `string`; `kind`: `\"allDay\"`; `startDate`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `endDate` | `string` | Exclusive local end date. |\n| `kind` | `\"allDay\"` | - |\n| `startDate` | `string` | Inclusive local start date. |\n\n\n<!-- src/entities/agent-sessions/agent-session/classes/AgentSession.md -->\n# Class: AgentSession\n\nA managed or externally hosted coding-agent session.\n\n## Extends\n\n- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\\<[`AgentSessionResponse`](../../../../../generated/agent-harness/types.gen/type-aliases/AgentSessionResponse.md)\\>\n\n## Properties\n\n| Property | Modifier | Type | Description | Inherited from |\n| ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-access\"></a> `access` | `readonly` | [`EntityAccess`](../../../sharing/access/classes/EntityAccess.md) | Access requests and direct user grants. | - |\n| <a id=\"property-codeexecutions\"></a> `codeExecutions` | `readonly` | \\{ `byId`: (`id`) => [`CodeExecution`](../../code-execution/classes/CodeExecution.md); \\} | Saved code executions scoped to this session. Handle construction makes no request. | - |\n| `codeExecutions.byId` | `public` | (`id`) => [`CodeExecution`](../../code-execution/classes/CodeExecution.md) | - | - |\n| <a id=\"property-createdat\"></a> `createdAt` | `readonly` | () => `Promise`\\<`string`\\> | When the session was created. | - |\n| <a id=\"property-harness\"></a> `harness` | `readonly` | () => `Promise`\\<`string`\\> | The agent harness implementation serving the session. | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |\n| <a id=\"property-instructions\"></a> `instructions` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | Instructions the session's runtime works under, when any were stated at creation. Fixed for the session's life. | - |\n| <a id=\"property-isarchived\"></a> `isArchived` | `readonly` | () => `Promise`\\<`boolean`\\> | Whether the session is archived and read-only. | - |\n| <a id=\"property-model\"></a> `model` | `readonly` | () => `Promise`\\<`string`\\> | The model currently configured for the session. | - |\n| <a id=\"property-modifiedat\"></a> `modifiedAt` | `readonly` | () => `Promise`\\<`string`\\> | When the session was last modified. | - |\n| <a id=\"property-name\"></a> `name` | `readonly` | () => `Promise`\\<`string`\\> | The session's user-facing display name. | - |\n| <a id=\"property-repourl\"></a> `repoUrl` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | The repository the agent works with, when one was supplied. | - |\n| <a id=\"property-reviews\"></a> `reviews` | `readonly` | \\{ `byId`: (`id`) => [`SessionReview`](../../review/classes/SessionReview.md); `create`: (`input`) => `Promise`\\<[`SessionReview`](../../review/classes/SessionReview.md)\\>; \\} | Persisted reviews scoped to this session, with or without a code execution. | - |\n| `reviews.byId` | `public` | (`id`) => [`SessionReview`](../../review/classes/SessionReview.md) | - | - |\n| `reviews.create` | `public` | (`input`) => `Promise`\\<[`SessionReview`](../../review/classes/SessionReview.md)\\> | - | - |\n| <a id=\"property-sandboxsize\"></a> `sandboxSize` | `readonly` | () => `Promise`\\<[`SandboxSize`](../../../../../generated/agent-harness/types.gen/type-aliases/SandboxSize.md)\\> | Compute tier of the managed sandbox. | - |\n| <a id=\"property-status\"></a> `status` | `readonly` | () => `Promise`\\<[`SessionStatusDto`](../../../../../generated/agent-harness/types.gen/type-aliases/SessionStatusDto.md)\\> | The session's latest runtime status. | - |\n| <a id=\"property-workspace\"></a> `workspace` | `readonly` | () => `Promise`\\<`string`\\> | The directory in which the agent harness runs. | - |\n\n## Methods\n\n### archive()\n\n> **archive**(): `Promise`\\<`void`\\>\n\nArchive this session, making it read-only until unarchived.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### changes()\n\n> **changes**(): `Promise`\\<[`AgentSessionChangesResponse`](../../../../../generated/agent-harness/types.gen/type-aliases/AgentSessionChangesResponse.md)\\>\n\nRead the latest captured GitHub pull request changes and capture status.\n\n#### Returns\n\n`Promise`\\<[`AgentSessionChangesResponse`](../../../../../generated/agent-harness/types.gen/type-aliases/AgentSessionChangesResponse.md)\\>\n\n***\n\n### changesPatch()\n\n> **changesPatch**(): `Promise`\\<`string`\\>\n\nRead the unified diff of the latest captured changeset.\n\n#### Returns\n\n`Promise`\\<`string`\\>\n\n***\n\n### control()\n\n> **control**(`action`): `Promise`\\<[`ControlResponse`](../../../../../generated/agent-harness/types.gen/type-aliases/ControlResponse.md)\\>\n\nSend a prompt or lifecycle operation to the live agent session.\n\nThe returned `actionId` matches `requestId` on the folded message the\naction derives once it dispatches. A `queued` status means a turn was\nrunning: the action waits in the session's queue ([queue](#queue)) and\ndispatches when that turn ends.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `action` | [`AgentAction`](../../../../../generated/agent-harness/types.gen/type-aliases/AgentAction.md) |\n\n#### Returns\n\n`Promise`\\<[`ControlResponse`](../../../../../generated/agent-harness/types.gen/type-aliases/ControlResponse.md)\\>\n\n***\n\n### delete()\n\n> **delete**(): `Promise`\\<`void`\\>\n\nDelete this session and any live resources it owns.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### linkPullRequest()\n\n> **linkPullRequest**(`url`): `Promise`\\<`void`\\>\n\nLink the GitHub pull request at `url` to this session. Linking one that\nis already linked changes nothing.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `url` | `string` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### log()\n\n> **log**(): `Promise`\\<[`AgentSessionLogResponse`](../../../../../generated/agent-harness/types.gen/type-aliases/AgentSessionLogResponse.md)\\>\n\nRead the complete raw protocol log for this session.\n\n#### Returns\n\n`Promise`\\<[`AgentSessionLogResponse`](../../../../../generated/agent-harness/types.gen/type-aliases/AgentSessionLogResponse.md)\\>\n\n***\n\n### prompt()\n\n> **prompt**(`text`, `attachments?`): `Promise`\\<[`ControlResponse`](../../../../../generated/agent-harness/types.gen/type-aliases/ControlResponse.md)\\>\n\nSend a prompt to the session — sugar over [control](#control).\n\n`attachments` are files the prompt refers to, each by a URL the agent\ncan fetch (a static file service URL in practice); they reach the agent\nas ACP `resource_link` blocks after the text.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `text` | `string` |\n| `attachments?` | [`PromptAttachment`](../../../../../generated/agent-harness/types.gen/type-aliases/PromptAttachment.md)[] |\n\n#### Returns\n\n`Promise`\\<[`ControlResponse`](../../../../../generated/agent-harness/types.gen/type-aliases/ControlResponse.md)\\>\n\n***\n\n### pullRequests()\n\n> **pullRequests**(): `Promise`\\<[`SessionPullRequest`](../type-aliases/SessionPullRequest.md)[]\\>\n\nThe GitHub pull requests linked to this session: the one its agent\nopened and any a person linked, oldest first.\n\n#### Returns\n\n`Promise`\\<[`SessionPullRequest`](../type-aliases/SessionPullRequest.md)[]\\>\n\n***\n\n### queue()\n\n> **queue**(): `Promise`\\<[`QueuedAction`](../../queued-action/classes/QueuedAction.md)[]\\>\n\nThe actions waiting to dispatch in this session, oldest first. Each can\nbe edited or removed until it dispatches.\n\n#### Returns\n\n`Promise`\\<[`QueuedAction`](../../queued-action/classes/QueuedAction.md)[]\\>\n\n***\n\n### refreshChanges()\n\n> **refreshChanges**(): `Promise`\\<[`AgentSessionChangesResponse`](../../../../../generated/agent-harness/types.gen/type-aliases/AgentSessionChangesResponse.md)\\>\n\nRequest a fresh capture and return the current state while it runs.\n\n#### Returns\n\n`Promise`\\<[`AgentSessionChangesResponse`](../../../../../generated/agent-harness/types.gen/type-aliases/AgentSessionChangesResponse.md)\\>\n\n***\n\n### rename()\n\n> **rename**(`name`): `Promise`\\<`void`\\>\n\nRename this session.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `name` | `string` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### setSandboxSize()\n\n> **setSandboxSize**(`size`): `Promise`\\<[`SandboxSize`](../../../../../generated/agent-harness/types.gen/type-aliases/SandboxSize.md)\\>\n\nResize this session's sandbox and remember the size as the owner's default.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `size` | [`SandboxSize`](../../../../../generated/agent-harness/types.gen/type-aliases/SandboxSize.md) |\n\n#### Returns\n\n`Promise`\\<[`SandboxSize`](../../../../../generated/agent-harness/types.gen/type-aliases/SandboxSize.md)\\>\n\n***\n\n### sharePermissions()\n\n> **sharePermissions**(): `Promise`\\<[`SharePermissionV2`](../../../../../generated/agent-harness/types.gen/type-aliases/SharePermissionV2.md)\\>\n\nSharing configuration.\n\n#### Returns\n\n`Promise`\\<[`SharePermissionV2`](../../../../../generated/agent-harness/types.gen/type-aliases/SharePermissionV2.md)\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`AgentSessionResponse`](../../../../../generated/agent-harness/types.gen/type-aliases/AgentSessionResponse.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`AgentSessionResponse`](../../../../../generated/agent-harness/types.gen/type-aliases/AgentSessionResponse.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`AgentSessionResponse`](../../../../../generated/agent-harness/types.gen/type-aliases/AgentSessionResponse.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)\n\n***\n\n### toolApprovalById()\n\n> **toolApprovalById**(`id`): [`ToolApproval`](../../tool-approval/classes/ToolApproval.md)\n\nConstruct an approval handle scoped to this session.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`ToolApproval`](../../tool-approval/classes/ToolApproval.md)\n\n***\n\n### unarchive()\n\n> **unarchive**(): `Promise`\\<`void`\\>\n\nRestore an archived session so it can be edited and prompted again.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### unlinkPullRequest()\n\n> **unlinkPullRequest**(`url`): `Promise`\\<`void`\\>\n\nUnlink a GitHub pull request a person linked to this session. The pull\nrequest the session's agent opened stays linked.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `url` | `string` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### updateSharePermissions()\n\n> **updateSharePermissions**(`options`): `Promise`\\<[`SharePermissionV2`](../../../../../generated/agent-harness/types.gen/type-aliases/SharePermissionV2.md)\\>\n\nReplace sharing grants.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | [`SharePermissionOptions`](../../../sharing/permissions/type-aliases/SharePermissionOptions.md) |\n\n#### Returns\n\n`Promise`\\<[`SharePermissionV2`](../../../../../generated/agent-harness/types.gen/type-aliases/SharePermissionV2.md)\\>\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `id`): `AgentSession`\n\nA handle to an agent session by id. Details load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `id` | `string` |\n\n#### Returns\n\n`AgentSession`\n\n***\n\n### codingPreferences()\n\n> `static` **codingPreferences**(`client`): `Promise`\\<[`CodingPreferencesBody`](../../../../../generated/agent-harness/types.gen/type-aliases/CodingPreferencesBody.md)\\>\n\nWhat the caller's new coding sessions are told to do beyond their assignment.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`Promise`\\<[`CodingPreferencesBody`](../../../../../generated/agent-harness/types.gen/type-aliases/CodingPreferencesBody.md)\\>\n\n***\n\n### createManaged()\n\n> `static` **createManaged**(`client`, `opts?`): `Promise`\\<`AgentSession`\\>\n\nCreate a managed session, optionally delivering its first prompt.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `opts?` | [`CreateManagedSessionOptions`](../type-aliases/CreateManagedSessionOptions.md) |\n\n#### Returns\n\n`Promise`\\<`AgentSession`\\>\n\n***\n\n### defaultSandboxSize()\n\n> `static` **defaultSandboxSize**(`client`): `Promise`\\<[`SandboxSize`](../../../../../generated/agent-harness/types.gen/type-aliases/SandboxSize.md)\\>\n\nThe caller's default sandbox size for new `@coder` sessions.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`Promise`\\<[`SandboxSize`](../../../../../generated/agent-harness/types.gen/type-aliases/SandboxSize.md)\\>\n\n***\n\n### forPullRequest()\n\n> `static` **forPullRequest**(`client`, `url`): `Promise`\\<`AgentSession`[]\\>\n\nThe sessions linked to the GitHub pull request at `url` that the caller\ncan view, oldest link first.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `url` | `string` |\n\n#### Returns\n\n`Promise`\\<`AgentSession`[]\\>\n\n***\n\n### repositories()\n\n> `static` **repositories**(`client`): `Promise`\\<[`SelectableRepository`](../type-aliases/SelectableRepository.md)[]\\>\n\nThe GitHub repositories the caller can hand a managed session: every\nrepository under an installation of Macro's GitHub App they or their\nteams made, sorted by `owner/name`. Empty when the App is installed\nnowhere they reach.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`Promise`\\<[`SelectableRepository`](../type-aliases/SelectableRepository.md)[]\\>\n\n***\n\n### repositoryBranches()\n\n> `static` **repositoryBranches**(`client`, `repoUrl`): `Promise`\\<`string`[]\\>\n\nBranch names on one repository the caller can start a managed session\nfrom, in the order GitHub listed them. Empty when the repository has\nno commits yet. `repoUrl` is one of the URLs [AgentSession.repositories](#repositories)\nlists.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `repoUrl` | `string` |\n\n#### Returns\n\n`Promise`\\<`string`[]\\>\n\n***\n\n### setCodingPreferences()\n\n> `static` **setCodingPreferences**(`client`, `preferences`): `Promise`\\<[`CodingPreferencesBody`](../../../../../generated/agent-harness/types.gen/type-aliases/CodingPreferencesBody.md)\\>\n\nReplace the caller's coding preferences.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `preferences` | [`CodingPreferencesBody`](../../../../../generated/agent-harness/types.gen/type-aliases/CodingPreferencesBody.md) |\n\n#### Returns\n\n`Promise`\\<[`CodingPreferencesBody`](../../../../../generated/agent-harness/types.gen/type-aliases/CodingPreferencesBody.md)\\>\n\n***\n\n### setDefaultSandboxSize()\n\n> `static` **setDefaultSandboxSize**(`client`, `size`): `Promise`\\<[`SandboxSize`](../../../../../generated/agent-harness/types.gen/type-aliases/SandboxSize.md)\\>\n\nSet the caller's default sandbox size for the next `@coder` mention.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `size` | [`SandboxSize`](../../../../../generated/agent-harness/types.gen/type-aliases/SandboxSize.md) |\n\n#### Returns\n\n`Promise`\\<[`SandboxSize`](../../../../../generated/agent-harness/types.gen/type-aliases/SandboxSize.md)\\>\n\n\n<!-- src/entities/agent-sessions/agent-session/type-aliases/CreateManagedSessionOptions.md -->\n# Type Alias: CreateManagedSessionOptions\n\n> **CreateManagedSessionOptions** = \\{ `instructions?`: `string`; `model?`: `string`; `prompt?`: `string`; `repoBranch?`: `string`; `repoUrl?`: `string`; \\}\n\nWhat a managed session is created with.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-instructions\"></a> `instructions?` | `string` | Instructions the session's runtime works under, fixed for its life. |\n| <a id=\"property-model\"></a> `model?` | `string` | The model the session runs on, instead of its persona's. The session's model from creation, read back as [AgentSession.model](../classes/AgentSession.md#property-model). |\n| <a id=\"property-prompt\"></a> `prompt?` | `string` | First prompt to deliver once the session is running. |\n| <a id=\"property-repobranch\"></a> `repoBranch?` | `string` | The branch the session starts on; needs `repoUrl`. Omitted, the repository's default branch. |\n| <a id=\"property-repourl\"></a> `repoUrl?` | `string` | The repository the session works on, as one of the URLs [AgentSession.repositories](../classes/AgentSession.md#repositories) lists for the caller. Omitted, the runtime chooses from the prompt. Honored for Cursor sessions. |\n\n\n<!-- src/entities/agent-sessions/agent-session/type-aliases/SelectableRepository.md -->\n# Type Alias: SelectableRepository\n\n> **SelectableRepository** = \\{ `defaultBranch?`: `string`; `url`: `string`; \\}\n\nA GitHub repository the caller can point a managed session at.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-defaultbranch\"></a> `defaultBranch?` | `string` | The branch its clones check out, and where a session starts unless `createManaged` names another. Absent for a repository with no commits. |\n| <a id=\"property-url\"></a> `url` | `string` | The canonical `https://github.com/owner/name` URL, as `createManaged` takes it. |\n\n\n<!-- src/entities/agent-sessions/agent-session/type-aliases/SessionPullRequest.md -->\n# Type Alias: SessionPullRequest\n\n> **SessionPullRequest** = \\{ `createdAt`: `string`; `githubKey`: `string`; `linkedBy?`: [`User`](../../../users/user/classes/User.md); `source`: [`PullRequestLinkSource`](../../../../../generated/agent-harness/types.gen/type-aliases/PullRequestLinkSource.md); `url`: `string`; \\}\n\nA GitHub pull request linked to a session.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-createdat\"></a> `createdAt` | `string` | When it was linked. |\n| <a id=\"property-githubkey\"></a> `githubKey` | `string` | The pull request's `owner/repo/pull/number` key. |\n| <a id=\"property-linkedby\"></a> `linkedBy?` | [`User`](../../../users/user/classes/User.md) | Who linked it, for pull requests a person linked. |\n| <a id=\"property-source\"></a> `source` | [`PullRequestLinkSource`](../../../../../generated/agent-harness/types.gen/type-aliases/PullRequestLinkSource.md) | Whether the session's agent opened it or a person linked it. |\n| <a id=\"property-url\"></a> `url` | `string` | The pull request's GitHub URL. |\n\n\n<!-- src/entities/agent-sessions/code-execution/classes/CodeExecution.md -->\n# Class: CodeExecution\n\nA saved code execution belonging to one agent session.\n\n## Extends\n\n- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\\<[`ExecutionRecord`](../../../../../generated/agent-harness/types.gen/type-aliases/ExecutionRecord.md)\\>\n\n## Properties\n\n| Property | Modifier | Type | Description | Inherited from |\n| ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-calls\"></a> `calls` | `readonly` | () => `Promise`\\<[`RecordedToolCall`](../../../../../generated/agent-harness/types.gen/type-aliases/RecordedToolCall.md)[]\\> | Legacy bridge calls; direct HTTP executions leave this empty. | - |\n| <a id=\"property-error\"></a> `error` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | Execution failure text, when present. | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |\n| <a id=\"property-reviews\"></a> `reviews` | `readonly` | \\{ `create`: (`input`) => `Promise`\\<[`SessionReview`](../../review/classes/SessionReview.md)\\>; `list`: () => `Promise`\\<[`SessionReview`](../../review/classes/SessionReview.md)[]\\>; \\} | Persistent UI blocks, independent of the execution lifetime. | - |\n| `reviews.create` | `public` | (`input`) => `Promise`\\<[`SessionReview`](../../review/classes/SessionReview.md)\\> | - | - |\n| `reviews.list` | `public` | () => `Promise`\\<[`SessionReview`](../../review/classes/SessionReview.md)[]\\> | - | - |\n| <a id=\"property-source\"></a> `source` | `readonly` | () => `Promise`\\<`string`\\> | The submitted JavaScript module source. | - |\n| <a id=\"property-status\"></a> `status` | `readonly` | () => `Promise`\\<[`ExecutionStatus`](../../../../../generated/agent-harness/types.gen/type-aliases/ExecutionStatus.md)\\> | Saved execution state. Call refresh to observe subsequent changes. | - |\n\n## Methods\n\n### refresh()\n\n> **refresh**(): `Promise`\\<`CodeExecution`\\>\n\nReload the saved state, for example after a running execution completes.\n\n#### Returns\n\n`Promise`\\<`CodeExecution`\\>\n\n***\n\n### result()\n\n> **result**(): `Promise`\\<`unknown`\\>\n\nThe program's returned JSON; preserves an explicit null result.\n\n#### Returns\n\n`Promise`\\<`unknown`\\>\n\n***\n\n### session()\n\n> **session**(): [`AgentSession`](../../agent-session/classes/AgentSession.md)\n\nThe session this execution belongs to.\n\n#### Returns\n\n[`AgentSession`](../../agent-session/classes/AgentSession.md)\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`ExecutionRecord`](../../../../../generated/agent-harness/types.gen/type-aliases/ExecutionRecord.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`ExecutionRecord`](../../../../../generated/agent-harness/types.gen/type-aliases/ExecutionRecord.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`ExecutionRecord`](../../../../../generated/agent-harness/types.gen/type-aliases/ExecutionRecord.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `session`, `id`): `CodeExecution`\n\nConstruct a lazy execution handle within its owning session.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `session` | [`AgentSession`](../../agent-session/classes/AgentSession.md) |\n| `id` | `string` |\n\n#### Returns\n\n`CodeExecution`\n\n\n<!-- src/entities/agent-sessions/code-execution/type-aliases/CodeResult.md -->\n# Type Alias: CodeResult\n\n> **CodeResult** = \\{ `data`: [`JsonValue`](JsonValue.md); `reviews`: \\{ `id`: `string`; `kind`: `\"email\"` \\| `\"calendar\"`; \\}[]; \\}\n\nJSON data returned to the model, plus references to independently saved UI.\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-data\"></a> `data` | [`JsonValue`](JsonValue.md) |\n| <a id=\"property-reviews\"></a> `reviews` | \\{ `id`: `string`; `kind`: `\"email\"` \\| `\"calendar\"`; \\}[] |\n\n\n<!-- src/entities/agent-sessions/code-execution/type-aliases/JsonValue.md -->\n# Type Alias: JsonValue\n\n> **JsonValue** = `null` \\| `boolean` \\| `number` \\| `string` \\| `JsonValue`[] \\| \\{\\[`key`: `string`\\]: `JsonValue`; \\}\n\n\n<!-- src/entities/agent-sessions/conversation/classes/AgentConversation.md -->\n# Class: AgentConversation\n\nAn agent's conversation in one channel.\n\n## Constructors\n\n### Constructor\n\n> **new AgentConversation**(`client`, `channel`, `record`): `AgentConversation`\n\n#### Parameters\n\n| Parameter | Type | Description |\n| ------ | ------ | ------ |\n| `client` | `MacroClient` | - |\n| `channel` | [`Channel`](../../../channels/channel/classes/Channel.md) | Parent channel. |\n| `record` | [`AgentConversationDto`](../../../../../generated/agent-harness/types.gen/type-aliases/AgentConversationDto.md) | - |\n\n#### Returns\n\n`AgentConversation`\n\n## Properties\n\n| Property | Modifier | Type | Description |\n| ------ | ------ | ------ | ------ |\n| <a id=\"property-channel\"></a> `channel` | `readonly` | [`Channel`](../../../channels/channel/classes/Channel.md) | Parent channel. |\n\n## Methods\n\n### agent()\n\n> **agent**(): [`Agent`](../../../agents/agent/classes/Agent.md)\n\nThe agent taking part.\n\n#### Returns\n\n[`Agent`](../../../agents/agent/classes/Agent.md)\n\n***\n\n### sessions()\n\n> **sessions**(): \\{ `createdAt`: `string`; `isCurrent`: `boolean`; `session`: [`AgentSession`](../../agent-session/classes/AgentSession.md); \\}[]\n\nConversation sessions with their current flag.\n\n#### Returns\n\n\\{ `createdAt`: `string`; `isCurrent`: `boolean`; `session`: [`AgentSession`](../../agent-session/classes/AgentSession.md); \\}[]\n\n***\n\n### startFresh()\n\n> **startFresh**(`session`): `Promise`\\<`void`\\>\n\nStart a fresh conversation from one of its sessions.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `session` | [`AgentSession`](../../agent-session/classes/AgentSession.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `agentId`: `string`; `channelId`: `string`; \\}\n\nSerialize scoped identity.\n\n#### Returns\n\n\\{ `agentId`: `string`; `channelId`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `agentId` | `string` |\n| `channelId` | `string` |\n\n***\n\n### turns()\n\n> **turns**(): [`ConversationTurn`](ConversationTurn.md)[]\n\nRecorded conversation turns.\n\n#### Returns\n\n[`ConversationTurn`](ConversationTurn.md)[]\n\n\n<!-- src/entities/agent-sessions/conversation/classes/ConversationTurn.md -->\n# Class: ConversationTurn\n\nOne agent conversation turn, identified by its source message.\n\n## Constructors\n\n### Constructor\n\n> **new ConversationTurn**(`client`, `conversation`, `record`): `ConversationTurn`\n\n#### Parameters\n\n| Parameter | Type | Description |\n| ------ | ------ | ------ |\n| `client` | `MacroClient` | - |\n| `conversation` | [`AgentConversation`](AgentConversation.md) | Parent conversation. |\n| `record` | [`AgentConversationTurnDto`](../../../../../generated/agent-harness/types.gen/type-aliases/AgentConversationTurnDto.md) | - |\n\n#### Returns\n\n`ConversationTurn`\n\n## Properties\n\n| Property | Modifier | Type | Description |\n| ------ | ------ | ------ | ------ |\n| <a id=\"property-conversation\"></a> `conversation` | `readonly` | [`AgentConversation`](AgentConversation.md) | Parent conversation. |\n\n## Methods\n\n### retry()\n\n> **retry**(`actionId`): `Promise`\\<`void`\\>\n\nRetry with a caller persisted action nonce. Never retries automatically.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `actionId` | `string` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### session()\n\n> **session**(): [`AgentSession`](../../agent-session/classes/AgentSession.md)\n\nSession that handled this turn.\n\n#### Returns\n\n[`AgentSession`](../../agent-session/classes/AgentSession.md)\n\n***\n\n### source()\n\n> **source**(): [`Message`](../../../channels/message/classes/Message.md)\n\nOriginating message.\n\n#### Returns\n\n[`Message`](../../../channels/message/classes/Message.md)\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `channelId`: `string`; `sourceMessageId`: `string`; \\}\n\nSerialize scoped identity.\n\n#### Returns\n\n\\{ `channelId`: `string`; `sourceMessageId`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `channelId` | `string` |\n| `sourceMessageId` | `string` |\n\n\n<!-- src/entities/agent-sessions/namespace/classes/AgentSessionNamespace.md -->\n# Class: AgentSessionNamespace\n\nEntry point for coding-agent sessions.\n\n## Constructors\n\n### Constructor\n\n> **new AgentSessionNamespace**(`client`): `AgentSessionNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`AgentSessionNamespace`\n\n## Methods\n\n### byId()\n\n> **byId**(`id`): [`AgentSession`](../../agent-session/classes/AgentSession.md)\n\nA handle to an agent session by id. Details load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`AgentSession`](../../agent-session/classes/AgentSession.md)\n\n***\n\n### codingPreferences()\n\n> **codingPreferences**(): `Promise`\\<[`CodingPreferencesBody`](../../../../../generated/agent-harness/types.gen/type-aliases/CodingPreferencesBody.md)\\>\n\nWhat the caller's new coding sessions are told to do beyond their assignment.\n\n#### Returns\n\n`Promise`\\<[`CodingPreferencesBody`](../../../../../generated/agent-harness/types.gen/type-aliases/CodingPreferencesBody.md)\\>\n\n***\n\n### createManaged()\n\n> **createManaged**(`opts?`): `Promise`\\<[`AgentSession`](../../agent-session/classes/AgentSession.md)\\>\n\nCreate a managed agent session.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts?` | [`CreateManagedSessionOptions`](../../agent-session/type-aliases/CreateManagedSessionOptions.md) |\n\n#### Returns\n\n`Promise`\\<[`AgentSession`](../../agent-session/classes/AgentSession.md)\\>\n\n***\n\n### defaultSandboxSize()\n\n> **defaultSandboxSize**(): `Promise`\\<[`SandboxSize`](../../../../../generated/agent-harness/types.gen/type-aliases/SandboxSize.md)\\>\n\nThe caller's default sandbox size for new `@coder` sessions.\n\n#### Returns\n\n`Promise`\\<[`SandboxSize`](../../../../../generated/agent-harness/types.gen/type-aliases/SandboxSize.md)\\>\n\n***\n\n### forPullRequest()\n\n> **forPullRequest**(`url`): `Promise`\\<[`AgentSession`](../../agent-session/classes/AgentSession.md)[]\\>\n\nThe sessions linked to the GitHub pull request at `url` that the caller\ncan view.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `url` | `string` |\n\n#### Returns\n\n`Promise`\\<[`AgentSession`](../../agent-session/classes/AgentSession.md)[]\\>\n\n***\n\n### repositories()\n\n> **repositories**(): `Promise`\\<[`SelectableRepository`](../../agent-session/type-aliases/SelectableRepository.md)[]\\>\n\nThe GitHub repositories the caller can hand a managed session, with the\nbranch each one's sessions start on by default.\n\n#### Returns\n\n`Promise`\\<[`SelectableRepository`](../../agent-session/type-aliases/SelectableRepository.md)[]\\>\n\n***\n\n### repositoryBranches()\n\n> **repositoryBranches**(`repoUrl`): `Promise`\\<`string`[]\\>\n\nBranch names on one repository the caller can start a managed session\nfrom. `repoUrl` is one of the URLs [AgentSessionNamespace.repositories](#repositories)\nlists.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `repoUrl` | `string` |\n\n#### Returns\n\n`Promise`\\<`string`[]\\>\n\n***\n\n### setCodingPreferences()\n\n> **setCodingPreferences**(`preferences`): `Promise`\\<[`CodingPreferencesBody`](../../../../../generated/agent-harness/types.gen/type-aliases/CodingPreferencesBody.md)\\>\n\nReplace the caller's coding preferences.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `preferences` | [`CodingPreferencesBody`](../../../../../generated/agent-harness/types.gen/type-aliases/CodingPreferencesBody.md) |\n\n#### Returns\n\n`Promise`\\<[`CodingPreferencesBody`](../../../../../generated/agent-harness/types.gen/type-aliases/CodingPreferencesBody.md)\\>\n\n***\n\n### setDefaultSandboxSize()\n\n> **setDefaultSandboxSize**(`size`): `Promise`\\<[`SandboxSize`](../../../../../generated/agent-harness/types.gen/type-aliases/SandboxSize.md)\\>\n\nSet the caller's default sandbox size for the next `@coder` mention.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `size` | [`SandboxSize`](../../../../../generated/agent-harness/types.gen/type-aliases/SandboxSize.md) |\n\n#### Returns\n\n`Promise`\\<[`SandboxSize`](../../../../../generated/agent-harness/types.gen/type-aliases/SandboxSize.md)\\>\n\n\n<!-- src/entities/agent-sessions/queued-action/classes/QueuedAction.md -->\n# Class: QueuedAction\n\nOne action waiting in an agent session's server-side queue: a prompt or a\ncompact accepted while a turn was running, dispatching when that turn\nends. Until then it can be edited (prompts only), steered, or removed; once\nit has dispatched, these actions answer 404 — there is no un-sending.\n\nList-sourced only - there is no per-action GET, only the queue snapshot -\nso this wraps whatever DTO the caller already has, the same shape\n`CrmComment` wraps a list-sourced record, rather than `MacroEntity`'s\nlazy-fetch-by-id.\n\n## Accessors\n\n### actionId\n\n#### Get Signature\n\n> **get** **actionId**(): `string`\n\nThe id the action was accepted under. Once it dispatches, this equals\n`requestId` on the folded message the action derives.\n\n##### Returns\n\n`string`\n\n***\n\n### actorUserId\n\n#### Get Signature\n\n> **get** **actorUserId**(): `string` \\| `undefined`\n\nThe user who queued it, absent when a bot acted on nobody's behalf.\n\n##### Returns\n\n`string` \\| `undefined`\n\n***\n\n### attachments\n\n#### Get Signature\n\n> **get** **attachments**(): [`PromptAttachment`](../../../../../generated/agent-harness/types.gen/type-aliases/PromptAttachment.md)[]\n\nFiles the prompt refers to; empty for a compact. Kept through an edit.\n\n##### Returns\n\n[`PromptAttachment`](../../../../../generated/agent-harness/types.gen/type-aliases/PromptAttachment.md)[]\n\n***\n\n### createdAt\n\n#### Get Signature\n\n> **get** **createdAt**(): `string`\n\nWhen the action was accepted, as an RFC 3339 timestamp.\n\n##### Returns\n\n`string`\n\n***\n\n### kind\n\n#### Get Signature\n\n> **get** **kind**(): `string`\n\n`prompt` or `compact`; only turn-occupying actions are ever queued.\n\n##### Returns\n\n`string`\n\n***\n\n### prompt\n\n#### Get Signature\n\n> **get** **prompt**(): `string` \\| `undefined`\n\nThe prompt's raw text, present for prompts only. What an edit replaces.\n\n##### Returns\n\n`string` \\| `undefined`\n\n## Methods\n\n### edit()\n\n> **edit**(`prompt`): `Promise`\\<`QueuedAction`\\>\n\nReplace this queued prompt's text before it dispatches. Returns this\nhandle for chaining; the edit endpoint answers 204, so `prompt` is\napplied locally rather than reread from a response body.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `prompt` | `string` |\n\n#### Returns\n\n`Promise`\\<`QueuedAction`\\>\n\n***\n\n### remove()\n\n> **remove**(): `Promise`\\<`void`\\>\n\nRemove this action from the queue before it dispatches.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### steer()\n\n> **steer**(): `Promise`\\<`void`\\>\n\nMove this action to the front and interrupt the current turn to run it next.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### from()\n\n> `static` **from**(`client`, `sessionId`, `dto`): `QueuedAction`\n\nWrap a queue entry already in hand (e.g. from `AgentSession.queue()`).\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `sessionId` | `string` |\n| `dto` | [`QueuedActionDto`](../../../../../generated/agent-harness/types.gen/type-aliases/QueuedActionDto.md) |\n\n#### Returns\n\n`QueuedAction`\n\n\n<!-- src/entities/agent-sessions/review/classes/ReviewItem.md -->\n# Class: ReviewItem\n\nAn item handle scopes edits and decisions to its persisted review.\n\n## Constructors\n\n### Constructor\n\n> **new ReviewItem**(`snapshot`, `actions`): `ReviewItem`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `snapshot` | [`ReviewItem`](../../../../../generated/agent-harness/types.gen/type-aliases/ReviewItem.md) |\n| `actions` | \\{ `dismiss`: () => `Promise`\\<`void`\\>; `edit`: (`draft`) => `Promise`\\<`void`\\>; `submit`: () => `Promise`\\<`void`\\>; \\} |\n| `actions.dismiss` | () => `Promise`\\<`void`\\> |\n| `actions.edit` | (`draft`) => `Promise`\\<`void`\\> |\n| `actions.submit` | () => `Promise`\\<`void`\\> |\n\n#### Returns\n\n`ReviewItem`\n\n## Accessors\n\n### draft\n\n#### Get Signature\n\n> **get** **draft**(): `unknown`\n\n##### Returns\n\n`unknown`\n\n***\n\n### id\n\n#### Get Signature\n\n> **get** **id**(): `string`\n\n##### Returns\n\n`string`\n\n***\n\n### result\n\n#### Get Signature\n\n> **get** **result**(): `unknown`\n\n##### Returns\n\n`unknown`\n\n***\n\n### status\n\n#### Get Signature\n\n> **get** **status**(): [`ReviewItemStatus`](../../../../../generated/agent-harness/types.gen/type-aliases/ReviewItemStatus.md)\n\n##### Returns\n\n[`ReviewItemStatus`](../../../../../generated/agent-harness/types.gen/type-aliases/ReviewItemStatus.md)\n\n## Methods\n\n### dismiss()\n\n> **dismiss**(): `Promise`\\<`void`\\>\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### edit()\n\n> **edit**(`draft`): `Promise`\\<`void`\\>\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `draft` | `unknown` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### submit()\n\n> **submit**(): `Promise`\\<`void`\\>\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n\n<!-- src/entities/agent-sessions/review/classes/SessionReview.md -->\n# Class: SessionReview\n\nA persistent review remains actionable after the code execution ends.\n\n## Extends\n\n- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\\<[`ReviewRecord`](../../../../../generated/agent-harness/types.gen/type-aliases/ReviewRecord.md)\\>\n\n## Properties\n\n| Property | Modifier | Type | Inherited from |\n| ------ | ------ | ------ | ------ |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |\n| <a id=\"property-kind\"></a> `kind` | `readonly` | () => `Promise`\\<[`ReviewKind`](../../../../../generated/agent-harness/types.gen/type-aliases/ReviewKind.md)\\> | - |\n| <a id=\"property-title\"></a> `title` | `readonly` | () => `Promise`\\<`string`\\> | - |\n\n## Methods\n\n### dismissAll()\n\n> **dismissAll**(): `Promise`\\<`void`\\>\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### items()\n\n> **items**(): `Promise`\\<[`ReviewItem`](ReviewItem.md)[]\\>\n\n#### Returns\n\n`Promise`\\<[`ReviewItem`](ReviewItem.md)[]\\>\n\n***\n\n### reference()\n\n> **reference**(): `Promise`\\<\\{ `id`: `string`; `kind`: [`ReviewKind`](../../../../../generated/agent-harness/types.gen/type-aliases/ReviewKind.md); \\}\\>\n\nCompact reference for main()'s returned reviews array.\n\n#### Returns\n\n`Promise`\\<\\{ `id`: `string`; `kind`: [`ReviewKind`](../../../../../generated/agent-harness/types.gen/type-aliases/ReviewKind.md); \\}\\>\n\n***\n\n### refresh()\n\n> **refresh**(): `Promise`\\<`SessionReview`\\>\n\n#### Returns\n\n`Promise`\\<`SessionReview`\\>\n\n***\n\n### session()\n\n> **session**(): [`AgentSession`](../../agent-session/classes/AgentSession.md)\n\n#### Returns\n\n[`AgentSession`](../../agent-session/classes/AgentSession.md)\n\n***\n\n### submitAll()\n\n> **submitAll**(): `Promise`\\<`void`\\>\n\nSubmit the saved pending drafts. Never retries a conflict or ambiguous send.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`ReviewRecord`](../../../../../generated/agent-harness/types.gen/type-aliases/ReviewRecord.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`ReviewRecord`](../../../../../generated/agent-harness/types.gen/type-aliases/ReviewRecord.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`ReviewRecord`](../../../../../generated/agent-harness/types.gen/type-aliases/ReviewRecord.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `session`, `id`): `SessionReview`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `session` | [`AgentSession`](../../agent-session/classes/AgentSession.md) |\n| `id` | `string` |\n\n#### Returns\n\n`SessionReview`\n\n***\n\n### create()\n\n> `static` **create**(`client`, `execution`, `input`): `Promise`\\<`SessionReview`\\>\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `execution` | [`CodeExecution`](../../code-execution/classes/CodeExecution.md) |\n| `input` | [`CreateReviewOptions`](../type-aliases/CreateReviewOptions.md) |\n\n#### Returns\n\n`Promise`\\<`SessionReview`\\>\n\n***\n\n### createForSession()\n\n> `static` **createForSession**(`client`, `session`, `input`, `execution?`): `Promise`\\<`SessionReview`\\>\n\nPresent a review in a session without requiring a code execution.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `session` | [`AgentSession`](../../agent-session/classes/AgentSession.md) |\n| `input` | [`CreateReviewOptions`](../type-aliases/CreateReviewOptions.md) |\n| `execution?` | [`CodeExecution`](../../code-execution/classes/CodeExecution.md) |\n\n#### Returns\n\n`Promise`\\<`SessionReview`\\>\n\n***\n\n### fromRecord()\n\n> `static` **fromRecord**(`client`, `session`, `record`): `SessionReview`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `session` | [`AgentSession`](../../agent-session/classes/AgentSession.md) |\n| `record` | [`ReviewRecord`](../../../../../generated/agent-harness/types.gen/type-aliases/ReviewRecord.md) |\n\n#### Returns\n\n`SessionReview`\n\n***\n\n### list()\n\n> `static` **list**(`client`, `execution`): `Promise`\\<`SessionReview`[]\\>\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `execution` | [`CodeExecution`](../../code-execution/classes/CodeExecution.md) |\n\n#### Returns\n\n`Promise`\\<`SessionReview`[]\\>\n\n\n<!-- src/entities/agent-sessions/review/type-aliases/CreateReviewOptions.md -->\n# Type Alias: CreateReviewOptions\n\n> **CreateReviewOptions** = \\{ `drafts`: [`ReviewEmailDraft`](ReviewEmailDraft.md)[]; `kind`: `\"email\"`; `title`: `string`; \\} \\| \\{ `drafts`: [`ReviewCalendarDraft`](ReviewCalendarDraft.md)[]; `kind`: `\"calendar\"`; `title`: `string`; \\}\n\n\n<!-- src/entities/agent-sessions/review/type-aliases/ReviewCalendarDraft.md -->\n# Type Alias: ReviewCalendarDraft\n\n> **ReviewCalendarDraft** = \\{ `addGoogleMeet?`: `boolean`; `addMacroCall?`: `boolean`; `attendees?`: \\{ `email`: `string`; `isOptional?`: `boolean`; \\}[]; `calendarId?`: `string` \\| `null`; `description?`: `string` \\| `null`; `eventType?`: `\"default\"` \\| `\"out_of_office\"`; `location?`: `string` \\| `null`; `outOfOffice?`: \\{ `autoDeclineMode?`: `\"decline_none\"` \\| `\"decline_all\"` \\| `\"decline_new_only\"`; `declineMessage?`: `string` \\| `null`; \\} \\| `null`; `recurrenceLines?`: `string`[]; `reminders?`: \\{ `overrides?`: \\{ `method`: `string`; `minutes`: `number`; \\}[]; `useDefault`: `boolean`; \\} \\| `null`; `time`: [`EventTime`](../../../../../generated/calendar/types.gen/type-aliases/EventTime.md); `title`: `string`; \\}\n\nCalendar drafts use the existing calendar composer and creation action.\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-addgooglemeet\"></a> `addGoogleMeet?` | `boolean` |\n| <a id=\"property-addmacrocall\"></a> `addMacroCall?` | `boolean` |\n| <a id=\"property-attendees\"></a> `attendees?` | \\{ `email`: `string`; `isOptional?`: `boolean`; \\}[] |\n| <a id=\"property-calendarid\"></a> `calendarId?` | `string` \\| `null` |\n| <a id=\"property-description\"></a> `description?` | `string` \\| `null` |\n| <a id=\"property-eventtype\"></a> `eventType?` | `\"default\"` \\| `\"out_of_office\"` |\n| <a id=\"property-location\"></a> `location?` | `string` \\| `null` |\n| <a id=\"property-outofoffice\"></a> `outOfOffice?` | \\{ `autoDeclineMode?`: `\"decline_none\"` \\| `\"decline_all\"` \\| `\"decline_new_only\"`; `declineMessage?`: `string` \\| `null`; \\} \\| `null` |\n| <a id=\"property-recurrencelines\"></a> `recurrenceLines?` | `string`[] |\n| <a id=\"property-reminders\"></a> `reminders?` | \\{ `overrides?`: \\{ `method`: `string`; `minutes`: `number`; \\}[]; `useDefault`: `boolean`; \\} \\| `null` |\n| <a id=\"property-time\"></a> `time` | [`EventTime`](../../../../../generated/calendar/types.gen/type-aliases/EventTime.md) |\n| <a id=\"property-title\"></a> `title` | `string` |\n\n\n<!-- src/entities/agent-sessions/review/type-aliases/ReviewEmailDraft.md -->\n# Type Alias: ReviewEmailDraft\n\n> **ReviewEmailDraft** = \\{ `attachments?`: \\{ `documentId`: `string`; \\}[]; `bcc?`: \\{ `email`: `string`; `name?`: `string` \\| `null`; \\}[]; `body`: `string`; `cc?`: \\{ `email`: `string`; `name?`: `string` \\| `null`; \\}[]; `includeSignature?`: `boolean` \\| `null`; `replyingToId?`: `string` \\| `null`; `subject`: `string`; `to`: \\{ `email`: `string`; `name?`: `string` \\| `null`; \\}[]; \\}\n\nMarkdown is rendered by the ordinary email action; the UI can edit each draft.\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-attachments\"></a> `attachments?` | \\{ `documentId`: `string`; \\}[] |\n| <a id=\"property-bcc\"></a> `bcc?` | \\{ `email`: `string`; `name?`: `string` \\| `null`; \\}[] |\n| <a id=\"property-body\"></a> `body` | `string` |\n| <a id=\"property-cc\"></a> `cc?` | \\{ `email`: `string`; `name?`: `string` \\| `null`; \\}[] |\n| <a id=\"property-includesignature\"></a> `includeSignature?` | `boolean` \\| `null` |\n| <a id=\"property-replyingtoid\"></a> `replyingToId?` | `string` \\| `null` |\n| <a id=\"property-subject\"></a> `subject` | `string` |\n| <a id=\"property-to\"></a> `to` | \\{ `email`: `string`; `name?`: `string` \\| `null`; \\}[] |\n\n\n<!-- src/entities/agent-sessions/tool-approval/classes/ToolApproval.md -->\n# Class: ToolApproval\n\nA permission request scoped to its originating agent session.\n\n## Properties\n\n| Property | Modifier | Type | Description |\n| ------ | ------ | ------ | ------ |\n| <a id=\"property-id\"></a> `id` | `readonly` | `string` | Approval identity. |\n| <a id=\"property-session\"></a> `session` | `readonly` | [`AgentSession`](../../agent-session/classes/AgentSession.md) | Owning session. |\n\n## Methods\n\n### answer()\n\n> **answer**(`answer`): `Promise`\\<[`AnswerToolApprovalResponse`](../../../../../generated/agent-harness/types.gen/type-aliases/AnswerToolApprovalResponse.md)\\>\n\nAnswer the approval using the generated discriminated answer contract.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `answer` | [`ToolApprovalAnswerDto`](../../../../../generated/agent-harness/types.gen/type-aliases/ToolApprovalAnswerDto.md) |\n\n#### Returns\n\n`Promise`\\<[`AnswerToolApprovalResponse`](../../../../../generated/agent-harness/types.gen/type-aliases/AnswerToolApprovalResponse.md)\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `id`: `string`; `sessionId`: `string`; \\}\n\nSerialize scoped identity only.\n\n#### Returns\n\n\\{ `id`: `string`; `sessionId`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `id` | `string` |\n| `sessionId` | `string` |\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `session`, `id`): `ToolApproval`\n\nConstruct a scoped approval handle.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `session` | [`AgentSession`](../../agent-session/classes/AgentSession.md) |\n| `id` | `string` |\n\n#### Returns\n\n`ToolApproval`\n"+ },+ {+ "name": "agents",+ "description": "Configure agents, pair hosts and inspect their sessions.",+ "overview": "<!-- src/entities/agents/agent/type-aliases/AgentOptions.md -->\n# Type Alias: AgentOptions\n\n> **AgentOptions** = `Omit`\\<[`CreateAgentRequest`](../../../../../generated/storage/types.gen/type-aliases/CreateAgentRequest.md), `\"channel_ids\"` \\| `\"team_id\"` \\| `\"harness_id\"` \\| `\"auto_accept_permissions\"` \\| `\"avatar_url\"` \\| `\"channel_scope\"` \\| `\"default_model\"` \\| `\"is_coding\"`\\> & \\{ `autoAcceptPermissions?`: `boolean`; `avatarUrl?`: `string`; `channels?`: [`Channel`](../../../channels/channel/classes/Channel.md)[]; `channelScope`: [`CreateAgentRequest`](../../../../../generated/storage/types.gen/type-aliases/CreateAgentRequest.md)\\[`\"channel_scope\"`\\]; `defaultModel`: `string`; `host?`: [`Harness`](../../../harnesses/harness/classes/Harness.md); `isCoding`: `boolean`; `team?`: [`Team`](../../../teams/team/classes/Team.md); \\}\n\nAgent creation and replacement settings.\n\n## Type Declaration\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `autoAcceptPermissions?` | `boolean` | Whether tool permissions are automatically accepted. |\n| `avatarUrl?` | `string` | Avatar URL. |\n| `channels?` | [`Channel`](../../../channels/channel/classes/Channel.md)[] | Channels the agent can access. |\n| `channelScope` | [`CreateAgentRequest`](../../../../../generated/storage/types.gen/type-aliases/CreateAgentRequest.md)\\[`\"channel_scope\"`\\] | Channel visibility policy. |\n| `defaultModel` | `string` | Default model. |\n| `host?` | [`Harness`](../../../harnesses/harness/classes/Harness.md) | Host running the agent. |\n| `isCoding` | `boolean` | Whether this is a coding agent. |\n| `team?` | [`Team`](../../../teams/team/classes/Team.md) | Owning team. |\n\n\n<!-- src/entities/agents/namespace/classes/AgentNamespace.md -->\n# Class: AgentNamespace\n\nConfigurable agents.\n\n## Constructors\n\n### Constructor\n\n> **new AgentNamespace**(`client`): `AgentNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`AgentNamespace`\n\n## Methods\n\n### byId()\n\n> **byId**(`id`): [`Agent`](../../agent/classes/Agent.md)\n\nConstruct a lazy agent handle.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`Agent`](../../agent/classes/Agent.md)\n\n***\n\n### create()\n\n> **create**(`options`): `Promise`\\<[`Agent`](../../agent/classes/Agent.md)\\>\n\nCreate an agent.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | [`AgentOptions`](../../agent/type-aliases/AgentOptions.md) |\n\n#### Returns\n\n`Promise`\\<[`Agent`](../../agent/classes/Agent.md)\\>\n\n***\n\n### list()\n\n> **list**(): `Promise`\\<[`Agent`](../../agent/classes/Agent.md)[]\\>\n\nAll accessible agents.\n\n#### Returns\n\n`Promise`\\<[`Agent`](../../agent/classes/Agent.md)[]\\>\n\n\n<!-- src/entities/harnesses/namespace/classes/HarnessNamespace.md -->\n# Class: HarnessNamespace\n\nHosts and device pairing. Self operations require host credentials.\n\n## Constructors\n\n### Constructor\n\n> **new HarnessNamespace**(`client`): `HarnessNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`HarnessNamespace`\n\n## Methods\n\n### agents()\n\n> **agents**(): `Promise`\\<[`Agent`](../../../agents/agent/classes/Agent.md)[]\\>\n\nAgent handles for the currently authenticated host.\n\n#### Returns\n\n`Promise`\\<[`Agent`](../../../agents/agent/classes/Agent.md)[]\\>\n\n***\n\n### byId()\n\n> **byId**(`id`): [`Harness`](../../harness/classes/Harness.md)\n\nConstruct a lazy host handle.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`Harness`](../../harness/classes/Harness.md)\n\n***\n\n### createPairing()\n\n> **createPairing**(`options`): `Promise`\\<\\{ `device`: [`DevicePairing`](../../pairing/classes/DevicePairing.md); `deviceSecret`: `string`; `expiresAt`: `string`; `pairing`: [`HarnessPairing`](../../pairing/classes/HarnessPairing.md); `pollIntervalSeconds`: `number`; \\}\\>\n\nStart pairing a device; persist the secret separately from the handles.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | [`CreatePairingRequest`](../../../../../generated/storage/types.gen/type-aliases/CreatePairingRequest.md) |\n\n#### Returns\n\n`Promise`\\<\\{ `device`: [`DevicePairing`](../../pairing/classes/DevicePairing.md); `deviceSecret`: `string`; `expiresAt`: `string`; `pairing`: [`HarnessPairing`](../../pairing/classes/HarnessPairing.md); `pollIntervalSeconds`: `number`; \\}\\>\n\n***\n\n### deleteSelf()\n\n> **deleteSelf**(): `Promise`\\<`void`\\>\n\nRevoke the currently authenticated host.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### list()\n\n> **list**(): `Promise`\\<[`Harness`](../../harness/classes/Harness.md)[]\\>\n\nAll hosts visible to the caller.\n\n#### Returns\n\n`Promise`\\<[`Harness`](../../harness/classes/Harness.md)[]\\>\n\n***\n\n### me()\n\n> **me**(): `Promise`\\<[`Harness`](../../harness/classes/Harness.md)\\>\n\nThe currently authenticated host.\n\n#### Returns\n\n`Promise`\\<[`Harness`](../../harness/classes/Harness.md)\\>\n\n***\n\n### pairing()\n\n> **pairing**(`code`): [`HarnessPairing`](../../pairing/classes/HarnessPairing.md)\n\nConstruct a lazy pairing from its displayed code.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `code` | `string` |\n\n#### Returns\n\n[`HarnessPairing`](../../pairing/classes/HarnessPairing.md)\n\n***\n\n### sessions()\n\n> **sessions**(): `Promise`\\<[`AgentSession`](../../../agent-sessions/agent-session/classes/AgentSession.md)[]\\>\n\nSession handles for the currently authenticated host.\n\n#### Returns\n\n`Promise`\\<[`AgentSession`](../../../agent-sessions/agent-session/classes/AgentSession.md)[]\\>\n",+ "documentation": "# Macro SDK: agents\n\nGenerated by TypeDoc. Paths below refer to the canonical Markdown hierarchy. Other entity handles are documented in their named section; request core for shared SDK helpers.\n\n<!-- generated/storage/types.gen/type-aliases/Agent.md -->\n# Type Alias: Agent\n\n> **Agent** = \\{ `auto_accept_permissions?`: `boolean` \\| `null`; `bot`: [`Bot`](Bot.md); `channel_ids`: `string`[]; `channel_scope`: [`AgentChannelScope`](AgentChannelScope.md); `default_model`: `string`; `harness`: `string`; `harness_id?`: `null` \\| [`HarnessId`](HarnessId.md); `instructions`: `string`; `is_coding`: `boolean`; `mcp`: [`AgentMcpServers`](AgentMcpServers.md); \\}\n\nA persisted user- or team-owned AI agent.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-auto_accept_permissions\"></a> `auto_accept_permissions?` | `boolean` \\| `null` | Whether the agent's sessions approve ACP permission requests without asking. `None` means always prompt. Bypass also requires the harness's opt-in. |\n| <a id=\"property-bot\"></a> `bot` | [`Bot`](Bot.md) | The bot identity used for mentions and channel participation. |\n| <a id=\"property-channel_ids\"></a> `channel_ids` | `string`[] | Selected channel ids. Empty for a global agent. |\n| <a id=\"property-channel_scope\"></a> `channel_scope` | [`AgentChannelScope`](AgentChannelScope.md) | Whether the agent is global or channel-specific. |\n| <a id=\"property-default_model\"></a> `default_model` | `string` | Model selected specifically for this agent. |\n| <a id=\"property-harness\"></a> `harness` | `string` | Harness used to run the agent. |\n| <a id=\"property-harness_id\"></a> `harness_id?` | `null` \\| [`HarnessId`](HarnessId.md) | - |\n| <a id=\"property-instructions\"></a> `instructions` | `string` | Instructions supplied to the agent at the start of a conversation. |\n| <a id=\"property-is_coding\"></a> `is_coding` | `boolean` | Whether the agent works in a repository, which decides how it answers a channel mention: a coding agent posts a magic chip into its live session, a chat agent replies in the thread. Chosen in the agent's settings; the persona's word, not the runtime's. |\n| <a id=\"property-mcp\"></a> `mcp` | [`AgentMcpServers`](AgentMcpServers.md) | Which MCP servers sessions of this agent are handed. |\n\n\n<!-- generated/storage/types.gen/type-aliases/AgentChannelScope.md -->\n# Type Alias: AgentChannelScope\n\n> **AgentChannelScope** = `\"all\"` \\| `\"selected\"`\n\nWhether an agent is available everywhere or only in selected channels.\n\n\n<!-- generated/storage/types.gen/type-aliases/AgentMcpServer.md -->\n# Type Alias: AgentMcpServer\n\n> **AgentMcpServer** = \\{ `app_slug`: `string`; `server_name`: `string`; \\}\n\nOne Pipedream app an agent lists under [`AgentMcpServers::Selected`].\n\nOnly the catalog identity is stored. Whether a given person has connected\nthe app is theirs, resolved at call time by the egress proxy, never here.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-app_slug\"></a> `app_slug` | `string` | Pipedream app slug, e.g. `linear`. |\n| <a id=\"property-server_name\"></a> `server_name` | `string` | Display name, e.g. `Linear`. |\n\n\n<!-- generated/storage/types.gen/type-aliases/AgentMcpServers.md -->\n# Type Alias: AgentMcpServers\n\n> **AgentMcpServers** = \\{ `scope`: `\"owner_connections\"`; \\} \\| \\{ `scope`: `\"selected\"`; `servers`: [`AgentMcpServer`](AgentMcpServer.md)[]; \\}\n\nWhich Pipedream MCP servers an agent's sessions are handed.\n\nOne value for the whole choice, so a selection can never travel without\nits scope or a scope without its selection. Serialized with a `scope` tag,\nwhich the generated TypeScript sees as a discriminated union.\n\n## Union Members\n\n### Type Literal\n\n\\{ `scope`: `\"owner_connections\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `scope`: `\"selected\"`; `servers`: [`AgentMcpServer`](AgentMcpServer.md)[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `scope` | `\"selected\"` | - |\n| `servers` | [`AgentMcpServer`](AgentMcpServer.md)[] | The apps, in the order the agent's author picked them. |\n\n\n<!-- generated/storage/types.gen/type-aliases/Bot.md -->\n# Type Alias: Bot\n\n> **Bot** = \\{ `avatar_url?`: `string` \\| `null`; `created_at`: `string`; `created_by?`: `string` \\| `null`; `deleted_at?`: `string` \\| `null`; `description?`: `string` \\| `null`; `handle`: `string`; `has_agent`: `boolean`; `id`: [`BotId`](BotId.md); `kind`: [`BotKind`](BotKind.md); `name`: `string`; `owner?`: `null` \\| [`BotOwner`](BotOwner.md); `updated_at`: `string`; \\}\n\nBot row.\n\nClients deserialize this, so both derives are used.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-avatar_url\"></a> `avatar_url?` | `string` \\| `null` | Optional avatar URL. |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | Creation timestamp. |\n| <a id=\"property-created_by\"></a> `created_by?` | `string` \\| `null` | User that created this bot. |\n| <a id=\"property-deleted_at\"></a> `deleted_at?` | `string` \\| `null` | Soft-delete timestamp. |\n| <a id=\"property-description\"></a> `description?` | `string` \\| `null` | Optional description. |\n| <a id=\"property-handle\"></a> `handle` | `string` | Stable handle. |\n| <a id=\"property-has_agent\"></a> `has_agent` | `boolean` | Whether mentioning this bot opens a sandboxed coding-agent session. |\n| <a id=\"property-id\"></a> `id` | [`BotId`](BotId.md) | Bot id. |\n| <a id=\"property-kind\"></a> `kind` | [`BotKind`](BotKind.md) | Bot kind. |\n| <a id=\"property-name\"></a> `name` | `string` | Display name. |\n| <a id=\"property-owner\"></a> `owner?` | `null` \\| [`BotOwner`](BotOwner.md) | - |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` | Update timestamp. |\n\n\n<!-- generated/storage/types.gen/type-aliases/BotId.md -->\n# Type Alias: BotId\n\n> **BotId** = `string`\n\n\n<!-- generated/storage/types.gen/type-aliases/BotKind.md -->\n# Type Alias: BotKind\n\n> **BotKind** = `\"owned\"` \\| `\"system\"`\n\nBot kind.\n\n\n<!-- generated/storage/types.gen/type-aliases/BotOwner.md -->\n# Type Alias: BotOwner\n\n> **BotOwner** = \\{ `type`: `\"user\"`; `user_id`: `string`; \\} \\| \\{ `team_id`: `string`; `type`: `\"team\"`; \\}\n\nBot owner.\n\n## Union Members\n\n### Type Literal\n\n\\{ `type`: `\"user\"`; `user_id`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"user\"` | - |\n| `user_id` | `string` | Owner user id. |\n\n***\n\n### Type Literal\n\n\\{ `team_id`: `string`; `type`: `\"team\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `team_id` | `string` | Owner team id. |\n| `type` | `\"team\"` | - |\n\n\n<!-- generated/storage/types.gen/type-aliases/CreateAgentRequest.md -->\n# Type Alias: CreateAgentRequest\n\n> **CreateAgentRequest** = \\{ `auto_accept_permissions?`: `boolean` \\| `null`; `avatar_url?`: `string` \\| `null`; `channel_ids?`: `string`[]; `channel_scope`: [`AgentChannelScope`](AgentChannelScope.md); `default_model`: `string`; `description?`: `string` \\| `null`; `handle`: `string`; `harness`: `string`; `harness_id?`: `null` \\| [`HarnessId`](HarnessId.md); `instructions`: `string`; `is_coding`: `boolean`; `mcp?`: [`AgentMcpServers`](AgentMcpServers.md); `name`: `string`; `team_id?`: `string` \\| `null`; \\}\n\nRequest to create a persisted AI agent.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-auto_accept_permissions\"></a> `auto_accept_permissions?` | `boolean` \\| `null` | Whether the agent's sessions approve ACP permission requests without asking. Omit to always prompt. |\n| <a id=\"property-avatar_url\"></a> `avatar_url?` | `string` \\| `null` | Optional avatar URL or data URL. |\n| <a id=\"property-channel_ids\"></a> `channel_ids?` | `string`[] | Selected channels. Must be non-empty only for `selected` scope. |\n| <a id=\"property-channel_scope\"></a> `channel_scope` | [`AgentChannelScope`](AgentChannelScope.md) | Whether the agent is global or channel-specific. |\n| <a id=\"property-default_model\"></a> `default_model` | `string` | Model selected specifically for this agent. |\n| <a id=\"property-description\"></a> `description?` | `string` \\| `null` | Optional description. |\n| <a id=\"property-handle\"></a> `handle` | `string` | Stable `@` handle. |\n| <a id=\"property-harness\"></a> `harness` | `string` | Harness used to run the agent. |\n| <a id=\"property-harness_id\"></a> `harness_id?` | `null` \\| [`HarnessId`](HarnessId.md) | - |\n| <a id=\"property-instructions\"></a> `instructions` | `string` | Instructions supplied to the agent at the start of a conversation. |\n| <a id=\"property-is_coding\"></a> `is_coding` | `boolean` | Whether the agent is a coding agent: a mention is answered with a magic chip into its live session (`true`) or a reply in the thread (`false`). |\n| <a id=\"property-mcp\"></a> `mcp?` | [`AgentMcpServers`](AgentMcpServers.md) | Which MCP servers sessions of this agent are handed. |\n| <a id=\"property-name\"></a> `name` | `string` | Display name. |\n| <a id=\"property-team_id\"></a> `team_id?` | `string` \\| `null` | Team owner. Omit for a private, user-owned agent. |\n\n\n<!-- generated/storage/types.gen/type-aliases/CreatePairingRequest.md -->\n# Type Alias: CreatePairingRequest\n\n> **CreatePairingRequest** = \\{ `allow_permission_bypass?`: `boolean` \\| `null`; `host?`: `string` \\| `null`; `name`: `string`; `scope?`: `null` \\| [`RequestedHarnessScope`](RequestedHarnessScope.md); \\}\n\nRequest to open a pairing: the daemon asks for a code the user approves.\n\nThe daemon serializes this, so both derives are used.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-allow_permission_bypass\"></a> `allow_permission_bypass?` | `boolean` \\| `null` | Daemon operator consent ceiling. Omitted by older clients; web approval decides. |\n| <a id=\"property-host\"></a> `host?` | `string` \\| `null` | Display-only description of the machine, e.g. `eric@macbook / darwin`. |\n| <a id=\"property-name\"></a> `name` | `string` | Requested harness display name (typically the machine's hostname). |\n| <a id=\"property-scope\"></a> `scope?` | `null` \\| [`RequestedHarnessScope`](RequestedHarnessScope.md) | - |\n\n\n<!-- generated/storage/types.gen/type-aliases/Harness.md -->\n# Type Alias: Harness\n\n> **Harness** = \\{ `allow_permission_bypass?`: `boolean`; `connected`: `boolean`; `created_at`: `string`; `created_by`: `string`; `id`: [`HarnessId`](HarnessId.md); `kind`: `string`; `last_connected_at?`: `string` \\| `null`; `name`: `string`; `owner`: [`HarnessOwner`](HarnessOwner.md); `updated_at`: `string`; \\}\n\nA registered user-run harness.\n\nClients deserialize this, so both derives are used.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-allow_permission_bypass\"></a> `allow_permission_bypass?` | `boolean` | Whether agents may bypass ACP permission requests on this harness. |\n| <a id=\"property-connected\"></a> `connected` | `boolean` | Whether the daemon currently holds a runtime connection. |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | Creation timestamp. |\n| <a id=\"property-created_by\"></a> `created_by` | `string` | User that registered this harness. |\n| <a id=\"property-id\"></a> `id` | [`HarnessId`](HarnessId.md) | Harness id. |\n| <a id=\"property-kind\"></a> `kind` | `string` | Runtime kind. Currently always `macrod`. |\n| <a id=\"property-last_connected_at\"></a> `last_connected_at?` | `string` \\| `null` | When the daemon last attached a runtime connection. |\n| <a id=\"property-name\"></a> `name` | `string` | Display name. |\n| <a id=\"property-owner\"></a> `owner` | [`HarnessOwner`](HarnessOwner.md) | Owner. |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` | Update timestamp. |\n\n\n<!-- generated/storage/types.gen/type-aliases/HarnessId.md -->\n# Type Alias: HarnessId\n\n> **HarnessId** = `string`\n\n\n<!-- generated/storage/types.gen/type-aliases/HarnessOwner.md -->\n# Type Alias: HarnessOwner\n\n> **HarnessOwner** = \\{ `type`: `\"user\"`; `user_id`: `string`; \\} \\| \\{ `team_id`: `string`; `type`: `\"team\"`; \\}\n\nHarness owner.\n\nExactly one of a user or a team, mirroring the bots owner pattern. There\nare no system harnesses.\n\n## Union Members\n\n### Type Literal\n\n\\{ `type`: `\"user\"`; `user_id`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"user\"` | - |\n| `user_id` | `string` | Owner user id. |\n\n***\n\n### Type Literal\n\n\\{ `team_id`: `string`; `type`: `\"team\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `team_id` | `string` | Owner team id. |\n| `type` | `\"team\"` | - |\n\n\n<!-- generated/storage/types.gen/type-aliases/PairingDetails.md -->\n# Type Alias: PairingDetails\n\n> **PairingDetails** = \\{ `code`: `string`; `created_at`: `string`; `expires_at`: `string`; `host?`: `string` \\| `null`; `requested_allow_permission_bypass?`: `boolean` \\| `null`; `requested_name`: `string`; `requested_scope?`: `null` \\| [`RequestedHarnessScope`](RequestedHarnessScope.md); \\}\n\nA pending pairing, as shown to the approving user.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-code\"></a> `code` | `string` | The pairing code, normalized to `XXXX-XXXX`. |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | When the pairing was created. |\n| <a id=\"property-expires_at\"></a> `expires_at` | `string` | When the pairing expires. |\n| <a id=\"property-host\"></a> `host?` | `string` \\| `null` | Display-only description of the machine. |\n| <a id=\"property-requested_allow_permission_bypass\"></a> `requested_allow_permission_bypass?` | `boolean` \\| `null` | Daemon operator consent ceiling; false forbids bypass at approval. |\n| <a id=\"property-requested_name\"></a> `requested_name` | `string` | Harness display name the daemon asked for. |\n| <a id=\"property-requested_scope\"></a> `requested_scope?` | `null` \\| [`RequestedHarnessScope`](RequestedHarnessScope.md) | - |\n\n\n<!-- generated/storage/types.gen/type-aliases/RequestedHarnessScope.md -->\n# Type Alias: RequestedHarnessScope\n\n> **RequestedHarnessScope** = `\"private\"` \\| `\"team\"`\n\nThe ownership scope a daemon's config asks for.\n\nAdvisory, not binding: the approving user confirms it in the dialog, which\narrives preselected to this. Approval is what actually sets ownership.\n\n\n<!-- src/entities/agents/agent/classes/Agent.md -->\n# Class: Agent\n\nA configurable agent backed by a bot identity.\n\n## Extends\n\n- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\\<[`Agent`](../../../../../generated/storage/types.gen/type-aliases/Agent.md)\\>\n\n## Properties\n\n| Property | Modifier | Type | Description | Inherited from |\n| ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-channels\"></a> `channels` | `readonly` | () => `Promise`\\<[`Channel`](../../../channels/channel/classes/Channel.md)[]\\> | Visible channels. | - |\n| <a id=\"property-defaultmodel\"></a> `defaultModel` | `readonly` | () => `Promise`\\<`string`\\> | Default model. | - |\n| <a id=\"property-host\"></a> `host` | `readonly` | () => `Promise`\\<[`Harness`](../../../harnesses/harness/classes/Harness.md) \\| `undefined`\\> | Host running this agent. | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |\n| <a id=\"property-instructions\"></a> `instructions` | `readonly` | () => `Promise`\\<`string`\\> | Agent instructions. | - |\n| <a id=\"property-name\"></a> `name` | `readonly` | () => `Promise`\\<`string`\\> | Display name. | - |\n\n## Methods\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`Agent`](../../../../../generated/storage/types.gen/type-aliases/Agent.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`Agent`](../../../../../generated/storage/types.gen/type-aliases/Agent.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`Agent`](../../../../../generated/storage/types.gen/type-aliases/Agent.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)\n\n***\n\n### update()\n\n> **update**(`options`): `Promise`\\<`void`\\>\n\nReplace agent settings.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | [`AgentOptions`](../type-aliases/AgentOptions.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `id`): `Agent`\n\nConstruct a lazy agent handle.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `id` | `string` |\n\n#### Returns\n\n`Agent`\n\n***\n\n### from()\n\n> `static` **from**(`client`, `record`): `Agent`\n\nSeed from a listed or created agent.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `record` | [`Agent`](../../../../../generated/storage/types.gen/type-aliases/Agent.md) |\n\n#### Returns\n\n`Agent`\n\n\n<!-- src/entities/agents/agent/functions/agentBody.md -->\n# Function: agentBody()\n\n> **agentBody**(`options`): [`CreateAgentRequest`](../../../../../generated/storage/types.gen/type-aliases/CreateAgentRequest.md)\n\nConvert entity references into the generated agent request.\n\n## Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | [`AgentOptions`](../type-aliases/AgentOptions.md) |\n\n## Returns\n\n[`CreateAgentRequest`](../../../../../generated/storage/types.gen/type-aliases/CreateAgentRequest.md)\n\n\n<!-- src/entities/agents/agent/type-aliases/AgentOptions.md -->\n# Type Alias: AgentOptions\n\n> **AgentOptions** = `Omit`\\<[`CreateAgentRequest`](../../../../../generated/storage/types.gen/type-aliases/CreateAgentRequest.md), `\"channel_ids\"` \\| `\"team_id\"` \\| `\"harness_id\"` \\| `\"auto_accept_permissions\"` \\| `\"avatar_url\"` \\| `\"channel_scope\"` \\| `\"default_model\"` \\| `\"is_coding\"`\\> & \\{ `autoAcceptPermissions?`: `boolean`; `avatarUrl?`: `string`; `channels?`: [`Channel`](../../../channels/channel/classes/Channel.md)[]; `channelScope`: [`CreateAgentRequest`](../../../../../generated/storage/types.gen/type-aliases/CreateAgentRequest.md)\\[`\"channel_scope\"`\\]; `defaultModel`: `string`; `host?`: [`Harness`](../../../harnesses/harness/classes/Harness.md); `isCoding`: `boolean`; `team?`: [`Team`](../../../teams/team/classes/Team.md); \\}\n\nAgent creation and replacement settings.\n\n## Type Declaration\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `autoAcceptPermissions?` | `boolean` | Whether tool permissions are automatically accepted. |\n| `avatarUrl?` | `string` | Avatar URL. |\n| `channels?` | [`Channel`](../../../channels/channel/classes/Channel.md)[] | Channels the agent can access. |\n| `channelScope` | [`CreateAgentRequest`](../../../../../generated/storage/types.gen/type-aliases/CreateAgentRequest.md)\\[`\"channel_scope\"`\\] | Channel visibility policy. |\n| `defaultModel` | `string` | Default model. |\n| `host?` | [`Harness`](../../../harnesses/harness/classes/Harness.md) | Host running the agent. |\n| `isCoding` | `boolean` | Whether this is a coding agent. |\n| `team?` | [`Team`](../../../teams/team/classes/Team.md) | Owning team. |\n\n\n<!-- src/entities/agents/namespace/classes/AgentNamespace.md -->\n# Class: AgentNamespace\n\nConfigurable agents.\n\n## Constructors\n\n### Constructor\n\n> **new AgentNamespace**(`client`): `AgentNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`AgentNamespace`\n\n## Methods\n\n### byId()\n\n> **byId**(`id`): [`Agent`](../../agent/classes/Agent.md)\n\nConstruct a lazy agent handle.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`Agent`](../../agent/classes/Agent.md)\n\n***\n\n### create()\n\n> **create**(`options`): `Promise`\\<[`Agent`](../../agent/classes/Agent.md)\\>\n\nCreate an agent.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | [`AgentOptions`](../../agent/type-aliases/AgentOptions.md) |\n\n#### Returns\n\n`Promise`\\<[`Agent`](../../agent/classes/Agent.md)\\>\n\n***\n\n### list()\n\n> **list**(): `Promise`\\<[`Agent`](../../agent/classes/Agent.md)[]\\>\n\nAll accessible agents.\n\n#### Returns\n\n`Promise`\\<[`Agent`](../../agent/classes/Agent.md)[]\\>\n\n\n<!-- src/entities/harnesses/harness/classes/Harness.md -->\n# Class: Harness\n\nA registered host for coding agents.\n\n## Extends\n\n- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\\<[`Harness`](../../../../../generated/storage/types.gen/type-aliases/Harness.md)\\>\n\n## Properties\n\n| Property | Modifier | Type | Description | Inherited from |\n| ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-connected\"></a> `connected` | `readonly` | () => `Promise`\\<`boolean`\\> | Whether the host is connected. | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |\n| <a id=\"property-kind\"></a> `kind` | `readonly` | () => `Promise`\\<`string`\\> | Runtime kind. | - |\n| <a id=\"property-name\"></a> `name` | `readonly` | () => `Promise`\\<`string`\\> | Display name. | - |\n\n## Methods\n\n### delete()\n\n> **delete**(): `Promise`\\<`void`\\>\n\nRemove the host.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`Harness`](../../../../../generated/storage/types.gen/type-aliases/Harness.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`Harness`](../../../../../generated/storage/types.gen/type-aliases/Harness.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`Harness`](../../../../../generated/storage/types.gen/type-aliases/Harness.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `id`): `Harness`\n\nConstruct a lazy host handle.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `id` | `string` |\n\n#### Returns\n\n`Harness`\n\n***\n\n### from()\n\n> `static` **from**(`client`, `record`): `Harness`\n\nSeed from a listed host.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `record` | [`Harness`](../../../../../generated/storage/types.gen/type-aliases/Harness.md) |\n\n#### Returns\n\n`Harness`\n\n\n<!-- src/entities/harnesses/namespace/classes/HarnessNamespace.md -->\n# Class: HarnessNamespace\n\nHosts and device pairing. Self operations require host credentials.\n\n## Constructors\n\n### Constructor\n\n> **new HarnessNamespace**(`client`): `HarnessNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`HarnessNamespace`\n\n## Methods\n\n### agents()\n\n> **agents**(): `Promise`\\<[`Agent`](../../../agents/agent/classes/Agent.md)[]\\>\n\nAgent handles for the currently authenticated host.\n\n#### Returns\n\n`Promise`\\<[`Agent`](../../../agents/agent/classes/Agent.md)[]\\>\n\n***\n\n### byId()\n\n> **byId**(`id`): [`Harness`](../../harness/classes/Harness.md)\n\nConstruct a lazy host handle.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`Harness`](../../harness/classes/Harness.md)\n\n***\n\n### createPairing()\n\n> **createPairing**(`options`): `Promise`\\<\\{ `device`: [`DevicePairing`](../../pairing/classes/DevicePairing.md); `deviceSecret`: `string`; `expiresAt`: `string`; `pairing`: [`HarnessPairing`](../../pairing/classes/HarnessPairing.md); `pollIntervalSeconds`: `number`; \\}\\>\n\nStart pairing a device; persist the secret separately from the handles.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | [`CreatePairingRequest`](../../../../../generated/storage/types.gen/type-aliases/CreatePairingRequest.md) |\n\n#### Returns\n\n`Promise`\\<\\{ `device`: [`DevicePairing`](../../pairing/classes/DevicePairing.md); `deviceSecret`: `string`; `expiresAt`: `string`; `pairing`: [`HarnessPairing`](../../pairing/classes/HarnessPairing.md); `pollIntervalSeconds`: `number`; \\}\\>\n\n***\n\n### deleteSelf()\n\n> **deleteSelf**(): `Promise`\\<`void`\\>\n\nRevoke the currently authenticated host.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### list()\n\n> **list**(): `Promise`\\<[`Harness`](../../harness/classes/Harness.md)[]\\>\n\nAll hosts visible to the caller.\n\n#### Returns\n\n`Promise`\\<[`Harness`](../../harness/classes/Harness.md)[]\\>\n\n***\n\n### me()\n\n> **me**(): `Promise`\\<[`Harness`](../../harness/classes/Harness.md)\\>\n\nThe currently authenticated host.\n\n#### Returns\n\n`Promise`\\<[`Harness`](../../harness/classes/Harness.md)\\>\n\n***\n\n### pairing()\n\n> **pairing**(`code`): [`HarnessPairing`](../../pairing/classes/HarnessPairing.md)\n\nConstruct a lazy pairing from its displayed code.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `code` | `string` |\n\n#### Returns\n\n[`HarnessPairing`](../../pairing/classes/HarnessPairing.md)\n\n***\n\n### sessions()\n\n> **sessions**(): `Promise`\\<[`AgentSession`](../../../agent-sessions/agent-session/classes/AgentSession.md)[]\\>\n\nSession handles for the currently authenticated host.\n\n#### Returns\n\n`Promise`\\<[`AgentSession`](../../../agent-sessions/agent-session/classes/AgentSession.md)[]\\>\n\n\n<!-- src/entities/harnesses/pairing/classes/DevicePairing.md -->\n# Class: DevicePairing\n\nDevice side pairing identity. Keep the device secret outside the handle.\n\n## Properties\n\n| Property | Modifier | Type | Description |\n| ------ | ------ | ------ | ------ |\n| <a id=\"property-id\"></a> `id` | `readonly` | `string` | Pairing identifier. |\n\n## Methods\n\n### claim()\n\n> **claim**(`deviceSecret`): `Promise`\\<\\{ `harness`: [`Harness`](../../harness/classes/Harness.md); `token`: `string`; \\} \\| `undefined`\\>\n\nAttempt to claim an approved pairing. Pending claims return undefined.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `deviceSecret` | `string` |\n\n#### Returns\n\n`Promise`\\<\\{ `harness`: [`Harness`](../../harness/classes/Harness.md); `token`: `string`; \\} \\| `undefined`\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `id`: `string`; \\}\n\nSerialize identity only.\n\n#### Returns\n\n\\{ `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `id`): `DevicePairing`\n\nConstruct the device side handle.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `id` | `string` |\n\n#### Returns\n\n`DevicePairing`\n\n\n<!-- src/entities/harnesses/pairing/classes/HarnessPairing.md -->\n# Class: HarnessPairing\n\nA short lived host pairing, addressed by its displayed code.\n\n## Extends\n\n- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\\<[`PairingDetails`](../../../../../generated/storage/types.gen/type-aliases/PairingDetails.md)\\>\n\n## Properties\n\n| Property | Modifier | Type | Description | Inherited from |\n| ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-expiresat\"></a> `expiresAt` | `readonly` | () => `Promise`\\<`string`\\> | Expiration time. | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |\n| <a id=\"property-name\"></a> `name` | `readonly` | () => `Promise`\\<`string`\\> | Requested name. | - |\n\n## Methods\n\n### approve()\n\n> **approve**(`options?`): `Promise`\\<[`Harness`](../../harness/classes/Harness.md)\\>\n\nApprove this pairing.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options?` | \\{ `allowPermissionBypass?`: `boolean`; `name?`: `string`; `team?`: [`Team`](../../../teams/team/classes/Team.md); \\} |\n| `options.allowPermissionBypass?` | `boolean` |\n| `options.name?` | `string` |\n| `options.team?` | [`Team`](../../../teams/team/classes/Team.md) |\n\n#### Returns\n\n`Promise`\\<[`Harness`](../../harness/classes/Harness.md)\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`PairingDetails`](../../../../../generated/storage/types.gen/type-aliases/PairingDetails.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`PairingDetails`](../../../../../generated/storage/types.gen/type-aliases/PairingDetails.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`PairingDetails`](../../../../../generated/storage/types.gen/type-aliases/PairingDetails.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `code`): `HarnessPairing`\n\nConstruct a lazy pairing from a pairing code.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `code` | `string` |\n\n#### Returns\n\n`HarnessPairing`\n"+ },+ {+ "name": "apiKeys",+ "description": "Create, list and revoke user API keys.",+ "overview": "<!-- src/entities/api-keys/namespace/classes/ApiKeyNamespace.md -->\n# Class: ApiKeyNamespace\n\nUser API key management.\n\n## Constructors\n\n### Constructor\n\n> **new ApiKeyNamespace**(`client`): `ApiKeyNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`ApiKeyNamespace`\n\n## Methods\n\n### byId()\n\n> **byId**(`id`): [`UserApiKey`](../../api-key/classes/UserApiKey.md)\n\nConstruct a lazy key handle.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`UserApiKey`](../../api-key/classes/UserApiKey.md)\n\n***\n\n### create()\n\n> **create**(`name`): `Promise`\\<\\{ `key`: [`UserApiKey`](../../api-key/classes/UserApiKey.md); `secret`: `string`; \\}\\>\n\nCreate a key. Save the secret now; it cannot be retrieved later.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `name` | `string` |\n\n#### Returns\n\n`Promise`\\<\\{ `key`: [`UserApiKey`](../../api-key/classes/UserApiKey.md); `secret`: `string`; \\}\\>\n\n***\n\n### list()\n\n> **list**(): `Promise`\\<[`UserApiKey`](../../api-key/classes/UserApiKey.md)[]\\>\n\nList metadata for the caller's API keys.\n\n#### Returns\n\n`Promise`\\<[`UserApiKey`](../../api-key/classes/UserApiKey.md)[]\\>\n\n***\n\n### tokenForEmail()\n\n> **tokenForEmail**(`email`): `Promise`\\<[`MacroApiTokenResponse`](../../../../../generated/auth/types.gen/type-aliases/MacroApiTokenResponse.md)\\>\n\nExchange an email address for a Macro API token, subject to server authorization.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `email` | `string` |\n\n#### Returns\n\n`Promise`\\<[`MacroApiTokenResponse`](../../../../../generated/auth/types.gen/type-aliases/MacroApiTokenResponse.md)\\>\n",+ "documentation": "# Macro SDK: apiKeys\n\nGenerated by TypeDoc. Paths below refer to the canonical Markdown hierarchy. Other entity handles are documented in their named section; request core for shared SDK helpers.\n\n<!-- generated/auth/types.gen/type-aliases/MacroApiTokenResponse.md -->\n# Type Alias: MacroApiTokenResponse\n\n> **MacroApiTokenResponse** = \\{ `macro_api_token`: `string`; \\}\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-macro_api_token\"></a> `macro_api_token` | `string` | The newly created macro_api_token |\n\n\n<!-- generated/storage/types.gen/type-aliases/UserApiKeyId.md -->\n# Type Alias: UserApiKeyId\n\n> **UserApiKeyId** = `string`\n\nOpaque identifier for a stored user API key.\n\n\n<!-- generated/storage/types.gen/type-aliases/UserApiKeyInfo.md -->\n# Type Alias: UserApiKeyInfo\n\n> **UserApiKeyInfo** = \\{ `createdAt`: `string`; `id`: [`UserApiKeyId`](UserApiKeyId.md); `name`: `string`; \\}\n\nSafe metadata for a stored key. Never contains the secret or its hash.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-createdat\"></a> `createdAt` | `string` | When the key was created. |\n| <a id=\"property-id\"></a> `id` | [`UserApiKeyId`](UserApiKeyId.md) | Opaque identifier used to address the key after create. |\n| <a id=\"property-name\"></a> `name` | `string` | User-facing name. |\n\n\n<!-- src/entities/api-keys/api-key/classes/UserApiKey.md -->\n# Class: UserApiKey\n\nA user API key's metadata. Secrets are returned only at creation.\n\n## Extends\n\n- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\\<[`UserApiKeyInfo`](../../../../../generated/storage/types.gen/type-aliases/UserApiKeyInfo.md)\\>\n\n## Properties\n\n| Property | Modifier | Type | Description | Inherited from |\n| ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-createdat\"></a> `createdAt` | `readonly` | () => `Promise`\\<`string`\\> | Creation time. | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |\n| <a id=\"property-name\"></a> `name` | `readonly` | () => `Promise`\\<`string`\\> | Human readable label. | - |\n\n## Methods\n\n### delete()\n\n> **delete**(): `Promise`\\<`void`\\>\n\nRevoke this key.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`UserApiKeyInfo`](../../../../../generated/storage/types.gen/type-aliases/UserApiKeyInfo.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`UserApiKeyInfo`](../../../../../generated/storage/types.gen/type-aliases/UserApiKeyInfo.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`UserApiKeyInfo`](../../../../../generated/storage/types.gen/type-aliases/UserApiKeyInfo.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `id`): `UserApiKey`\n\nConstruct a lazy key handle.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `id` | `string` |\n\n#### Returns\n\n`UserApiKey`\n\n***\n\n### from()\n\n> `static` **from**(`client`, `record`): `UserApiKey`\n\nSeed from metadata, deliberately excluding the secret.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `record` | [`UserApiKeyInfo`](../../../../../generated/storage/types.gen/type-aliases/UserApiKeyInfo.md) |\n\n#### Returns\n\n`UserApiKey`\n\n\n<!-- src/entities/api-keys/namespace/classes/ApiKeyNamespace.md -->\n# Class: ApiKeyNamespace\n\nUser API key management.\n\n## Constructors\n\n### Constructor\n\n> **new ApiKeyNamespace**(`client`): `ApiKeyNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`ApiKeyNamespace`\n\n## Methods\n\n### byId()\n\n> **byId**(`id`): [`UserApiKey`](../../api-key/classes/UserApiKey.md)\n\nConstruct a lazy key handle.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`UserApiKey`](../../api-key/classes/UserApiKey.md)\n\n***\n\n### create()\n\n> **create**(`name`): `Promise`\\<\\{ `key`: [`UserApiKey`](../../api-key/classes/UserApiKey.md); `secret`: `string`; \\}\\>\n\nCreate a key. Save the secret now; it cannot be retrieved later.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `name` | `string` |\n\n#### Returns\n\n`Promise`\\<\\{ `key`: [`UserApiKey`](../../api-key/classes/UserApiKey.md); `secret`: `string`; \\}\\>\n\n***\n\n### list()\n\n> **list**(): `Promise`\\<[`UserApiKey`](../../api-key/classes/UserApiKey.md)[]\\>\n\nList metadata for the caller's API keys.\n\n#### Returns\n\n`Promise`\\<[`UserApiKey`](../../api-key/classes/UserApiKey.md)[]\\>\n\n***\n\n### tokenForEmail()\n\n> **tokenForEmail**(`email`): `Promise`\\<[`MacroApiTokenResponse`](../../../../../generated/auth/types.gen/type-aliases/MacroApiTokenResponse.md)\\>\n\nExchange an email address for a Macro API token, subject to server authorization.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `email` | `string` |\n\n#### Returns\n\n`Promise`\\<[`MacroApiTokenResponse`](../../../../../generated/auth/types.gen/type-aliases/MacroApiTokenResponse.md)\\>\n"+ },+ {+ "name": "entityMentions",+ "description": "Create and delete typed resource mention relationships.",+ "overview": "<!-- src/entities/entity-mentions/namespace/classes/EntityMentionNamespace.md -->\n# Class: EntityMentionNamespace\n\nStored entity mention relationships.\n\n## Constructors\n\n### Constructor\n\n> **new EntityMentionNamespace**(`client`): `EntityMentionNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`EntityMentionNamespace`\n\n## Methods\n\n### byId()\n\n> **byId**(`id`): [`EntityMention`](../../mention/classes/EntityMention.md)\n\nConstruct a stored mention handle.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`EntityMention`](../../mention/classes/EntityMention.md)\n\n***\n\n### create()\n\n> **create**(`source`, `target`): `Promise`\\<[`EntityMention`](../../mention/classes/EntityMention.md)\\>\n\nCreate a mention from a source resource to a target resource.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `source` | [`EntityReference`](../../../reference/type-aliases/EntityReference.md) |\n| `target` | [`EntityReference`](../../../reference/type-aliases/EntityReference.md) |\n\n#### Returns\n\n`Promise`\\<[`EntityMention`](../../mention/classes/EntityMention.md)\\>\n",+ "documentation": "# Macro SDK: entityMentions\n\nGenerated by TypeDoc. Paths below refer to the canonical Markdown hierarchy. Other entity handles are documented in their named section; request core for shared SDK helpers.\n\n<!-- src/entities/entity-mentions/mention/classes/EntityMention.md -->\n# Class: EntityMention\n\nA stored mention connecting two resources.\n\n## Properties\n\n| Property | Modifier | Type | Description |\n| ------ | ------ | ------ | ------ |\n| <a id=\"property-id\"></a> `id` | `readonly` | `string` | Mention identity. |\n\n## Methods\n\n### delete()\n\n> **delete**(): `Promise`\\<`void`\\>\n\nRemove this mention.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `id`: `string`; \\}\n\nSerialize identity only.\n\n#### Returns\n\n\\{ `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `id`): `EntityMention`\n\nConstruct a mention handle for removal.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `id` | `string` |\n\n#### Returns\n\n`EntityMention`\n\n\n<!-- src/entities/entity-mentions/namespace/classes/EntityMentionNamespace.md -->\n# Class: EntityMentionNamespace\n\nStored entity mention relationships.\n\n## Constructors\n\n### Constructor\n\n> **new EntityMentionNamespace**(`client`): `EntityMentionNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`EntityMentionNamespace`\n\n## Methods\n\n### byId()\n\n> **byId**(`id`): [`EntityMention`](../../mention/classes/EntityMention.md)\n\nConstruct a stored mention handle.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`EntityMention`](../../mention/classes/EntityMention.md)\n\n***\n\n### create()\n\n> **create**(`source`, `target`): `Promise`\\<[`EntityMention`](../../mention/classes/EntityMention.md)\\>\n\nCreate a mention from a source resource to a target resource.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `source` | [`EntityReference`](../../../reference/type-aliases/EntityReference.md) |\n| `target` | [`EntityReference`](../../../reference/type-aliases/EntityReference.md) |\n\n#### Returns\n\n`Promise`\\<[`EntityMention`](../../mention/classes/EntityMention.md)\\>\n"+ },+ {+ "name": "githubPullRequests",+ "description": "Read stored GitHub pull request snapshots and captured diffs.",+ "overview": "<!-- src/entities/github-pull-requests/namespace/classes/GithubPullRequestNamespace.md -->\n# Class: GithubPullRequestNamespace\n\nGitHub pull request snapshots and captured diffs.\n\n## Constructors\n\n### Constructor\n\n> **new GithubPullRequestNamespace**(`client`): `GithubPullRequestNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`GithubPullRequestNamespace`\n\n## Methods\n\n### byId()\n\n> **byId**(`id`): [`GithubPullRequest`](../../pull-request/classes/GithubPullRequest.md)\n\nConstruct from a Macro foreign entity's identity.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`GithubPullRequest`](../../pull-request/classes/GithubPullRequest.md)\n\n***\n\n### forEntity()\n\n> **forEntity**(`entity`): [`GithubPullRequest`](../../pull-request/classes/GithubPullRequest.md)\n\nResolve a foreign entity as a pull request.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `entity` | [`ForeignEntity`](../../../foreign/foreign-entity/classes/ForeignEntity.md) |\n\n#### Returns\n\n[`GithubPullRequest`](../../pull-request/classes/GithubPullRequest.md)\n",+ "documentation": "# Macro SDK: githubPullRequests\n\nGenerated by TypeDoc. Paths below refer to the canonical Markdown hierarchy. Other entity handles are documented in their named section; request core for shared SDK helpers.\n\n<!-- generated/storage/types.gen/type-aliases/ChangedFileDto.md -->\n# Type Alias: ChangedFileDto\n\n> **ChangedFileDto** = \\{ `additions`: `number`; `binary`: `boolean`; `deletions`: `number`; `kind`: [`FileChangeKindDto`](FileChangeKindDto.md); `patchOmitted`: `boolean`; `path`: `string`; `previousPath?`: `string` \\| `null`; \\}\n\nOne changed file.\n\nClients deserialize this, so both derives are used.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-additions\"></a> `additions` | `number` | Lines added. |\n| <a id=\"property-binary\"></a> `binary` | `boolean` | The diff carries no text for this file. |\n| <a id=\"property-deletions\"></a> `deletions` | `number` | Lines removed. |\n| <a id=\"property-kind\"></a> `kind` | [`FileChangeKindDto`](FileChangeKindDto.md) | What happened to the file. |\n| <a id=\"property-patchomitted\"></a> `patchOmitted` | `boolean` | The file's hunks were left out of the patch to fit the size budget. |\n| <a id=\"property-path\"></a> `path` | `string` | The file's path after the change, or before it for a deletion. |\n| <a id=\"property-previouspath\"></a> `previousPath?` | `string` \\| `null` | Where a renamed file came from. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ChangesetDto.md -->\n# Type Alias: ChangesetDto\n\n> **ChangesetDto** = \\{ `additions`: `number`; `base`: [`GitRefDto`](GitRefDto.md); `capturedAt`: `string`; `deletions`: `number`; `files`: [`ChangedFileDto`](ChangedFileDto.md)[]; `head`: [`GitRefDto`](GitRefDto.md); `id`: `string`; `patchBytes`: `number`; `repository?`: `string` \\| `null`; `source`: [`ChangesetSourceDto`](ChangesetSourceDto.md); `truncated`: `boolean`; \\}\n\nOne changeset: the files a patch touches and what happened to each.\n\nClients deserialize this, so both derives are used.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-additions\"></a> `additions` | `number` | Lines added across all files. |\n| <a id=\"property-base\"></a> `base` | [`GitRefDto`](GitRefDto.md) | The side the work started from. |\n| <a id=\"property-capturedat\"></a> `capturedAt` | `string` | When the diff was taken. |\n| <a id=\"property-deletions\"></a> `deletions` | `number` | Lines removed across all files. |\n| <a id=\"property-files\"></a> `files` | [`ChangedFileDto`](ChangedFileDto.md)[] | Every changed file, in patch order. |\n| <a id=\"property-head\"></a> `head` | [`GitRefDto`](GitRefDto.md) | The side carrying the work. |\n| <a id=\"property-id\"></a> `id` | `string` | The changeset's id; a different id means different changes. |\n| <a id=\"property-patchbytes\"></a> `patchBytes` | `number` | Size of the patch the matching patch route serves; zero when nothing changed. |\n| <a id=\"property-repository\"></a> `repository?` | `string` \\| `null` | `https://github.com/owner/name`, when known. |\n| <a id=\"property-source\"></a> `source` | [`ChangesetSourceDto`](ChangesetSourceDto.md) | Where the diff was read from. |\n| <a id=\"property-truncated\"></a> `truncated` | `boolean` | Some files' hunks were left out of the patch. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ChangesetSourceDto.md -->\n# Type Alias: ChangesetSourceDto\n\n> **ChangesetSourceDto** = `\"github_pull_request\"`\n\nThe source of a changeset's diff, on the wire.\n\n\n<!-- generated/storage/types.gen/type-aliases/FileChangeKindDto.md -->\n# Type Alias: FileChangeKindDto\n\n> **FileChangeKindDto** = `\"added\"` \\| `\"modified\"` \\| `\"deleted\"` \\| `\"renamed\"`\n\nWhat happened to a file, on the wire.\n\n\n<!-- generated/storage/types.gen/type-aliases/GitRefDto.md -->\n# Type Alias: GitRefDto\n\n> **GitRefDto** = \\{ `name?`: `string` \\| `null`; `sha?`: `string` \\| `null`; \\}\n\nOne end of the compared range.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-name\"></a> `name?` | `string` \\| `null` | The branch name, when known. |\n| <a id=\"property-sha\"></a> `sha?` | `string` \\| `null` | The commit, when known. |\n\n\n<!-- generated/storage/types.gen/type-aliases/GithubPullRequestCheckRun.md -->\n# Type Alias: GithubPullRequestCheckRun\n\n> **GithubPullRequestCheckRun** = \\{ `completedAt?`: `string` \\| `null`; `conclusion?`: `string` \\| `null`; `id`: `number`; `name`: `string`; `startedAt?`: `string` \\| `null`; `status`: `string`; `url?`: `string` \\| `null`; \\}\n\nA check run associated with a GitHub pull request.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-completedat\"></a> `completedAt?` | `string` \\| `null` | When the check run completed, when available. |\n| <a id=\"property-conclusion\"></a> `conclusion?` | `string` \\| `null` | The raw GitHub check run conclusion, when the run has completed. |\n| <a id=\"property-id\"></a> `id` | `number` | The unique GitHub identifier for the check run. |\n| <a id=\"property-name\"></a> `name` | `string` | The check run name. |\n| <a id=\"property-startedat\"></a> `startedAt?` | `string` \\| `null` | When the check run started, when available. |\n| <a id=\"property-status\"></a> `status` | `string` | The raw GitHub check run status. |\n| <a id=\"property-url\"></a> `url?` | `string` \\| `null` | The public GitHub URL for the check run, when available. |\n\n\n<!-- generated/storage/types.gen/type-aliases/GithubPullRequestComment.md -->\n# Type Alias: GithubPullRequestComment\n\n> **GithubPullRequestComment** = \\{ `authorAssociation?`: `string` \\| `null`; `authorId?`: `number` \\| `null`; `authorLogin?`: `string` \\| `null`; `body`: `string`; `createdAt?`: `string` \\| `null`; `id`: `number`; `inReplyToId?`: `number` \\| `null`; `line?`: `number` \\| `null`; `originalLine?`: `number` \\| `null`; `path?`: `string` \\| `null`; `pullRequestReviewId?`: `number` \\| `null`; `source`: `string`; `updatedAt?`: `string` \\| `null`; `url?`: `string` \\| `null`; \\}\n\nA comment associated with a GitHub pull request.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-authorassociation\"></a> `authorAssociation?` | `string` \\| `null` | GitHub's relationship label for the author, when available. |\n| <a id=\"property-authorid\"></a> `authorId?` | `number` \\| `null` | The stable numeric GitHub user id for the comment author, when available. |\n| <a id=\"property-authorlogin\"></a> `authorLogin?` | `string` \\| `null` | The GitHub login for the comment author, when available. |\n| <a id=\"property-body\"></a> `body` | `string` | The comment or review body text. |\n| <a id=\"property-createdat\"></a> `createdAt?` | `string` \\| `null` | When the comment was created or the review was submitted. |\n| <a id=\"property-id\"></a> `id` | `number` | The unique GitHub identifier for the comment or review. |\n| <a id=\"property-inreplytoid\"></a> `inReplyToId?` | `number` \\| `null` | The id of the comment this one replies to, when it is part of a review thread. Only ever present on `review_comment` sources. |\n| <a id=\"property-line\"></a> `line?` | `number` \\| `null` | The line in the current diff the comment is anchored to. Cleared by GitHub when later commits outdate the comment's diff. |\n| <a id=\"property-originalline\"></a> `originalLine?` | `number` \\| `null` | The line the comment was originally anchored to, kept even when the diff has since changed. |\n| <a id=\"property-path\"></a> `path?` | `string` \\| `null` | The repository-relative file path the review comment is anchored to. Only ever present on `review_comment` sources. |\n| <a id=\"property-pullrequestreviewid\"></a> `pullRequestReviewId?` | `number` \\| `null` | The id of the pull request review this comment was submitted with. Only ever present on `review_comment` sources. |\n| <a id=\"property-source\"></a> `source` | `string` | The GitHub source for the comment, such as `issue_comment` or `review_comment`. |\n| <a id=\"property-updatedat\"></a> `updatedAt?` | `string` \\| `null` | When the comment or review was last updated. |\n| <a id=\"property-url\"></a> `url?` | `string` \\| `null` | The public GitHub URL for the comment or review, when available. |\n\n\n<!-- generated/storage/types.gen/type-aliases/GithubPullRequestLabel.md -->\n# Type Alias: GithubPullRequestLabel\n\n> **GithubPullRequestLabel** = \\{ `color?`: `string` \\| `null`; `name`: `string`; \\}\n\nA label on a GitHub pull request.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-color\"></a> `color?` | `string` \\| `null` | The label color as six hex digits without a leading `#`, when known. |\n| <a id=\"property-name\"></a> `name` | `string` | The label name, unique within its repository regardless of case. |\n\n\n<!-- generated/storage/types.gen/type-aliases/GithubPullRequestReview.md -->\n# Type Alias: GithubPullRequestReview\n\n> **GithubPullRequestReview** = \\{ `reviewerGithubUserId`: `string`; `reviewerLogin?`: `string` \\| `null`; `state`: [`GithubPullRequestReviewState`](GithubPullRequestReviewState.md); `submittedAt?`: `string` \\| `null`; \\}\n\nA reviewer's latest submitted review on a pull request.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-reviewergithubuserid\"></a> `reviewerGithubUserId` | `string` | The stable numeric GitHub user id of the reviewer, as a string. |\n| <a id=\"property-reviewerlogin\"></a> `reviewerLogin?` | `string` \\| `null` | The reviewer's GitHub login, when known. |\n| <a id=\"property-state\"></a> `state` | [`GithubPullRequestReviewState`](GithubPullRequestReviewState.md) | What the review said. |\n| <a id=\"property-submittedat\"></a> `submittedAt?` | `string` \\| `null` | When the review was submitted, when known. |\n\n\n<!-- generated/storage/types.gen/type-aliases/GithubPullRequestReviewDecision.md -->\n# Type Alias: GithubPullRequestReviewDecision\n\n> **GithubPullRequestReviewDecision** = `\"approved\"` \\| `\"changes_requested\"` \\| `\"review_required\"`\n\nWhere a pull request's review stands, from its reviewers' latest reviews.\n\n\n<!-- generated/storage/types.gen/type-aliases/GithubPullRequestReviewState.md -->\n# Type Alias: GithubPullRequestReviewState\n\n> **GithubPullRequestReviewState** = `\"approved\"` \\| `\"changes_requested\"` \\| `\"commented\"` \\| `\"dismissed\"`\n\nWhat a reviewer's latest review on a pull request said.\n\n\n<!-- generated/storage/types.gen/type-aliases/GithubPullRequestUser.md -->\n# Type Alias: GithubPullRequestUser\n\n> **GithubPullRequestUser** = \\{ `githubUserId`: `string`; `login?`: `string` \\| `null`; \\}\n\nA GitHub user named on a pull request, such as an assignee.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-githubuserid\"></a> `githubUserId` | `string` | The stable numeric GitHub user id, as a string. |\n| <a id=\"property-login\"></a> `login?` | `string` \\| `null` | The user's GitHub login, when known. |\n\n\n<!-- generated/storage/types.gen/type-aliases/StoredGithubPullRequest.md -->\n# Type Alias: StoredGithubPullRequest\n\n> **StoredGithubPullRequest** = \\{ `additions?`: `number` \\| `null`; `assignees`: [`GithubPullRequestUser`](GithubPullRequestUser.md)[]; `authorGithubUserId?`: `string` \\| `null`; `authorLogin?`: `string` \\| `null`; `base?`: `null` \\| [`GitRefDto`](GitRefDto.md); `checks`: [`GithubPullRequestCheckRun`](GithubPullRequestCheckRun.md)[]; `comments`: [`GithubPullRequestComment`](GithubPullRequestComment.md)[]; `deletions?`: `number` \\| `null`; `description?`: `string` \\| `null`; `draft`: `boolean`; `githubKey`: `string`; `githubUpdatedAt?`: `string` \\| `null`; `head?`: `null` \\| [`GitRefDto`](GitRefDto.md); `id`: `string`; `labels`: [`GithubPullRequestLabel`](GithubPullRequestLabel.md)[]; `number`: `number`; `owner`: `string`; `repo`: `string`; `requestedReviewerGithubUserIds`: `string`[]; `reviewDecision?`: `null` \\| [`GithubPullRequestReviewDecision`](GithubPullRequestReviewDecision.md); `reviews`: [`GithubPullRequestReview`](GithubPullRequestReview.md)[]; `status?`: `null` \\| `\"open\"` \\| `\"closed\"` \\| `\"merged\"`; `title?`: `string` \\| `null`; `url`: `string`; \\}\n\nA GitHub pull request as Macro stores it, read through one of the caller's records.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-additions\"></a> `additions?` | `number` \\| `null` | Lines added across the pull request's changes. |\n| <a id=\"property-assignees\"></a> `assignees` | [`GithubPullRequestUser`](GithubPullRequestUser.md)[] | The users assigned to the pull request. |\n| <a id=\"property-authorgithubuserid\"></a> `authorGithubUserId?` | `string` \\| `null` | Stable numeric GitHub user id of the author. |\n| <a id=\"property-authorlogin\"></a> `authorLogin?` | `string` \\| `null` | The author's GitHub login when the pull request was last synced. |\n| <a id=\"property-base\"></a> `base?` | `null` \\| [`GitRefDto`](GitRefDto.md) | - |\n| <a id=\"property-checks\"></a> `checks` | [`GithubPullRequestCheckRun`](GithubPullRequestCheckRun.md)[] | The latest check runs on the pull request's head commit. |\n| <a id=\"property-comments\"></a> `comments` | [`GithubPullRequestComment`](GithubPullRequestComment.md)[] | Comments from the pull request's conversation, reviews, and review threads. Comment `authorId` intentionally retains the shared numeric GitHub comment contract; convert it to a decimal string before comparing it with `authorGithubUserId`. |\n| <a id=\"property-deletions\"></a> `deletions?` | `number` \\| `null` | Lines deleted across the pull request's changes. |\n| <a id=\"property-description\"></a> `description?` | `string` \\| `null` | The pull request body, as GitHub markdown. |\n| <a id=\"property-draft\"></a> `draft` | `boolean` | Whether the pull request is a draft. |\n| <a id=\"property-githubkey\"></a> `githubKey` | `string` | The pull request's `owner/repo/pull/number` key. |\n| <a id=\"property-githubupdatedat\"></a> `githubUpdatedAt?` | `string` \\| `null` | When GitHub last updated the pull request. |\n| <a id=\"property-head\"></a> `head?` | `null` \\| [`GitRefDto`](GitRefDto.md) | - |\n| <a id=\"property-id\"></a> `id` | `string` | The caller's record for the pull request. |\n| <a id=\"property-labels\"></a> `labels` | [`GithubPullRequestLabel`](GithubPullRequestLabel.md)[] | The pull request's labels. |\n| <a id=\"property-number\"></a> `number` | `number` | The pull request number within its repository. |\n| <a id=\"property-owner\"></a> `owner` | `string` | The repository owner the pull request was last synced under. |\n| <a id=\"property-repo\"></a> `repo` | `string` | The repository name the pull request was last synced under. |\n| <a id=\"property-requestedreviewergithubuserids\"></a> `requestedReviewerGithubUserIds` | `string`[] | Stable numeric GitHub user ids of the users asked to review. |\n| <a id=\"property-reviewdecision\"></a> `reviewDecision?` | `null` \\| [`GithubPullRequestReviewDecision`](GithubPullRequestReviewDecision.md) | - |\n| <a id=\"property-reviews\"></a> `reviews` | [`GithubPullRequestReview`](GithubPullRequestReview.md)[] | Each reviewer's latest submitted review. |\n| <a id=\"property-status\"></a> `status?` | `null` \\| `\"open\"` \\| `\"closed\"` \\| `\"merged\"` | The normalized pull request status. |\n| <a id=\"property-title\"></a> `title?` | `string` \\| `null` | The pull request title. |\n| <a id=\"property-url\"></a> `url` | `string` | The pull request's page on GitHub. |\n\n\n<!-- src/entities/github-pull-requests/namespace/classes/GithubPullRequestNamespace.md -->\n# Class: GithubPullRequestNamespace\n\nGitHub pull request snapshots and captured diffs.\n\n## Constructors\n\n### Constructor\n\n> **new GithubPullRequestNamespace**(`client`): `GithubPullRequestNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`GithubPullRequestNamespace`\n\n## Methods\n\n### byId()\n\n> **byId**(`id`): [`GithubPullRequest`](../../pull-request/classes/GithubPullRequest.md)\n\nConstruct from a Macro foreign entity's identity.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`GithubPullRequest`](../../pull-request/classes/GithubPullRequest.md)\n\n***\n\n### forEntity()\n\n> **forEntity**(`entity`): [`GithubPullRequest`](../../pull-request/classes/GithubPullRequest.md)\n\nResolve a foreign entity as a pull request.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `entity` | [`ForeignEntity`](../../../foreign/foreign-entity/classes/ForeignEntity.md) |\n\n#### Returns\n\n[`GithubPullRequest`](../../pull-request/classes/GithubPullRequest.md)\n\n\n<!-- src/entities/github-pull-requests/pull-request/classes/GithubPullRequest.md -->\n# Class: GithubPullRequest\n\nA stored GitHub pull request addressed by its Macro foreign entity.\n\n## Extends\n\n- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\\<[`StoredGithubPullRequest`](../../../../../generated/storage/types.gen/type-aliases/StoredGithubPullRequest.md)\\>\n\n## Properties\n\n| Property | Modifier | Type | Description | Inherited from |\n| ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |\n| <a id=\"property-status\"></a> `status` | `readonly` | () => `Promise`\\<`NonNullable`\\<`\"open\"` \\| `\"closed\"` \\| `\"merged\"` \\| `null` \\| `undefined`\\> \\| `undefined`\\> | Current state. | - |\n| <a id=\"property-title\"></a> `title` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | Pull request title. | - |\n| <a id=\"property-url\"></a> `url` | `readonly` | () => `Promise`\\<`string`\\> | GitHub URL. | - |\n\n## Methods\n\n### changes()\n\n> **changes**(): `Promise`\\<\\{ `changeset?`: [`PullRequestChangeset`](PullRequestChangeset.md); `error?`: `string`; \\}\\>\n\nCaptured change metadata, when available.\n\n#### Returns\n\n`Promise`\\<\\{ `changeset?`: [`PullRequestChangeset`](PullRequestChangeset.md); `error?`: `string`; \\}\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`StoredGithubPullRequest`](../../../../../generated/storage/types.gen/type-aliases/StoredGithubPullRequest.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`StoredGithubPullRequest`](../../../../../generated/storage/types.gen/type-aliases/StoredGithubPullRequest.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`StoredGithubPullRequest`](../../../../../generated/storage/types.gen/type-aliases/StoredGithubPullRequest.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `id`): `GithubPullRequest`\n\nConstruct a lazy pull request handle.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `id` | `string` |\n\n#### Returns\n\n`GithubPullRequest`\n\n\n<!-- src/entities/github-pull-requests/pull-request/classes/PullRequestChangeset.md -->\n# Class: PullRequestChangeset\n\nOne captured diff belonging to a pull request.\n\n## Constructors\n\n### Constructor\n\n> **new PullRequestChangeset**(`client`, `pullRequest`, `record`): `PullRequestChangeset`\n\n#### Parameters\n\n| Parameter | Type | Description |\n| ------ | ------ | ------ |\n| `client` | `MacroClient` | - |\n| `pullRequest` | [`GithubPullRequest`](GithubPullRequest.md) | Parent pull request. |\n| `record` | [`ChangesetDto`](../../../../../generated/storage/types.gen/type-aliases/ChangesetDto.md) | Captured metadata. |\n\n#### Returns\n\n`PullRequestChangeset`\n\n## Properties\n\n| Property | Modifier | Type | Description |\n| ------ | ------ | ------ | ------ |\n| <a id=\"property-pullrequest\"></a> `pullRequest` | `readonly` | [`GithubPullRequest`](GithubPullRequest.md) | Parent pull request. |\n| <a id=\"property-record\"></a> `record` | `readonly` | [`ChangesetDto`](../../../../../generated/storage/types.gen/type-aliases/ChangesetDto.md) | Captured metadata. |\n\n## Accessors\n\n### id\n\n#### Get Signature\n\n> **get** **id**(): `string`\n\nCaptured identity.\n\n##### Returns\n\n`string`\n\n## Methods\n\n### patch()\n\n> **patch**(): `Promise`\\<`string`\\>\n\nRead the captured unified patch.\n\n#### Returns\n\n`Promise`\\<`string`\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `additions`: `number`; `base`: [`GitRefDto`](../../../../../generated/storage/types.gen/type-aliases/GitRefDto.md); `capturedAt`: `string`; `deletions`: `number`; `files`: [`ChangedFileDto`](../../../../../generated/storage/types.gen/type-aliases/ChangedFileDto.md)[]; `head`: [`GitRefDto`](../../../../../generated/storage/types.gen/type-aliases/GitRefDto.md); `id`: `string`; `patchBytes`: `number`; `pullRequestId`: `string`; `repository?`: `string` \\| `null`; `source`: `\"github_pull_request\"`; `truncated`: `boolean`; \\}\n\nSerialize captured metadata and parent identity.\n\n#### Returns\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `additions` | `number` | Lines added across all files. |\n| `base` | [`GitRefDto`](../../../../../generated/storage/types.gen/type-aliases/GitRefDto.md) | The side the work started from. |\n| `capturedAt` | `string` | When the diff was taken. |\n| `deletions` | `number` | Lines removed across all files. |\n| `files` | [`ChangedFileDto`](../../../../../generated/storage/types.gen/type-aliases/ChangedFileDto.md)[] | Every changed file, in patch order. |\n| `head` | [`GitRefDto`](../../../../../generated/storage/types.gen/type-aliases/GitRefDto.md) | The side carrying the work. |\n| `id` | `string` | The changeset's id; a different id means different changes. |\n| `patchBytes` | `number` | Size of the patch the matching patch route serves; zero when nothing changed. |\n| `pullRequestId` | `string` | - |\n| `repository?` | `string` \\| `null` | `https://github.com/owner/name`, when known. |\n| `source` | `\"github_pull_request\"` | Where the diff was read from. |\n| `truncated` | `boolean` | Some files' hunks were left out of the patch. |\n"+ },+ {+ "name": "initiatives",+ "description": "Group tasks and members into initiatives.",+ "overview": "<!-- src/entities/initiatives/initiative/interfaces/InitiativeOptions.md -->\n# Interface: InitiativeOptions\n\nInitiative creation settings.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-description\"></a> `description?` | `string` | Collaborative description. |\n| <a id=\"property-members\"></a> `members?` | [`User`](../../../users/user/classes/User.md)[] | Members assigned to this initiative. |\n| <a id=\"property-name\"></a> `name` | `string` | Initiative name. |\n| <a id=\"property-propertyvalues\"></a> `propertyValues?` | [`InitialPropertyValue`](../../../../../generated/storage/types.gen/type-aliases/InitialPropertyValue.md)[] | Initial properties. |\n| <a id=\"property-sharewithteam\"></a> `shareWithTeam?` | `boolean` | Whether the current team can access it. |\n\n\n<!-- src/entities/initiatives/namespace/classes/InitiativeNamespace.md -->\n# Class: InitiativeNamespace\n\nInitiatives in the caller's workspace.\n\n## Constructors\n\n### Constructor\n\n> **new InitiativeNamespace**(`client`): `InitiativeNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`InitiativeNamespace`\n\n## Methods\n\n### byId()\n\n> **byId**(`id`): [`Initiative`](../../initiative/classes/Initiative.md)\n\nConstruct a lazy initiative handle.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`Initiative`](../../initiative/classes/Initiative.md)\n\n***\n\n### create()\n\n> **create**(`options`): `Promise`\\<[`Initiative`](../../initiative/classes/Initiative.md)\\>\n\nCreate an initiative.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | [`InitiativeOptions`](../../initiative/interfaces/InitiativeOptions.md) |\n\n#### Returns\n\n`Promise`\\<[`Initiative`](../../initiative/classes/Initiative.md)\\>\n\n***\n\n### list()\n\n> **list**(): `Promise`\\<[`Initiative`](../../initiative/classes/Initiative.md)[]\\>\n\nList accessible initiatives.\n\n#### Returns\n\n`Promise`\\<[`Initiative`](../../initiative/classes/Initiative.md)[]\\>\n",+ "documentation": "# Macro SDK: initiatives\n\nGenerated by TypeDoc. Paths below refer to the canonical Markdown hierarchy. Other entity handles are documented in their named section; request core for shared SDK helpers.\n\n<!-- generated/storage/types.gen/type-aliases/AccessLevel.md -->\n# Type Alias: AccessLevel\n\n> **AccessLevel** = `\"view\"` \\| `\"comment\"` \\| `\"edit\"` \\| `\"owner\"`\n\nOrdered from least to most access top -> bottom\n\n\n<!-- generated/storage/types.gen/type-aliases/ChannelSharePermission.md -->\n# Type Alias: ChannelSharePermission\n\n> **ChannelSharePermission** = \\{ `access_level`: [`AccessLevel`](AccessLevel.md); `channel_id`: `string`; \\}\n\nThe channel share permission\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-access_level\"></a> `access_level` | [`AccessLevel`](AccessLevel.md) | The access level for the channel |\n| <a id=\"property-channel_id\"></a> `channel_id` | `string` | The channel id |\n\n\n<!-- generated/storage/types.gen/type-aliases/EntityReference.md -->\n# Type Alias: EntityReference\n\n> **EntityReference** = \\{ `entity_id`: `string`; `entity_type`: [`EntityType`](EntityType.md); `specific_message_id?`: `string` \\| `null`; \\}\n\nEntity reference for entity-type property values.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | - |\n| <a id=\"property-entity_type\"></a> `entity_type` | [`EntityType`](EntityType.md) | - |\n| <a id=\"property-specific_message_id\"></a> `specific_message_id?` | `string` \\| `null` | For CHANNEL, CHAT, THREAD entity types - optional specific message ID. This allows referencing a specific message within a thread/channel/chat. |\n\n\n<!-- generated/storage/types.gen/type-aliases/EntityType.md -->\n# Type Alias: EntityType\n\n> **EntityType** = `\"CALENDAR_EVENT\"` \\| `\"CALL_RECORD\"` \\| `\"CHANNEL\"` \\| `\"CHAT\"` \\| `\"COMPANY\"` \\| `\"DATABASE_ROW\"` \\| `\"CONTACT\"` \\| `\"DOCUMENT\"` \\| `\"INITIATIVE\"` \\| `\"PROJECT\"` \\| `\"TASK\"` \\| `\"THREAD\"` \\| `\"USER\"`\n\nType of entity that can be referenced by entity properties.\n\n\n<!-- generated/storage/types.gen/type-aliases/InitialPropertyValue.md -->\n# Type Alias: InitialPropertyValue\n\n> **InitialPropertyValue** = \\{ `propertyDefinitionId`: `string`; `value`: [`SetPropertyValue`](SetPropertyValue.md); \\}\n\nA property value set on a new initiative as part of its create.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-propertydefinitionid\"></a> `propertyDefinitionId` | `string` | Property definition to set. |\n| <a id=\"property-value\"></a> `value` | [`SetPropertyValue`](SetPropertyValue.md) | Value, validated by the properties service like any other property write. |\n\n\n<!-- generated/storage/types.gen/type-aliases/InitiativeDetail.md -->\n# Type Alias: InitiativeDetail\n\n> **InitiativeDetail** = \\{ `createdAt`: `string`; `id`: [`InitiativeId`](InitiativeId.md); `memberIds`: [`MacroUserIdStr`](MacroUserIdStr.md)[]; `name`: `string`; `ownerId`: [`MacroUserIdStr`](MacroUserIdStr.md); `sharePermission`: [`SharePermissionV2`](SharePermissionV2.md); `taskIds`: `string`[]; `updatedAt`: `string`; `userAccessLevel`: [`AccessLevel`](AccessLevel.md); \\}\n\nFull initiative returned to a caller, including members, tasks, and share state.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-createdat\"></a> `createdAt` | `string` | When the initiative was created. |\n| <a id=\"property-id\"></a> `id` | [`InitiativeId`](InitiativeId.md) | Opaque identifier. |\n| <a id=\"property-memberids\"></a> `memberIds` | [`MacroUserIdStr`](MacroUserIdStr.md)[] | Member user ids. The owner is never stored here. |\n| <a id=\"property-name\"></a> `name` | `string` | Display name. |\n| <a id=\"property-ownerid\"></a> `ownerId` | [`MacroUserIdStr`](MacroUserIdStr.md) | Owner of the initiative. |\n| <a id=\"property-sharepermission\"></a> `sharePermission` | [`SharePermissionV2`](SharePermissionV2.md) | Current share permission. |\n| <a id=\"property-taskids\"></a> `taskIds` | `string`[] | Task ids currently assigned to the initiative. |\n| <a id=\"property-updatedat\"></a> `updatedAt` | `string` | When the initiative was last updated. |\n| <a id=\"property-useraccesslevel\"></a> `userAccessLevel` | [`AccessLevel`](AccessLevel.md) | Caller's access level on this initiative. |\n\n\n<!-- generated/storage/types.gen/type-aliases/InitiativeId.md -->\n# Type Alias: InitiativeId\n\n> **InitiativeId** = `string`\n\nOpaque identifier for an initiative. Minted as UUIDv7 in application code.\n\n\n<!-- generated/storage/types.gen/type-aliases/LinkShare.md -->\n# Type Alias: LinkShare\n\n> **LinkShare** = `\"PUBLIC\"` \\| `\"TEAM\"`\n\nDefines who can access an item through its share link.\n\n\n<!-- generated/storage/types.gen/type-aliases/MacroUserIdStr.md -->\n# Type Alias: MacroUserIdStr\n\n> **MacroUserIdStr** = `string`\n\n\n<!-- generated/storage/types.gen/type-aliases/SetPropertyValue.md -->\n# Type Alias: SetPropertyValue\n\n> **SetPropertyValue** = \\{ `type`: `\"boolean\"`; `value`: `boolean`; \\} \\| \\{ `type`: `\"date\"`; `value`: `string`; \\} \\| \\{ `type`: `\"number\"`; `value`: `number`; \\} \\| \\{ `type`: `\"string\"`; `value`: `string`; \\} \\| \\{ `option_id`: `string`; `type`: `\"select_option\"`; \\} \\| \\{ `option_ids`: `string`[]; `type`: `\"multi_select_option\"`; \\} \\| \\{ `reference`: [`EntityReference`](EntityReference.md); `type`: `\"entity_reference\"`; \\} \\| \\{ `references`: [`EntityReference`](EntityReference.md)[]; `type`: `\"multi_entity_reference\"`; \\} \\| \\{ `type`: `\"link\"`; `url`: `string`; \\} \\| \\{ `type`: `\"multi_link\"`; `urls`: `string`[]; \\}\n\nType-safe enum for setting entity property values - provides compile-time validation.\n\n\n<!-- generated/storage/types.gen/type-aliases/SharePermissionV2.md -->\n# Type Alias: SharePermissionV2\n\n> **SharePermissionV2** = \\{ `channelSharePermissions?`: [`ChannelSharePermission`](ChannelSharePermission.md)[] \\| `null`; `id`: `string`; `linkShare?`: `null` \\| [`LinkShare`](LinkShare.md); `linkShareAccessLevel?`: `null` \\| [`AccessLevel`](AccessLevel.md); `owner`: `string`; `teamShareAccessLevel?`: `null` \\| [`AccessLevel`](AccessLevel.md); \\}\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-channelsharepermissions\"></a> `channelSharePermissions?` | [`ChannelSharePermission`](ChannelSharePermission.md)[] \\| `null` | The channel share permissions for the item |\n| <a id=\"property-id\"></a> `id` | `string` | The share permission id |\n| <a id=\"property-linkshare\"></a> `linkShare?` | `null` \\| [`LinkShare`](LinkShare.md) | - |\n| <a id=\"property-linkshareaccesslevel\"></a> `linkShareAccessLevel?` | `null` \\| [`AccessLevel`](AccessLevel.md) | - |\n| <a id=\"property-owner\"></a> `owner` | `string` | The owner of the item |\n| <a id=\"property-teamshareaccesslevel\"></a> `teamShareAccessLevel?` | `null` \\| [`AccessLevel`](AccessLevel.md) | - |\n\n\n<!-- src/entities/initiatives/initiative/classes/Initiative.md -->\n# Class: Initiative\n\nA group of tasks and members working toward an outcome.\n\n## Extends\n\n- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\\<[`InitiativeDetail`](../../../../../generated/storage/types.gen/type-aliases/InitiativeDetail.md)\\>\n\n## Properties\n\n| Property | Modifier | Type | Description | Inherited from |\n| ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-access\"></a> `access` | `readonly` | [`EntityAccess`](../../../sharing/access/classes/EntityAccess.md) | Access requests and direct user grants. | - |\n| <a id=\"property-accesslevel\"></a> `accessLevel` | `readonly` | () => `Promise`\\<[`AccessLevel`](../../../../../generated/storage/types.gen/type-aliases/AccessLevel.md)\\> | Current user's access. | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |\n| <a id=\"property-members\"></a> `members` | `readonly` | () => `Promise`\\<[`User`](../../../users/user/classes/User.md)[]\\> | Assigned members. | - |\n| <a id=\"property-name\"></a> `name` | `readonly` | () => `Promise`\\<`string`\\> | Display name. | - |\n| <a id=\"property-owner\"></a> `owner` | `readonly` | () => `Promise`\\<[`User`](../../../users/user/classes/User.md)\\> | Owner. | - |\n| <a id=\"property-sharepermissions\"></a> `sharePermissions` | `readonly` | () => `Promise`\\<[`SharePermissionV2`](../../../../../generated/storage/types.gen/type-aliases/SharePermissionV2.md)\\> | Sharing configuration. | - |\n| <a id=\"property-tasks\"></a> `tasks` | `readonly` | () => `Promise`\\<[`Task`](../../../tasks/task/classes/Task.md)[]\\> | Tasks in this initiative. | - |\n\n## Methods\n\n### delete()\n\n> **delete**(): `Promise`\\<`void`\\>\n\nDelete this initiative.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`InitiativeDetail`](../../../../../generated/storage/types.gen/type-aliases/InitiativeDetail.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`InitiativeDetail`](../../../../../generated/storage/types.gen/type-aliases/InitiativeDetail.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`InitiativeDetail`](../../../../../generated/storage/types.gen/type-aliases/InitiativeDetail.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)\n\n***\n\n### update()\n\n> **update**(`options`): `Promise`\\<`void`\\>\n\nUpdate the name, membership or sharing configuration.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | \\{ `members?`: [`User`](../../../users/user/classes/User.md)[]; `name?`: `string`; `sharePermission?`: [`SharePermissionOptions`](../../../sharing/permissions/type-aliases/SharePermissionOptions.md); \\} |\n| `options.members?` | [`User`](../../../users/user/classes/User.md)[] |\n| `options.name?` | `string` |\n| `options.sharePermission?` | [`SharePermissionOptions`](../../../sharing/permissions/type-aliases/SharePermissionOptions.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `id`): `Initiative`\n\nConstruct a lazy initiative handle.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `id` | `string` |\n\n#### Returns\n\n`Initiative`\n\n***\n\n### from()\n\n> `static` **from**(`client`, `record`): `Initiative`\n\nSeed from an initiative detail response.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `record` | [`InitiativeDetail`](../../../../../generated/storage/types.gen/type-aliases/InitiativeDetail.md) |\n\n#### Returns\n\n`Initiative`\n\n\n<!-- src/entities/initiatives/initiative/interfaces/InitiativeOptions.md -->\n# Interface: InitiativeOptions\n\nInitiative creation settings.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-description\"></a> `description?` | `string` | Collaborative description. |\n| <a id=\"property-members\"></a> `members?` | [`User`](../../../users/user/classes/User.md)[] | Members assigned to this initiative. |\n| <a id=\"property-name\"></a> `name` | `string` | Initiative name. |\n| <a id=\"property-propertyvalues\"></a> `propertyValues?` | [`InitialPropertyValue`](../../../../../generated/storage/types.gen/type-aliases/InitialPropertyValue.md)[] | Initial properties. |\n| <a id=\"property-sharewithteam\"></a> `shareWithTeam?` | `boolean` | Whether the current team can access it. |\n\n\n<!-- src/entities/initiatives/namespace/classes/InitiativeNamespace.md -->\n# Class: InitiativeNamespace\n\nInitiatives in the caller's workspace.\n\n## Constructors\n\n### Constructor\n\n> **new InitiativeNamespace**(`client`): `InitiativeNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`InitiativeNamespace`\n\n## Methods\n\n### byId()\n\n> **byId**(`id`): [`Initiative`](../../initiative/classes/Initiative.md)\n\nConstruct a lazy initiative handle.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`Initiative`](../../initiative/classes/Initiative.md)\n\n***\n\n### create()\n\n> **create**(`options`): `Promise`\\<[`Initiative`](../../initiative/classes/Initiative.md)\\>\n\nCreate an initiative.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | [`InitiativeOptions`](../../initiative/interfaces/InitiativeOptions.md) |\n\n#### Returns\n\n`Promise`\\<[`Initiative`](../../initiative/classes/Initiative.md)\\>\n\n***\n\n### list()\n\n> **list**(): `Promise`\\<[`Initiative`](../../initiative/classes/Initiative.md)[]\\>\n\nList accessible initiatives.\n\n#### Returns\n\n`Promise`\\<[`Initiative`](../../initiative/classes/Initiative.md)[]\\>\n"+ },+ {+ "name": "meetings",+ "description": "Create and manage meeting schedules, invitations and sharing links.",+ "overview": "<!-- src/entities/meetings/namespace/classes/MeetingNamespace.md -->\n# Class: MeetingNamespace\n\nMeeting schedules and invitation lookup.\n\n## Constructors\n\n### Constructor\n\n> **new MeetingNamespace**(`client`): `MeetingNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`MeetingNamespace`\n\n## Methods\n\n### active()\n\n> **active**(): `Promise`\\<[`Meeting`](../../meeting/classes/Meeting.md)[]\\>\n\nList active meetings.\n\n#### Returns\n\n`Promise`\\<[`Meeting`](../../meeting/classes/Meeting.md)[]\\>\n\n***\n\n### byId()\n\n> **byId**(`id`): [`Meeting`](../../meeting/classes/Meeting.md)\n\nConstruct a handle to one of the caller's newest 100 standalone meetings. Use lookup for invitations.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`Meeting`](../../meeting/classes/Meeting.md)\n\n***\n\n### create()\n\n> **create**(`options`): `Promise`\\<[`Meeting`](../../meeting/classes/Meeting.md)\\>\n\nCreate a meeting.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | `Omit`\\<[`CreateMeetingRequest`](../../../../../generated/storage/types.gen/type-aliases/CreateMeetingRequest.md), `\"preparationId\"`\\> |\n\n#### Returns\n\n`Promise`\\<[`Meeting`](../../meeting/classes/Meeting.md)\\>\n\n***\n\n### list()\n\n> **list**(): `Promise`\\<[`Meeting`](../../meeting/classes/Meeting.md)[]\\>\n\nList the caller's newest 100 standalone meetings.\n\n#### Returns\n\n`Promise`\\<[`Meeting`](../../meeting/classes/Meeting.md)[]\\>\n\n***\n\n### lookup()\n\n> **lookup**(`token`): `Promise`\\<[`Meeting`](../../meeting/classes/Meeting.md)\\>\n\nResolve a meeting's invitation token.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `token` | `string` |\n\n#### Returns\n\n`Promise`\\<[`Meeting`](../../meeting/classes/Meeting.md)\\>\n",+ "documentation": "# Macro SDK: meetings\n\nGenerated by TypeDoc. Paths below refer to the canonical Markdown hierarchy. Other entity handles are documented in their named section; request core for shared SDK helpers.\n\n<!-- generated/storage/types.gen/type-aliases/CreateMeetingRequest.md -->\n# Type Alias: CreateMeetingRequest\n\n> **CreateMeetingRequest** = \\{ `preparationId?`: `string` \\| `null`; `scheduledEnd?`: `string` \\| `null`; `scheduledStart?`: `string` \\| `null`; `title?`: `string` \\| `null`; \\}\n\nInputs for creating a meeting without starting its RTC room.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-preparationid\"></a> `preparationId?` | `string` \\| `null` | Optional unused room reserved by this actor on the setup screen. |\n| <a id=\"property-scheduledend\"></a> `scheduledEnd?` | `string` \\| `null` | Optional scheduled end. |\n| <a id=\"property-scheduledstart\"></a> `scheduledStart?` | `string` \\| `null` | Optional scheduled start. |\n| <a id=\"property-title\"></a> `title?` | `string` \\| `null` | Optional display title. |\n\n\n<!-- generated/storage/types.gen/type-aliases/Meeting.md -->\n# Type Alias: Meeting\n\n> **Meeting** = \\{ `callId?`: `string` \\| `null`; `channelId?`: `string` \\| `null`; `id`: `string`; `scheduledEnd?`: `string` \\| `null`; `scheduledStart?`: `string` \\| `null`; `shareToken`: [`MeetingToken`](MeetingToken.md); `title`: `string`; \\}\n\nPersistent meeting metadata. No channel contents or archived media are exposed.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-callid\"></a> `callId?` | `string` \\| `null` | Currently active call session, if any. |\n| <a id=\"property-channelid\"></a> `channelId?` | `string` \\| `null` | Associated channel, for links to existing channel calls only. |\n| <a id=\"property-id\"></a> `id` | `string` | Persistent meeting identifier. |\n| <a id=\"property-scheduledend\"></a> `scheduledEnd?` | `string` \\| `null` | Scheduled end, or none for an instant meeting. |\n| <a id=\"property-scheduledstart\"></a> `scheduledStart?` | `string` \\| `null` | Scheduled start, or none for an instant meeting. |\n| <a id=\"property-sharetoken\"></a> `shareToken` | [`MeetingToken`](MeetingToken.md) | Bearer capability embedded in the invitation URL. |\n| <a id=\"property-title\"></a> `title` | `string` | Human-readable meeting title. |\n\n\n<!-- generated/storage/types.gen/type-aliases/MeetingInvitePermissions.md -->\n# Type Alias: MeetingInvitePermissions\n\n> **MeetingInvitePermissions** = \\{ `canInvite`: `boolean`; \\}\n\nWhether the authenticated caller can invite teammates to this meeting.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-caninvite\"></a> `canInvite` | `boolean` | True for the owner of an uncancelled standalone meeting. |\n\n\n<!-- generated/storage/types.gen/type-aliases/MeetingToken.md -->\n# Type Alias: MeetingToken\n\n> **MeetingToken** = `string`\n\nAn invitation capability for joining a meeting's RTC room. Chat additionally\nrequires the resulting participant credential and current guest membership.\n\n\n<!-- generated/storage/types.gen/type-aliases/UpdateMeetingRequest.md -->\n# Type Alias: UpdateMeetingRequest\n\n> **UpdateMeetingRequest** = \\{ `clearSchedule?`: `boolean`; `scheduledEnd?`: `string` \\| `null`; `scheduledStart?`: `string` \\| `null`; `title?`: `string` \\| `null`; \\}\n\nChanges to a meeting's title or scheduled time; omitted values stay unchanged.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-clearschedule\"></a> `clearSchedule?` | `boolean` | Remove timed scheduling, for example when the calendar event becomes all-day. |\n| <a id=\"property-scheduledend\"></a> `scheduledEnd?` | `string` \\| `null` | Replacement scheduled end; requires a matching start. |\n| <a id=\"property-scheduledstart\"></a> `scheduledStart?` | `string` \\| `null` | Replacement scheduled start; requires a matching end. |\n| <a id=\"property-title\"></a> `title?` | `string` \\| `null` | Replacement title, when supplied. |\n\n\n<!-- src/entities/meetings/meeting/classes/Meeting.md -->\n# Class: Meeting\n\nA meeting's schedule and invitation link.\n\n## Extends\n\n- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\\<[`Meeting`](../../../../../generated/storage/types.gen/type-aliases/Meeting.md)\\>\n\n## Properties\n\n| Property | Modifier | Type | Description | Inherited from |\n| ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-call\"></a> `call` | `readonly` | () => `Promise`\\<[`CallRecord`](../../../calls/call-record/classes/CallRecord.md) \\| `undefined`\\> | Associated call record. | - |\n| <a id=\"property-channel\"></a> `channel` | `readonly` | () => `Promise`\\<[`Channel`](../../../channels/channel/classes/Channel.md) \\| `undefined`\\> | Associated channel. | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |\n| <a id=\"property-scheduledend\"></a> `scheduledEnd` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | Scheduled end. | - |\n| <a id=\"property-scheduledstart\"></a> `scheduledStart` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | Scheduled start. | - |\n| <a id=\"property-title\"></a> `title` | `readonly` | () => `Promise`\\<`string`\\> | Display title. | - |\n\n## Methods\n\n### cancel()\n\n> **cancel**(): `Promise`\\<`void`\\>\n\nCancel this meeting.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### invite()\n\n> **invite**(`email`): `Promise`\\<`void`\\>\n\nInvite an email address.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `email` | `string` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### invitePermissions()\n\n> **invitePermissions**(): `Promise`\\<[`MeetingInvitePermissions`](../../../../../generated/storage/types.gen/type-aliases/MeetingInvitePermissions.md)\\>\n\nWhether the caller can send invitations.\n\n#### Returns\n\n`Promise`\\<[`MeetingInvitePermissions`](../../../../../generated/storage/types.gen/type-aliases/MeetingInvitePermissions.md)\\>\n\n***\n\n### inviteUsers()\n\n> **inviteUsers**(`users`): `Promise`\\<`void`\\>\n\nInvite Macro users.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `users` | [`User`](../../../users/user/classes/User.md)[] |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`Meeting`](../../../../../generated/storage/types.gen/type-aliases/Meeting.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`Meeting`](../../../../../generated/storage/types.gen/type-aliases/Meeting.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`Meeting`](../../../../../generated/storage/types.gen/type-aliases/Meeting.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)\n\n***\n\n### update()\n\n> **update**(`options`): `Promise`\\<`void`\\>\n\nUpdate schedule or title.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | [`UpdateMeetingRequest`](../../../../../generated/storage/types.gen/type-aliases/UpdateMeetingRequest.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### webUrl()\n\n> **webUrl**(): `Promise`\\<`string`\\>\n\nShareable meeting link.\n\n#### Returns\n\n`Promise`\\<`string`\\>\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `id`): `Meeting`\n\nConstruct a lazy meeting handle.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `id` | `string` |\n\n#### Returns\n\n`Meeting`\n\n***\n\n### from()\n\n> `static` **from**(`client`, `record`): `Meeting`\n\nSeed a meeting from a server response.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `record` | [`Meeting`](../../../../../generated/storage/types.gen/type-aliases/Meeting.md) |\n\n#### Returns\n\n`Meeting`\n\n\n<!-- src/entities/meetings/namespace/classes/MeetingNamespace.md -->\n# Class: MeetingNamespace\n\nMeeting schedules and invitation lookup.\n\n## Constructors\n\n### Constructor\n\n> **new MeetingNamespace**(`client`): `MeetingNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`MeetingNamespace`\n\n## Methods\n\n### active()\n\n> **active**(): `Promise`\\<[`Meeting`](../../meeting/classes/Meeting.md)[]\\>\n\nList active meetings.\n\n#### Returns\n\n`Promise`\\<[`Meeting`](../../meeting/classes/Meeting.md)[]\\>\n\n***\n\n### byId()\n\n> **byId**(`id`): [`Meeting`](../../meeting/classes/Meeting.md)\n\nConstruct a handle to one of the caller's newest 100 standalone meetings. Use lookup for invitations.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`Meeting`](../../meeting/classes/Meeting.md)\n\n***\n\n### create()\n\n> **create**(`options`): `Promise`\\<[`Meeting`](../../meeting/classes/Meeting.md)\\>\n\nCreate a meeting.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | `Omit`\\<[`CreateMeetingRequest`](../../../../../generated/storage/types.gen/type-aliases/CreateMeetingRequest.md), `\"preparationId\"`\\> |\n\n#### Returns\n\n`Promise`\\<[`Meeting`](../../meeting/classes/Meeting.md)\\>\n\n***\n\n### list()\n\n> **list**(): `Promise`\\<[`Meeting`](../../meeting/classes/Meeting.md)[]\\>\n\nList the caller's newest 100 standalone meetings.\n\n#### Returns\n\n`Promise`\\<[`Meeting`](../../meeting/classes/Meeting.md)[]\\>\n\n***\n\n### lookup()\n\n> **lookup**(`token`): `Promise`\\<[`Meeting`](../../meeting/classes/Meeting.md)\\>\n\nResolve a meeting's invitation token.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `token` | `string` |\n\n#### Returns\n\n`Promise`\\<[`Meeting`](../../meeting/classes/Meeting.md)\\>\n"+ },+ {+ "name": "routines",+ "description": "Create scheduled and event-triggered agent routines and inspect executions.",+ "overview": "<!-- src/entities/routines/namespace/classes/RoutineNamespace.md -->\n# Class: RoutineNamespace\n\nScheduled and event-triggered routines.\n\n## Constructors\n\n### Constructor\n\n> **new RoutineNamespace**(`client`): `RoutineNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`RoutineNamespace`\n\n## Methods\n\n### byId()\n\n> **byId**(`id`): [`Routine`](../../routine/classes/Routine.md)\n\nConstruct a lazy routine handle.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`Routine`](../../routine/classes/Routine.md)\n\n***\n\n### create()\n\n> **create**(`options`): `Promise`\\<[`Routine`](../../routine/classes/Routine.md)\\>\n\nCreate an agent routine.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | [`RoutineOptions`](../../routine/interfaces/RoutineOptions.md) |\n\n#### Returns\n\n`Promise`\\<[`Routine`](../../routine/classes/Routine.md)\\>\n\n***\n\n### list()\n\n> **list**(`options?`): `Promise`\\<[`Routine`](../../routine/classes/Routine.md)[]\\>\n\nList routines, optionally including event triggers.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options?` | \\{ `includeEvents?`: `boolean`; \\} |\n| `options.includeEvents?` | `boolean` |\n\n#### Returns\n\n`Promise`\\<[`Routine`](../../routine/classes/Routine.md)[]\\>\n\n\n<!-- src/entities/routines/routine/interfaces/RoutineOptions.md -->\n# Interface: RoutineOptions\n\nConfiguration of an agent routine.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-agent\"></a> `agent?` | [`Agent`](../../../agents/agent/classes/Agent.md) | Agent to run the task. |\n| <a id=\"property-enabled\"></a> `enabled?` | `boolean` | Whether triggers can start executions. Defaults to true on creation. |\n| <a id=\"property-model\"></a> `model?` | `string` | Model override. |\n| <a id=\"property-name\"></a> `name` | `string` | Display name. |\n| <a id=\"property-prompt\"></a> `prompt` | `string` | Instructions delivered to the agent. |\n| <a id=\"property-trigger\"></a> `trigger` | [`RoutineTriggerOptions`](../type-aliases/RoutineTriggerOptions.md) | Schedules or Macro events that start the routine. |\n| <a id=\"property-userprompt\"></a> `userPrompt` | `string` | Original user instructions. |\n\n\n<!-- src/entities/routines/routine/type-aliases/RoutineEventFilter.md -->\n# Type Alias: RoutineEventFilter\n\n> **RoutineEventFilter** = `Omit`\\<[`EventFilter`](../../../../../generated/scheduled-action/types.gen/type-aliases/EventFilter.md), `\"ids\"` \\| `\"condition\"`\\> & \\{ `condition?`: `string`; `entities?`: [`EntityReference`](../../../reference/type-aliases/EntityReference.md)[]; \\}\n\nAn event selector references resources by typed handles.\n\n## Type Declaration\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `condition?` | `string` | Optional yes/no condition on the triggering content. |\n| `entities?` | [`EntityReference`](../../../reference/type-aliases/EntityReference.md)[] | Resource selectors for these events. Omit to match all resources. |\n\n\n<!-- src/entities/routines/routine/type-aliases/RoutineTriggerOptions.md -->\n# Type Alias: RoutineTriggerOptions\n\n> **RoutineTriggerOptions** = [`SingleRoutineTrigger`](SingleRoutineTrigger.md) \\| \\{ `triggers`: [`SingleRoutineTrigger`](SingleRoutineTrigger.md)[]; `type`: `\"multiple\"`; \\}\n\nOne or multiple routine triggers.\n\n\n<!-- src/entities/routines/routine/type-aliases/SingleRoutineTrigger.md -->\n# Type Alias: SingleRoutineTrigger\n\n> **SingleRoutineTrigger** = `Extract`\\<[`RoutineTrigger`](../../../../../generated/scheduled-action/types.gen/type-aliases/RoutineTrigger.md), \\{ `type`: `\"cron\"`; \\}\\> \\| \\{ `filters`: [`RoutineEventFilter`](RoutineEventFilter.md)[]; `type`: `\"events\"`; \\}\n\nOne schedule or set of event selectors.\n",+ "documentation": "# Macro SDK: routines\n\nGenerated by TypeDoc. Paths below refer to the canonical Markdown hierarchy. Other entity handles are documented in their named section; request core for shared SDK helpers.\n\n<!-- generated/scheduled-action/types.gen/type-aliases/ActionExecutionRecord.md -->\n# Type Alias: ActionExecutionRecord\n\n> **ActionExecutionRecord** = \\{ `action_id`: `string`; `created_at`: `string`; `end_time`: `string`; `id?`: `string` \\| `null`; `is_success`: `boolean`; `resource_id?`: `string` \\| `null`; `result`: \\{\\[`key`: `string`\\]: `unknown`; \\}; `start_time`: `string`; \\}\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-action_id\"></a> `action_id` | `string` | - |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | - |\n| <a id=\"property-end_time\"></a> `end_time` | `string` | - |\n| <a id=\"property-id\"></a> `id?` | `string` \\| `null` | - |\n| <a id=\"property-is_success\"></a> `is_success` | `boolean` | - |\n| <a id=\"property-resource_id\"></a> `resource_id?` | `string` \\| `null` | ID of the primary resource produced by this run. Its type is recorded in `result`, independently of the routine's current configuration. |\n| <a id=\"property-result\"></a> `result` | \\{\\[`key`: `string`\\]: `unknown`; \\} | - |\n| <a id=\"property-start_time\"></a> `start_time` | `string` | - |\n\n\n<!-- generated/scheduled-action/types.gen/type-aliases/ActionKind.md -->\n# Type Alias: ActionKind\n\n> **ActionKind** = `\"Agent\"`\n\n\n<!-- generated/scheduled-action/types.gen/type-aliases/ActionTrigger.md -->\n# Type Alias: ActionTrigger\n\n> **ActionTrigger** = \\{ `schedule`: [`Schedule`](Schedule.md); `timezone`: `string`; `type`: `\"cron\"`; \\} \\| \\{ `filters`: [`EventFilters`](EventFilters.md); `type`: `\"events\"`; \\} \\| \\{ `triggers`: [`RoutineTriggers`](RoutineTriggers.md); `type`: `\"multiple\"`; \\}\n\nA routine may run on one trigger or any of several schedules and Macro events.\n\n\n<!-- generated/scheduled-action/types.gen/type-aliases/AgentTaskAgent.md -->\n# Type Alias: AgentTaskAgent\n\n> **AgentTaskAgent** = \\{ `bot_id`: `string`; \\}\n\nA persona selection, independent of its runtime and current default model.\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-bot_id\"></a> `bot_id` | `string` |\n\n\n<!-- generated/scheduled-action/types.gen/type-aliases/EventFilter.md -->\n# Type Alias: EventFilter\n\n> **EventFilter** = \\{ `condition?`: `string` \\| `null`; `events`: [`EventName`](EventName.md)[]; `ids?`: `string`[] \\| `null`; \\}\n\nAn event name AND an entity ID must match within the same filter. A\ncondition further requires the event's content to answer it with yes.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-condition\"></a> `condition?` | `string` \\| `null` | Yes/no question about the triggering content, e.g. \"Is this email an invoice?\". The routine runs only when the answer is yes. |\n| <a id=\"property-events\"></a> `events` | [`EventName`](EventName.md)[] | - |\n| <a id=\"property-ids\"></a> `ids?` | `string`[] \\| `null` | - |\n\n\n<!-- generated/scheduled-action/types.gen/type-aliases/EventFilters.md -->\n# Type Alias: EventFilters\n\n> **EventFilters** = [`EventFilter`](EventFilter.md)[]\n\nBounded nonempty OR of filters, canonicalized to remove duplicates.\n\n\n<!-- generated/scheduled-action/types.gen/type-aliases/EventName.md -->\n# Type Alias: EventName\n\n> **EventName** = `\"document.created\"` \\| `\"document.updated\"` \\| `\"document.deleted\"` \\| `\"task.created\"` \\| `\"task.status_changed\"` \\| `\"task.priority_changed\"` \\| `\"task.property_changed\"` \\| `\"email.message_received\"` \\| `\"channel.created\"` \\| `\"channel.message_posted\"` \\| `\"channel.mentioned\"` \\| `\"channel.message_patched\"` \\| `\"channel.message_attachment_created\"` \\| `\"call.started\"` \\| `\"call.ended\"`\n\nClosed allowlist: unknown names, deletions and ambiguous attribution are not\nselectors. Adding a broker variant does not automatically enable routines.\n\n\n<!-- generated/scheduled-action/types.gen/type-aliases/RoutineTrigger.md -->\n# Type Alias: RoutineTrigger\n\n> **RoutineTrigger** = \\{ `schedule`: [`Schedule`](Schedule.md); `timezone`: `string`; `type`: `\"cron\"`; \\} \\| \\{ `filters`: [`EventFilters`](EventFilters.md); `type`: `\"events\"`; \\}\n\nAn individual trigger in a routine's trigger list.\n\n\n<!-- generated/scheduled-action/types.gen/type-aliases/RoutineTriggers.md -->\n# Type Alias: RoutineTriggers\n\n> **RoutineTriggers** = [`RoutineTrigger`](RoutineTrigger.md)[]\n\nBounded schedules and one combined set of event filters.\n\n\n<!-- generated/scheduled-action/types.gen/type-aliases/Schedule.md -->\n# Type Alias: Schedule\n\n> **Schedule** = `string`\n\n\n<!-- generated/scheduled-action/types.gen/type-aliases/ScheduledAction.md -->\n# Type Alias: ScheduledAction\n\n> **ScheduledAction** = \\{ `claimed?`: `string` \\| `null`; `configuration_revision`: `number`; `created_at`: `string`; `enabled`: `boolean`; `event_activated_at?`: `string` \\| `null`; `id?`: `string` \\| `null`; `kind`: [`ActionKind`](ActionKind.md); `name`: `string`; `next_run_at?`: `string` \\| `null`; `owner`: `string`; `task`: \\{\\[`key`: `string`\\]: `unknown`; \\}; `trigger`: [`ActionTrigger`](ActionTrigger.md); `updated_at`: `string`; \\}\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-claimed\"></a> `claimed?` | `string` \\| `null` | - |\n| <a id=\"property-configuration_revision\"></a> `configuration_revision` | `number` | Independent of execution bookkeeping in `updated_at`. |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | - |\n| <a id=\"property-enabled\"></a> `enabled` | `boolean` | When false, automatic dispatch skips this action. `run_now` remains available regardless. |\n| <a id=\"property-event_activated_at\"></a> `event_activated_at?` | `string` \\| `null` | Event publication boundary; absent for cron actions. |\n| <a id=\"property-id\"></a> `id?` | `string` \\| `null` | - |\n| <a id=\"property-kind\"></a> `kind` | [`ActionKind`](ActionKind.md) | - |\n| <a id=\"property-name\"></a> `name` | `string` | - |\n| <a id=\"property-next_run_at\"></a> `next_run_at?` | `string` \\| `null` | Next cron firing, absent for event-triggered actions. |\n| <a id=\"property-owner\"></a> `owner` | `string` | Who the action belongs to. Every action is user-owned today, but the type no longer says so: the principal string on the wire and in the `owner` column is the same, and a bot- or team-owned row decodes rather than failing to parse. |\n| <a id=\"property-task\"></a> `task` | \\{\\[`key`: `string`\\]: `unknown`; \\} | - |\n| <a id=\"property-trigger\"></a> `trigger` | [`ActionTrigger`](ActionTrigger.md) | - |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` | - |\n\n\n<!-- generated/scheduled-action/types.gen/type-aliases/ScheduledActionResponse.md -->\n# Type Alias: ScheduledActionResponse\n\n> **ScheduledActionResponse** = [`ScheduledAction`](ScheduledAction.md) & \\{ `schedule?`: `string` \\| `null`; `timezone?`: `string` \\| `null`; \\}\n\nCanonical trigger plus deprecated cron fields for existing clients. Event\nresponses omit legacy fields rather than inventing a schedule or timezone.\n\n## Type Declaration\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `schedule?` | `string` \\| `null` | Deprecated: use `trigger.schedule`. Present only for cron actions. **Deprecated** |\n| `timezone?` | `string` \\| `null` | Deprecated: use `trigger.timezone`. Present only for cron actions. **Deprecated** |\n\n\n<!-- src/entities/routines/namespace/classes/RoutineNamespace.md -->\n# Class: RoutineNamespace\n\nScheduled and event-triggered routines.\n\n## Constructors\n\n### Constructor\n\n> **new RoutineNamespace**(`client`): `RoutineNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`RoutineNamespace`\n\n## Methods\n\n### byId()\n\n> **byId**(`id`): [`Routine`](../../routine/classes/Routine.md)\n\nConstruct a lazy routine handle.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`Routine`](../../routine/classes/Routine.md)\n\n***\n\n### create()\n\n> **create**(`options`): `Promise`\\<[`Routine`](../../routine/classes/Routine.md)\\>\n\nCreate an agent routine.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | [`RoutineOptions`](../../routine/interfaces/RoutineOptions.md) |\n\n#### Returns\n\n`Promise`\\<[`Routine`](../../routine/classes/Routine.md)\\>\n\n***\n\n### list()\n\n> **list**(`options?`): `Promise`\\<[`Routine`](../../routine/classes/Routine.md)[]\\>\n\nList routines, optionally including event triggers.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options?` | \\{ `includeEvents?`: `boolean`; \\} |\n| `options.includeEvents?` | `boolean` |\n\n#### Returns\n\n`Promise`\\<[`Routine`](../../routine/classes/Routine.md)[]\\>\n\n\n<!-- src/entities/routines/routine/classes/Routine.md -->\n# Class: Routine\n\nA scheduled or event-triggered agent task.\n\n## Extends\n\n- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\\<[`ScheduledActionResponse`](../../../../../generated/scheduled-action/types.gen/type-aliases/ScheduledActionResponse.md)\\>\n\n## Properties\n\n| Property | Modifier | Type | Description | Inherited from |\n| ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-enabled\"></a> `enabled` | `readonly` | () => `Promise`\\<`boolean`\\> | Whether the routine is enabled. | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |\n| <a id=\"property-name\"></a> `name` | `readonly` | () => `Promise`\\<`string`\\> | Routine name. | - |\n| <a id=\"property-nextrunat\"></a> `nextRunAt` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | Next scheduled execution. | - |\n| <a id=\"property-owner\"></a> `owner` | `readonly` | () => `Promise`\\<[`User`](../../../users/user/classes/User.md)\\> | Routine owner. | - |\n| <a id=\"property-revision\"></a> `revision` | `readonly` | () => `Promise`\\<`number`\\> | Configuration revision. | - |\n| <a id=\"property-trigger\"></a> `trigger` | `readonly` | () => `Promise`\\<[`ActionTrigger`](../../../../../generated/scheduled-action/types.gen/type-aliases/ActionTrigger.md)\\> | Configured triggers. | - |\n\n## Methods\n\n### delete()\n\n> **delete**(): `Promise`\\<`void`\\>\n\nDelete the routine.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### execute()\n\n> **execute**(): `Promise`\\<[`AgentSession`](../../../agent-sessions/agent-session/classes/AgentSession.md) \\| [`Chat`](../../../chats/chat/classes/Chat.md) \\| `undefined`\\>\n\nStart an execution immediately and return its transcript handle if available.\n\n#### Returns\n\n`Promise`\\<[`AgentSession`](../../../agent-sessions/agent-session/classes/AgentSession.md) \\| [`Chat`](../../../chats/chat/classes/Chat.md) \\| `undefined`\\>\n\n***\n\n### history()\n\n> **history**(): `Promise`\\<[`RoutineExecution`](RoutineExecution.md)[]\\>\n\nCompleted executions, with their routine scoped identity.\n\n#### Returns\n\n`Promise`\\<[`RoutineExecution`](RoutineExecution.md)[]\\>\n\n***\n\n### setEnabled()\n\n> **setEnabled**(`enabled`): `Promise`\\<`void`\\>\n\nEnable or disable triggering.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `enabled` | `boolean` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`ScheduledActionResponse`](../../../../../generated/scheduled-action/types.gen/type-aliases/ScheduledActionResponse.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`ScheduledActionResponse`](../../../../../generated/scheduled-action/types.gen/type-aliases/ScheduledActionResponse.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`ScheduledActionResponse`](../../../../../generated/scheduled-action/types.gen/type-aliases/ScheduledActionResponse.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)\n\n***\n\n### update()\n\n> **update**(`options`): `Promise`\\<`void`\\>\n\nReplace the routine's task and trigger configuration.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | [`RoutineOptions`](../interfaces/RoutineOptions.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `id`): `Routine`\n\nConstruct a lazy routine handle.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `id` | `string` |\n\n#### Returns\n\n`Routine`\n\n***\n\n### from()\n\n> `static` **from**(`client`, `record`): `Routine`\n\nSeed a handle from a server record.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `record` | [`ScheduledActionResponse`](../../../../../generated/scheduled-action/types.gen/type-aliases/ScheduledActionResponse.md) |\n\n#### Returns\n\n`Routine`\n\n\n<!-- src/entities/routines/routine/classes/RoutineExecution.md -->\n# Class: RoutineExecution\n\nA completed routine execution, as recorded by the service.\n\n## Constructors\n\n### Constructor\n\n> **new RoutineExecution**(`routine`, `record`): `RoutineExecution`\n\n#### Parameters\n\n| Parameter | Type | Description |\n| ------ | ------ | ------ |\n| `routine` | [`Routine`](Routine.md) | Parent routine. |\n| `record` | [`ActionExecutionRecord`](../../../../../generated/scheduled-action/types.gen/type-aliases/ActionExecutionRecord.md) | Execution snapshot. |\n\n#### Returns\n\n`RoutineExecution`\n\n## Properties\n\n| Property | Modifier | Type | Description |\n| ------ | ------ | ------ | ------ |\n| <a id=\"property-record\"></a> `record` | `readonly` | [`ActionExecutionRecord`](../../../../../generated/scheduled-action/types.gen/type-aliases/ActionExecutionRecord.md) | Execution snapshot. |\n| <a id=\"property-routine\"></a> `routine` | `readonly` | [`Routine`](Routine.md) | Parent routine. |\n\n## Accessors\n\n### id\n\n#### Get Signature\n\n> **get** **id**(): `string` \\| `undefined`\n\nExecution identity, when assigned.\n\n##### Returns\n\n`string` \\| `undefined`\n\n## Methods\n\n### toJSON()\n\n> **toJSON**(): \\{ `action_id`: `string`; `created_at`: `string`; `end_time`: `string`; `id?`: `string` \\| `null`; `is_success`: `boolean`; `resource_id?`: `string` \\| `null`; `result`: \\{\\[`key`: `string`\\]: `unknown`; \\}; `routine`: `string`; `start_time`: `string`; \\}\n\nSerialize without the authenticated client.\n\n#### Returns\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `action_id` | `string` | - |\n| `created_at` | `string` | - |\n| `end_time` | `string` | - |\n| `id?` | `string` \\| `null` | - |\n| `is_success` | `boolean` | - |\n| `resource_id?` | `string` \\| `null` | ID of the primary resource produced by this run. Its type is recorded in `result`, independently of the routine's current configuration. |\n| `result` | \\{\\[`key`: `string`\\]: `unknown`; \\} | - |\n| `routine` | `string` | - |\n| `start_time` | `string` | - |\n\n\n<!-- src/entities/routines/routine/functions/routineBody.md -->\n# Function: routineBody()\n\n> **routineBody**(`options`): \\{ `enabled`: `boolean` \\| `undefined`; `kind`: `\"Agent\"`; `name`: `string`; `task`: \\{ `agent?`: [`AgentTaskAgent`](../../../../../generated/scheduled-action/types.gen/type-aliases/AgentTaskAgent.md) \\| `null`; `model?`: `string` \\| `null`; `prompt`: `string`; `user_prompt`: `string`; \\}; `trigger`: [`ActionTrigger`](../../../../../generated/scheduled-action/types.gen/type-aliases/ActionTrigger.md); \\}\n\nTranslate typed routine options into the generated wire contract.\n\n## Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | [`RoutineOptions`](../interfaces/RoutineOptions.md) |\n\n## Returns\n\n\\{ `enabled`: `boolean` \\| `undefined`; `kind`: `\"Agent\"`; `name`: `string`; `task`: \\{ `agent?`: [`AgentTaskAgent`](../../../../../generated/scheduled-action/types.gen/type-aliases/AgentTaskAgent.md) \\| `null`; `model?`: `string` \\| `null`; `prompt`: `string`; `user_prompt`: `string`; \\}; `trigger`: [`ActionTrigger`](../../../../../generated/scheduled-action/types.gen/type-aliases/ActionTrigger.md); \\}\n\n| Name | Type | Default value |\n| ------ | ------ | ------ |\n| `enabled` | `boolean` \\| `undefined` | `options.enabled` |\n| `kind` | `\"Agent\"` | - |\n| `name` | `string` | `options.name` |\n| `task` | \\{ `agent?`: [`AgentTaskAgent`](../../../../../generated/scheduled-action/types.gen/type-aliases/AgentTaskAgent.md) \\| `null`; `model?`: `string` \\| `null`; `prompt`: `string`; `user_prompt`: `string`; \\} | - |\n| `task.agent?` | [`AgentTaskAgent`](../../../../../generated/scheduled-action/types.gen/type-aliases/AgentTaskAgent.md) \\| `null` | - |\n| `task.model?` | `string` \\| `null` | - |\n| `task.prompt` | `string` | - |\n| `task.user_prompt` | `string` | - |\n| `trigger` | [`ActionTrigger`](../../../../../generated/scheduled-action/types.gen/type-aliases/ActionTrigger.md) | - |\n\n\n<!-- src/entities/routines/routine/interfaces/RoutineOptions.md -->\n# Interface: RoutineOptions\n\nConfiguration of an agent routine.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-agent\"></a> `agent?` | [`Agent`](../../../agents/agent/classes/Agent.md) | Agent to run the task. |\n| <a id=\"property-enabled\"></a> `enabled?` | `boolean` | Whether triggers can start executions. Defaults to true on creation. |\n| <a id=\"property-model\"></a> `model?` | `string` | Model override. |\n| <a id=\"property-name\"></a> `name` | `string` | Display name. |\n| <a id=\"property-prompt\"></a> `prompt` | `string` | Instructions delivered to the agent. |\n| <a id=\"property-trigger\"></a> `trigger` | [`RoutineTriggerOptions`](../type-aliases/RoutineTriggerOptions.md) | Schedules or Macro events that start the routine. |\n| <a id=\"property-userprompt\"></a> `userPrompt` | `string` | Original user instructions. |\n\n\n<!-- src/entities/routines/routine/type-aliases/RoutineEventFilter.md -->\n# Type Alias: RoutineEventFilter\n\n> **RoutineEventFilter** = `Omit`\\<[`EventFilter`](../../../../../generated/scheduled-action/types.gen/type-aliases/EventFilter.md), `\"ids\"` \\| `\"condition\"`\\> & \\{ `condition?`: `string`; `entities?`: [`EntityReference`](../../../reference/type-aliases/EntityReference.md)[]; \\}\n\nAn event selector references resources by typed handles.\n\n## Type Declaration\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `condition?` | `string` | Optional yes/no condition on the triggering content. |\n| `entities?` | [`EntityReference`](../../../reference/type-aliases/EntityReference.md)[] | Resource selectors for these events. Omit to match all resources. |\n\n\n<!-- src/entities/routines/routine/type-aliases/RoutineTriggerOptions.md -->\n# Type Alias: RoutineTriggerOptions\n\n> **RoutineTriggerOptions** = [`SingleRoutineTrigger`](SingleRoutineTrigger.md) \\| \\{ `triggers`: [`SingleRoutineTrigger`](SingleRoutineTrigger.md)[]; `type`: `\"multiple\"`; \\}\n\nOne or multiple routine triggers.\n\n\n<!-- src/entities/routines/routine/type-aliases/SingleRoutineTrigger.md -->\n# Type Alias: SingleRoutineTrigger\n\n> **SingleRoutineTrigger** = `Extract`\\<[`RoutineTrigger`](../../../../../generated/scheduled-action/types.gen/type-aliases/RoutineTrigger.md), \\{ `type`: `\"cron\"`; \\}\\> \\| \\{ `filters`: [`RoutineEventFilter`](RoutineEventFilter.md)[]; `type`: `\"events\"`; \\}\n\nOne schedule or set of event selectors.\n"+ },+ {+ "name": "unfurls",+ "description": "Read URL preview metadata.",+ "overview": "<!-- src/entities/unfurls/namespace/classes/UnfurlNamespace.md -->\n# Class: UnfurlNamespace\n\nURL metadata lookup.\n\n## Constructors\n\n### Constructor\n\n> **new UnfurlNamespace**(`client`): `UnfurlNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`UnfurlNamespace`\n\n## Methods\n\n### bulk()\n\n> **bulk**(`urls`): `Promise`\\<[`GetUnfurlBulkResponse`](../../../../../generated/unfurl/types.gen/type-aliases/GetUnfurlBulkResponse.md)\\>\n\nRead metadata for multiple URLs in one request.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `urls` | `string`[] |\n\n#### Returns\n\n`Promise`\\<[`GetUnfurlBulkResponse`](../../../../../generated/unfurl/types.gen/type-aliases/GetUnfurlBulkResponse.md)\\>\n\n***\n\n### get()\n\n> **get**(`url`): `Promise`\\<[`GetUnfurlResponse`](../../../../../generated/unfurl/types.gen/type-aliases/GetUnfurlResponse.md)\\>\n\nRead title, description and preview metadata for a URL.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `url` | `string` |\n\n#### Returns\n\n`Promise`\\<[`GetUnfurlResponse`](../../../../../generated/unfurl/types.gen/type-aliases/GetUnfurlResponse.md)\\>\n",+ "documentation": "# Macro SDK: unfurls\n\nGenerated by TypeDoc. Paths below refer to the canonical Markdown hierarchy. Other entity handles are documented in their named section; request core for shared SDK helpers.\n\n<!-- generated/unfurl/types.gen/type-aliases/GetUnfurlBulkResponse.md -->\n# Type Alias: GetUnfurlBulkResponse\n\n> **GetUnfurlBulkResponse** = \\{ `responses`: [`Vec`](Vec.md); \\}\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-responses\"></a> `responses` | [`Vec`](Vec.md) |\n\n\n<!-- generated/unfurl/types.gen/type-aliases/GetUnfurlResponse.md -->\n# Type Alias: GetUnfurlResponse\n\n> **GetUnfurlResponse** = \\{ `description?`: `string` \\| `null`; `embed_type?`: [`UnfurlEmbedType`](UnfurlEmbedType.md); `embed_url?`: `string` \\| `null`; `favicon_url?`: `string` \\| `null`; `image_url?`: `string` \\| `null`; `title`: `string`; `url`: `string`; \\}\n\nUnfurl response for a single URL: the URL itself plus any metadata that\nwas extracted from the page's `<head>` (title, description, image,\nfavicon).\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-description\"></a> `description?` | `string` \\| `null` | The page description (from `og:description`), if any. |\n| <a id=\"property-embed_type\"></a> `embed_type?` | [`UnfurlEmbedType`](UnfurlEmbedType.md) | The type of embeddable content, if the URL supports iframe embedding. |\n| <a id=\"property-embed_url\"></a> `embed_url?` | `string` \\| `null` | The iframe-embeddable URL for services like Loom or Supercut. |\n| <a id=\"property-favicon_url\"></a> `favicon_url?` | `string` \\| `null` | The page's favicon URL, if any. |\n| <a id=\"property-image_url\"></a> `image_url?` | `string` \\| `null` | The page's preview image URL (from `og:image`), if any. |\n| <a id=\"property-title\"></a> `title` | `string` | The page title (from custom URL parser, Open Graph, or `<title>`). |\n| <a id=\"property-url\"></a> `url` | `string` | The URL that was unfurled. |\n\n\n<!-- generated/unfurl/types.gen/type-aliases/UnfurlEmbedType.md -->\n# Type Alias: UnfurlEmbedType\n\n> **UnfurlEmbedType** = `\"None\"` \\| `\"Video\"`\n\nThe type of embeddable content for services that support iframe embedding.\n\n\n<!-- generated/unfurl/types.gen/type-aliases/Vec.md -->\n# Type Alias: Vec\n\n> **Vec** = (`null` \\| \\{ `description?`: `string` \\| `null`; `embed_type?`: [`UnfurlEmbedType`](UnfurlEmbedType.md); `embed_url?`: `string` \\| `null`; `favicon_url?`: `string` \\| `null`; `image_url?`: `string` \\| `null`; `title`: `string`; `url`: `string`; \\})[]\n\n\n<!-- src/entities/unfurls/namespace/classes/UnfurlNamespace.md -->\n# Class: UnfurlNamespace\n\nURL metadata lookup.\n\n## Constructors\n\n### Constructor\n\n> **new UnfurlNamespace**(`client`): `UnfurlNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`UnfurlNamespace`\n\n## Methods\n\n### bulk()\n\n> **bulk**(`urls`): `Promise`\\<[`GetUnfurlBulkResponse`](../../../../../generated/unfurl/types.gen/type-aliases/GetUnfurlBulkResponse.md)\\>\n\nRead metadata for multiple URLs in one request.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `urls` | `string`[] |\n\n#### Returns\n\n`Promise`\\<[`GetUnfurlBulkResponse`](../../../../../generated/unfurl/types.gen/type-aliases/GetUnfurlBulkResponse.md)\\>\n\n***\n\n### get()\n\n> **get**(`url`): `Promise`\\<[`GetUnfurlResponse`](../../../../../generated/unfurl/types.gen/type-aliases/GetUnfurlResponse.md)\\>\n\nRead title, description and preview metadata for a URL.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `url` | `string` |\n\n#### Returns\n\n`Promise`\\<[`GetUnfurlResponse`](../../../../../generated/unfurl/types.gen/type-aliases/GetUnfurlResponse.md)\\>\n"},{"name": "ai",- "description": "Generate structured objects and classify supplied content with Jev.",- "overview": "<!-- src/entities/ai/namespace/classes/AiNamespace.md -->\n# Class: AiNamespace\n\nShared cognition endpoints, charged to the authenticated acting user.\n\n## Constructors\n\n### Constructor\n\n> **new AiNamespace**(`client`): `AiNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`AiNamespace`\n\n## Methods\n\n### decide()\n\n> **decide**(`request`): `Promise`\\<[`DecisionResponse`](../../../../../generated/cognition/types.gen/type-aliases/DecisionResponse.md)\\>\n\nAsk named yes/no questions about JSON input. Each probability estimates\nyes, from 0 to 1. This classifies supplied data without running tools.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `request` | [`DecisionRequest`](../../../../../generated/cognition/types.gen/type-aliases/DecisionRequest.md) |\n\n#### Returns\n\n`Promise`\\<[`DecisionResponse`](../../../../../generated/cognition/types.gen/type-aliases/DecisionResponse.md)\\>\n\n***\n\n### structuredCompletion()\n\n> **structuredCompletion**(`request`): `Promise`\\<[`StructuredCompletionResponse`](../../../../../generated/cognition/types.gen/type-aliases/StructuredCompletionResponse.md)\\>\n\nGenerate an answer matching a JSON Schema. Set toolset to { type: 'none' }\nto use only supplied context. Other toolsets can perform the requested\nactions; always inspect outcome and toolActivity, including interruptions.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `request` | [`StructuredCompletionRequest`](../../../../../generated/cognition/types.gen/type-aliases/StructuredCompletionRequest.md) |\n\n#### Returns\n\n`Promise`\\<[`StructuredCompletionResponse`](../../../../../generated/cognition/types.gen/type-aliases/StructuredCompletionResponse.md)\\>\n",- "documentation": "# Macro SDK: ai\n\nGenerated by TypeDoc. Paths below refer to the canonical Markdown hierarchy. Other entity handles are documented in their named section; request core for shared SDK helpers.\n\n<!-- generated/cognition/types.gen/type-aliases/DatabaseChange.md -->\n# Type Alias: DatabaseChange\n\n> **DatabaseChange** = \\{ `kind`: `\"none\"`; \\} \\| \\{ `kind`: `\"schema\"`; \\} \\| \\{ `count`: `number`; `kind`: `\"rows\"`; \\}\n\nWhat a successful tool call committed to the user's databases.\n\n\n<!-- generated/cognition/types.gen/type-aliases/DecisionRequest.md -->\n# Type Alias: DecisionRequest\n\n> **DecisionRequest** = \\{ `input`: `unknown`; `questions`: \\{\\[`key`: `string`\\]: `string`; \\}; \\}\n\nNamed yes/no questions to evaluate against one arbitrary JSON input.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-input\"></a> `input` | `unknown` | Data to classify. The entire compact request must fit in 64 KiB. |\n| <a id=\"property-questions\"></a> `questions` | \\{\\[`key`: `string`\\]: `string`; \\} | One to 32 questions, each at most 500 characters. Keys must be nonblank and at most 80 UTF-8 bytes; they are preserved in the response. |\n\n\n<!-- generated/cognition/types.gen/type-aliases/DecisionResponse.md -->\n# Type Alias: DecisionResponse\n\n> **DecisionResponse** = \\{ `probabilities`: \\{\\[`key`: `string`\\]: `number`; \\}; \\}\n\nThe probability of yes for every requested question, under its original key.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-probabilities\"></a> `probabilities` | \\{\\[`key`: `string`\\]: `number`; \\} | Probabilities between zero and one, inclusive; not boolean decisions. |\n\n\n<!-- generated/cognition/types.gen/type-aliases/DynamicSchema.md -->\n# Type Alias: DynamicSchema\n\n> **DynamicSchema** = \\{ `description?`: `string` \\| `null`; `name`: `string`; `schema`: `unknown`; \\}\n\nSchema definition for dynamic structured completions.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-description\"></a> `description?` | `string` \\| `null` | Optional description of what the schema represents. |\n| <a id=\"property-name\"></a> `name` | `string` | Name of the schema. |\n| <a id=\"property-schema\"></a> `schema` | `unknown` | The JSON schema to validate against. |\n\n\n<!-- generated/cognition/types.gen/type-aliases/StructuredCompletionOutcome.md -->\n# Type Alias: StructuredCompletionOutcome\n\n> **StructuredCompletionOutcome** = \\{ `result`: `unknown`; `status`: `\"completed\"`; \\} \\| \\{ `reason`: `string`; `status`: `\"interrupted\"`; \\}\n\n\n<!-- generated/cognition/types.gen/type-aliases/StructuredCompletionRequest.md -->\n# Type Alias: StructuredCompletionRequest\n\n> **StructuredCompletionRequest** = \\{ `additional_instructions?`: `string` \\| `null`; `model`: `string`; `output_schema`: [`DynamicSchema`](DynamicSchema.md); `prompt`: `string`; `toolset?`: [`ToolSet`](ToolSet.md); \\}\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-additional_instructions\"></a> `additional_instructions?` | `string` \\| `null` |\n| <a id=\"property-model\"></a> `model` | `string` |\n| <a id=\"property-output_schema\"></a> `output_schema` | [`DynamicSchema`](DynamicSchema.md) |\n| <a id=\"property-prompt\"></a> `prompt` | `string` |\n| <a id=\"property-toolset\"></a> `toolset?` | [`ToolSet`](ToolSet.md) |\n\n\n<!-- generated/cognition/types.gen/type-aliases/StructuredCompletionResponse.md -->\n# Type Alias: StructuredCompletionResponse\n\n> **StructuredCompletionResponse** = \\{ `outcome`: [`StructuredCompletionOutcome`](StructuredCompletionOutcome.md); `toolActivity`: [`StructuredToolActivity`](StructuredToolActivity.md)[]; \\}\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-outcome\"></a> `outcome` | [`StructuredCompletionOutcome`](StructuredCompletionOutcome.md) | - |\n| <a id=\"property-toolactivity\"></a> `toolActivity` | [`StructuredToolActivity`](StructuredToolActivity.md)[] | Actual completed tools, independent of the model's claims. |\n\n\n<!-- generated/cognition/types.gen/type-aliases/StructuredToolActivity.md -->\n# Type Alias: StructuredToolActivity\n\n> **StructuredToolActivity** = \\{ `name`: `string`; `outcome`: [`ToolOutcome`](ToolOutcome.md); \\}\n\nOne tool call the agent finished, and what it did.\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-name\"></a> `name` | `string` |\n| <a id=\"property-outcome\"></a> `outcome` | [`ToolOutcome`](ToolOutcome.md) |\n\n\n<!-- generated/cognition/types.gen/type-aliases/ToolOutcome.md -->\n# Type Alias: ToolOutcome\n\n> **ToolOutcome** = \\{ `changes`: [`DatabaseChange`](DatabaseChange.md); `status`: `\"succeeded\"`; \\} \\| \\{ `status`: `\"failed\"`; \\}\n\n\n<!-- generated/cognition/types.gen/type-aliases/ToolSet.md -->\n# Type Alias: ToolSet\n\n> **ToolSet** = \\{ `type`: `\"all\"`; \\} \\| \\{ `type`: `\"none\"`; \\} \\| \\{ `type`: `\"databases\"`; \\} \\| \\{ `type`: `\"databases_read_only\"`; \\}\n\n\n<!-- src/entities/ai/namespace/classes/AiNamespace.md -->\n# Class: AiNamespace\n\nShared cognition endpoints, charged to the authenticated acting user.\n\n## Constructors\n\n### Constructor\n\n> **new AiNamespace**(`client`): `AiNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`AiNamespace`\n\n## Methods\n\n### decide()\n\n> **decide**(`request`): `Promise`\\<[`DecisionResponse`](../../../../../generated/cognition/types.gen/type-aliases/DecisionResponse.md)\\>\n\nAsk named yes/no questions about JSON input. Each probability estimates\nyes, from 0 to 1. This classifies supplied data without running tools.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `request` | [`DecisionRequest`](../../../../../generated/cognition/types.gen/type-aliases/DecisionRequest.md) |\n\n#### Returns\n\n`Promise`\\<[`DecisionResponse`](../../../../../generated/cognition/types.gen/type-aliases/DecisionResponse.md)\\>\n\n***\n\n### structuredCompletion()\n\n> **structuredCompletion**(`request`): `Promise`\\<[`StructuredCompletionResponse`](../../../../../generated/cognition/types.gen/type-aliases/StructuredCompletionResponse.md)\\>\n\nGenerate an answer matching a JSON Schema. Set toolset to { type: 'none' }\nto use only supplied context. Other toolsets can perform the requested\nactions; always inspect outcome and toolActivity, including interruptions.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `request` | [`StructuredCompletionRequest`](../../../../../generated/cognition/types.gen/type-aliases/StructuredCompletionRequest.md) |\n\n#### Returns\n\n`Promise`\\<[`StructuredCompletionResponse`](../../../../../generated/cognition/types.gen/type-aliases/StructuredCompletionResponse.md)\\>\n"+ "description": "Generate structured objects, classify supplied content with Jev and read AI usage.",+ "overview": "<!-- src/entities/ai/namespace/classes/AiNamespace.md -->\n# Class: AiNamespace\n\nShared cognition endpoints, charged to the authenticated acting user.\n\n## Constructors\n\n### Constructor\n\n> **new AiNamespace**(`client`): `AiNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`AiNamespace`\n\n## Methods\n\n### decide()\n\n> **decide**(`request`): `Promise`\\<[`DecisionResponse`](../../../../../generated/cognition/types.gen/type-aliases/DecisionResponse.md)\\>\n\nAsk named yes/no questions about JSON input. Each probability estimates\nyes, from 0 to 1. This classifies supplied data without running tools.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `request` | [`DecisionRequest`](../../../../../generated/cognition/types.gen/type-aliases/DecisionRequest.md) |\n\n#### Returns\n\n`Promise`\\<[`DecisionResponse`](../../../../../generated/cognition/types.gen/type-aliases/DecisionResponse.md)\\>\n\n***\n\n### structuredCompletion()\n\n> **structuredCompletion**(`request`): `Promise`\\<[`StructuredCompletionResponse`](../../../../../generated/cognition/types.gen/type-aliases/StructuredCompletionResponse.md)\\>\n\nGenerate an answer matching a JSON Schema. Set toolset to { type: 'none' }\nto use only supplied context. Other toolsets can perform the requested\nactions; always inspect outcome and toolActivity, including interruptions.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `request` | [`StructuredCompletionRequest`](../../../../../generated/cognition/types.gen/type-aliases/StructuredCompletionRequest.md) |\n\n#### Returns\n\n`Promise`\\<[`StructuredCompletionResponse`](../../../../../generated/cognition/types.gen/type-aliases/StructuredCompletionResponse.md)\\>\n\n***\n\n### usage()\n\n> **usage**(`options?`): `Promise`\\<[`UsageSummary`](../../../../../generated/cognition/types.gen/type-aliases/UsageSummary.md)\\>\n\nRead AI usage over a time range, optionally restricting it to users.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options?` | `Omit`\\<[`UsageRequest`](../../../../../generated/cognition/types.gen/type-aliases/UsageRequest.md), `\"include_users\"`\\> & \\{ `users?`: [`User`](../../../users/user/classes/User.md)[]; \\} |\n\n#### Returns\n\n`Promise`\\<[`UsageSummary`](../../../../../generated/cognition/types.gen/type-aliases/UsageSummary.md)\\>\n",+ "documentation": "# Macro SDK: ai\n\nGenerated by TypeDoc. Paths below refer to the canonical Markdown hierarchy. Other entity handles are documented in their named section; request core for shared SDK helpers.\n\n<!-- generated/cognition/types.gen/type-aliases/AiFeature.md -->\n# Type Alias: AiFeature\n\n> **AiFeature** = `\"chat\"` \\| `\"memory\"` \\| `\"automation\"` \\| `\"dynamic_completions_api\"` \\| `\"chat_rename\"` \\| `\"call_summary\"` \\| `\"channel_bot\"` \\| `\"ai_projection\"` \\| `\"ai_editing\"` \\| `\"import\"` \\| `\"agent_session\"` \\| `\"agent_repository_choice\"` \\| `\"dictation\"` \\| `\"image_generation\"`\n\nEverything we use AI for. The wire / DB form of each variant is its\n`snake_case` name.\n\n\n<!-- generated/cognition/types.gen/type-aliases/CompletionUsage.md -->\n# Type Alias: CompletionUsage\n\n> **CompletionUsage** = \\{ `cost`: [`Usage`](Usage.md); `entity?`: `string` \\| `null`; `feature`: [`AiFeature`](AiFeature.md); `user`: [`MacroUserIdStr`](MacroUserIdStr.md); \\}\n\nUser and feature attribution for one invocation.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-cost\"></a> `cost` | [`Usage`](Usage.md) | Measured usage and resolved cost. |\n| <a id=\"property-entity\"></a> `entity?` | `string` \\| `null` | Related entity, if any. |\n| <a id=\"property-feature\"></a> `feature` | [`AiFeature`](AiFeature.md) | Feature that performed the invocation. |\n| <a id=\"property-user\"></a> `user` | [`MacroUserIdStr`](MacroUserIdStr.md) | User the invocation was performed for. |\n\n\n<!-- generated/cognition/types.gen/type-aliases/DatabaseChange.md -->\n# Type Alias: DatabaseChange\n\n> **DatabaseChange** = \\{ `kind`: `\"none\"`; \\} \\| \\{ `kind`: `\"schema\"`; \\} \\| \\{ `count`: `number`; `kind`: `\"rows\"`; \\}\n\nWhat a successful tool call committed to the user's databases.\n\n\n<!-- generated/cognition/types.gen/type-aliases/DecisionRequest.md -->\n# Type Alias: DecisionRequest\n\n> **DecisionRequest** = \\{ `input`: `unknown`; `questions`: \\{\\[`key`: `string`\\]: `string`; \\}; \\}\n\nNamed yes/no questions to evaluate against one arbitrary JSON input.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-input\"></a> `input` | `unknown` | Data to classify. The entire compact request must fit in 64 KiB. |\n| <a id=\"property-questions\"></a> `questions` | \\{\\[`key`: `string`\\]: `string`; \\} | One to 32 questions, each at most 500 characters. Keys must be nonblank and at most 80 UTF-8 bytes; they are preserved in the response. |\n\n\n<!-- generated/cognition/types.gen/type-aliases/DecisionResponse.md -->\n# Type Alias: DecisionResponse\n\n> **DecisionResponse** = \\{ `probabilities`: \\{\\[`key`: `string`\\]: `number`; \\}; \\}\n\nThe probability of yes for every requested question, under its original key.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-probabilities\"></a> `probabilities` | \\{\\[`key`: `string`\\]: `number`; \\} | Probabilities between zero and one, inclusive; not boolean decisions. |\n\n\n<!-- generated/cognition/types.gen/type-aliases/DynamicSchema.md -->\n# Type Alias: DynamicSchema\n\n> **DynamicSchema** = \\{ `description?`: `string` \\| `null`; `name`: `string`; `schema`: `unknown`; \\}\n\nSchema definition for dynamic structured completions.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-description\"></a> `description?` | `string` \\| `null` | Optional description of what the schema represents. |\n| <a id=\"property-name\"></a> `name` | `string` | Name of the schema. |\n| <a id=\"property-schema\"></a> `schema` | `unknown` | The JSON schema to validate against. |\n\n\n<!-- generated/cognition/types.gen/type-aliases/FeatureUsage.md -->\n# Type Alias: FeatureUsage\n\n> **FeatureUsage** = \\{ `entries`: [`CompletionUsage`](CompletionUsage.md)[]; `feature`: [`AiFeature`](AiFeature.md); `total`: `number`; \\}\n\nRecorded invocations and total for one feature.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entries\"></a> `entries` | [`CompletionUsage`](CompletionUsage.md)[] | Recorded invocations. |\n| <a id=\"property-feature\"></a> `feature` | [`AiFeature`](AiFeature.md) | Feature attribution. |\n| <a id=\"property-total\"></a> `total` | `number` | Total cost (USD). |\n\n\n<!-- generated/cognition/types.gen/type-aliases/MacroUserIdStr.md -->\n# Type Alias: MacroUserIdStr\n\n> **MacroUserIdStr** = `string`\n\n\n<!-- generated/cognition/types.gen/type-aliases/Price.md -->\n# Type Alias: Price\n\n> **Price** = \\{ `price_per_audio_minute?`: `number` \\| `null`; `price_per_million_cache_read?`: `number` \\| `null`; `price_per_million_cache_write?`: `number` \\| `null`; `price_per_million_in`: `number`; `price_per_million_out`: `number`; `total`: `number`; \\}\n\nRates applied to an invocation and its resolved dollar cost.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-price_per_audio_minute\"></a> `price_per_audio_minute?` | `number` \\| `null` | Price per audio minute (USD), absent for token billing. |\n| <a id=\"property-price_per_million_cache_read\"></a> `price_per_million_cache_read?` | `number` \\| `null` | Price per million cache-read input tokens (USD), absent when the model has no published rate and for audio billing. |\n| <a id=\"property-price_per_million_cache_write\"></a> `price_per_million_cache_write?` | `number` \\| `null` | Price per million cache-write input tokens (USD), absent when the model has no published rate and for audio billing. |\n| <a id=\"property-price_per_million_in\"></a> `price_per_million_in` | `number` | Price per million input tokens (USD); zero for audio billing. |\n| <a id=\"property-price_per_million_out\"></a> `price_per_million_out` | `number` | Price per million output tokens (USD); zero for audio billing. |\n| <a id=\"property-total\"></a> `total` | `number` | Total cost (USD). |\n\n\n<!-- generated/cognition/types.gen/type-aliases/StructuredCompletionOutcome.md -->\n# Type Alias: StructuredCompletionOutcome\n\n> **StructuredCompletionOutcome** = \\{ `result`: `unknown`; `status`: `\"completed\"`; \\} \\| \\{ `reason`: `string`; `status`: `\"interrupted\"`; \\}\n\n\n<!-- generated/cognition/types.gen/type-aliases/StructuredCompletionRequest.md -->\n# Type Alias: StructuredCompletionRequest\n\n> **StructuredCompletionRequest** = \\{ `additional_instructions?`: `string` \\| `null`; `model`: `string`; `output_schema`: [`DynamicSchema`](DynamicSchema.md); `prompt`: `string`; `toolset?`: [`ToolSet`](ToolSet.md); \\}\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-additional_instructions\"></a> `additional_instructions?` | `string` \\| `null` |\n| <a id=\"property-model\"></a> `model` | `string` |\n| <a id=\"property-output_schema\"></a> `output_schema` | [`DynamicSchema`](DynamicSchema.md) |\n| <a id=\"property-prompt\"></a> `prompt` | `string` |\n| <a id=\"property-toolset\"></a> `toolset?` | [`ToolSet`](ToolSet.md) |\n\n\n<!-- generated/cognition/types.gen/type-aliases/StructuredCompletionResponse.md -->\n# Type Alias: StructuredCompletionResponse\n\n> **StructuredCompletionResponse** = \\{ `outcome`: [`StructuredCompletionOutcome`](StructuredCompletionOutcome.md); `toolActivity`: [`StructuredToolActivity`](StructuredToolActivity.md)[]; \\}\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-outcome\"></a> `outcome` | [`StructuredCompletionOutcome`](StructuredCompletionOutcome.md) | - |\n| <a id=\"property-toolactivity\"></a> `toolActivity` | [`StructuredToolActivity`](StructuredToolActivity.md)[] | Actual completed tools, independent of the model's claims. |\n\n\n<!-- generated/cognition/types.gen/type-aliases/StructuredToolActivity.md -->\n# Type Alias: StructuredToolActivity\n\n> **StructuredToolActivity** = \\{ `name`: `string`; `outcome`: [`ToolOutcome`](ToolOutcome.md); \\}\n\nOne tool call the agent finished, and what it did.\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-name\"></a> `name` | `string` |\n| <a id=\"property-outcome\"></a> `outcome` | [`ToolOutcome`](ToolOutcome.md) |\n\n\n<!-- generated/cognition/types.gen/type-aliases/ToolOutcome.md -->\n# Type Alias: ToolOutcome\n\n> **ToolOutcome** = \\{ `changes`: [`DatabaseChange`](DatabaseChange.md); `status`: `\"succeeded\"`; \\} \\| \\{ `status`: `\"failed\"`; \\}\n\n\n<!-- generated/cognition/types.gen/type-aliases/ToolSet.md -->\n# Type Alias: ToolSet\n\n> **ToolSet** = \\{ `type`: `\"all\"`; \\} \\| \\{ `type`: `\"none\"`; \\} \\| \\{ `type`: `\"databases\"`; \\} \\| \\{ `type`: `\"databases_read_only\"`; \\}\n\n\n<!-- generated/cognition/types.gen/type-aliases/Usage.md -->\n# Type Alias: Usage\n\n> **Usage** = \\{ `audio_seconds?`: `number` \\| `null`; `cache_read_input_tokens`: `number`; `cache_write_input_tokens`: `number`; `created_at`: `string`; `input_tokens`: `number`; `model`: `string`; `output_tokens`: `number`; `price?`: `null` \\| [`Price`](Price.md); \\}\n\nMeasured usage for one invocation.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-audio_seconds\"></a> `audio_seconds?` | `number` \\| `null` | Audio duration in seconds, absent for token billing. |\n| <a id=\"property-cache_read_input_tokens\"></a> `cache_read_input_tokens` | `number` | Input tokens read from a prompt cache; zero for audio billing. |\n| <a id=\"property-cache_write_input_tokens\"></a> `cache_write_input_tokens` | `number` | Input tokens written to a prompt cache; zero for audio billing. |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | Recording timestamp. |\n| <a id=\"property-input_tokens\"></a> `input_tokens` | `number` | Uncached input tokens; zero for audio billing. |\n| <a id=\"property-model\"></a> `model` | `string` | Provider model identifier. |\n| <a id=\"property-output_tokens\"></a> `output_tokens` | `number` | Output tokens; zero for audio billing. |\n| <a id=\"property-price\"></a> `price?` | `null` \\| [`Price`](Price.md) | - |\n\n\n<!-- generated/cognition/types.gen/type-aliases/UsageRequest.md -->\n# Type Alias: UsageRequest\n\n> **UsageRequest** = \\{ `features?`: [`AiFeature`](AiFeature.md)[]; `from?`: `string` \\| `null`; `include_users?`: `string`[]; `until?`: `string` \\| `null`; \\}\n\nRequest body for [`get_usage_handler`].\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-features\"></a> `features?` | [`AiFeature`](AiFeature.md)[] | If empty, include all features. |\n| <a id=\"property-from\"></a> `from?` | `string` \\| `null` | Inclusive lower bound on `created_at`. |\n| <a id=\"property-include_users\"></a> `include_users?` | `string`[] | If empty, include all users. |\n| <a id=\"property-until\"></a> `until?` | `string` \\| `null` | Exclusive upper bound on `created_at`. |\n\n\n<!-- generated/cognition/types.gen/type-aliases/UsageSummary.md -->\n# Type Alias: UsageSummary\n\n> **UsageSummary** = \\{ `entries`: [`FeatureUsage`](FeatureUsage.md)[]; `total`: `number`; \\}\n\nPer-feature breakdown and grand total.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entries\"></a> `entries` | [`FeatureUsage`](FeatureUsage.md)[] | Per-feature usage. |\n| <a id=\"property-total\"></a> `total` | `number` | Grand total (USD). |\n\n\n<!-- src/entities/ai/namespace/classes/AiNamespace.md -->\n# Class: AiNamespace\n\nShared cognition endpoints, charged to the authenticated acting user.\n\n## Constructors\n\n### Constructor\n\n> **new AiNamespace**(`client`): `AiNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`AiNamespace`\n\n## Methods\n\n### decide()\n\n> **decide**(`request`): `Promise`\\<[`DecisionResponse`](../../../../../generated/cognition/types.gen/type-aliases/DecisionResponse.md)\\>\n\nAsk named yes/no questions about JSON input. Each probability estimates\nyes, from 0 to 1. This classifies supplied data without running tools.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `request` | [`DecisionRequest`](../../../../../generated/cognition/types.gen/type-aliases/DecisionRequest.md) |\n\n#### Returns\n\n`Promise`\\<[`DecisionResponse`](../../../../../generated/cognition/types.gen/type-aliases/DecisionResponse.md)\\>\n\n***\n\n### structuredCompletion()\n\n> **structuredCompletion**(`request`): `Promise`\\<[`StructuredCompletionResponse`](../../../../../generated/cognition/types.gen/type-aliases/StructuredCompletionResponse.md)\\>\n\nGenerate an answer matching a JSON Schema. Set toolset to { type: 'none' }\nto use only supplied context. Other toolsets can perform the requested\nactions; always inspect outcome and toolActivity, including interruptions.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `request` | [`StructuredCompletionRequest`](../../../../../generated/cognition/types.gen/type-aliases/StructuredCompletionRequest.md) |\n\n#### Returns\n\n`Promise`\\<[`StructuredCompletionResponse`](../../../../../generated/cognition/types.gen/type-aliases/StructuredCompletionResponse.md)\\>\n\n***\n\n### usage()\n\n> **usage**(`options?`): `Promise`\\<[`UsageSummary`](../../../../../generated/cognition/types.gen/type-aliases/UsageSummary.md)\\>\n\nRead AI usage over a time range, optionally restricting it to users.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options?` | `Omit`\\<[`UsageRequest`](../../../../../generated/cognition/types.gen/type-aliases/UsageRequest.md), `\"include_users\"`\\> & \\{ `users?`: [`User`](../../../users/user/classes/User.md)[]; \\} |\n\n#### Returns\n\n`Promise`\\<[`UsageSummary`](../../../../../generated/cognition/types.gen/type-aliases/UsageSummary.md)\\>\n"},{"name": "bots",@@ -20,50 +68,50 @@{"name": "calendar","description": "Find and manage calendar events.",- "overview": "<!-- src/entities/calendar/namespace/classes/CalendarNamespace.md -->\n# Class: CalendarNamespace\n\nThe calendar surface: the caller's visible calendars, event creation, and\nhandles to individual events and calendars. Backed by calendar_service (the\nSDK reaches it on the gateway's `/calendar` route).\n\n## Constructors\n\n### Constructor\n\n> **new CalendarNamespace**(`client`): `CalendarNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`CalendarNamespace`\n\n## Methods\n\n### calendar()\n\n> **calendar**(`id`): [`Calendar`](../../calendar/classes/Calendar.md)\n\nA handle to a calendar by id. Detail loads on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`Calendar`](../../calendar/classes/Calendar.md)\n\n***\n\n### calendars()\n\n> **calendars**(): `Promise`\\<[`Calendar`](../../calendar/classes/Calendar.md)[]\\>\n\nThe caller's visible calendars, primaries and writable first.\n\n#### Returns\n\n`Promise`\\<[`Calendar`](../../calendar/classes/Calendar.md)[]\\>\n\n***\n\n### createEvent()\n\n> **createEvent**(`options`): `Promise`\\<[`CalendarEvent`](../../event/classes/CalendarEvent.md)\\>\n\nCreate a calendar event and return a handle to its synced record.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | [`CreateEventOptions`](../interfaces/CreateEventOptions.md) |\n\n#### Returns\n\n`Promise`\\<[`CalendarEvent`](../../event/classes/CalendarEvent.md)\\>\n\n***\n\n### event()\n\n> **event**(`id`): [`CalendarEvent`](../../event/classes/CalendarEvent.md)\n\nA handle to a calendar event by id, for driving mutations.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`CalendarEvent`](../../event/classes/CalendarEvent.md)\n\n***\n\n### replacement()\n\n> **replacement**(`operationId`): [`CalendarReplacement`](../../replacement/classes/CalendarReplacement.md)\n\nRecover a saved replacement, including after its original event was retired.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `operationId` | `string` |\n\n#### Returns\n\n[`CalendarReplacement`](../../replacement/classes/CalendarReplacement.md)\n\n\n<!-- src/entities/calendar/namespace/interfaces/CreateEventOptions.md -->\n# Interface: CreateEventOptions\n\nFields for a new calendar event.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-attendees\"></a> `attendees?` | [`CalendarAttendeeInputBody`](../../../../../generated/calendar/types.gen/type-aliases/CalendarAttendeeInputBody.md)[] | Invited attendees. |\n| <a id=\"property-calendar\"></a> `calendar?` | [`Calendar`](../../calendar/classes/Calendar.md) | Exact calendar to create the event on; takes precedence over the inbox default. |\n| <a id=\"property-conference\"></a> `conference?` | [`ConferenceChange`](../../../../../generated/calendar/types.gen/type-aliases/ConferenceChange.md) | Conference to attach; omit to create the event without one. |\n| <a id=\"property-description\"></a> `description?` | `string` | Optional event body. |\n| <a id=\"property-emaillink\"></a> `emailLink?` | [`Link`](../../../email/link/classes/Link.md) | Connected inbox whose primary calendar receives the event; defaults to the requester's primary inbox. |\n| <a id=\"property-location\"></a> `location?` | `string` | Optional location label. |\n| <a id=\"property-macrocall\"></a> `macroCall?` | `boolean` | Mint a Macro call with the event; its join link lands in the description and location. Cannot be combined with `conference`. |\n| <a id=\"property-outofoffice\"></a> `outOfOffice?` | [`OutOfOfficeProperties`](../../../../../generated/calendar/types.gen/type-aliases/OutOfOfficeProperties.md) | Out-of-office properties; present to create an out-of-office event. |\n| <a id=\"property-recurrencelines\"></a> `recurrenceLines?` | `string`[] | Raw RFC 5545 recurrence properties (`RRULE`, `RDATE`, `EXDATE`). |\n| <a id=\"property-reminders\"></a> `reminders?` | [`EventReminders`](../../../../../generated/calendar/types.gen/type-aliases/EventReminders.md) | Reminder configuration; omit to keep the calendar defaults. |\n| <a id=\"property-time\"></a> `time` | [`EventTime`](../../../../../generated/calendar/types.gen/type-aliases/EventTime.md) | Timed or all-day shape. |\n| <a id=\"property-title\"></a> `title` | `string` | Display title. |\n| <a id=\"property-transparency\"></a> `transparency?` | [`EventTransparency`](../../../../../generated/calendar/types.gen/type-aliases/EventTransparency.md) | Availability behavior. |\n| <a id=\"property-visibility\"></a> `visibility?` | [`EventVisibility`](../../../../../generated/calendar/types.gen/type-aliases/EventVisibility.md) | Event visibility. |\n",- "documentation": "# Macro SDK: calendar\n\nGenerated by TypeDoc. Paths below refer to the canonical Markdown hierarchy. Other entity handles are documented in their named section; request core for shared SDK helpers.\n\n<!-- generated/calendar/types.gen/type-aliases/AttendeeResponseStatus.md -->\n# Type Alias: AttendeeResponseStatus\n\n> **AttendeeResponseStatus** = `\"needs_action\"` \\| `\"accepted\"` \\| `\"declined\"` \\| `\"tentative\"`\n\nRSVP state for an attendee.\n\n\n<!-- generated/calendar/types.gen/type-aliases/CalendarAttendee.md -->\n# Type Alias: CalendarAttendee\n\n> **CalendarAttendee** = \\{ `comment?`: `string` \\| `null`; `displayName?`: `string` \\| `null`; `email`: `string`; `isOptional`: `boolean`; `isOrganizer`: `boolean`; `isSelf`: `boolean`; `responseStatus`: [`AttendeeResponseStatus`](AttendeeResponseStatus.md); \\}\n\nAn attendee on a calendar event.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-comment\"></a> `comment?` | `string` \\| `null` | Optional attendee comment. |\n| <a id=\"property-displayname\"></a> `displayName?` | `string` \\| `null` | Provider display name. |\n| <a id=\"property-email\"></a> `email` | `string` | Normalized email address. |\n| <a id=\"property-isoptional\"></a> `isOptional` | `boolean` | Whether attendance is optional. |\n| <a id=\"property-isorganizer\"></a> `isOrganizer` | `boolean` | Whether this attendee is the organizer. |\n| <a id=\"property-isself\"></a> `isSelf` | `boolean` | Whether this attendee is one of the viewing requester's inboxes. |\n| <a id=\"property-responsestatus\"></a> `responseStatus` | [`AttendeeResponseStatus`](AttendeeResponseStatus.md) | RSVP state. |\n\n\n<!-- generated/calendar/types.gen/type-aliases/CalendarAttendeeInputBody.md -->\n# Type Alias: CalendarAttendeeInputBody\n\n> **CalendarAttendeeInputBody** = \\{ `email`: `string`; `isOptional?`: `boolean`; \\}\n\nAn attendee supplied to a calendar mutation.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-email\"></a> `email` | `string` | Attendee email address. |\n| <a id=\"property-isoptional\"></a> `isOptional?` | `boolean` | Whether attendance is optional. |\n\n\n<!-- generated/calendar/types.gen/type-aliases/CalendarCapabilities.md -->\n# Type Alias: CalendarCapabilities\n\n> **CalendarCapabilities** = \\{ `autoDecline`: `boolean`; `conferenceProvider?`: `null` \\| [`ConferenceProvider`](ConferenceProvider.md); `customRecurrence`: `boolean`; `emailReminders`: `boolean`; `removeConference`: `boolean`; `resetRsvp`: `boolean`; \\}\n\nActual provider capabilities used by calendar editors.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-autodecline\"></a> `autoDecline` | `boolean` | Whether event-level automatic invitation declines are supported. |\n| <a id=\"property-conferenceprovider\"></a> `conferenceProvider?` | `null` \\| [`ConferenceProvider`](ConferenceProvider.md) | - |\n| <a id=\"property-customrecurrence\"></a> `customRecurrence` | `boolean` | Whether arbitrary RFC 5545 recurrence properties can be written. |\n| <a id=\"property-emailreminders\"></a> `emailReminders` | `boolean` | Whether email reminders are delivered by the provider or Macro. |\n| <a id=\"property-removeconference\"></a> `removeConference` | `boolean` | Whether an existing conference can be detached. |\n| <a id=\"property-resetrsvp\"></a> `resetRsvp` | `boolean` | Whether an attendee can reset their RSVP to unanswered. |\n\n\n<!-- generated/calendar/types.gen/type-aliases/CalendarDeletionScopeParam.md -->\n# Type Alias: CalendarDeletionScopeParam\n\n> **CalendarDeletionScopeParam** = `\"all\"` \\| `\"this_event\"` \\| `\"this_and_following\"`\n\nHow much of a recurring series a deletion removes.\n\n\n<!-- generated/calendar/types.gen/type-aliases/CalendarEvent.md -->\n# Type Alias: CalendarEvent\n\n> **CalendarEvent** = \\{ `attendees`: [`CalendarAttendee`](CalendarAttendee.md)[]; `calendarId?`: `string` \\| `null`; `conferenceProvider?`: `null` \\| [`ConferenceProvider`](ConferenceProvider.md); `conferenceUrl?`: `string` \\| `null`; `createdAt`: `string`; `creatorEmail?`: `string` \\| `null`; `creatorName?`: `string` \\| `null`; `description?`: `string` \\| `null`; `eventType?`: [`EventType`](EventType.md); `icalUid`: `string`; `id`: `string`; `isReadOnly`: `boolean`; `location?`: `string` \\| `null`; `organizerEmail?`: `string` \\| `null`; `organizerName?`: `string` \\| `null`; `ownerId`: `string`; `recurrenceLines`: `string`[]; `reminders?`: [`EventReminders`](EventReminders.md); `sequence`: `number`; `sources?`: [`CalendarEventSourceContent`](CalendarEventSourceContent.md)[]; `status`: [`EventStatus`](EventStatus.md); `time`: [`EventTime`](EventTime.md); `title`: `string`; `transparency`: [`EventTransparency`](EventTransparency.md); `updatedAt`: `string`; `visibility`: [`EventVisibility`](EventVisibility.md); \\}\n\nA stable, first-class Macro calendar event entity.\n\nContent fields hold the canonical source's values: the account's primary\ncalendar copy when one is synced, else the freshest remaining copy.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-attendees\"></a> `attendees` | [`CalendarAttendee`](CalendarAttendee.md)[] | Attendees, keyed by email during persistence. |\n| <a id=\"property-calendarid\"></a> `calendarId?` | `string` \\| `null` | Calendar the canonical source belongs to, when known. Absent only in projections stored before calendars were attributed. |\n| <a id=\"property-conferenceprovider\"></a> `conferenceProvider?` | `null` \\| [`ConferenceProvider`](ConferenceProvider.md) | - |\n| <a id=\"property-conferenceurl\"></a> `conferenceUrl?` | `string` \\| `null` | Direct join URL when known. |\n| <a id=\"property-createdat\"></a> `createdAt` | `string` | Entity creation time. |\n| <a id=\"property-creatoremail\"></a> `creatorEmail?` | `string` \\| `null` | Provider-reported creator email. Distinct from the organizer when someone writes onto a calendar they do not own. Omitted from stored projections when unknown so events ingested before this field still compare equal. |\n| <a id=\"property-creatorname\"></a> `creatorName?` | `string` \\| `null` | Provider-reported creator display name. |\n| <a id=\"property-description\"></a> `description?` | `string` \\| `null` | Optional event body. |\n| <a id=\"property-eventtype\"></a> `eventType?` | [`EventType`](EventType.md) | Provider event type. Skipped when it is the regular type so projections stored before event types were modeled still compare equal. |\n| <a id=\"property-icaluid\"></a> `icalUid` | `string` | RFC 5545 UID used to reconcile provider and email sources. |\n| <a id=\"property-id\"></a> `id` | `string` | Macro entity identifier. |\n| <a id=\"property-isreadonly\"></a> `isReadOnly` | `boolean` | Whether the canonical source's calendar prohibits editing it. |\n| <a id=\"property-location\"></a> `location?` | `string` \\| `null` | Optional physical or virtual location label. |\n| <a id=\"property-organizeremail\"></a> `organizerEmail?` | `string` \\| `null` | Organizer email. |\n| <a id=\"property-organizername\"></a> `organizerName?` | `string` \\| `null` | Organizer display name. |\n| <a id=\"property-ownerid\"></a> `ownerId` | `string` | Macro user who owns this event entity. |\n| <a id=\"property-recurrencelines\"></a> `recurrenceLines` | `string`[] | Raw RFC 5545 recurrence properties (`RRULE`, `RDATE`, `EXDATE`). |\n| <a id=\"property-reminders\"></a> `reminders?` | [`EventReminders`](EventReminders.md) | Per-user reminder configuration. Skipped when it is the provider default so projections stored before reminders were modeled still compare equal. |\n| <a id=\"property-sequence\"></a> `sequence` | `number` | Provider/iCalendar sequence number. |\n| <a id=\"property-sources\"></a> `sources?` | [`CalendarEventSourceContent`](CalendarEventSourceContent.md)[] | Content of every active copy of this event, canonical first: the primary calendar's copy, then the freshest. A client picks the copy whose calendar it is showing and falls back to the first. Populated only on the read path, so stored projections omit it. |\n| <a id=\"property-status\"></a> `status` | [`EventStatus`](EventStatus.md) | Event status. |\n| <a id=\"property-time\"></a> `time` | [`EventTime`](EventTime.md) | Timed or all-day shape. |\n| <a id=\"property-title\"></a> `title` | `string` | Display title. |\n| <a id=\"property-transparency\"></a> `transparency` | [`EventTransparency`](EventTransparency.md) | Availability behavior. |\n| <a id=\"property-updatedat\"></a> `updatedAt` | `string` | Entity update time. |\n| <a id=\"property-visibility\"></a> `visibility` | [`EventVisibility`](EventVisibility.md) | Event visibility. |\n\n\n<!-- generated/calendar/types.gen/type-aliases/CalendarEventSourceContent.md -->\n# Type Alias: CalendarEventSourceContent\n\n> **CalendarEventSourceContent** = \\{ `calendarId`: `string`; `creatorEmail?`: `string` \\| `null`; `creatorName?`: `string` \\| `null`; `description?`: `string` \\| `null`; `eventType`: [`EventType`](EventType.md); `isReadOnly`: `boolean`; `location?`: `string` \\| `null`; `reminders`: [`EventReminders`](EventReminders.md); `title`: `string`; `transparency`: [`EventTransparency`](EventTransparency.md); `visibility`: [`EventVisibility`](EventVisibility.md); \\}\n\nThe content one provider copy of an event carries.\n\nGoogle keeps these fields per calendar copy: a shared calendar's copy of a\nmember's event can have its own title, type, reminders, and access role.\nThe entity holds its canonical source's values. Every other copy's values\nare read from here so a client can show the copy that belongs to the\ncalendar being viewed.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-calendarid\"></a> `calendarId` | `string` | Calendar this copy lives on. |\n| <a id=\"property-creatoremail\"></a> `creatorEmail?` | `string` \\| `null` | Provider-reported creator email. |\n| <a id=\"property-creatorname\"></a> `creatorName?` | `string` \\| `null` | Provider-reported creator display name. |\n| <a id=\"property-description\"></a> `description?` | `string` \\| `null` | Optional event body. |\n| <a id=\"property-eventtype\"></a> `eventType` | [`EventType`](EventType.md) | Provider event type. |\n| <a id=\"property-isreadonly\"></a> `isReadOnly` | `boolean` | Whether the calendar's access role prohibits editing this copy. |\n| <a id=\"property-location\"></a> `location?` | `string` \\| `null` | Optional physical or virtual location label. |\n| <a id=\"property-reminders\"></a> `reminders` | [`EventReminders`](EventReminders.md) | Reminder configuration of this copy. |\n| <a id=\"property-title\"></a> `title` | `string` | Display title. |\n| <a id=\"property-transparency\"></a> `transparency` | [`EventTransparency`](EventTransparency.md) | Availability behavior. |\n| <a id=\"property-visibility\"></a> `visibility` | [`EventVisibility`](EventVisibility.md) | Event visibility. |\n\n\n<!-- generated/calendar/types.gen/type-aliases/CalendarProvider.md -->\n# Type Alias: CalendarProvider\n\n> **CalendarProvider** = `\"google\"` \\| `\"outlook\"`\n\nProvider selected from the persisted calendar account and email binding.\n\n\n<!-- generated/calendar/types.gen/type-aliases/CalendarReplacementView.md -->\n# Type Alias: CalendarReplacementView\n\n> **CalendarReplacementView** = \\{ `attendeeCount`: `number`; `completedSteps`: `number`; `event?`: `null` \\| [`CalendarEvent`](CalendarEvent.md); `isSeries`: `boolean`; `operationId`: `string`; `providerUrl?`: `string` \\| `null`; `removeConference`: `boolean`; `replacementUrl?`: `string` \\| `null`; `status`: [`ReplacementStatus`](ReplacementStatus.md); `time`: [`EventTime`](EventTime.md); `title`: `string`; `totalSteps`: `number`; \\}\n\nSafe preview and recovery response; never exposes the opaque provider snapshot.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-attendeecount\"></a> `attendeeCount` | `number` | Guest count for cancellation and reinvitation confirmation. |\n| <a id=\"property-completedsteps\"></a> `completedSteps` | `number` | Number of completed provider steps. |\n| <a id=\"property-event\"></a> `event?` | `null` \\| [`CalendarEvent`](CalendarEvent.md) | - |\n| <a id=\"property-isseries\"></a> `isSeries` | `boolean` | Entire recurring series, including exceptions, is replaced. |\n| <a id=\"property-operationid\"></a> `operationId` | `string` | Use this identity when confirming or checking progress. |\n| <a id=\"property-providerurl\"></a> `providerUrl?` | `string` \\| `null` | Original event for manual review. |\n| <a id=\"property-removeconference\"></a> `removeConference` | `boolean` | The provider conference is removed. |\n| <a id=\"property-replacementurl\"></a> `replacementUrl?` | `string` \\| `null` | New provider event, when creation was confirmed. |\n| <a id=\"property-status\"></a> `status` | [`ReplacementStatus`](ReplacementStatus.md) | Current durable state. |\n| <a id=\"property-time\"></a> `time` | [`EventTime`](EventTime.md) | Frozen time. |\n| <a id=\"property-title\"></a> `title` | `string` | Frozen title. |\n| <a id=\"property-totalsteps\"></a> `totalSteps` | `number` | Number of provider steps in this operation. |\n\n\n<!-- generated/calendar/types.gen/type-aliases/CalendarRsvpScopeParam.md -->\n# Type Alias: CalendarRsvpScopeParam\n\n> **CalendarRsvpScopeParam** = `\"all\"` \\| `\"this_event\"`\n\nHow much of a recurring series an RSVP applies to.\n\nUnlike deletion there is no this-and-following variant: the provider\ncannot express a forward-scoped response, so offering one would be a\npromise sync could not keep.\n\n\n<!-- generated/calendar/types.gen/type-aliases/CalendarUpdateScopeParam.md -->\n# Type Alias: CalendarUpdateScopeParam\n\n> **CalendarUpdateScopeParam** = `\"all\"` \\| `\"this_event\"`\n\nHow much of a recurring series an update applies to.\n\nLike RSVPs there is no this-and-following variant: the provider cannot\nexpress a forward-scoped edit as one write, and emulating it (truncate\nthe series, insert an edited clone) is non-atomic and re-invites the\nattendees of the clone. Compose it from a this-and-following deletion\nand a create when that shape is wanted.\n\n\n<!-- generated/calendar/types.gen/type-aliases/ConferenceChange.md -->\n# Type Alias: ConferenceChange\n\n> **ConferenceChange** = `\"provider_default\"` \\| `\"microsoft_teams\"` \\| `\"google_meet\"` \\| `\"none\"`\n\nA requested change to an event's conferencing. Omitting the field leaves\nthe existing conference untouched; only these values change it.\n\n\n<!-- generated/calendar/types.gen/type-aliases/ConferenceProvider.md -->\n# Type Alias: ConferenceProvider\n\n> **ConferenceProvider** = `\"microsoft_teams\"` \\| `\"google_meet\"` \\| `\"other\"`\n\nThe conferencing system backing an event's join URL.\n\nCalendars can create Google Meet or Microsoft Teams according to their\ncapabilities. Imported third-party conferences are labeled separately.\nOmitting a conference change preserves the current conference; explicit\nchanges still require provider and calendar capability validation.\n\n\n<!-- generated/calendar/types.gen/type-aliases/EventReminderOverride.md -->\n# Type Alias: EventReminderOverride\n\n> **EventReminderOverride** = \\{ `method`: `string`; `minutes`: `number`; \\}\n\nOne reminder: how it alerts and how many minutes before the event start\n(before midnight in the calendar's zone for all-day events) it fires.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-method\"></a> `method` | `string` | Provider method, stored verbatim; only `popup` fires Macro notifications. |\n| <a id=\"property-minutes\"></a> `minutes` | `number` | Minutes before the event start. |\n\n\n<!-- generated/calendar/types.gen/type-aliases/EventReminders.md -->\n# Type Alias: EventReminders\n\n> **EventReminders** = \\{ `overrides?`: [`EventReminderOverride`](EventReminderOverride.md)[]; `useDefault`: `boolean`; \\}\n\nPer-user reminder configuration for an event, mirroring Google's model:\neither the calendar's default reminders apply, or the explicit overrides\nreplace them entirely.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-overrides\"></a> `overrides?` | [`EventReminderOverride`](EventReminderOverride.md)[] | Explicit reminders replacing the defaults when `use_default` is off. |\n| <a id=\"property-usedefault\"></a> `useDefault` | `boolean` | Whether the calendar's default reminders apply. |\n\n\n<!-- generated/calendar/types.gen/type-aliases/EventStatus.md -->\n# Type Alias: EventStatus\n\n> **EventStatus** = `\"confirmed\"` \\| `\"tentative\"` \\| `\"cancelled\"`\n\nCanonical event status.\n\n\n<!-- generated/calendar/types.gen/type-aliases/EventTime.md -->\n# Type Alias: EventTime\n\n> **EventTime** = \\{ `endsAt`: `string`; `kind`: `\"timed\"`; `startsAt`: `string`; `timeZone?`: `string` \\| `null`; \\} \\| \\{ `endDate`: `string`; `kind`: `\"allDay\"`; `startDate`: `string`; \\}\n\nThe mutually exclusive time shape of a calendar event.\n\nFields are renamed per variant rather than with `rename_all_fields`\nbecause utoipa only honors variant-level serde renames when it\nderives the OpenAPI schema.\n\n## Union Members\n\n### Type Literal\n\n\\{ `endsAt`: `string`; `kind`: `\"timed\"`; `startsAt`: `string`; `timeZone?`: `string` \\| `null`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `endsAt` | `string` | Exclusive end instant; equal to the start for an imported point event. |\n| `kind` | `\"timed\"` | - |\n| `startsAt` | `string` | Inclusive start instant. |\n| `timeZone?` | `string` \\| `null` | Original IANA time-zone identifier, when supplied. |\n\n***\n\n### Type Literal\n\n\\{ `endDate`: `string`; `kind`: `\"allDay\"`; `startDate`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `endDate` | `string` | Exclusive local end date. |\n| `kind` | `\"allDay\"` | - |\n| `startDate` | `string` | Inclusive local start date. |\n\n\n<!-- generated/calendar/types.gen/type-aliases/EventTransparency.md -->\n# Type Alias: EventTransparency\n\n> **EventTransparency** = `\"opaque\"` \\| `\"transparent\"`\n\nWhether an event blocks availability.\n\n\n<!-- generated/calendar/types.gen/type-aliases/EventType.md -->\n# Type Alias: EventType\n\n> **EventType** = `\"default\"` \\| `\"out_of_office\"` \\| `\"focus_time\"` \\| `\"working_location\"` \\| `\"birthday\"` \\| `\"from_gmail\"`\n\nGoogle's event type: ordinary meetings versus the status-style entries\n(working location, out of office, focus time, birthdays) Google renders\nand notifies differently. Immutable at the provider after creation.\n\n\n<!-- generated/calendar/types.gen/type-aliases/EventVisibility.md -->\n# Type Alias: EventVisibility\n\n> **EventVisibility** = `\"default\"` \\| `\"public\"` \\| `\"private\"` \\| `\"confidential\"`\n\nVisibility of event details.\n\n\n<!-- generated/calendar/types.gen/type-aliases/OutOfOfficeAutoDeclineMode.md -->\n# Type Alias: OutOfOfficeAutoDeclineMode\n\n> **OutOfOfficeAutoDeclineMode** = `\"decline_none\"` \\| `\"decline_all_conflicting_invitations\"` \\| `\"decline_only_new_conflicting_invitations\"`\n\nHow an out-of-office event responds to conflicting invitations, mirroring\nGoogle's `autoDeclineMode`.\n\n\n<!-- generated/calendar/types.gen/type-aliases/OutOfOfficeProperties.md -->\n# Type Alias: OutOfOfficeProperties\n\n> **OutOfOfficeProperties** = \\{ `autoDeclineMode?`: [`OutOfOfficeAutoDeclineMode`](OutOfOfficeAutoDeclineMode.md); `declineMessage?`: `string` \\| `null`; \\}\n\nThe extra properties Google requires on an out-of-office event, mirroring\nits `outOfOfficeProperties` block. Their presence on a draft or patch is\nwhat marks the mutation as out-of-office.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-autodeclinemode\"></a> `autoDeclineMode?` | [`OutOfOfficeAutoDeclineMode`](OutOfOfficeAutoDeclineMode.md) | How conflicting invitations are handled while the user is out. |\n| <a id=\"property-declinemessage\"></a> `declineMessage?` | `string` \\| `null` | Message returned to organizers whose invitations are auto-declined. |\n\n\n<!-- generated/calendar/types.gen/type-aliases/ReplacementStatus.md -->\n# Type Alias: ReplacementStatus\n\n> **ReplacementStatus** = `\"needs_confirmation\"` \\| `\"in_progress\"` \\| `\"complete\"`\n\nUser-visible workflow state.\n\n\n<!-- generated/calendar/types.gen/type-aliases/VisibleCalendar.md -->\n# Type Alias: VisibleCalendar\n\n> **VisibleCalendar** = \\{ `capabilities`: [`CalendarCapabilities`](CalendarCapabilities.md); `color?`: `string` \\| `null`; `defaultReminders`: [`EventReminderOverride`](EventReminderOverride.md)[]; `emailAddress`: `string`; `emailLinkId`: `string`; `id`: `string`; `isPrimary`: `boolean`; `isSubscription`: `boolean`; `isWritable`: `boolean`; `name`: `string`; `provider`: [`CalendarProvider`](CalendarProvider.md); `syncError?`: `string` \\| `null`; \\}\n\nA calendar visible to a requester, listed for pickers and filters.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-capabilities\"></a> `capabilities` | [`CalendarCapabilities`](CalendarCapabilities.md) | Provider features available on this actual calendar. |\n| <a id=\"property-color\"></a> `color?` | `string` \\| `null` | Provider color. |\n| <a id=\"property-defaultreminders\"></a> `defaultReminders` | [`EventReminderOverride`](EventReminderOverride.md)[] | Default reminders applied to events that keep `useDefault`. |\n| <a id=\"property-emailaddress\"></a> `emailAddress` | `string` | Connected inbox address, for grouping in multi-inbox pickers. |\n| <a id=\"property-emaillinkid\"></a> `emailLinkId` | `string` | Connected inbox that syncs this calendar. |\n| <a id=\"property-id\"></a> `id` | `string` | Persisted Macro calendar identifier. |\n| <a id=\"property-isprimary\"></a> `isPrimary` | `boolean` | Whether this is its account's primary calendar. |\n| <a id=\"property-issubscription\"></a> `isSubscription` | `boolean` | Whether this is one of Google's shared system calendars (holidays, birthdays) the account subscribes to rather than one a person maintains. |\n| <a id=\"property-iswritable\"></a> `isWritable` | `boolean` | Whether the grant can create and modify events on this calendar. |\n| <a id=\"property-name\"></a> `name` | `string` | Provider display name. |\n| <a id=\"property-provider\"></a> `provider` | [`CalendarProvider`](CalendarProvider.md) | Calendar provider, for display and reconnect routing. |\n| <a id=\"property-syncerror\"></a> `syncError?` | `string` \\| `null` | A persistent sync failure isolated to this calendar, surfaced so the settings row can badge it. `None` while the calendar is syncing normally or a failure has not yet crossed the persistence threshold. |\n\n\n<!-- src/entities/calendar/calendar/classes/Calendar.md -->\n# Class: Calendar\n\nA calendar visible to the requester across their connected inboxes: a\nfree-to-construct handle whose detail resolves from the caller's calendar\nlist. There is no fetch-by-id endpoint, so a bare [Calendar.byId](#byid)\nhandle loads its detail by listing the caller's calendars and matching on id.\n\n## Extends\n\n- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\\<[`VisibleCalendar`](../../../../../generated/calendar/types.gen/type-aliases/VisibleCalendar.md)\\>\n\n## Properties\n\n| Property | Modifier | Type | Description | Inherited from |\n| ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-color\"></a> `color` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | Provider color, when set. | - |\n| <a id=\"property-emailaddress\"></a> `emailAddress` | `readonly` | () => `Promise`\\<`string`\\> | Connected inbox address that syncs this calendar. | - |\n| <a id=\"property-emaillink\"></a> `emailLink` | `readonly` | () => `Promise`\\<[`Link`](../../../email/link/classes/Link.md)\\> | The connected inbox (email link) that syncs this calendar. | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |\n| <a id=\"property-isprimary\"></a> `isPrimary` | `readonly` | () => `Promise`\\<`boolean`\\> | Whether this is its account's primary calendar. | - |\n| <a id=\"property-issubscription\"></a> `isSubscription` | `readonly` | () => `Promise`\\<`boolean`\\> | Whether this is a subscribed system calendar (holidays, birthdays). | - |\n| <a id=\"property-iswritable\"></a> `isWritable` | `readonly` | () => `Promise`\\<`boolean`\\> | Whether the grant can create and modify events on this calendar. | - |\n| <a id=\"property-name\"></a> `name` | `readonly` | () => `Promise`\\<`string`\\> | Provider display name. | - |\n| <a id=\"property-syncerror\"></a> `syncError` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | A persistent per-calendar sync failure, surfaced for settings badges. | - |\n\n## Methods\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`VisibleCalendar`](../../../../../generated/calendar/types.gen/type-aliases/VisibleCalendar.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`VisibleCalendar`](../../../../../generated/calendar/types.gen/type-aliases/VisibleCalendar.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`VisibleCalendar`](../../../../../generated/calendar/types.gen/type-aliases/VisibleCalendar.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `id`): `Calendar`\n\nA handle to a calendar by id. Detail loads on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `id` | `string` |\n\n#### Returns\n\n`Calendar`\n\n***\n\n### list()\n\n> `static` **list**(`client`): `Promise`\\<`Calendar`[]\\>\n\nThe caller's visible calendars, primaries and writable first.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`Promise`\\<`Calendar`[]\\>\n\n\n<!-- src/entities/calendar/event/classes/CalendarEvent.md -->\n# Class: CalendarEvent\n\nA Macro calendar event: a handle exposing the event's synced fields and the\nmutations that act on it ([CalendarEvent.update](#update),\n[CalendarEvent.delete](#delete), [CalendarEvent.rsvp](#rsvp)).\n\nThe calendar service has no fetch-by-id endpoint, so a handle reads its\nfields only when seeded with a record — as returned by\n[CalendarEvent.update](#update), [CalendarEvent.rsvp](#rsvp), or\n`calendar.createEvent`. A bare [CalendarEvent.byId](#byid) handle can drive\nmutations, but reading a field on it throws.\n\n## Extends\n\n- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\\<[`CalendarEvent`](../../../../../generated/calendar/types.gen/type-aliases/CalendarEvent.md)\\>\n\n## Properties\n\n| Property | Modifier | Type | Description | Inherited from |\n| ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-attendees\"></a> `attendees` | `readonly` | () => `Promise`\\<[`CalendarAttendee`](../../../../../generated/calendar/types.gen/type-aliases/CalendarAttendee.md)[]\\> | Attendees on the canonical copy. | - |\n| <a id=\"property-calendar\"></a> `calendar` | `readonly` | () => `Promise`\\<[`Calendar`](../../calendar/classes/Calendar.md) \\| `undefined`\\> | The calendar the canonical source belongs to, when known. | - |\n| <a id=\"property-description\"></a> `description` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | Optional event body. | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |\n| <a id=\"property-isreadonly\"></a> `isReadOnly` | `readonly` | () => `Promise`\\<`boolean`\\> | Whether the canonical source's calendar prohibits editing. | - |\n| <a id=\"property-location\"></a> `location` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | Optional physical or virtual location label. | - |\n| <a id=\"property-recurrencelines\"></a> `recurrenceLines` | `readonly` | () => `Promise`\\<`string`[]\\> | Raw RFC 5545 recurrence properties (`RRULE`, `RDATE`, `EXDATE`). | - |\n| <a id=\"property-status\"></a> `status` | `readonly` | () => `Promise`\\<[`EventStatus`](../../../../../generated/calendar/types.gen/type-aliases/EventStatus.md)\\> | Event status. | - |\n| <a id=\"property-time\"></a> `time` | `readonly` | () => `Promise`\\<[`EventTime`](../../../../../generated/calendar/types.gen/type-aliases/EventTime.md)\\> | Timed or all-day shape. | - |\n| <a id=\"property-title\"></a> `title` | `readonly` | () => `Promise`\\<`string`\\> | Display title. | - |\n| <a id=\"property-transparency\"></a> `transparency` | `readonly` | () => `Promise`\\<[`EventTransparency`](../../../../../generated/calendar/types.gen/type-aliases/EventTransparency.md)\\> | Availability behavior. | - |\n\n## Methods\n\n### delete()\n\n> **delete**(`options?`): `Promise`\\<`void`\\>\n\nDelete the event (or a scoped part of a recurring series) at its provider.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options?` | [`DeleteEventOptions`](../interfaces/DeleteEventOptions.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### prepareReplacement()\n\n> **prepareReplacement**(`options`): `Promise`\\<[`CalendarReplacement`](../../replacement/classes/CalendarReplacement.md)\\>\n\nPreview an organizer replacement without cancelling or sending invitations.\nReview replacement.status() before explicitly calling replacement.confirm().\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | \\{ `calendar?`: [`Calendar`](../../calendar/classes/Calendar.md); `recurrenceId?`: `string`; `removeConference`: `boolean`; \\} |\n| `options.calendar?` | [`Calendar`](../../calendar/classes/Calendar.md) |\n| `options.recurrenceId?` | `string` |\n| `options.removeConference` | `boolean` |\n\n#### Returns\n\n`Promise`\\<[`CalendarReplacement`](../../replacement/classes/CalendarReplacement.md)\\>\n\n***\n\n### providerUrl()\n\n> **providerUrl**(`options?`): `Promise`\\<`string` \\| `undefined`\\>\n\nOpen this calendar copy in its provider for actions unavailable through its API.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options?` | \\{ `calendar?`: [`Calendar`](../../calendar/classes/Calendar.md); `recurrenceId?`: `string`; \\} |\n| `options.calendar?` | [`Calendar`](../../calendar/classes/Calendar.md) |\n| `options.recurrenceId?` | `string` |\n\n#### Returns\n\n`Promise`\\<`string` \\| `undefined`\\>\n\n***\n\n### record()\n\n> **record**(): `Promise`\\<[`CalendarEvent`](../../../../../generated/calendar/types.gen/type-aliases/CalendarEvent.md)\\>\n\nThe full synced event record. Available on a seeded handle (from create /\nupdate / rsvp); a bare `byId` handle throws (no fetch-by-id endpoint).\n\n#### Returns\n\n`Promise`\\<[`CalendarEvent`](../../../../../generated/calendar/types.gen/type-aliases/CalendarEvent.md)\\>\n\n***\n\n### rsvp()\n\n> **rsvp**(`options`): `Promise`\\<`CalendarEvent`\\>\n\nRecord the requester's RSVP and return a handle to the synced record.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | [`RsvpEventOptions`](../interfaces/RsvpEventOptions.md) |\n\n#### Returns\n\n`Promise`\\<`CalendarEvent`\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`CalendarEvent`](../../../../../generated/calendar/types.gen/type-aliases/CalendarEvent.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`CalendarEvent`](../../../../../generated/calendar/types.gen/type-aliases/CalendarEvent.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`CalendarEvent`](../../../../../generated/calendar/types.gen/type-aliases/CalendarEvent.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)\n\n***\n\n### update()\n\n> **update**(`options`): `Promise`\\<`CalendarEvent`\\>\n\nUpdate the event and return a handle to its synced record.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | [`UpdateEventOptions`](../interfaces/UpdateEventOptions.md) |\n\n#### Returns\n\n`Promise`\\<`CalendarEvent`\\>\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `id`): `CalendarEvent`\n\nA handle to a calendar event by id, for driving mutations. Reading a\nfield on it throws (there is no fetch-by-id endpoint).\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `id` | `string` |\n\n#### Returns\n\n`CalendarEvent`\n\n***\n\n### fromRecord()\n\n> `static` **fromRecord**(`client`, `record`): `CalendarEvent`\n\nA handle seeded with a synced event record; reads resolve without a fetch.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `record` | [`CalendarEvent`](../../../../../generated/calendar/types.gen/type-aliases/CalendarEvent.md) |\n\n#### Returns\n\n`CalendarEvent`\n\n\n<!-- src/entities/calendar/event/interfaces/DeleteEventOptions.md -->\n# Interface: DeleteEventOptions\n\nHow a deletion is scoped across a recurring series.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-calendar\"></a> `calendar?` | [`Calendar`](../../calendar/classes/Calendar.md) | Calendar whose copy of the event is deleted, for a multi-calendar event. Omit to delete the canonical copy. |\n| <a id=\"property-recurrenceid\"></a> `recurrenceId?` | `string` | Original-start key of the occurrence a scoped deletion targets. |\n| <a id=\"property-scope\"></a> `scope?` | [`CalendarDeletionScopeParam`](../../../../../generated/calendar/types.gen/type-aliases/CalendarDeletionScopeParam.md) | Deletion scope; defaults to the entire event or series. |\n\n\n<!-- src/entities/calendar/event/interfaces/RsvpEventOptions.md -->\n# Interface: RsvpEventOptions\n\nThe RSVP to record and how it is scoped across a recurring series.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-calendar\"></a> `calendar?` | [`Calendar`](../../calendar/classes/Calendar.md) | Calendar whose copy of the event is answered, for a multi-calendar event. Omit to answer on the canonical copy. |\n| <a id=\"property-recurrenceid\"></a> `recurrenceId?` | `string` | Original-start key of the occurrence the response targets. |\n| <a id=\"property-response\"></a> `response` | [`AttendeeResponseStatus`](../../../../../generated/calendar/types.gen/type-aliases/AttendeeResponseStatus.md) | The response to record for the connected account. |\n| <a id=\"property-scope\"></a> `scope?` | [`CalendarRsvpScopeParam`](../../../../../generated/calendar/types.gen/type-aliases/CalendarRsvpScopeParam.md) | How much of a recurring series the response covers. Omit to let `recurrenceId` decide. |\n\n\n<!-- src/entities/calendar/event/interfaces/UpdateEventOptions.md -->\n# Interface: UpdateEventOptions\n\nFields to change on an event; omitted fields are left untouched.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-attendees\"></a> `attendees?` | [`CalendarAttendeeInputBody`](../../../../../generated/calendar/types.gen/type-aliases/CalendarAttendeeInputBody.md)[] | Replacement attendee list. |\n| <a id=\"property-calendar\"></a> `calendar?` | [`Calendar`](../../calendar/classes/Calendar.md) | Calendar whose copy of the event is patched, for a multi-calendar event. Omit to patch the canonical copy. |\n| <a id=\"property-conference\"></a> `conference?` | [`ConferenceChange`](../../../../../generated/calendar/types.gen/type-aliases/ConferenceChange.md) | Provider conference change; omit to retain it. Outlook removal requires a separately confirmed replacement via prepareReplacement(). |\n| <a id=\"property-description\"></a> `description?` | `string` | Replacement description; an empty string clears it. |\n| <a id=\"property-location\"></a> `location?` | `string` | Replacement location; an empty string clears it. |\n| <a id=\"property-outofoffice\"></a> `outOfOffice?` | [`OutOfOfficeProperties`](../../../../../generated/calendar/types.gen/type-aliases/OutOfOfficeProperties.md) | Replacement out-of-office properties, applied only to an event that is already out-of-office. |\n| <a id=\"property-recurrenceid\"></a> `recurrenceId?` | `string` | Original-start key of the occurrence the update targets. |\n| <a id=\"property-recurrencelines\"></a> `recurrenceLines?` | `string`[] | Replacement recurrence properties; an empty list clears them. |\n| <a id=\"property-reminders\"></a> `reminders?` | [`EventReminders`](../../../../../generated/calendar/types.gen/type-aliases/EventReminders.md) | Replacement reminder configuration. |\n| <a id=\"property-scope\"></a> `scope?` | [`CalendarUpdateScopeParam`](../../../../../generated/calendar/types.gen/type-aliases/CalendarUpdateScopeParam.md) | How much of a recurring series the update covers. Omit to let `recurrenceId` decide. |\n| <a id=\"property-time\"></a> `time?` | [`EventTime`](../../../../../generated/calendar/types.gen/type-aliases/EventTime.md) | Replacement time. |\n| <a id=\"property-title\"></a> `title?` | `string` | Replacement title; an empty string clears it. |\n| <a id=\"property-transparency\"></a> `transparency?` | [`EventTransparency`](../../../../../generated/calendar/types.gen/type-aliases/EventTransparency.md) | Replacement availability behavior. |\n| <a id=\"property-visibility\"></a> `visibility?` | [`EventVisibility`](../../../../../generated/calendar/types.gen/type-aliases/EventVisibility.md) | Replacement visibility. |\n\n\n<!-- src/entities/calendar/namespace/classes/CalendarNamespace.md -->\n# Class: CalendarNamespace\n\nThe calendar surface: the caller's visible calendars, event creation, and\nhandles to individual events and calendars. Backed by calendar_service (the\nSDK reaches it on the gateway's `/calendar` route).\n\n## Constructors\n\n### Constructor\n\n> **new CalendarNamespace**(`client`): `CalendarNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`CalendarNamespace`\n\n## Methods\n\n### calendar()\n\n> **calendar**(`id`): [`Calendar`](../../calendar/classes/Calendar.md)\n\nA handle to a calendar by id. Detail loads on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`Calendar`](../../calendar/classes/Calendar.md)\n\n***\n\n### calendars()\n\n> **calendars**(): `Promise`\\<[`Calendar`](../../calendar/classes/Calendar.md)[]\\>\n\nThe caller's visible calendars, primaries and writable first.\n\n#### Returns\n\n`Promise`\\<[`Calendar`](../../calendar/classes/Calendar.md)[]\\>\n\n***\n\n### createEvent()\n\n> **createEvent**(`options`): `Promise`\\<[`CalendarEvent`](../../event/classes/CalendarEvent.md)\\>\n\nCreate a calendar event and return a handle to its synced record.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | [`CreateEventOptions`](../interfaces/CreateEventOptions.md) |\n\n#### Returns\n\n`Promise`\\<[`CalendarEvent`](../../event/classes/CalendarEvent.md)\\>\n\n***\n\n### event()\n\n> **event**(`id`): [`CalendarEvent`](../../event/classes/CalendarEvent.md)\n\nA handle to a calendar event by id, for driving mutations.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`CalendarEvent`](../../event/classes/CalendarEvent.md)\n\n***\n\n### replacement()\n\n> **replacement**(`operationId`): [`CalendarReplacement`](../../replacement/classes/CalendarReplacement.md)\n\nRecover a saved replacement, including after its original event was retired.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `operationId` | `string` |\n\n#### Returns\n\n[`CalendarReplacement`](../../replacement/classes/CalendarReplacement.md)\n\n\n<!-- src/entities/calendar/namespace/interfaces/CreateEventOptions.md -->\n# Interface: CreateEventOptions\n\nFields for a new calendar event.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-attendees\"></a> `attendees?` | [`CalendarAttendeeInputBody`](../../../../../generated/calendar/types.gen/type-aliases/CalendarAttendeeInputBody.md)[] | Invited attendees. |\n| <a id=\"property-calendar\"></a> `calendar?` | [`Calendar`](../../calendar/classes/Calendar.md) | Exact calendar to create the event on; takes precedence over the inbox default. |\n| <a id=\"property-conference\"></a> `conference?` | [`ConferenceChange`](../../../../../generated/calendar/types.gen/type-aliases/ConferenceChange.md) | Conference to attach; omit to create the event without one. |\n| <a id=\"property-description\"></a> `description?` | `string` | Optional event body. |\n| <a id=\"property-emaillink\"></a> `emailLink?` | [`Link`](../../../email/link/classes/Link.md) | Connected inbox whose primary calendar receives the event; defaults to the requester's primary inbox. |\n| <a id=\"property-location\"></a> `location?` | `string` | Optional location label. |\n| <a id=\"property-macrocall\"></a> `macroCall?` | `boolean` | Mint a Macro call with the event; its join link lands in the description and location. Cannot be combined with `conference`. |\n| <a id=\"property-outofoffice\"></a> `outOfOffice?` | [`OutOfOfficeProperties`](../../../../../generated/calendar/types.gen/type-aliases/OutOfOfficeProperties.md) | Out-of-office properties; present to create an out-of-office event. |\n| <a id=\"property-recurrencelines\"></a> `recurrenceLines?` | `string`[] | Raw RFC 5545 recurrence properties (`RRULE`, `RDATE`, `EXDATE`). |\n| <a id=\"property-reminders\"></a> `reminders?` | [`EventReminders`](../../../../../generated/calendar/types.gen/type-aliases/EventReminders.md) | Reminder configuration; omit to keep the calendar defaults. |\n| <a id=\"property-time\"></a> `time` | [`EventTime`](../../../../../generated/calendar/types.gen/type-aliases/EventTime.md) | Timed or all-day shape. |\n| <a id=\"property-title\"></a> `title` | `string` | Display title. |\n| <a id=\"property-transparency\"></a> `transparency?` | [`EventTransparency`](../../../../../generated/calendar/types.gen/type-aliases/EventTransparency.md) | Availability behavior. |\n| <a id=\"property-visibility\"></a> `visibility?` | [`EventVisibility`](../../../../../generated/calendar/types.gen/type-aliases/EventVisibility.md) | Event visibility. |\n\n\n<!-- src/entities/calendar/replacement/classes/CalendarReplacement.md -->\n# Class: CalendarReplacement\n\nDurable organizer replacement, recoverable even after the original event is retired.\n\n## Constructors\n\n### Constructor\n\n> **new CalendarReplacement**(`client`, `id`): `CalendarReplacement`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `id` | `string` |\n\n#### Returns\n\n`CalendarReplacement`\n\n## Properties\n\n| Property | Modifier | Type |\n| ------ | ------ | ------ |\n| <a id=\"property-id\"></a> `id` | `readonly` | `string` |\n\n## Methods\n\n### confirm()\n\n> **confirm**(): `Promise`\\<[`CalendarReplacementView`](../../../../../generated/calendar/types.gen/type-aliases/CalendarReplacementView.md)\\>\n\nConfirm the reviewed cancellation and reinvitation, or resume that same operation.\nPresent the preview and obtain the organizer's confirmation before the first call.\n\n#### Returns\n\n`Promise`\\<[`CalendarReplacementView`](../../../../../generated/calendar/types.gen/type-aliases/CalendarReplacementView.md)\\>\n\n***\n\n### discard()\n\n> **discard**(): `Promise`\\<`void`\\>\n\nDiscard an unconfirmed preview. Confirmed operations must be recovered, not discarded.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### status()\n\n> **status**(): `Promise`\\<[`CalendarReplacementView`](../../../../../generated/calendar/types.gen/type-aliases/CalendarReplacementView.md)\\>\n\nRead progress without initiating provider writes.\n\n#### Returns\n\n`Promise`\\<[`CalendarReplacementView`](../../../../../generated/calendar/types.gen/type-aliases/CalendarReplacementView.md)\\>\n"+ "overview": "<!-- src/entities/calendar/namespace/classes/CalendarNamespace.md -->\n# Class: CalendarNamespace\n\nThe calendar surface: the caller's visible calendars, event creation, and\nhandles to individual events and calendars. Backed by calendar_service (the\nSDK reaches it on the gateway's `/calendar` route).\n\n## Constructors\n\n### Constructor\n\n> **new CalendarNamespace**(`client`): `CalendarNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`CalendarNamespace`\n\n## Methods\n\n### availabilityCalendars()\n\n> **availabilityCalendars**(): `Promise`\\<\\{ `calendar`: [`Calendar`](../../calendar/classes/Calendar.md); `contributesToAvailability`: `boolean`; `isPrimary`: `boolean`; `name`: `string`; \\}[]\\>\n\nCalendar availability settings, each referring to a typed calendar.\n\n#### Returns\n\n`Promise`\\<\\{ `calendar`: [`Calendar`](../../calendar/classes/Calendar.md); `contributesToAvailability`: `boolean`; `isPrimary`: `boolean`; `name`: `string`; \\}[]\\>\n\n***\n\n### calendar()\n\n> **calendar**(`id`): [`Calendar`](../../calendar/classes/Calendar.md)\n\nA handle to a calendar by id. Detail loads on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`Calendar`](../../calendar/classes/Calendar.md)\n\n***\n\n### calendars()\n\n> **calendars**(): `Promise`\\<[`Calendar`](../../calendar/classes/Calendar.md)[]\\>\n\nThe caller's visible calendars, primaries and writable first.\n\n#### Returns\n\n`Promise`\\<[`Calendar`](../../calendar/classes/Calendar.md)[]\\>\n\n***\n\n### createEvent()\n\n> **createEvent**(`options`): `Promise`\\<[`CalendarEvent`](../../event/classes/CalendarEvent.md)\\>\n\nCreate a calendar event and return a handle to its synced record.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | [`CreateEventOptions`](../interfaces/CreateEventOptions.md) |\n\n#### Returns\n\n`Promise`\\<[`CalendarEvent`](../../event/classes/CalendarEvent.md)\\>\n\n***\n\n### event()\n\n> **event**(`id`): [`CalendarEvent`](../../event/classes/CalendarEvent.md)\n\nA handle to a calendar event by id, for driving mutations.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`CalendarEvent`](../../event/classes/CalendarEvent.md)\n\n***\n\n### occurrences()\n\n> **occurrences**(`options`): `AsyncGenerator`\\<\\{ `event`: [`CalendarEvent`](../../event/classes/CalendarEvent.md); `occurrence`: [`CalendarOccurrence`](../../../../../generated/storage/types.gen/type-aliases/CalendarOccurrence.md); \\}, `any`, `any`\\>\n\nCalendar occurrences in a viewport, automatically paginated.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | `Omit`\\<[`ListOccurrencesData`](../../../../../generated/storage/types.gen/type-aliases/ListOccurrencesData.md)\\[`\"query\"`\\], `\"cursor\"`\\> |\n\n#### Returns\n\n`AsyncGenerator`\\<\\{ `event`: [`CalendarEvent`](../../event/classes/CalendarEvent.md); `occurrence`: [`CalendarOccurrence`](../../../../../generated/storage/types.gen/type-aliases/CalendarOccurrence.md); \\}, `any`, `any`\\>\n\n***\n\n### replacement()\n\n> **replacement**(`operationId`): [`CalendarReplacement`](../../replacement/classes/CalendarReplacement.md)\n\nRecover a saved replacement, including after its original event was retired.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `operationId` | `string` |\n\n#### Returns\n\n[`CalendarReplacement`](../../replacement/classes/CalendarReplacement.md)\n\n***\n\n### setTeamSharing()\n\n> **setTeamSharing**(`sharing`): `Promise`\\<[`TeamCalendarSharing`](../../../../../generated/calendar/types.gen/type-aliases/TeamCalendarSharing.md)\\>\n\nReplace the team calendar sharing preference.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `sharing` | [`TeamCalendarSharing`](../../../../../generated/calendar/types.gen/type-aliases/TeamCalendarSharing.md) |\n\n#### Returns\n\n`Promise`\\<[`TeamCalendarSharing`](../../../../../generated/calendar/types.gen/type-aliases/TeamCalendarSharing.md)\\>\n\n***\n\n### teamOutOfOffice()\n\n> **teamOutOfOffice**(`options`): `Promise`\\<\\{ `hasMore`: `boolean`; `items`: \\{ `event`: [`CalendarEvent`](../../event/classes/CalendarEvent.md); `occurrenceKey`: `string`; `owner`: [`User`](../../../users/user/classes/User.md); `time`: [`EventTime`](../../../../../generated/storage/types.gen/type-aliases/EventTime.md); `title`: `string` \\| `undefined`; \\}[]; \\}\\>\n\nTeammates' out-of-office occurrences in a bounded viewport. Check hasMore for truncation.\n\n#### Parameters\n\n| Parameter | Type | Description |\n| ------ | ------ | ------ |\n| `options` | \\{ `end`: `string`; `endDate?`: `string`; `limit?`: `number`; `start`: `string`; `startDate?`: `string`; \\} | - |\n| `options.end` | `string` | Exclusive UTC viewport end. |\n| `options.endDate?` | `string` | Exclusive local date boundary for all-day events. |\n| `options.limit?` | `number` | Maximum number of occurrences, from 1 through 2,000. |\n| `options.start` | `string` | Inclusive UTC viewport start. |\n| `options.startDate?` | `string` | Inclusive local date boundary for all-day events. |\n\n#### Returns\n\n`Promise`\\<\\{ `hasMore`: `boolean`; `items`: \\{ `event`: [`CalendarEvent`](../../event/classes/CalendarEvent.md); `occurrenceKey`: `string`; `owner`: [`User`](../../../users/user/classes/User.md); `time`: [`EventTime`](../../../../../generated/storage/types.gen/type-aliases/EventTime.md); `title`: `string` \\| `undefined`; \\}[]; \\}\\>\n\n***\n\n### teamPage()\n\n> **teamPage**(`options`): `Promise`\\<\\{ `items`: (\\{ `contributesToAvailability`: `boolean`; `id`: `string`; `kind`: `\"busy\"`; `owner`: [`User`](../../../users/user/classes/User.md); `time`: [`EventTime`](../../../../../generated/storage/types.gen/type-aliases/EventTime.md); \\} \\| \\{ `contributesToAvailability`: `boolean`; `details`: [`TeamCalendarDetails`](../../../../../generated/storage/types.gen/type-aliases/TeamCalendarDetails.md); `id`: `string`; `kind`: `\"details\"`; `owner`: [`User`](../../../users/user/classes/User.md); `time`: [`EventTime`](../../../../../generated/storage/types.gen/type-aliases/EventTime.md); \\})[]; `members`: \\{ `coverage`: [`TeamCalendarCoverage`](../../../../../generated/storage/types.gen/type-aliases/TeamCalendarCoverage.md); `sharing`: [`TeamCalendarSharing`](../../../../../generated/storage/types.gen/type-aliases/TeamCalendarSharing.md); `user`: [`User`](../../../users/user/classes/User.md); \\}[]; `nextCursor`: `string` \\| `undefined`; \\}\\>\n\nA page of team availability, including its roster and continuation cursor.\n\n#### Parameters\n\n| Parameter | Type | Description |\n| ------ | ------ | ------ |\n| `options` | \\{ `cursor?`: `string` \\| `null`; `end`: `string`; `limit?`: `number` \\| `null`; `start`: `string`; \\} | - |\n| `options.cursor?` | `string` \\| `null` | Continuation returned by the preceding page. |\n| `options.end` | `string` | Exclusive instant. |\n| `options.limit?` | `number` \\| `null` | Maximum source occurrences, at most 2,000. Zero returns the roster only. |\n| `options.start` | `string` | Inclusive instant. |\n\n#### Returns\n\n`Promise`\\<\\{ `items`: (\\{ `contributesToAvailability`: `boolean`; `id`: `string`; `kind`: `\"busy\"`; `owner`: [`User`](../../../users/user/classes/User.md); `time`: [`EventTime`](../../../../../generated/storage/types.gen/type-aliases/EventTime.md); \\} \\| \\{ `contributesToAvailability`: `boolean`; `details`: [`TeamCalendarDetails`](../../../../../generated/storage/types.gen/type-aliases/TeamCalendarDetails.md); `id`: `string`; `kind`: `\"details\"`; `owner`: [`User`](../../../users/user/classes/User.md); `time`: [`EventTime`](../../../../../generated/storage/types.gen/type-aliases/EventTime.md); \\})[]; `members`: \\{ `coverage`: [`TeamCalendarCoverage`](../../../../../generated/storage/types.gen/type-aliases/TeamCalendarCoverage.md); `sharing`: [`TeamCalendarSharing`](../../../../../generated/storage/types.gen/type-aliases/TeamCalendarSharing.md); `user`: [`User`](../../../users/user/classes/User.md); \\}[]; `nextCursor`: `string` \\| `undefined`; \\}\\>\n\n***\n\n### teamSharing()\n\n> **teamSharing**(): `Promise`\\<[`TeamCalendarSharing`](../../../../../generated/calendar/types.gen/type-aliases/TeamCalendarSharing.md)\\>\n\nCurrent sharing preference for the team calendar.\n\n#### Returns\n\n`Promise`\\<[`TeamCalendarSharing`](../../../../../generated/calendar/types.gen/type-aliases/TeamCalendarSharing.md)\\>\n\n\n<!-- src/entities/calendar/namespace/interfaces/CreateEventOptions.md -->\n# Interface: CreateEventOptions\n\nFields for a new calendar event.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-attendees\"></a> `attendees?` | [`CalendarAttendeeInputBody`](../../../../../generated/calendar/types.gen/type-aliases/CalendarAttendeeInputBody.md)[] | Invited attendees. |\n| <a id=\"property-calendar\"></a> `calendar?` | [`Calendar`](../../calendar/classes/Calendar.md) | Exact calendar to create the event on; takes precedence over the inbox default. |\n| <a id=\"property-conference\"></a> `conference?` | [`ConferenceChange`](../../../../../generated/calendar/types.gen/type-aliases/ConferenceChange.md) | Conference to attach; omit to create the event without one. |\n| <a id=\"property-description\"></a> `description?` | `string` | Optional event body. |\n| <a id=\"property-emaillink\"></a> `emailLink?` | [`Link`](../../../email/link/classes/Link.md) | Connected inbox whose primary calendar receives the event; defaults to the requester's primary inbox. |\n| <a id=\"property-location\"></a> `location?` | `string` | Optional location label. |\n| <a id=\"property-macrocall\"></a> `macroCall?` | `boolean` | Mint a Macro call with the event; its join link lands in the description and location. Cannot be combined with `conference`. |\n| <a id=\"property-outofoffice\"></a> `outOfOffice?` | [`OutOfOfficeProperties`](../../../../../generated/calendar/types.gen/type-aliases/OutOfOfficeProperties.md) | Out-of-office properties; present to create an out-of-office event. |\n| <a id=\"property-recurrencelines\"></a> `recurrenceLines?` | `string`[] | Raw RFC 5545 recurrence properties (`RRULE`, `RDATE`, `EXDATE`). |\n| <a id=\"property-reminders\"></a> `reminders?` | [`EventReminders`](../../../../../generated/calendar/types.gen/type-aliases/EventReminders.md) | Reminder configuration; omit to keep the calendar defaults. |\n| <a id=\"property-time\"></a> `time` | [`EventTime`](../../../../../generated/calendar/types.gen/type-aliases/EventTime.md) | Timed or all-day shape. |\n| <a id=\"property-title\"></a> `title` | `string` | Display title. |\n| <a id=\"property-transparency\"></a> `transparency?` | [`EventTransparency`](../../../../../generated/calendar/types.gen/type-aliases/EventTransparency.md) | Availability behavior. |\n| <a id=\"property-visibility\"></a> `visibility?` | [`EventVisibility`](../../../../../generated/calendar/types.gen/type-aliases/EventVisibility.md) | Event visibility. |\n",+ "documentation": "# Macro SDK: calendar\n\nGenerated by TypeDoc. Paths below refer to the canonical Markdown hierarchy. Other entity handles are documented in their named section; request core for shared SDK helpers.\n\n<!-- generated/calendar/types.gen/type-aliases/AttendeeResponseStatus.md -->\n# Type Alias: AttendeeResponseStatus\n\n> **AttendeeResponseStatus** = `\"needs_action\"` \\| `\"accepted\"` \\| `\"declined\"` \\| `\"tentative\"`\n\nRSVP state for an attendee.\n\n\n<!-- generated/calendar/types.gen/type-aliases/CalendarAttendee.md -->\n# Type Alias: CalendarAttendee\n\n> **CalendarAttendee** = \\{ `comment?`: `string` \\| `null`; `displayName?`: `string` \\| `null`; `email`: `string`; `isOptional`: `boolean`; `isOrganizer`: `boolean`; `isSelf`: `boolean`; `responseStatus`: [`AttendeeResponseStatus`](AttendeeResponseStatus.md); \\}\n\nAn attendee on a calendar event.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-comment\"></a> `comment?` | `string` \\| `null` | Optional attendee comment. |\n| <a id=\"property-displayname\"></a> `displayName?` | `string` \\| `null` | Provider display name. |\n| <a id=\"property-email\"></a> `email` | `string` | Normalized email address. |\n| <a id=\"property-isoptional\"></a> `isOptional` | `boolean` | Whether attendance is optional. |\n| <a id=\"property-isorganizer\"></a> `isOrganizer` | `boolean` | Whether this attendee is the organizer. |\n| <a id=\"property-isself\"></a> `isSelf` | `boolean` | Whether this attendee is one of the viewing requester's inboxes. |\n| <a id=\"property-responsestatus\"></a> `responseStatus` | [`AttendeeResponseStatus`](AttendeeResponseStatus.md) | RSVP state. |\n\n\n<!-- generated/calendar/types.gen/type-aliases/CalendarAttendeeInputBody.md -->\n# Type Alias: CalendarAttendeeInputBody\n\n> **CalendarAttendeeInputBody** = \\{ `email`: `string`; `isOptional?`: `boolean`; \\}\n\nAn attendee supplied to a calendar mutation.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-email\"></a> `email` | `string` | Attendee email address. |\n| <a id=\"property-isoptional\"></a> `isOptional?` | `boolean` | Whether attendance is optional. |\n\n\n<!-- generated/calendar/types.gen/type-aliases/CalendarCapabilities.md -->\n# Type Alias: CalendarCapabilities\n\n> **CalendarCapabilities** = \\{ `autoDecline`: `boolean`; `conferenceProvider?`: `null` \\| [`ConferenceProvider`](ConferenceProvider.md); `customRecurrence`: `boolean`; `emailReminders`: `boolean`; `removeConference`: `boolean`; `resetRsvp`: `boolean`; \\}\n\nActual provider capabilities used by calendar editors.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-autodecline\"></a> `autoDecline` | `boolean` | Whether event-level automatic invitation declines are supported. |\n| <a id=\"property-conferenceprovider\"></a> `conferenceProvider?` | `null` \\| [`ConferenceProvider`](ConferenceProvider.md) | - |\n| <a id=\"property-customrecurrence\"></a> `customRecurrence` | `boolean` | Whether arbitrary RFC 5545 recurrence properties can be written. |\n| <a id=\"property-emailreminders\"></a> `emailReminders` | `boolean` | Whether email reminders are delivered by the provider or Macro. |\n| <a id=\"property-removeconference\"></a> `removeConference` | `boolean` | Whether an existing conference can be detached. |\n| <a id=\"property-resetrsvp\"></a> `resetRsvp` | `boolean` | Whether an attendee can reset their RSVP to unanswered. |\n\n\n<!-- generated/calendar/types.gen/type-aliases/CalendarDeletionScopeParam.md -->\n# Type Alias: CalendarDeletionScopeParam\n\n> **CalendarDeletionScopeParam** = `\"all\"` \\| `\"this_event\"` \\| `\"this_and_following\"`\n\nHow much of a recurring series a deletion removes.\n\n\n<!-- generated/calendar/types.gen/type-aliases/CalendarEvent.md -->\n# Type Alias: CalendarEvent\n\n> **CalendarEvent** = \\{ `attendees`: [`CalendarAttendee`](CalendarAttendee.md)[]; `calendarId?`: `string` \\| `null`; `conferenceProvider?`: `null` \\| [`ConferenceProvider`](ConferenceProvider.md); `conferenceUrl?`: `string` \\| `null`; `createdAt`: `string`; `creatorEmail?`: `string` \\| `null`; `creatorName?`: `string` \\| `null`; `description?`: `string` \\| `null`; `eventType?`: [`EventType`](EventType.md); `icalUid`: `string`; `id`: `string`; `isReadOnly`: `boolean`; `location?`: `string` \\| `null`; `organizerEmail?`: `string` \\| `null`; `organizerName?`: `string` \\| `null`; `ownerId`: `string`; `recurrenceLines`: `string`[]; `reminders?`: [`EventReminders`](EventReminders.md); `sequence`: `number`; `sources?`: [`CalendarEventSourceContent`](CalendarEventSourceContent.md)[]; `status`: [`EventStatus`](EventStatus.md); `time`: [`EventTime`](EventTime.md); `title`: `string`; `transparency`: [`EventTransparency`](EventTransparency.md); `updatedAt`: `string`; `visibility`: [`EventVisibility`](EventVisibility.md); \\}\n\nA stable, first-class Macro calendar event entity.\n\nContent fields hold the canonical source's values: the account's primary\ncalendar copy when one is synced, else the freshest remaining copy.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-attendees\"></a> `attendees` | [`CalendarAttendee`](CalendarAttendee.md)[] | Attendees, keyed by email during persistence. |\n| <a id=\"property-calendarid\"></a> `calendarId?` | `string` \\| `null` | Calendar the canonical source belongs to, when known. Absent only in projections stored before calendars were attributed. |\n| <a id=\"property-conferenceprovider\"></a> `conferenceProvider?` | `null` \\| [`ConferenceProvider`](ConferenceProvider.md) | - |\n| <a id=\"property-conferenceurl\"></a> `conferenceUrl?` | `string` \\| `null` | Direct join URL when known. |\n| <a id=\"property-createdat\"></a> `createdAt` | `string` | Entity creation time. |\n| <a id=\"property-creatoremail\"></a> `creatorEmail?` | `string` \\| `null` | Provider-reported creator email. Distinct from the organizer when someone writes onto a calendar they do not own. Omitted from stored projections when unknown so events ingested before this field still compare equal. |\n| <a id=\"property-creatorname\"></a> `creatorName?` | `string` \\| `null` | Provider-reported creator display name. |\n| <a id=\"property-description\"></a> `description?` | `string` \\| `null` | Optional event body. |\n| <a id=\"property-eventtype\"></a> `eventType?` | [`EventType`](EventType.md) | Provider event type. Skipped when it is the regular type so projections stored before event types were modeled still compare equal. |\n| <a id=\"property-icaluid\"></a> `icalUid` | `string` | RFC 5545 UID used to reconcile provider and email sources. |\n| <a id=\"property-id\"></a> `id` | `string` | Macro entity identifier. |\n| <a id=\"property-isreadonly\"></a> `isReadOnly` | `boolean` | Whether the canonical source's calendar prohibits editing it. |\n| <a id=\"property-location\"></a> `location?` | `string` \\| `null` | Optional physical or virtual location label. |\n| <a id=\"property-organizeremail\"></a> `organizerEmail?` | `string` \\| `null` | Organizer email. |\n| <a id=\"property-organizername\"></a> `organizerName?` | `string` \\| `null` | Organizer display name. |\n| <a id=\"property-ownerid\"></a> `ownerId` | `string` | Macro user who owns this event entity. |\n| <a id=\"property-recurrencelines\"></a> `recurrenceLines` | `string`[] | Raw RFC 5545 recurrence properties (`RRULE`, `RDATE`, `EXDATE`). |\n| <a id=\"property-reminders\"></a> `reminders?` | [`EventReminders`](EventReminders.md) | Per-user reminder configuration. Skipped when it is the provider default so projections stored before reminders were modeled still compare equal. |\n| <a id=\"property-sequence\"></a> `sequence` | `number` | Provider/iCalendar sequence number. |\n| <a id=\"property-sources\"></a> `sources?` | [`CalendarEventSourceContent`](CalendarEventSourceContent.md)[] | Content of every active copy of this event, canonical first: the primary calendar's copy, then the freshest. A client picks the copy whose calendar it is showing and falls back to the first. Populated only on the read path, so stored projections omit it. |\n| <a id=\"property-status\"></a> `status` | [`EventStatus`](EventStatus.md) | Event status. |\n| <a id=\"property-time\"></a> `time` | [`EventTime`](EventTime.md) | Timed or all-day shape. |\n| <a id=\"property-title\"></a> `title` | `string` | Display title. |\n| <a id=\"property-transparency\"></a> `transparency` | [`EventTransparency`](EventTransparency.md) | Availability behavior. |\n| <a id=\"property-updatedat\"></a> `updatedAt` | `string` | Entity update time. |\n| <a id=\"property-visibility\"></a> `visibility` | [`EventVisibility`](EventVisibility.md) | Event visibility. |\n\n\n<!-- generated/calendar/types.gen/type-aliases/CalendarEventSourceContent.md -->\n# Type Alias: CalendarEventSourceContent\n\n> **CalendarEventSourceContent** = \\{ `calendarId`: `string`; `creatorEmail?`: `string` \\| `null`; `creatorName?`: `string` \\| `null`; `description?`: `string` \\| `null`; `eventType`: [`EventType`](EventType.md); `isReadOnly`: `boolean`; `location?`: `string` \\| `null`; `reminders`: [`EventReminders`](EventReminders.md); `title`: `string`; `transparency`: [`EventTransparency`](EventTransparency.md); `visibility`: [`EventVisibility`](EventVisibility.md); \\}\n\nThe content one provider copy of an event carries.\n\nGoogle keeps these fields per calendar copy: a shared calendar's copy of a\nmember's event can have its own title, type, reminders, and access role.\nThe entity holds its canonical source's values. Every other copy's values\nare read from here so a client can show the copy that belongs to the\ncalendar being viewed.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-calendarid\"></a> `calendarId` | `string` | Calendar this copy lives on. |\n| <a id=\"property-creatoremail\"></a> `creatorEmail?` | `string` \\| `null` | Provider-reported creator email. |\n| <a id=\"property-creatorname\"></a> `creatorName?` | `string` \\| `null` | Provider-reported creator display name. |\n| <a id=\"property-description\"></a> `description?` | `string` \\| `null` | Optional event body. |\n| <a id=\"property-eventtype\"></a> `eventType` | [`EventType`](EventType.md) | Provider event type. |\n| <a id=\"property-isreadonly\"></a> `isReadOnly` | `boolean` | Whether the calendar's access role prohibits editing this copy. |\n| <a id=\"property-location\"></a> `location?` | `string` \\| `null` | Optional physical or virtual location label. |\n| <a id=\"property-reminders\"></a> `reminders` | [`EventReminders`](EventReminders.md) | Reminder configuration of this copy. |\n| <a id=\"property-title\"></a> `title` | `string` | Display title. |\n| <a id=\"property-transparency\"></a> `transparency` | [`EventTransparency`](EventTransparency.md) | Availability behavior. |\n| <a id=\"property-visibility\"></a> `visibility` | [`EventVisibility`](EventVisibility.md) | Event visibility. |\n\n\n<!-- generated/calendar/types.gen/type-aliases/CalendarProvider.md -->\n# Type Alias: CalendarProvider\n\n> **CalendarProvider** = `\"google\"` \\| `\"outlook\"`\n\nProvider selected from the persisted calendar account and email binding.\n\n\n<!-- generated/calendar/types.gen/type-aliases/CalendarReplacementView.md -->\n# Type Alias: CalendarReplacementView\n\n> **CalendarReplacementView** = \\{ `attendeeCount`: `number`; `completedSteps`: `number`; `event?`: `null` \\| [`CalendarEvent`](CalendarEvent.md); `isSeries`: `boolean`; `operationId`: `string`; `providerUrl?`: `string` \\| `null`; `removeConference`: `boolean`; `replacementUrl?`: `string` \\| `null`; `status`: [`ReplacementStatus`](ReplacementStatus.md); `time`: [`EventTime`](EventTime.md); `title`: `string`; `totalSteps`: `number`; \\}\n\nSafe preview and recovery response; never exposes the opaque provider snapshot.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-attendeecount\"></a> `attendeeCount` | `number` | Guest count for cancellation and reinvitation confirmation. |\n| <a id=\"property-completedsteps\"></a> `completedSteps` | `number` | Number of completed provider steps. |\n| <a id=\"property-event\"></a> `event?` | `null` \\| [`CalendarEvent`](CalendarEvent.md) | - |\n| <a id=\"property-isseries\"></a> `isSeries` | `boolean` | Entire recurring series, including exceptions, is replaced. |\n| <a id=\"property-operationid\"></a> `operationId` | `string` | Use this identity when confirming or checking progress. |\n| <a id=\"property-providerurl\"></a> `providerUrl?` | `string` \\| `null` | Original event for manual review. |\n| <a id=\"property-removeconference\"></a> `removeConference` | `boolean` | The provider conference is removed. |\n| <a id=\"property-replacementurl\"></a> `replacementUrl?` | `string` \\| `null` | New provider event, when creation was confirmed. |\n| <a id=\"property-status\"></a> `status` | [`ReplacementStatus`](ReplacementStatus.md) | Current durable state. |\n| <a id=\"property-time\"></a> `time` | [`EventTime`](EventTime.md) | Frozen time. |\n| <a id=\"property-title\"></a> `title` | `string` | Frozen title. |\n| <a id=\"property-totalsteps\"></a> `totalSteps` | `number` | Number of provider steps in this operation. |\n\n\n<!-- generated/calendar/types.gen/type-aliases/CalendarRsvpScopeParam.md -->\n# Type Alias: CalendarRsvpScopeParam\n\n> **CalendarRsvpScopeParam** = `\"all\"` \\| `\"this_event\"`\n\nHow much of a recurring series an RSVP applies to.\n\nUnlike deletion there is no this-and-following variant: the provider\ncannot express a forward-scoped response, so offering one would be a\npromise sync could not keep.\n\n\n<!-- generated/calendar/types.gen/type-aliases/CalendarUpdateScopeParam.md -->\n# Type Alias: CalendarUpdateScopeParam\n\n> **CalendarUpdateScopeParam** = `\"all\"` \\| `\"this_event\"`\n\nHow much of a recurring series an update applies to.\n\nLike RSVPs there is no this-and-following variant: the provider cannot\nexpress a forward-scoped edit as one write, and emulating it (truncate\nthe series, insert an edited clone) is non-atomic and re-invites the\nattendees of the clone. Compose it from a this-and-following deletion\nand a create when that shape is wanted.\n\n\n<!-- generated/calendar/types.gen/type-aliases/ConferenceChange.md -->\n# Type Alias: ConferenceChange\n\n> **ConferenceChange** = `\"provider_default\"` \\| `\"microsoft_teams\"` \\| `\"google_meet\"` \\| `\"none\"`\n\nA requested change to an event's conferencing. Omitting the field leaves\nthe existing conference untouched; only these values change it.\n\n\n<!-- generated/calendar/types.gen/type-aliases/ConferenceProvider.md -->\n# Type Alias: ConferenceProvider\n\n> **ConferenceProvider** = `\"microsoft_teams\"` \\| `\"google_meet\"` \\| `\"other\"`\n\nThe conferencing system backing an event's join URL.\n\nCalendars can create Google Meet or Microsoft Teams according to their\ncapabilities. Imported third-party conferences are labeled separately.\nOmitting a conference change preserves the current conference; explicit\nchanges still require provider and calendar capability validation.\n\n\n<!-- generated/calendar/types.gen/type-aliases/EventReminderOverride.md -->\n# Type Alias: EventReminderOverride\n\n> **EventReminderOverride** = \\{ `method`: `string`; `minutes`: `number`; \\}\n\nOne reminder: how it alerts and how many minutes before the event start\n(before midnight in the calendar's zone for all-day events) it fires.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-method\"></a> `method` | `string` | Provider method, stored verbatim; only `popup` fires Macro notifications. |\n| <a id=\"property-minutes\"></a> `minutes` | `number` | Minutes before the event start. |\n\n\n<!-- generated/calendar/types.gen/type-aliases/EventReminders.md -->\n# Type Alias: EventReminders\n\n> **EventReminders** = \\{ `overrides?`: [`EventReminderOverride`](EventReminderOverride.md)[]; `useDefault`: `boolean`; \\}\n\nPer-user reminder configuration for an event, mirroring Google's model:\neither the calendar's default reminders apply, or the explicit overrides\nreplace them entirely.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-overrides\"></a> `overrides?` | [`EventReminderOverride`](EventReminderOverride.md)[] | Explicit reminders replacing the defaults when `use_default` is off. |\n| <a id=\"property-usedefault\"></a> `useDefault` | `boolean` | Whether the calendar's default reminders apply. |\n\n\n<!-- generated/calendar/types.gen/type-aliases/EventStatus.md -->\n# Type Alias: EventStatus\n\n> **EventStatus** = `\"confirmed\"` \\| `\"tentative\"` \\| `\"cancelled\"`\n\nCanonical event status.\n\n\n<!-- generated/calendar/types.gen/type-aliases/EventTime.md -->\n# Type Alias: EventTime\n\n> **EventTime** = \\{ `endsAt`: `string`; `kind`: `\"timed\"`; `startsAt`: `string`; `timeZone?`: `string` \\| `null`; \\} \\| \\{ `endDate`: `string`; `kind`: `\"allDay\"`; `startDate`: `string`; \\}\n\nThe mutually exclusive time shape of a calendar event.\n\nFields are renamed per variant rather than with `rename_all_fields`\nbecause utoipa only honors variant-level serde renames when it\nderives the OpenAPI schema.\n\n## Union Members\n\n### Type Literal\n\n\\{ `endsAt`: `string`; `kind`: `\"timed\"`; `startsAt`: `string`; `timeZone?`: `string` \\| `null`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `endsAt` | `string` | Exclusive end instant; equal to the start for an imported point event. |\n| `kind` | `\"timed\"` | - |\n| `startsAt` | `string` | Inclusive start instant. |\n| `timeZone?` | `string` \\| `null` | Original IANA time-zone identifier, when supplied. |\n\n***\n\n### Type Literal\n\n\\{ `endDate`: `string`; `kind`: `\"allDay\"`; `startDate`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `endDate` | `string` | Exclusive local end date. |\n| `kind` | `\"allDay\"` | - |\n| `startDate` | `string` | Inclusive local start date. |\n\n\n<!-- generated/calendar/types.gen/type-aliases/EventTransparency.md -->\n# Type Alias: EventTransparency\n\n> **EventTransparency** = `\"opaque\"` \\| `\"transparent\"`\n\nWhether an event blocks availability.\n\n\n<!-- generated/calendar/types.gen/type-aliases/EventType.md -->\n# Type Alias: EventType\n\n> **EventType** = `\"default\"` \\| `\"out_of_office\"` \\| `\"focus_time\"` \\| `\"working_location\"` \\| `\"birthday\"` \\| `\"from_gmail\"`\n\nGoogle's event type: ordinary meetings versus the status-style entries\n(working location, out of office, focus time, birthdays) Google renders\nand notifies differently. Immutable at the provider after creation.\n\n\n<!-- generated/calendar/types.gen/type-aliases/EventVisibility.md -->\n# Type Alias: EventVisibility\n\n> **EventVisibility** = `\"default\"` \\| `\"public\"` \\| `\"private\"` \\| `\"confidential\"`\n\nVisibility of event details.\n\n\n<!-- generated/calendar/types.gen/type-aliases/OutOfOfficeAutoDeclineMode.md -->\n# Type Alias: OutOfOfficeAutoDeclineMode\n\n> **OutOfOfficeAutoDeclineMode** = `\"decline_none\"` \\| `\"decline_all_conflicting_invitations\"` \\| `\"decline_only_new_conflicting_invitations\"`\n\nHow an out-of-office event responds to conflicting invitations, mirroring\nGoogle's `autoDeclineMode`.\n\n\n<!-- generated/calendar/types.gen/type-aliases/OutOfOfficeProperties.md -->\n# Type Alias: OutOfOfficeProperties\n\n> **OutOfOfficeProperties** = \\{ `autoDeclineMode?`: [`OutOfOfficeAutoDeclineMode`](OutOfOfficeAutoDeclineMode.md); `declineMessage?`: `string` \\| `null`; \\}\n\nThe extra properties Google requires on an out-of-office event, mirroring\nits `outOfOfficeProperties` block. Their presence on a draft or patch is\nwhat marks the mutation as out-of-office.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-autodeclinemode\"></a> `autoDeclineMode?` | [`OutOfOfficeAutoDeclineMode`](OutOfOfficeAutoDeclineMode.md) | How conflicting invitations are handled while the user is out. |\n| <a id=\"property-declinemessage\"></a> `declineMessage?` | `string` \\| `null` | Message returned to organizers whose invitations are auto-declined. |\n\n\n<!-- generated/calendar/types.gen/type-aliases/ReplacementStatus.md -->\n# Type Alias: ReplacementStatus\n\n> **ReplacementStatus** = `\"needs_confirmation\"` \\| `\"in_progress\"` \\| `\"complete\"`\n\nUser-visible workflow state.\n\n\n<!-- generated/calendar/types.gen/type-aliases/TeamCalendarSharing.md -->\n# Type Alias: TeamCalendarSharing\n\n> **TeamCalendarSharing** = `\"all\"` \\| `\"busy_only\"` \\| `\"none\"`\n\nWhat a user exposes through their team membership.\n\n\n<!-- generated/calendar/types.gen/type-aliases/VisibleCalendar.md -->\n# Type Alias: VisibleCalendar\n\n> **VisibleCalendar** = \\{ `capabilities`: [`CalendarCapabilities`](CalendarCapabilities.md); `color?`: `string` \\| `null`; `defaultReminders`: [`EventReminderOverride`](EventReminderOverride.md)[]; `emailAddress`: `string`; `emailLinkId`: `string`; `id`: `string`; `isPrimary`: `boolean`; `isSubscription`: `boolean`; `isWritable`: `boolean`; `name`: `string`; `provider`: [`CalendarProvider`](CalendarProvider.md); `syncError?`: `string` \\| `null`; \\}\n\nA calendar visible to a requester, listed for pickers and filters.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-capabilities\"></a> `capabilities` | [`CalendarCapabilities`](CalendarCapabilities.md) | Provider features available on this actual calendar. |\n| <a id=\"property-color\"></a> `color?` | `string` \\| `null` | Provider color. |\n| <a id=\"property-defaultreminders\"></a> `defaultReminders` | [`EventReminderOverride`](EventReminderOverride.md)[] | Default reminders applied to events that keep `useDefault`. |\n| <a id=\"property-emailaddress\"></a> `emailAddress` | `string` | Connected inbox address, for grouping in multi-inbox pickers. |\n| <a id=\"property-emaillinkid\"></a> `emailLinkId` | `string` | Connected inbox that syncs this calendar. |\n| <a id=\"property-id\"></a> `id` | `string` | Persisted Macro calendar identifier. |\n| <a id=\"property-isprimary\"></a> `isPrimary` | `boolean` | Whether this is its account's primary calendar. |\n| <a id=\"property-issubscription\"></a> `isSubscription` | `boolean` | Whether this is one of Google's shared system calendars (holidays, birthdays) the account subscribes to rather than one a person maintains. |\n| <a id=\"property-iswritable\"></a> `isWritable` | `boolean` | Whether the grant can create and modify events on this calendar. |\n| <a id=\"property-name\"></a> `name` | `string` | Provider display name. |\n| <a id=\"property-provider\"></a> `provider` | [`CalendarProvider`](CalendarProvider.md) | Calendar provider, for display and reconnect routing. |\n| <a id=\"property-syncerror\"></a> `syncError?` | `string` \\| `null` | A persistent sync failure isolated to this calendar, surfaced so the settings row can badge it. `None` while the calendar is syncing normally or a failure has not yet crossed the persistence threshold. |\n\n\n<!-- generated/storage/types.gen/type-aliases/AttendeeResponseStatus.md -->\n# Type Alias: AttendeeResponseStatus\n\n> **AttendeeResponseStatus** = `\"needs_action\"` \\| `\"accepted\"` \\| `\"declined\"` \\| `\"tentative\"`\n\nRSVP state for an attendee.\n\n\n<!-- generated/storage/types.gen/type-aliases/CalendarAttendee.md -->\n# Type Alias: CalendarAttendee\n\n> **CalendarAttendee** = \\{ `comment?`: `string` \\| `null`; `displayName?`: `string` \\| `null`; `email`: `string`; `isOptional`: `boolean`; `isOrganizer`: `boolean`; `isSelf`: `boolean`; `responseStatus`: [`AttendeeResponseStatus`](AttendeeResponseStatus.md); \\}\n\nAn attendee on a calendar event.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-comment\"></a> `comment?` | `string` \\| `null` | Optional attendee comment. |\n| <a id=\"property-displayname\"></a> `displayName?` | `string` \\| `null` | Provider display name. |\n| <a id=\"property-email\"></a> `email` | `string` | Normalized email address. |\n| <a id=\"property-isoptional\"></a> `isOptional` | `boolean` | Whether attendance is optional. |\n| <a id=\"property-isorganizer\"></a> `isOrganizer` | `boolean` | Whether this attendee is the organizer. |\n| <a id=\"property-isself\"></a> `isSelf` | `boolean` | Whether this attendee is one of the viewing requester's inboxes. |\n| <a id=\"property-responsestatus\"></a> `responseStatus` | [`AttendeeResponseStatus`](AttendeeResponseStatus.md) | RSVP state. |\n\n\n<!-- generated/storage/types.gen/type-aliases/CalendarOccurrence.md -->\n# Type Alias: CalendarOccurrence\n\n> **CalendarOccurrence** = \\{ `eventId`: `string`; `isCancelled`: `boolean`; `occurrenceKey`: `string`; `recurrenceId?`: `string` \\| `null`; `time`: [`EventTime`](EventTime.md); \\}\n\nA materialized recurrence instance optimized for range queries.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-eventid\"></a> `eventId` | `string` | Owning event entity. |\n| <a id=\"property-iscancelled\"></a> `isCancelled` | `boolean` | Whether the instance was cancelled. |\n| <a id=\"property-occurrencekey\"></a> `occurrenceKey` | `string` | Stable key within the event. |\n| <a id=\"property-recurrenceid\"></a> `recurrenceId?` | `string` \\| `null` | Provider recurrence identifier, when applicable. |\n| <a id=\"property-time\"></a> `time` | [`EventTime`](EventTime.md) | Instance time. |\n\n\n<!-- generated/storage/types.gen/type-aliases/EventTime.md -->\n# Type Alias: EventTime\n\n> **EventTime** = \\{ `endsAt`: `string`; `kind`: `\"timed\"`; `startsAt`: `string`; `timeZone?`: `string` \\| `null`; \\} \\| \\{ `endDate`: `string`; `kind`: `\"allDay\"`; `startDate`: `string`; \\}\n\nThe mutually exclusive time shape of a calendar event.\n\nFields are renamed per variant rather than with `rename_all_fields`\nbecause utoipa only honors variant-level serde renames when it\nderives the OpenAPI schema.\n\n## Union Members\n\n### Type Literal\n\n\\{ `endsAt`: `string`; `kind`: `\"timed\"`; `startsAt`: `string`; `timeZone?`: `string` \\| `null`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `endsAt` | `string` | Exclusive end instant; equal to the start for an imported point event. |\n| `kind` | `\"timed\"` | - |\n| `startsAt` | `string` | Inclusive start instant. |\n| `timeZone?` | `string` \\| `null` | Original IANA time-zone identifier, when supplied. |\n\n***\n\n### Type Literal\n\n\\{ `endDate`: `string`; `kind`: `\"allDay\"`; `startDate`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `endDate` | `string` | Exclusive local end date. |\n| `kind` | `\"allDay\"` | - |\n| `startDate` | `string` | Inclusive local start date. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ListOccurrencesData.md -->\n# Type Alias: ListOccurrencesData\n\n> **ListOccurrencesData** = \\{ `body?`: `never`; `path?`: `never`; `query`: \\{ `cursor?`: `string`; `end`: `string`; `endDate?`: `string`; `limit?`: `number`; `start`: `string`; `startDate?`: `string`; \\}; `url`: `\"/calendar-events\"`; \\}\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-body\"></a> `body?` | `never` | - |\n| <a id=\"property-path\"></a> `path?` | `never` | - |\n| <a id=\"property-query\"></a> `query` | \\{ `cursor?`: `string`; `end`: `string`; `endDate?`: `string`; `limit?`: `number`; `start`: `string`; `startDate?`: `string`; \\} | - |\n| `query.cursor?` | `string` | Opaque continuation cursor returned by the previous page. |\n| `query.end` | `string` | Exclusive UTC viewport end. |\n| `query.endDate?` | `string` | Exclusive local date boundary for all-day events. |\n| `query.limit?` | `number` | Maximum number of occurrences, from 1 through 2,000. |\n| `query.start` | `string` | Inclusive UTC viewport start. |\n| `query.startDate?` | `string` | Inclusive local date boundary for all-day events. |\n| <a id=\"property-url\"></a> `url` | `\"/calendar-events\"` | - |\n\n\n<!-- generated/storage/types.gen/type-aliases/TeamCalendarCoverage.md -->\n# Type Alias: TeamCalendarCoverage\n\n> **TeamCalendarCoverage** = `\"ready\"` \\| `\"unavailable\"` \\| `\"hidden\"`\n\nWhether a member's calendar projection can establish availability.\n\n\n<!-- generated/storage/types.gen/type-aliases/TeamCalendarDetails.md -->\n# Type Alias: TeamCalendarDetails\n\n> **TeamCalendarDetails** = \\{ `attendees`: [`CalendarAttendee`](CalendarAttendee.md)[]; `calendarName`: `string`; `conferenceUrl?`: `string` \\| `null`; `description?`: `string` \\| `null`; `location?`: `string` \\| `null`; `organizerEmail?`: `string` \\| `null`; `organizerName?`: `string` \\| `null`; `title`: `string`; \\}\n\nSafe details from a single authorized source.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-attendees\"></a> `attendees` | [`CalendarAttendee`](CalendarAttendee.md)[] | Attendees; self flags are relative to the requesting viewer. |\n| <a id=\"property-calendarname\"></a> `calendarName` | `string` | Source calendar name, shown only with details. |\n| <a id=\"property-conferenceurl\"></a> `conferenceUrl?` | `string` \\| `null` | Join URL, if supplied by this source. |\n| <a id=\"property-description\"></a> `description?` | `string` \\| `null` | Body, if supplied by this source. |\n| <a id=\"property-location\"></a> `location?` | `string` \\| `null` | Location, if supplied by this source. |\n| <a id=\"property-organizeremail\"></a> `organizerEmail?` | `string` \\| `null` | Organizer address from this source. |\n| <a id=\"property-organizername\"></a> `organizerName?` | `string` \\| `null` | Organizer name from this source. |\n| <a id=\"property-title\"></a> `title` | `string` | Display title. |\n\n\n<!-- generated/storage/types.gen/type-aliases/TeamCalendarSharing.md -->\n# Type Alias: TeamCalendarSharing\n\n> **TeamCalendarSharing** = `\"all\"` \\| `\"busy_only\"` \\| `\"none\"`\n\nWhat a user exposes through their team membership.\n\n\n<!-- src/entities/calendar/calendar/classes/Calendar.md -->\n# Class: Calendar\n\nA calendar visible to the requester across their connected inboxes: a\nfree-to-construct handle whose detail resolves from the caller's calendar\nlist. There is no fetch-by-id endpoint, so a bare [Calendar.byId](#byid)\nhandle loads its detail by listing the caller's calendars and matching on id.\n\n## Extends\n\n- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\\<[`VisibleCalendar`](../../../../../generated/calendar/types.gen/type-aliases/VisibleCalendar.md)\\>\n\n## Properties\n\n| Property | Modifier | Type | Description | Inherited from |\n| ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-color\"></a> `color` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | Provider color, when set. | - |\n| <a id=\"property-emailaddress\"></a> `emailAddress` | `readonly` | () => `Promise`\\<`string`\\> | Connected inbox address that syncs this calendar. | - |\n| <a id=\"property-emaillink\"></a> `emailLink` | `readonly` | () => `Promise`\\<[`Link`](../../../email/link/classes/Link.md)\\> | The connected inbox (email link) that syncs this calendar. | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |\n| <a id=\"property-isprimary\"></a> `isPrimary` | `readonly` | () => `Promise`\\<`boolean`\\> | Whether this is its account's primary calendar. | - |\n| <a id=\"property-issubscription\"></a> `isSubscription` | `readonly` | () => `Promise`\\<`boolean`\\> | Whether this is a subscribed system calendar (holidays, birthdays). | - |\n| <a id=\"property-iswritable\"></a> `isWritable` | `readonly` | () => `Promise`\\<`boolean`\\> | Whether the grant can create and modify events on this calendar. | - |\n| <a id=\"property-name\"></a> `name` | `readonly` | () => `Promise`\\<`string`\\> | Provider display name. | - |\n| <a id=\"property-syncerror\"></a> `syncError` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | A persistent per-calendar sync failure, surfaced for settings badges. | - |\n\n## Methods\n\n### setContributesToAvailability()\n\n> **setContributesToAvailability**(`contributesToAvailability`): `Promise`\\<`void`\\>\n\nSet whether this calendar contributes to the caller's availability.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `contributesToAvailability` | `boolean` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`VisibleCalendar`](../../../../../generated/calendar/types.gen/type-aliases/VisibleCalendar.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`VisibleCalendar`](../../../../../generated/calendar/types.gen/type-aliases/VisibleCalendar.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`VisibleCalendar`](../../../../../generated/calendar/types.gen/type-aliases/VisibleCalendar.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `id`): `Calendar`\n\nA handle to a calendar by id. Detail loads on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `id` | `string` |\n\n#### Returns\n\n`Calendar`\n\n***\n\n### list()\n\n> `static` **list**(`client`): `Promise`\\<`Calendar`[]\\>\n\nThe caller's visible calendars, primaries and writable first.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`Promise`\\<`Calendar`[]\\>\n\n\n<!-- src/entities/calendar/event/classes/CalendarEvent.md -->\n# Class: CalendarEvent\n\nA Macro calendar event: a handle exposing the event's synced fields and the\nmutations that act on it ([CalendarEvent.update](#update),\n[CalendarEvent.delete](#delete), [CalendarEvent.rsvp](#rsvp)).\n\nThe calendar service has no fetch-by-id endpoint, so a handle reads its\nfields only when seeded with a record — as returned by\n[CalendarEvent.update](#update), [CalendarEvent.rsvp](#rsvp), or\n`calendar.createEvent`. A bare [CalendarEvent.byId](#byid) handle can drive\nmutations, but reading a field on it throws.\n\n## Extends\n\n- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\\<[`CalendarEvent`](../../../../../generated/calendar/types.gen/type-aliases/CalendarEvent.md)\\>\n\n## Properties\n\n| Property | Modifier | Type | Description | Inherited from |\n| ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-attendees\"></a> `attendees` | `readonly` | () => `Promise`\\<[`CalendarAttendee`](../../../../../generated/calendar/types.gen/type-aliases/CalendarAttendee.md)[]\\> | Attendees on the canonical copy. | - |\n| <a id=\"property-calendar\"></a> `calendar` | `readonly` | () => `Promise`\\<[`Calendar`](../../calendar/classes/Calendar.md) \\| `undefined`\\> | The calendar the canonical source belongs to, when known. | - |\n| <a id=\"property-description\"></a> `description` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | Optional event body. | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |\n| <a id=\"property-isreadonly\"></a> `isReadOnly` | `readonly` | () => `Promise`\\<`boolean`\\> | Whether the canonical source's calendar prohibits editing. | - |\n| <a id=\"property-location\"></a> `location` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | Optional physical or virtual location label. | - |\n| <a id=\"property-recurrencelines\"></a> `recurrenceLines` | `readonly` | () => `Promise`\\<`string`[]\\> | Raw RFC 5545 recurrence properties (`RRULE`, `RDATE`, `EXDATE`). | - |\n| <a id=\"property-status\"></a> `status` | `readonly` | () => `Promise`\\<[`EventStatus`](../../../../../generated/calendar/types.gen/type-aliases/EventStatus.md)\\> | Event status. | - |\n| <a id=\"property-time\"></a> `time` | `readonly` | () => `Promise`\\<[`EventTime`](../../../../../generated/calendar/types.gen/type-aliases/EventTime.md)\\> | Timed or all-day shape. | - |\n| <a id=\"property-title\"></a> `title` | `readonly` | () => `Promise`\\<`string`\\> | Display title. | - |\n| <a id=\"property-transparency\"></a> `transparency` | `readonly` | () => `Promise`\\<[`EventTransparency`](../../../../../generated/calendar/types.gen/type-aliases/EventTransparency.md)\\> | Availability behavior. | - |\n\n## Methods\n\n### delete()\n\n> **delete**(`options?`): `Promise`\\<`void`\\>\n\nDelete the event (or a scoped part of a recurring series) at its provider.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options?` | [`DeleteEventOptions`](../interfaces/DeleteEventOptions.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### prepareReplacement()\n\n> **prepareReplacement**(`options`): `Promise`\\<[`CalendarReplacement`](../../replacement/classes/CalendarReplacement.md)\\>\n\nPreview an organizer replacement without cancelling or sending invitations.\nReview replacement.status() before explicitly calling replacement.confirm().\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | \\{ `calendar?`: [`Calendar`](../../calendar/classes/Calendar.md); `recurrenceId?`: `string`; `removeConference`: `boolean`; \\} |\n| `options.calendar?` | [`Calendar`](../../calendar/classes/Calendar.md) |\n| `options.recurrenceId?` | `string` |\n| `options.removeConference` | `boolean` |\n\n#### Returns\n\n`Promise`\\<[`CalendarReplacement`](../../replacement/classes/CalendarReplacement.md)\\>\n\n***\n\n### providerUrl()\n\n> **providerUrl**(`options?`): `Promise`\\<`string` \\| `undefined`\\>\n\nOpen this calendar copy in its provider for actions unavailable through its API.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options?` | \\{ `calendar?`: [`Calendar`](../../calendar/classes/Calendar.md); `recurrenceId?`: `string`; \\} |\n| `options.calendar?` | [`Calendar`](../../calendar/classes/Calendar.md) |\n| `options.recurrenceId?` | `string` |\n\n#### Returns\n\n`Promise`\\<`string` \\| `undefined`\\>\n\n***\n\n### record()\n\n> **record**(): `Promise`\\<[`CalendarEvent`](../../../../../generated/calendar/types.gen/type-aliases/CalendarEvent.md)\\>\n\nThe full synced event record. Available on a seeded handle (from create /\nupdate / rsvp); a bare `byId` handle throws (no fetch-by-id endpoint).\n\n#### Returns\n\n`Promise`\\<[`CalendarEvent`](../../../../../generated/calendar/types.gen/type-aliases/CalendarEvent.md)\\>\n\n***\n\n### rsvp()\n\n> **rsvp**(`options`): `Promise`\\<`CalendarEvent`\\>\n\nRecord the requester's RSVP and return a handle to the synced record.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | [`RsvpEventOptions`](../interfaces/RsvpEventOptions.md) |\n\n#### Returns\n\n`Promise`\\<`CalendarEvent`\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`CalendarEvent`](../../../../../generated/calendar/types.gen/type-aliases/CalendarEvent.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`CalendarEvent`](../../../../../generated/calendar/types.gen/type-aliases/CalendarEvent.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`CalendarEvent`](../../../../../generated/calendar/types.gen/type-aliases/CalendarEvent.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)\n\n***\n\n### update()\n\n> **update**(`options`): `Promise`\\<`CalendarEvent`\\>\n\nUpdate the event and return a handle to its synced record.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | [`UpdateEventOptions`](../interfaces/UpdateEventOptions.md) |\n\n#### Returns\n\n`Promise`\\<`CalendarEvent`\\>\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `id`): `CalendarEvent`\n\nA handle to a calendar event by id, for driving mutations. Reading a\nfield on it throws (there is no fetch-by-id endpoint).\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `id` | `string` |\n\n#### Returns\n\n`CalendarEvent`\n\n***\n\n### fromRecord()\n\n> `static` **fromRecord**(`client`, `record`): `CalendarEvent`\n\nA handle seeded with a synced event record; reads resolve without a fetch.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `record` | [`CalendarEvent`](../../../../../generated/calendar/types.gen/type-aliases/CalendarEvent.md) |\n\n#### Returns\n\n`CalendarEvent`\n\n\n<!-- src/entities/calendar/event/interfaces/DeleteEventOptions.md -->\n# Interface: DeleteEventOptions\n\nHow a deletion is scoped across a recurring series.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-calendar\"></a> `calendar?` | [`Calendar`](../../calendar/classes/Calendar.md) | Calendar whose copy of the event is deleted, for a multi-calendar event. Omit to delete the canonical copy. |\n| <a id=\"property-recurrenceid\"></a> `recurrenceId?` | `string` | Original-start key of the occurrence a scoped deletion targets. |\n| <a id=\"property-scope\"></a> `scope?` | [`CalendarDeletionScopeParam`](../../../../../generated/calendar/types.gen/type-aliases/CalendarDeletionScopeParam.md) | Deletion scope; defaults to the entire event or series. |\n\n\n<!-- src/entities/calendar/event/interfaces/RsvpEventOptions.md -->\n# Interface: RsvpEventOptions\n\nThe RSVP to record and how it is scoped across a recurring series.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-calendar\"></a> `calendar?` | [`Calendar`](../../calendar/classes/Calendar.md) | Calendar whose copy of the event is answered, for a multi-calendar event. Omit to answer on the canonical copy. |\n| <a id=\"property-recurrenceid\"></a> `recurrenceId?` | `string` | Original-start key of the occurrence the response targets. |\n| <a id=\"property-response\"></a> `response` | [`AttendeeResponseStatus`](../../../../../generated/calendar/types.gen/type-aliases/AttendeeResponseStatus.md) | The response to record for the connected account. |\n| <a id=\"property-scope\"></a> `scope?` | [`CalendarRsvpScopeParam`](../../../../../generated/calendar/types.gen/type-aliases/CalendarRsvpScopeParam.md) | How much of a recurring series the response covers. Omit to let `recurrenceId` decide. |\n\n\n<!-- src/entities/calendar/event/interfaces/UpdateEventOptions.md -->\n# Interface: UpdateEventOptions\n\nFields to change on an event; omitted fields are left untouched.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-attendees\"></a> `attendees?` | [`CalendarAttendeeInputBody`](../../../../../generated/calendar/types.gen/type-aliases/CalendarAttendeeInputBody.md)[] | Replacement attendee list. |\n| <a id=\"property-calendar\"></a> `calendar?` | [`Calendar`](../../calendar/classes/Calendar.md) | Calendar whose copy of the event is patched, for a multi-calendar event. Omit to patch the canonical copy. |\n| <a id=\"property-conference\"></a> `conference?` | [`ConferenceChange`](../../../../../generated/calendar/types.gen/type-aliases/ConferenceChange.md) | Provider conference change; omit to retain it. Outlook removal requires a separately confirmed replacement via prepareReplacement(). |\n| <a id=\"property-description\"></a> `description?` | `string` | Replacement description; an empty string clears it. |\n| <a id=\"property-location\"></a> `location?` | `string` | Replacement location; an empty string clears it. |\n| <a id=\"property-outofoffice\"></a> `outOfOffice?` | [`OutOfOfficeProperties`](../../../../../generated/calendar/types.gen/type-aliases/OutOfOfficeProperties.md) | Replacement out-of-office properties, applied only to an event that is already out-of-office. |\n| <a id=\"property-recurrenceid\"></a> `recurrenceId?` | `string` | Original-start key of the occurrence the update targets. |\n| <a id=\"property-recurrencelines\"></a> `recurrenceLines?` | `string`[] | Replacement recurrence properties; an empty list clears them. |\n| <a id=\"property-reminders\"></a> `reminders?` | [`EventReminders`](../../../../../generated/calendar/types.gen/type-aliases/EventReminders.md) | Replacement reminder configuration. |\n| <a id=\"property-scope\"></a> `scope?` | [`CalendarUpdateScopeParam`](../../../../../generated/calendar/types.gen/type-aliases/CalendarUpdateScopeParam.md) | How much of a recurring series the update covers. Omit to let `recurrenceId` decide. |\n| <a id=\"property-time\"></a> `time?` | [`EventTime`](../../../../../generated/calendar/types.gen/type-aliases/EventTime.md) | Replacement time. |\n| <a id=\"property-title\"></a> `title?` | `string` | Replacement title; an empty string clears it. |\n| <a id=\"property-transparency\"></a> `transparency?` | [`EventTransparency`](../../../../../generated/calendar/types.gen/type-aliases/EventTransparency.md) | Replacement availability behavior. |\n| <a id=\"property-visibility\"></a> `visibility?` | [`EventVisibility`](../../../../../generated/calendar/types.gen/type-aliases/EventVisibility.md) | Replacement visibility. |\n\n\n<!-- src/entities/calendar/namespace/classes/CalendarNamespace.md -->\n# Class: CalendarNamespace\n\nThe calendar surface: the caller's visible calendars, event creation, and\nhandles to individual events and calendars. Backed by calendar_service (the\nSDK reaches it on the gateway's `/calendar` route).\n\n## Constructors\n\n### Constructor\n\n> **new CalendarNamespace**(`client`): `CalendarNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`CalendarNamespace`\n\n## Methods\n\n### availabilityCalendars()\n\n> **availabilityCalendars**(): `Promise`\\<\\{ `calendar`: [`Calendar`](../../calendar/classes/Calendar.md); `contributesToAvailability`: `boolean`; `isPrimary`: `boolean`; `name`: `string`; \\}[]\\>\n\nCalendar availability settings, each referring to a typed calendar.\n\n#### Returns\n\n`Promise`\\<\\{ `calendar`: [`Calendar`](../../calendar/classes/Calendar.md); `contributesToAvailability`: `boolean`; `isPrimary`: `boolean`; `name`: `string`; \\}[]\\>\n\n***\n\n### calendar()\n\n> **calendar**(`id`): [`Calendar`](../../calendar/classes/Calendar.md)\n\nA handle to a calendar by id. Detail loads on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`Calendar`](../../calendar/classes/Calendar.md)\n\n***\n\n### calendars()\n\n> **calendars**(): `Promise`\\<[`Calendar`](../../calendar/classes/Calendar.md)[]\\>\n\nThe caller's visible calendars, primaries and writable first.\n\n#### Returns\n\n`Promise`\\<[`Calendar`](../../calendar/classes/Calendar.md)[]\\>\n\n***\n\n### createEvent()\n\n> **createEvent**(`options`): `Promise`\\<[`CalendarEvent`](../../event/classes/CalendarEvent.md)\\>\n\nCreate a calendar event and return a handle to its synced record.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | [`CreateEventOptions`](../interfaces/CreateEventOptions.md) |\n\n#### Returns\n\n`Promise`\\<[`CalendarEvent`](../../event/classes/CalendarEvent.md)\\>\n\n***\n\n### event()\n\n> **event**(`id`): [`CalendarEvent`](../../event/classes/CalendarEvent.md)\n\nA handle to a calendar event by id, for driving mutations.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`CalendarEvent`](../../event/classes/CalendarEvent.md)\n\n***\n\n### occurrences()\n\n> **occurrences**(`options`): `AsyncGenerator`\\<\\{ `event`: [`CalendarEvent`](../../event/classes/CalendarEvent.md); `occurrence`: [`CalendarOccurrence`](../../../../../generated/storage/types.gen/type-aliases/CalendarOccurrence.md); \\}, `any`, `any`\\>\n\nCalendar occurrences in a viewport, automatically paginated.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | `Omit`\\<[`ListOccurrencesData`](../../../../../generated/storage/types.gen/type-aliases/ListOccurrencesData.md)\\[`\"query\"`\\], `\"cursor\"`\\> |\n\n#### Returns\n\n`AsyncGenerator`\\<\\{ `event`: [`CalendarEvent`](../../event/classes/CalendarEvent.md); `occurrence`: [`CalendarOccurrence`](../../../../../generated/storage/types.gen/type-aliases/CalendarOccurrence.md); \\}, `any`, `any`\\>\n\n***\n\n### replacement()\n\n> **replacement**(`operationId`): [`CalendarReplacement`](../../replacement/classes/CalendarReplacement.md)\n\nRecover a saved replacement, including after its original event was retired.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `operationId` | `string` |\n\n#### Returns\n\n[`CalendarReplacement`](../../replacement/classes/CalendarReplacement.md)\n\n***\n\n### setTeamSharing()\n\n> **setTeamSharing**(`sharing`): `Promise`\\<[`TeamCalendarSharing`](../../../../../generated/calendar/types.gen/type-aliases/TeamCalendarSharing.md)\\>\n\nReplace the team calendar sharing preference.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `sharing` | [`TeamCalendarSharing`](../../../../../generated/calendar/types.gen/type-aliases/TeamCalendarSharing.md) |\n\n#### Returns\n\n`Promise`\\<[`TeamCalendarSharing`](../../../../../generated/calendar/types.gen/type-aliases/TeamCalendarSharing.md)\\>\n\n***\n\n### teamOutOfOffice()\n\n> **teamOutOfOffice**(`options`): `Promise`\\<\\{ `hasMore`: `boolean`; `items`: \\{ `event`: [`CalendarEvent`](../../event/classes/CalendarEvent.md); `occurrenceKey`: `string`; `owner`: [`User`](../../../users/user/classes/User.md); `time`: [`EventTime`](../../../../../generated/storage/types.gen/type-aliases/EventTime.md); `title`: `string` \\| `undefined`; \\}[]; \\}\\>\n\nTeammates' out-of-office occurrences in a bounded viewport. Check hasMore for truncation.\n\n#### Parameters\n\n| Parameter | Type | Description |\n| ------ | ------ | ------ |\n| `options` | \\{ `end`: `string`; `endDate?`: `string`; `limit?`: `number`; `start`: `string`; `startDate?`: `string`; \\} | - |\n| `options.end` | `string` | Exclusive UTC viewport end. |\n| `options.endDate?` | `string` | Exclusive local date boundary for all-day events. |\n| `options.limit?` | `number` | Maximum number of occurrences, from 1 through 2,000. |\n| `options.start` | `string` | Inclusive UTC viewport start. |\n| `options.startDate?` | `string` | Inclusive local date boundary for all-day events. |\n\n#### Returns\n\n`Promise`\\<\\{ `hasMore`: `boolean`; `items`: \\{ `event`: [`CalendarEvent`](../../event/classes/CalendarEvent.md); `occurrenceKey`: `string`; `owner`: [`User`](../../../users/user/classes/User.md); `time`: [`EventTime`](../../../../../generated/storage/types.gen/type-aliases/EventTime.md); `title`: `string` \\| `undefined`; \\}[]; \\}\\>\n\n***\n\n### teamPage()\n\n> **teamPage**(`options`): `Promise`\\<\\{ `items`: (\\{ `contributesToAvailability`: `boolean`; `id`: `string`; `kind`: `\"busy\"`; `owner`: [`User`](../../../users/user/classes/User.md); `time`: [`EventTime`](../../../../../generated/storage/types.gen/type-aliases/EventTime.md); \\} \\| \\{ `contributesToAvailability`: `boolean`; `details`: [`TeamCalendarDetails`](../../../../../generated/storage/types.gen/type-aliases/TeamCalendarDetails.md); `id`: `string`; `kind`: `\"details\"`; `owner`: [`User`](../../../users/user/classes/User.md); `time`: [`EventTime`](../../../../../generated/storage/types.gen/type-aliases/EventTime.md); \\})[]; `members`: \\{ `coverage`: [`TeamCalendarCoverage`](../../../../../generated/storage/types.gen/type-aliases/TeamCalendarCoverage.md); `sharing`: [`TeamCalendarSharing`](../../../../../generated/storage/types.gen/type-aliases/TeamCalendarSharing.md); `user`: [`User`](../../../users/user/classes/User.md); \\}[]; `nextCursor`: `string` \\| `undefined`; \\}\\>\n\nA page of team availability, including its roster and continuation cursor.\n\n#### Parameters\n\n| Parameter | Type | Description |\n| ------ | ------ | ------ |\n| `options` | \\{ `cursor?`: `string` \\| `null`; `end`: `string`; `limit?`: `number` \\| `null`; `start`: `string`; \\} | - |\n| `options.cursor?` | `string` \\| `null` | Continuation returned by the preceding page. |\n| `options.end` | `string` | Exclusive instant. |\n| `options.limit?` | `number` \\| `null` | Maximum source occurrences, at most 2,000. Zero returns the roster only. |\n| `options.start` | `string` | Inclusive instant. |\n\n#### Returns\n\n`Promise`\\<\\{ `items`: (\\{ `contributesToAvailability`: `boolean`; `id`: `string`; `kind`: `\"busy\"`; `owner`: [`User`](../../../users/user/classes/User.md); `time`: [`EventTime`](../../../../../generated/storage/types.gen/type-aliases/EventTime.md); \\} \\| \\{ `contributesToAvailability`: `boolean`; `details`: [`TeamCalendarDetails`](../../../../../generated/storage/types.gen/type-aliases/TeamCalendarDetails.md); `id`: `string`; `kind`: `\"details\"`; `owner`: [`User`](../../../users/user/classes/User.md); `time`: [`EventTime`](../../../../../generated/storage/types.gen/type-aliases/EventTime.md); \\})[]; `members`: \\{ `coverage`: [`TeamCalendarCoverage`](../../../../../generated/storage/types.gen/type-aliases/TeamCalendarCoverage.md); `sharing`: [`TeamCalendarSharing`](../../../../../generated/storage/types.gen/type-aliases/TeamCalendarSharing.md); `user`: [`User`](../../../users/user/classes/User.md); \\}[]; `nextCursor`: `string` \\| `undefined`; \\}\\>\n\n***\n\n### teamSharing()\n\n> **teamSharing**(): `Promise`\\<[`TeamCalendarSharing`](../../../../../generated/calendar/types.gen/type-aliases/TeamCalendarSharing.md)\\>\n\nCurrent sharing preference for the team calendar.\n\n#### Returns\n\n`Promise`\\<[`TeamCalendarSharing`](../../../../../generated/calendar/types.gen/type-aliases/TeamCalendarSharing.md)\\>\n\n\n<!-- src/entities/calendar/namespace/interfaces/CreateEventOptions.md -->\n# Interface: CreateEventOptions\n\nFields for a new calendar event.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-attendees\"></a> `attendees?` | [`CalendarAttendeeInputBody`](../../../../../generated/calendar/types.gen/type-aliases/CalendarAttendeeInputBody.md)[] | Invited attendees. |\n| <a id=\"property-calendar\"></a> `calendar?` | [`Calendar`](../../calendar/classes/Calendar.md) | Exact calendar to create the event on; takes precedence over the inbox default. |\n| <a id=\"property-conference\"></a> `conference?` | [`ConferenceChange`](../../../../../generated/calendar/types.gen/type-aliases/ConferenceChange.md) | Conference to attach; omit to create the event without one. |\n| <a id=\"property-description\"></a> `description?` | `string` | Optional event body. |\n| <a id=\"property-emaillink\"></a> `emailLink?` | [`Link`](../../../email/link/classes/Link.md) | Connected inbox whose primary calendar receives the event; defaults to the requester's primary inbox. |\n| <a id=\"property-location\"></a> `location?` | `string` | Optional location label. |\n| <a id=\"property-macrocall\"></a> `macroCall?` | `boolean` | Mint a Macro call with the event; its join link lands in the description and location. Cannot be combined with `conference`. |\n| <a id=\"property-outofoffice\"></a> `outOfOffice?` | [`OutOfOfficeProperties`](../../../../../generated/calendar/types.gen/type-aliases/OutOfOfficeProperties.md) | Out-of-office properties; present to create an out-of-office event. |\n| <a id=\"property-recurrencelines\"></a> `recurrenceLines?` | `string`[] | Raw RFC 5545 recurrence properties (`RRULE`, `RDATE`, `EXDATE`). |\n| <a id=\"property-reminders\"></a> `reminders?` | [`EventReminders`](../../../../../generated/calendar/types.gen/type-aliases/EventReminders.md) | Reminder configuration; omit to keep the calendar defaults. |\n| <a id=\"property-time\"></a> `time` | [`EventTime`](../../../../../generated/calendar/types.gen/type-aliases/EventTime.md) | Timed or all-day shape. |\n| <a id=\"property-title\"></a> `title` | `string` | Display title. |\n| <a id=\"property-transparency\"></a> `transparency?` | [`EventTransparency`](../../../../../generated/calendar/types.gen/type-aliases/EventTransparency.md) | Availability behavior. |\n| <a id=\"property-visibility\"></a> `visibility?` | [`EventVisibility`](../../../../../generated/calendar/types.gen/type-aliases/EventVisibility.md) | Event visibility. |\n\n\n<!-- src/entities/calendar/replacement/classes/CalendarReplacement.md -->\n# Class: CalendarReplacement\n\nDurable organizer replacement, recoverable even after the original event is retired.\n\n## Constructors\n\n### Constructor\n\n> **new CalendarReplacement**(`client`, `id`): `CalendarReplacement`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `id` | `string` |\n\n#### Returns\n\n`CalendarReplacement`\n\n## Properties\n\n| Property | Modifier | Type |\n| ------ | ------ | ------ |\n| <a id=\"property-id\"></a> `id` | `readonly` | `string` |\n\n## Methods\n\n### confirm()\n\n> **confirm**(): `Promise`\\<[`CalendarReplacementView`](../../../../../generated/calendar/types.gen/type-aliases/CalendarReplacementView.md)\\>\n\nConfirm the reviewed cancellation and reinvitation, or resume that same operation.\nPresent the preview and obtain the organizer's confirmation before the first call.\n\n#### Returns\n\n`Promise`\\<[`CalendarReplacementView`](../../../../../generated/calendar/types.gen/type-aliases/CalendarReplacementView.md)\\>\n\n***\n\n### discard()\n\n> **discard**(): `Promise`\\<`void`\\>\n\nDiscard an unconfirmed preview. Confirmed operations must be recovered, not discarded.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### status()\n\n> **status**(): `Promise`\\<[`CalendarReplacementView`](../../../../../generated/calendar/types.gen/type-aliases/CalendarReplacementView.md)\\>\n\nRead progress without initiating provider writes.\n\n#### Returns\n\n`Promise`\\<[`CalendarReplacementView`](../../../../../generated/calendar/types.gen/type-aliases/CalendarReplacementView.md)\\>\n"},{"name": "calls",- "description": "Read call records and transcripts.",+ "description": "Read and edit call records, transcripts and meeting links.","overview": "<!-- src/entities/calls/namespace/classes/CallRecordNamespace.md -->\n# Class: CallRecordNamespace\n\n## Constructors\n\n### Constructor\n\n> **new CallRecordNamespace**(`client`): `CallRecordNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`CallRecordNamespace`\n\n## Methods\n\n### byId()\n\n> **byId**(`id`): [`CallRecord`](../../call-record/classes/CallRecord.md)\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`CallRecord`](../../call-record/classes/CallRecord.md)\n\n***\n\n### search()\n\n> **search**(`query`, `opts?`): `AsyncGenerator`\\<[`CallRecord`](../../call-record/classes/CallRecord.md)\\>\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `query` | `string` |\n| `opts?` | [`SearchOpts`](../../../search/interfaces/SearchOpts.md) |\n\n#### Returns\n\n`AsyncGenerator`\\<[`CallRecord`](../../call-record/classes/CallRecord.md)\\>\n",- "documentation": "# Macro SDK: calls\n\nGenerated by TypeDoc. Paths below refer to the canonical Markdown hierarchy. Other entity handles are documented in their named section; request core for shared SDK helpers.\n\n<!-- generated/storage/types.gen/type-aliases/AccessLevel.md -->\n# Type Alias: AccessLevel\n\n> **AccessLevel** = `\"view\"` \\| `\"comment\"` \\| `\"edit\"` \\| `\"owner\"`\n\nOrdered from least to most access top -> bottom\n\n\n<!-- generated/storage/types.gen/type-aliases/BotSenderProfile.md -->\n# Type Alias: BotSenderProfile\n\n> **BotSenderProfile** = \\{ `avatar_url?`: `string` \\| `null`; `name`: `string`; \\}\n\nPublic bot profile attached to bot-authored messages.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-avatar_url\"></a> `avatar_url?` | `string` \\| `null` | Bot avatar URL. |\n| <a id=\"property-name\"></a> `name` | `string` | Bot display name. |\n\n\n<!-- generated/storage/types.gen/type-aliases/CallRecord.md -->\n# Type Alias: CallRecord\n\n> **CallRecord** = \\{ `callId`: `string`; `channelId?`: `string` \\| `null`; `channelName?`: `string` \\| `null`; `createdBy`: `string`; `customName?`: `string` \\| `null`; `durationMs?`: `number` \\| `null`; `egressId?`: `string` \\| `null`; `endedAt?`: `string` \\| `null`; `guests`: [`CallRecordGuest`](CallRecordGuest.md)[]; `isActive`: `boolean`; `participants`: [`CallRecordParticipant`](CallRecordParticipant.md)[]; `recordingPreviewUrl?`: `string` \\| `null`; `recordingStartedAt?`: `string` \\| `null`; `recordingUrl?`: `string` \\| `null`; `roomName`: `string`; `shareWithTeam`: `boolean`; `startedAt`: `string`; `status?`: `null` \\| [`CallStatus`](CallStatus.md); `summary?`: `string` \\| `null`; `teamShareAccessLevel?`: `null` \\| [`AccessLevel`](AccessLevel.md); `transcript`: [`CallRecordTranscriptSegment`](CallRecordTranscriptSegment.md)[]; `userAccessLevel?`: `null` \\| [`AccessLevel`](AccessLevel.md); `viewerHasDeclined?`: `boolean`; \\}\n\nFull record of a call, unifying rows from `calls` (active) and\n`call_records` (archived) into a single response shape.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-callid\"></a> `callId` | `string` | The call identifier. |\n| <a id=\"property-channelid\"></a> `channelId?` | `string` \\| `null` | The channel this call belongs to. |\n| <a id=\"property-channelname\"></a> `channelName?` | `string` \\| `null` | Resolved display name for the channel. |\n| <a id=\"property-createdby\"></a> `createdBy` | `string` | User who created the call. |\n| <a id=\"property-customname\"></a> `customName?` | `string` \\| `null` | User-supplied or AI-generated display name for the call. Only set on archived `call_records`; active calls always return `None`. |\n| <a id=\"property-durationms\"></a> `durationMs?` | `number` \\| `null` | Call duration in milliseconds (None if still active). |\n| <a id=\"property-egressid\"></a> `egressId?` | `string` \\| `null` | Recording egress ID, if any. |\n| <a id=\"property-endedat\"></a> `endedAt?` | `string` \\| `null` | When the call ended (None if still active). |\n| <a id=\"property-guests\"></a> `guests` | [`CallRecordGuest`](CallRecordGuest.md)[] | Non-account guests (both active and historic). Guests only ever exist on standalone meeting calls, never on channel calls. |\n| <a id=\"property-isactive\"></a> `isActive` | `boolean` | Whether the call is currently active (from `calls` table). |\n| <a id=\"property-participants\"></a> `participants` | [`CallRecordParticipant`](CallRecordParticipant.md)[] | Macro-account participants (both active and historic). |\n| <a id=\"property-recordingpreviewurl\"></a> `recordingPreviewUrl?` | `string` \\| `null` | Presigned URL for the call recording preview image, if available. |\n| <a id=\"property-recordingstartedat\"></a> `recordingStartedAt?` | `string` \\| `null` | When the egress recording actually began. `None` until the `egress_started` webhook arrives (typically a few seconds after `started_at`). Frontend should anchor transcript-to-audio sync to this value when present, falling back to `started_at` otherwise. |\n| <a id=\"property-recordingurl\"></a> `recordingUrl?` | `string` \\| `null` | Presigned URL for the call recording, if available. |\n| <a id=\"property-roomname\"></a> `roomName` | `string` | The RTC room name. |\n| <a id=\"property-sharewithteam\"></a> `shareWithTeam` | `boolean` | Whether the call is shared with the creator's team. While the call is live this is the pending toggle applied at archive; afterwards it mirrors `team_share_access_level`. |\n| <a id=\"property-startedat\"></a> `startedAt` | `string` | When the call started (created_at for active, started_at for archived). |\n| <a id=\"property-status\"></a> `status?` | `null` \\| [`CallStatus`](CallStatus.md) | - |\n| <a id=\"property-summary\"></a> `summary?` | `string` \\| `null` | AI-generated summary of the call. Only set on archived `call_records` once summarization has run; active calls always return `None`. |\n| <a id=\"property-teamshareaccesslevel\"></a> `teamShareAccessLevel?` | `null` \\| [`AccessLevel`](AccessLevel.md) | - |\n| <a id=\"property-transcript\"></a> `transcript` | [`CallRecordTranscriptSegment`](CallRecordTranscriptSegment.md)[] | Transcript segments ordered by `sequence_num`. |\n| <a id=\"property-useraccesslevel\"></a> `userAccessLevel?` | `null` \\| [`AccessLevel`](AccessLevel.md) | - |\n| <a id=\"property-viewerhasdeclined\"></a> `viewerHasDeclined?` | `boolean` | Whether the authenticated viewer has declined this call on any device. Set on the single-record read so clients that missed `call_declined` can still stop ringing via reconciliation; `false` in list contexts. |\n\n\n<!-- generated/storage/types.gen/type-aliases/CallRecordGuest.md -->\n# Type Alias: CallRecordGuest\n\n> **CallRecordGuest** = \\{ `displayName`: `string`; `id`: [`GuestId`](GuestId.md); `joinedAt`: `string`; `leftAt?`: `string` \\| `null`; \\}\n\nA non-account guest as returned in a [`CallRecord`].\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-displayname\"></a> `displayName` | `string` | Guest-provided display name. |\n| <a id=\"property-id\"></a> `id` | [`GuestId`](GuestId.md) | Opaque guest identity; matches the guest's transcript `speaker_id`. |\n| <a id=\"property-joinedat\"></a> `joinedAt` | `string` | When the guest joined the call. |\n| <a id=\"property-leftat\"></a> `leftAt?` | `string` \\| `null` | When the guest left (None if still in an active call). |\n\n\n<!-- generated/storage/types.gen/type-aliases/CallRecordParticipant.md -->\n# Type Alias: CallRecordParticipant\n\n> **CallRecordParticipant** = \\{ `joinedAt`: `string`; `leftAt?`: `string` \\| `null`; `userId`: `string`; \\}\n\nA participant as returned in a [`CallRecord`] (historic — includes `left_at`).\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-joinedat\"></a> `joinedAt` | `string` | When the user joined the call. |\n| <a id=\"property-leftat\"></a> `leftAt?` | `string` \\| `null` | When the user left (None if still in an active call). |\n| <a id=\"property-userid\"></a> `userId` | `string` | The Macro user id. |\n\n\n<!-- generated/storage/types.gen/type-aliases/CallRecordTranscriptSegment.md -->\n# Type Alias: CallRecordTranscriptSegment\n\n> **CallRecordTranscriptSegment** = \\{ `content`: `string`; `diarizedSpeakerId?`: `string` \\| `null`; `endedAt?`: `string` \\| `null`; `segmentId?`: `string` \\| `null`; `sequenceNum`: `number`; `speakerId`: `string`; `startedAt`: `string`; `transcriptId`: `string`; \\}\n\nA transcript segment as returned in a [`CallRecord`].\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-content\"></a> `content` | `string` | The transcribed text content. |\n| <a id=\"property-diarizedspeakerid\"></a> `diarizedSpeakerId?` | `string` \\| `null` | Stable per-speaker identifier produced by the STT provider's diarization pass. Unique across tracks in the call. `None` when the provider didn't return a speaker label. |\n| <a id=\"property-endedat\"></a> `endedAt?` | `string` \\| `null` | When the speaker stopped (if known). |\n| <a id=\"property-segmentid\"></a> `segmentId?` | `string` \\| `null` | LiveKit segment ID (nullable for archived records). |\n| <a id=\"property-sequencenum\"></a> `sequenceNum` | `number` | Ordering within the call. |\n| <a id=\"property-speakerid\"></a> `speakerId` | `string` | The speaker's user ID. |\n| <a id=\"property-startedat\"></a> `startedAt` | `string` | When the speaker started this segment. |\n| <a id=\"property-transcriptid\"></a> `transcriptId` | `string` | Stable DB-row id for the segment. |\n\n\n<!-- generated/storage/types.gen/type-aliases/CallStatus.md -->\n# Type Alias: CallStatus\n\n> **CallStatus** = `\"ATTENDED\"` \\| `\"MISSED\"` \\| `\"UNATTENDED\"`\n\nViewer-relative attendance status for a call record.\nSerializes as `ATTENDED`, `MISSED`, or `UNATTENDED`.\n\n\n<!-- generated/storage/types.gen/type-aliases/CountedReaction.md -->\n# Type Alias: CountedReaction\n\n> **CountedReaction** = \\{ `emoji`: `string`; `users`: `string`[]; \\}\n\nReaction emoji and the users who added it.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-emoji\"></a> `emoji` | `string` | Emoji being reacted with. |\n| <a id=\"property-users\"></a> `users` | `string`[] | User identifiers. |\n\n\n<!-- generated/storage/types.gen/type-aliases/DocumentId.md -->\n# Type Alias: DocumentId\n\n> **DocumentId** = `string`\n\nA validated document identifier. Historical document ids need not be UUIDs.\n\n\n<!-- generated/storage/types.gen/type-aliases/GuestId.md -->\n# Type Alias: GuestId\n\n> **GuestId** = `string`\n\nA non-account guest of a single call session.\n\nThe id doubles as the guest's RTC participant identity, so identities are\nopaque UUIDs and never share a namespace (or a column) with Macro user\nids. Only the server mints them; Macro users keep `macro|…` identities,\nso an RTC identity classifies as exactly one of the two.\n\n\n<!-- generated/storage/types.gen/type-aliases/ImportedAuthor.md -->\n# Type Alias: ImportedAuthor\n\n> **ImportedAuthor** = \\{ `name`: `string`; \\}\n\nDisplay attribution for a comment imported from an external document.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-name\"></a> `name` | `string` | Original author text; never interpreted as an authenticated principal. |\n\n\n<!-- generated/storage/types.gen/type-aliases/Message.md -->\n# Type Alias: Message\n\n> **Message** = \\{ `attachments`: [`MessageAttachment`](MessageAttachment.md)[]; `bot_profile?`: `null` \\| [`BotSenderProfile`](BotSenderProfile.md); `content`: `string`; `created_at`: `string`; `deleted_at?`: `string` \\| `null`; `edited_at?`: `string` \\| `null`; `guest_name?`: `string` \\| `null`; `id`: `string`; `imported_author?`: `null` \\| [`ImportedAuthor`](ImportedAuthor.md); `mentions`: [`SimpleMention`](SimpleMention.md)[]; `parent`: [`MessageParent`](MessageParent.md); `reactions`: [`CountedReaction`](CountedReaction.md)[]; `sender_id`: `string`; `thread_id?`: `string` \\| `null`; `triggered_by?`: `string` \\| `null`; `updated_at`: `string`; \\}\n\nShared message representation for channel timelines and entity discussions.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-attachments\"></a> `attachments` | [`MessageAttachment`](MessageAttachment.md)[] | Attached entities. |\n| <a id=\"property-bot_profile\"></a> `bot_profile?` | `null` \\| [`BotSenderProfile`](BotSenderProfile.md) | - |\n| <a id=\"property-content\"></a> `content` | `string` | Macro Markdown body. |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | Creation time. |\n| <a id=\"property-deleted_at\"></a> `deleted_at?` | `string` \\| `null` | Message tombstone, independent of thread deletion. |\n| <a id=\"property-edited_at\"></a> `edited_at?` | `string` \\| `null` | Last content edit, if any. |\n| <a id=\"property-guest_name\"></a> `guest_name?` | `string` \\| `null` | Display name of a verified call guest, retained after the call ends. |\n| <a id=\"property-id\"></a> `id` | `string` | Message UUID. |\n| <a id=\"property-imported_author\"></a> `imported_author?` | `null` \\| [`ImportedAuthor`](ImportedAuthor.md) | - |\n| <a id=\"property-mentions\"></a> `mentions` | [`SimpleMention`](SimpleMention.md)[] | Tracked mentions, retained when a caller changes attachments only. |\n| <a id=\"property-parent\"></a> `parent` | [`MessageParent`](MessageParent.md) | Entity that owns this conversation. |\n| <a id=\"property-reactions\"></a> `reactions` | [`CountedReaction`](CountedReaction.md)[] | Aggregated reactions. |\n| <a id=\"property-sender_id\"></a> `sender_id` | `string` | Authenticated actor or owner of imported content. |\n| <a id=\"property-thread_id\"></a> `thread_id?` | `string` \\| `null` | Root message UUID for replies; absent on roots. |\n| <a id=\"property-triggered_by\"></a> `triggered_by?` | `string` \\| `null` | User who triggered a bot-authored message. |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` | Last persisted update. |\n\n\n<!-- generated/storage/types.gen/type-aliases/MessageAttachment.md -->\n# Type Alias: MessageAttachment\n\n> **MessageAttachment** = \\{ `created_at`: `string`; `entity_id`: `string`; `entity_type`: `string`; `height?`: `number` \\| `null`; `id`: `string`; `width?`: `number` \\| `null`; \\}\n\nAn entity attached to a message.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | When the attachment was added. |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | Attached entity identifier. |\n| <a id=\"property-entity_type\"></a> `entity_type` | `string` | Attached entity type. |\n| <a id=\"property-height\"></a> `height?` | `number` \\| `null` | Optional media height. |\n| <a id=\"property-id\"></a> `id` | `string` | Attachment UUID. |\n| <a id=\"property-width\"></a> `width?` | `number` \\| `null` | Optional media width. |\n\n\n<!-- generated/storage/types.gen/type-aliases/MessageParent.md -->\n# Type Alias: MessageParent\n\n> **MessageParent** = \\{ `id`: `string`; `type`: `\"channel\"`; \\} \\| \\{ `id`: [`DocumentId`](DocumentId.md); `type`: `\"document\"`; \\} \\| \\{ `id`: `string`; `type`: `\"initiative\"`; \\} \\| \\{ `id`: `string`; `type`: `\"crm_company\"`; \\} \\| \\{ `id`: `string`; `type`: `\"crm_contact\"`; \\} \\| \\{ `id`: `string`; `type`: `\"call\"`; \\}\n\nThe entity whose permissions and lifecycle govern a message.\n\n## Union Members\n\n### Type Literal\n\n\\{ `id`: `string`; `type`: `\"channel\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | A channel, including direct messages. |\n| `type` | `\"channel\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: [`DocumentId`](DocumentId.md); `type`: `\"document\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | [`DocumentId`](DocumentId.md) | A document, including tasks and PDFs. |\n| `type` | `\"document\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: `string`; `type`: `\"initiative\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | An initiative, presented as a project in the application. |\n| `type` | `\"initiative\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: `string`; `type`: `\"crm_company\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | A CRM company. |\n| `type` | `\"crm_company\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: `string`; `type`: `\"crm_contact\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | A CRM contact. |\n| `type` | `\"crm_contact\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: `string`; `type`: `\"call\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | A video call and its persistent chat thread. |\n| `type` | `\"call\"` | - |\n\n\n<!-- generated/storage/types.gen/type-aliases/SimpleMention.md -->\n# Type Alias: SimpleMention\n\n> **SimpleMention** = \\{ `entity_id`: `string`; `entity_type`: `string`; \\}\n\nA mention tracked in a message body.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | Mentioned entity identifier. |\n| <a id=\"property-entity_type\"></a> `entity_type` | `string` | Mentioned entity type. |\n\n\n<!-- src/entities/calls/call-record/classes/CallRecord.md -->\n# Class: CallRecord\n\nA Macro call record (an archived or still active call).\n\n## Extends\n\n- [`FavoritableEntity`](../../../entity/classes/FavoritableEntity.md)\\<`CallRecordDetail`\\>\n\n## Properties\n\n| Property | Modifier | Type | Default value | Description | Overrides | Inherited from |\n| ------ | ------ | ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-channel\"></a> `channel` | `readonly` | () => `Promise`\\<[`Channel`](../../../channels/channel/classes/Channel.md) \\| `undefined`\\> | `...` | The channel the call belongs to, if it is a channel call. | - | - |\n| <a id=\"property-channelname\"></a> `channelName` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | `...` | The display name of the channel the call belongs to. | - | - |\n| <a id=\"property-creator\"></a> `creator` | `readonly` | () => `Promise`\\<[`User`](../../../users/user/classes/User.md)\\> | `...` | The user who started the call. | - | - |\n| <a id=\"property-durationms\"></a> `durationMs` | `readonly` | () => `Promise`\\<`number` \\| `undefined`\\> | `...` | Call duration in milliseconds (undefined if still active). | - | - |\n| <a id=\"property-endedat\"></a> `endedAt` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | `...` | When the call ended (undefined if still active). | - | - |\n| <a id=\"property-entitytype\"></a> `entityType` | `readonly` | `\"call\"` | `'call'` | Favorites identify call records as `call`. | [`FavoritableEntity`](../../../entity/classes/FavoritableEntity.md).[`entityType`](../../../entity/classes/FavoritableEntity.md#property-entitytype) | - |\n| <a id=\"property-guests\"></a> `guests` | `readonly` | () => `Promise`\\<[`CallRecordGuest`](../../../../../generated/storage/types.gen/type-aliases/CallRecordGuest.md)[]\\> | `...` | Current and past guests; each id matches its transcript speaker id. | - | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | `undefined` | - | - | [`FavoritableEntity`](../../../entity/classes/FavoritableEntity.md).[`id`](../../../entity/classes/FavoritableEntity.md#property-id) |\n| <a id=\"property-isactive\"></a> `isActive` | `readonly` | () => `Promise`\\<`boolean`\\> | `...` | Whether the call is still in progress. | - | - |\n| <a id=\"property-name\"></a> `name` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | `...` | The call's display name (user-supplied or AI-generated; unset while active). | - | - |\n| <a id=\"property-participants\"></a> `participants` | `readonly` | () => `Promise`\\<[`CallRecordParticipant`](../../../../../generated/storage/types.gen/type-aliases/CallRecordParticipant.md)[]\\> | `...` | Macro-account participants, both active and historic. | - | - |\n| <a id=\"property-recordingpreviewurl\"></a> `recordingPreviewUrl` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | `...` | URL of the recording preview (thumbnail), once available. | - | - |\n| <a id=\"property-recordingstartedat\"></a> `recordingStartedAt` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | `...` | When the recording started, if it was recorded. | - | - |\n| <a id=\"property-recordingurl\"></a> `recordingUrl` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | `...` | URL of the call recording, once available. | - | - |\n| <a id=\"property-roomname\"></a> `roomName` | `readonly` | () => `Promise`\\<`string`\\> | `...` | The realtime room the call runs in. | - | - |\n| <a id=\"property-sharewithteam\"></a> `shareWithTeam` | `readonly` | () => `Promise`\\<`boolean`\\> | `...` | Whether the call is shared with the creator's team: the pending toggle while the call is live, the canonical grant once it is archived. | - | - |\n| <a id=\"property-startedat\"></a> `startedAt` | `readonly` | () => `Promise`\\<`string`\\> | `...` | When the call started. | - | - |\n| <a id=\"property-status\"></a> `status` | `readonly` | () => `Promise`\\<`NonNullable`\\<CallStatus \\| null \\| undefined\\> \\| `undefined`\\> | `...` | The call's status (undefined until set). | - | - |\n| <a id=\"property-summary\"></a> `summary` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | `...` | AI-generated summary of the call, once summarization has run. | - | - |\n| <a id=\"property-teamshareaccesslevel\"></a> `teamShareAccessLevel` | `readonly` | () => `Promise`\\<`NonNullable`\\<AccessLevel \\| null \\| undefined\\> \\| `undefined`\\> | `...` | The canonical access level granted to the creator's team once the call is archived, or null when it is not shared. Calls only ever grant `'view'`; while the call is live this is null and [CallRecord.shareWithTeam](#property-sharewithteam) carries the pending toggle. | - | - |\n| <a id=\"property-transcript\"></a> `transcript` | `readonly` | () => `Promise`\\<[`CallRecordTranscriptSegment`](../../../../../generated/storage/types.gen/type-aliases/CallRecordTranscriptSegment.md)[]\\> | `...` | Transcript segments, ordered by sequence number. | - | - |\n| <a id=\"property-search\"></a> `search` | `static` | (`client`, `query`, `searchOpts?`) => `AsyncGenerator`\\<`CallRecord`\\> | `...` | Search calls by name and transcript, most relevant first, auto-paginated. | - | - |\n\n## Methods\n\n### delete()\n\n> **delete**(): `Promise`\\<`void`\\>\n\nDelete the call record.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### favorite()\n\n> **favorite**(): `Promise`\\<`CallRecord`\\>\n\nAdd this entity to the user's favorites. Returns this handle for chaining.\nPlain unwrap: favoriting alters the user's favorites collection, not this\nentity's own detail, so there's nothing cached to invalidate.\n\n#### Returns\n\n`Promise`\\<`CallRecord`\\>\n\n#### Inherited from\n\n[`FavoritableEntity`](../../../entity/classes/FavoritableEntity.md).[`favorite`](../../../entity/classes/FavoritableEntity.md#favorite)\n\n***\n\n### message()\n\n> **message**(`id`): [`CallMessage`](../../message/classes/CallMessage.md)\n\nA message in this call's persistent chat. Fields load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`CallMessage`](../../message/classes/CallMessage.md)\n\n***\n\n### rename()\n\n> **rename**(`name`): `Promise`\\<`void`\\>\n\nRename the call or clear the custom name.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `name` | `string` \\| `null` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### setTeamShare()\n\n> **setTeamShare**(`shared`): `Promise`\\<`void`\\>\n\nShare the call with the creator's team (view access), or unshare it.\nWhile the call is live this sets the pending toggle any participant with\nedit access may change; once archived only the call's creator may change\nit and the API answers 403 otherwise.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `shared` | `boolean` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`CallRecord`](../../../../../generated/storage/types.gen/type-aliases/CallRecord.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`CallRecord`](../../../../../generated/storage/types.gen/type-aliases/CallRecord.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`CallRecord`](../../../../../generated/storage/types.gen/type-aliases/CallRecord.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`FavoritableEntity`](../../../entity/classes/FavoritableEntity.md).[`toJSON`](../../../entity/classes/FavoritableEntity.md#tojson)\n\n***\n\n### unfavorite()\n\n> **unfavorite**(): `Promise`\\<`CallRecord`\\>\n\nRemove this entity from the user's favorites. Returns this handle for chaining.\n\n#### Returns\n\n`Promise`\\<`CallRecord`\\>\n\n#### Inherited from\n\n[`FavoritableEntity`](../../../entity/classes/FavoritableEntity.md).[`unfavorite`](../../../entity/classes/FavoritableEntity.md#unfavorite)\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `id`): `CallRecord`\n\nA handle to a call record by id. Details load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `id` | `string` |\n\n#### Returns\n\n`CallRecord`\n\n\n<!-- src/entities/calls/message/classes/CallMessage.md -->\n# Class: CallMessage\n\nA message in a call's single persistent chat thread.\n\n## Extends\n\n- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\\<[`Message`](../../../../../generated/storage/types.gen/type-aliases/Message.md)\\>\n\n## Properties\n\n| Property | Modifier | Type | Description | Inherited from |\n| ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-callid\"></a> `callId` | `readonly` | `string` | - | - |\n| <a id=\"property-content\"></a> `content` | `readonly` | () => `Promise`\\<`string`\\> | The message body (markdown). | - |\n| <a id=\"property-createdat\"></a> `createdAt` | `readonly` | () => `Promise`\\<`string`\\> | When the message was created. | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |\n| <a id=\"property-updatedat\"></a> `updatedAt` | `readonly` | () => `Promise`\\<`string`\\> | When the message was last updated. | - |\n\n## Methods\n\n### author()\n\n> **author**(): `Promise`\\<[`User`](../../../users/user/classes/User.md)\\>\n\nThe user who sent this message.\n\n#### Returns\n\n`Promise`\\<[`User`](../../../users/user/classes/User.md)\\>\n\n***\n\n### call()\n\n> **call**(): [`CallRecord`](../../call-record/classes/CallRecord.md)\n\nThe call whose chat contains this message.\n\n#### Returns\n\n[`CallRecord`](../../call-record/classes/CallRecord.md)\n\n***\n\n### delete()\n\n> **delete**(): `Promise`\\<`void`\\>\n\nDelete this message, preserving the rest of the call's chat.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### edit()\n\n> **edit**(`body`): `Promise`\\<`CallMessage`\\>\n\nReplace this message's body.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `body` | `string` \\| [`RichMessage`](../../../../mentions/interfaces/RichMessage.md) |\n\n#### Returns\n\n`Promise`\\<`CallMessage`\\>\n\n***\n\n### reply()\n\n> **reply**(`body`): `Promise`\\<`CallMessage`\\>\n\nReply in the call's canonical thread, including when this is a reply.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `body` | `string` \\| [`RichMessage`](../../../../mentions/interfaces/RichMessage.md) |\n\n#### Returns\n\n`Promise`\\<`CallMessage`\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`Message`](../../../../../generated/storage/types.gen/type-aliases/Message.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`Message`](../../../../../generated/storage/types.gen/type-aliases/Message.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`Message`](../../../../../generated/storage/types.gen/type-aliases/Message.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `callId`, `id`): `CallMessage`\n\nA handle to a message by id. Fields load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `callId` | `string` |\n| `id` | `string` |\n\n#### Returns\n\n`CallMessage`\n\n***\n\n### from()\n\n> `static` **from**(`client`, `callId`, `record`): `CallMessage`\n\nBuild a message from its record without another fetch.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `callId` | `string` |\n| `record` | [`Message`](../../../../../generated/storage/types.gen/type-aliases/Message.md) |\n\n#### Returns\n\n`CallMessage`\n\n\n<!-- src/entities/calls/namespace/classes/CallRecordNamespace.md -->\n# Class: CallRecordNamespace\n\n## Constructors\n\n### Constructor\n\n> **new CallRecordNamespace**(`client`): `CallRecordNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`CallRecordNamespace`\n\n## Methods\n\n### byId()\n\n> **byId**(`id`): [`CallRecord`](../../call-record/classes/CallRecord.md)\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`CallRecord`](../../call-record/classes/CallRecord.md)\n\n***\n\n### search()\n\n> **search**(`query`, `opts?`): `AsyncGenerator`\\<[`CallRecord`](../../call-record/classes/CallRecord.md)\\>\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `query` | `string` |\n| `opts?` | [`SearchOpts`](../../../search/interfaces/SearchOpts.md) |\n\n#### Returns\n\n`AsyncGenerator`\\<[`CallRecord`](../../call-record/classes/CallRecord.md)\\>\n"+ "documentation": "# Macro SDK: calls\n\nGenerated by TypeDoc. Paths below refer to the canonical Markdown hierarchy. Other entity handles are documented in their named section; request core for shared SDK helpers.\n\n<!-- generated/storage/types.gen/type-aliases/AccessLevel.md -->\n# Type Alias: AccessLevel\n\n> **AccessLevel** = `\"view\"` \\| `\"comment\"` \\| `\"edit\"` \\| `\"owner\"`\n\nOrdered from least to most access top -> bottom\n\n\n<!-- generated/storage/types.gen/type-aliases/BotSenderProfile.md -->\n# Type Alias: BotSenderProfile\n\n> **BotSenderProfile** = \\{ `avatar_url?`: `string` \\| `null`; `name`: `string`; \\}\n\nPublic bot profile attached to bot-authored messages.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-avatar_url\"></a> `avatar_url?` | `string` \\| `null` | Bot avatar URL. |\n| <a id=\"property-name\"></a> `name` | `string` | Bot display name. |\n\n\n<!-- generated/storage/types.gen/type-aliases/CallRecord.md -->\n# Type Alias: CallRecord\n\n> **CallRecord** = \\{ `callId`: `string`; `channelId?`: `string` \\| `null`; `channelName?`: `string` \\| `null`; `createdBy`: `string`; `customName?`: `string` \\| `null`; `durationMs?`: `number` \\| `null`; `egressId?`: `string` \\| `null`; `endedAt?`: `string` \\| `null`; `guests`: [`CallRecordGuest`](CallRecordGuest.md)[]; `isActive`: `boolean`; `participants`: [`CallRecordParticipant`](CallRecordParticipant.md)[]; `recordingPreviewUrl?`: `string` \\| `null`; `recordingStartedAt?`: `string` \\| `null`; `recordingUrl?`: `string` \\| `null`; `roomName`: `string`; `shareWithTeam`: `boolean`; `startedAt`: `string`; `status?`: `null` \\| [`CallStatus`](CallStatus.md); `summary?`: `string` \\| `null`; `teamShareAccessLevel?`: `null` \\| [`AccessLevel`](AccessLevel.md); `transcript`: [`CallRecordTranscriptSegment`](CallRecordTranscriptSegment.md)[]; `userAccessLevel?`: `null` \\| [`AccessLevel`](AccessLevel.md); `viewerHasDeclined?`: `boolean`; \\}\n\nFull record of a call, unifying rows from `calls` (active) and\n`call_records` (archived) into a single response shape.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-callid\"></a> `callId` | `string` | The call identifier. |\n| <a id=\"property-channelid\"></a> `channelId?` | `string` \\| `null` | The channel this call belongs to. |\n| <a id=\"property-channelname\"></a> `channelName?` | `string` \\| `null` | Resolved display name for the channel. |\n| <a id=\"property-createdby\"></a> `createdBy` | `string` | User who created the call. |\n| <a id=\"property-customname\"></a> `customName?` | `string` \\| `null` | User-supplied or AI-generated display name for the call. Only set on archived `call_records`; active calls always return `None`. |\n| <a id=\"property-durationms\"></a> `durationMs?` | `number` \\| `null` | Call duration in milliseconds (None if still active). |\n| <a id=\"property-egressid\"></a> `egressId?` | `string` \\| `null` | Recording egress ID, if any. |\n| <a id=\"property-endedat\"></a> `endedAt?` | `string` \\| `null` | When the call ended (None if still active). |\n| <a id=\"property-guests\"></a> `guests` | [`CallRecordGuest`](CallRecordGuest.md)[] | Non-account guests (both active and historic). Guests only ever exist on standalone meeting calls, never on channel calls. |\n| <a id=\"property-isactive\"></a> `isActive` | `boolean` | Whether the call is currently active (from `calls` table). |\n| <a id=\"property-participants\"></a> `participants` | [`CallRecordParticipant`](CallRecordParticipant.md)[] | Macro-account participants (both active and historic). |\n| <a id=\"property-recordingpreviewurl\"></a> `recordingPreviewUrl?` | `string` \\| `null` | Presigned URL for the call recording preview image, if available. |\n| <a id=\"property-recordingstartedat\"></a> `recordingStartedAt?` | `string` \\| `null` | When the egress recording actually began. `None` until the `egress_started` webhook arrives (typically a few seconds after `started_at`). Frontend should anchor transcript-to-audio sync to this value when present, falling back to `started_at` otherwise. |\n| <a id=\"property-recordingurl\"></a> `recordingUrl?` | `string` \\| `null` | Presigned URL for the call recording, if available. |\n| <a id=\"property-roomname\"></a> `roomName` | `string` | The RTC room name. |\n| <a id=\"property-sharewithteam\"></a> `shareWithTeam` | `boolean` | Whether the call is shared with the creator's team. While the call is live this is the pending toggle applied at archive; afterwards it mirrors `team_share_access_level`. |\n| <a id=\"property-startedat\"></a> `startedAt` | `string` | When the call started (created_at for active, started_at for archived). |\n| <a id=\"property-status\"></a> `status?` | `null` \\| [`CallStatus`](CallStatus.md) | - |\n| <a id=\"property-summary\"></a> `summary?` | `string` \\| `null` | AI-generated summary of the call. Only set on archived `call_records` once summarization has run; active calls always return `None`. |\n| <a id=\"property-teamshareaccesslevel\"></a> `teamShareAccessLevel?` | `null` \\| [`AccessLevel`](AccessLevel.md) | - |\n| <a id=\"property-transcript\"></a> `transcript` | [`CallRecordTranscriptSegment`](CallRecordTranscriptSegment.md)[] | Transcript segments ordered by `sequence_num`. |\n| <a id=\"property-useraccesslevel\"></a> `userAccessLevel?` | `null` \\| [`AccessLevel`](AccessLevel.md) | - |\n| <a id=\"property-viewerhasdeclined\"></a> `viewerHasDeclined?` | `boolean` | Whether the authenticated viewer has declined this call on any device. Set on the single-record read so clients that missed `call_declined` can still stop ringing via reconciliation; `false` in list contexts. |\n\n\n<!-- generated/storage/types.gen/type-aliases/CallRecordGuest.md -->\n# Type Alias: CallRecordGuest\n\n> **CallRecordGuest** = \\{ `displayName`: `string`; `id`: [`GuestId`](GuestId.md); `joinedAt`: `string`; `leftAt?`: `string` \\| `null`; \\}\n\nA non-account guest as returned in a [`CallRecord`].\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-displayname\"></a> `displayName` | `string` | Guest-provided display name. |\n| <a id=\"property-id\"></a> `id` | [`GuestId`](GuestId.md) | Opaque guest identity; matches the guest's transcript `speaker_id`. |\n| <a id=\"property-joinedat\"></a> `joinedAt` | `string` | When the guest joined the call. |\n| <a id=\"property-leftat\"></a> `leftAt?` | `string` \\| `null` | When the guest left (None if still in an active call). |\n\n\n<!-- generated/storage/types.gen/type-aliases/CallRecordParticipant.md -->\n# Type Alias: CallRecordParticipant\n\n> **CallRecordParticipant** = \\{ `joinedAt`: `string`; `leftAt?`: `string` \\| `null`; `userId`: `string`; \\}\n\nA participant as returned in a [`CallRecord`] (historic — includes `left_at`).\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-joinedat\"></a> `joinedAt` | `string` | When the user joined the call. |\n| <a id=\"property-leftat\"></a> `leftAt?` | `string` \\| `null` | When the user left (None if still in an active call). |\n| <a id=\"property-userid\"></a> `userId` | `string` | The Macro user id. |\n\n\n<!-- generated/storage/types.gen/type-aliases/CallRecordTranscriptSegment.md -->\n# Type Alias: CallRecordTranscriptSegment\n\n> **CallRecordTranscriptSegment** = \\{ `content`: `string`; `diarizedSpeakerId?`: `string` \\| `null`; `endedAt?`: `string` \\| `null`; `segmentId?`: `string` \\| `null`; `sequenceNum`: `number`; `speakerId`: `string`; `startedAt`: `string`; `transcriptId`: `string`; \\}\n\nA transcript segment as returned in a [`CallRecord`].\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-content\"></a> `content` | `string` | The transcribed text content. |\n| <a id=\"property-diarizedspeakerid\"></a> `diarizedSpeakerId?` | `string` \\| `null` | Stable per-speaker identifier produced by the STT provider's diarization pass. Unique across tracks in the call. `None` when the provider didn't return a speaker label. |\n| <a id=\"property-endedat\"></a> `endedAt?` | `string` \\| `null` | When the speaker stopped (if known). |\n| <a id=\"property-segmentid\"></a> `segmentId?` | `string` \\| `null` | LiveKit segment ID (nullable for archived records). |\n| <a id=\"property-sequencenum\"></a> `sequenceNum` | `number` | Ordering within the call. |\n| <a id=\"property-speakerid\"></a> `speakerId` | `string` | The speaker's user ID. |\n| <a id=\"property-startedat\"></a> `startedAt` | `string` | When the speaker started this segment. |\n| <a id=\"property-transcriptid\"></a> `transcriptId` | `string` | Stable DB-row id for the segment. |\n\n\n<!-- generated/storage/types.gen/type-aliases/CallStatus.md -->\n# Type Alias: CallStatus\n\n> **CallStatus** = `\"ATTENDED\"` \\| `\"MISSED\"` \\| `\"UNATTENDED\"`\n\nViewer-relative attendance status for a call record.\nSerializes as `ATTENDED`, `MISSED`, or `UNATTENDED`.\n\n\n<!-- generated/storage/types.gen/type-aliases/CountedReaction.md -->\n# Type Alias: CountedReaction\n\n> **CountedReaction** = \\{ `emoji`: `string`; `users`: `string`[]; \\}\n\nReaction emoji and the users who added it.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-emoji\"></a> `emoji` | `string` | Emoji being reacted with. |\n| <a id=\"property-users\"></a> `users` | `string`[] | User identifiers. |\n\n\n<!-- generated/storage/types.gen/type-aliases/CustomSpeakerAssignment.md -->\n# Type Alias: CustomSpeakerAssignment\n\n> **CustomSpeakerAssignment** = \\{ `customSpeaker`: `string`; `diarizedSpeakerId`: `string`; \\}\n\nOne per-diarized-speaker override, used in [`EditCallTranscriptRequest`].\n\n`custom_speaker = None` clears any existing override for this\n`diarized_speaker_id`; `Some(macro_user_id)` sets it. The string is\nexpected to parse as a `MacroUserId` (e.g. `macro|[email protected]`);\nthe service layer rejects malformed values with `400 Bad Request`.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-customspeaker\"></a> `customSpeaker` | `string` | Macro user id to attribute matching rows to, or `None` to clear. |\n| <a id=\"property-diarizedspeakerid\"></a> `diarizedSpeakerId` | `string` | The diarization label whose rows this assignment targets. |\n\n\n<!-- generated/storage/types.gen/type-aliases/DocumentId.md -->\n# Type Alias: DocumentId\n\n> **DocumentId** = `string`\n\nA validated document identifier. Historical document ids need not be UUIDs.\n\n\n<!-- generated/storage/types.gen/type-aliases/EntityPermission.md -->\n# Type Alias: EntityPermission\n\n> **EntityPermission** = \\{ `access_level`: [`AccessLevel`](AccessLevel.md); `type`: `\"access_level\"`; \\} \\| \\{ `type`: `\"channel_view_only\"`; \\} \\| \\{ `role`: [`ParticipantRole`](ParticipantRole.md); `type`: `\"channel_role\"`; \\} \\| \\{ `role`: [`TeamRole`](TeamRole.md); `type`: `\"team_role\"`; \\}\n\nA user's permission for an entity, discriminated by entity kind.\n\nItems (documents, chats, projects, threads) use access levels.\nChannels use view-only permission or participant roles.\n\n## Union Members\n\n### Type Literal\n\n\\{ `access_level`: [`AccessLevel`](AccessLevel.md); `type`: `\"access_level\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `access_level` | [`AccessLevel`](AccessLevel.md) | The access level the user has. |\n| `type` | `\"access_level\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"channel_view_only\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `role`: [`ParticipantRole`](ParticipantRole.md); `type`: `\"channel_role\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `role` | [`ParticipantRole`](ParticipantRole.md) | The role the user has in the channel. |\n| `type` | `\"channel_role\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `role`: [`TeamRole`](TeamRole.md); `type`: `\"team_role\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `role` | [`TeamRole`](TeamRole.md) | The role the user has in the team. |\n| `type` | `\"team_role\"` | - |\n\n\n<!-- generated/storage/types.gen/type-aliases/GuestId.md -->\n# Type Alias: GuestId\n\n> **GuestId** = `string`\n\nA non-account guest of a single call session.\n\nThe id doubles as the guest's RTC participant identity, so identities are\nopaque UUIDs and never share a namespace (or a column) with Macro user\nids. Only the server mints them; Macro users keep `macro|…` identities,\nso an RTC identity classifies as exactly one of the two.\n\n\n<!-- generated/storage/types.gen/type-aliases/ImportedAuthor.md -->\n# Type Alias: ImportedAuthor\n\n> **ImportedAuthor** = \\{ `name`: `string`; \\}\n\nDisplay attribution for a comment imported from an external document.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-name\"></a> `name` | `string` | Original author text; never interpreted as an authenticated principal. |\n\n\n<!-- generated/storage/types.gen/type-aliases/Message.md -->\n# Type Alias: Message\n\n> **Message** = \\{ `attachments`: [`MessageAttachment`](MessageAttachment.md)[]; `bot_profile?`: `null` \\| [`BotSenderProfile`](BotSenderProfile.md); `content`: `string`; `created_at`: `string`; `deleted_at?`: `string` \\| `null`; `edited_at?`: `string` \\| `null`; `guest_name?`: `string` \\| `null`; `id`: `string`; `imported_author?`: `null` \\| [`ImportedAuthor`](ImportedAuthor.md); `mentions`: [`SimpleMention`](SimpleMention.md)[]; `parent`: [`MessageParent`](MessageParent.md); `reactions`: [`CountedReaction`](CountedReaction.md)[]; `sender_id`: `string`; `thread_id?`: `string` \\| `null`; `triggered_by?`: `string` \\| `null`; `updated_at`: `string`; \\}\n\nShared message representation for channel timelines and entity discussions.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-attachments\"></a> `attachments` | [`MessageAttachment`](MessageAttachment.md)[] | Attached entities. |\n| <a id=\"property-bot_profile\"></a> `bot_profile?` | `null` \\| [`BotSenderProfile`](BotSenderProfile.md) | - |\n| <a id=\"property-content\"></a> `content` | `string` | Macro Markdown body. |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | Creation time. |\n| <a id=\"property-deleted_at\"></a> `deleted_at?` | `string` \\| `null` | Message tombstone, independent of thread deletion. |\n| <a id=\"property-edited_at\"></a> `edited_at?` | `string` \\| `null` | Last content edit, if any. |\n| <a id=\"property-guest_name\"></a> `guest_name?` | `string` \\| `null` | Display name of a verified call guest, retained after the call ends. |\n| <a id=\"property-id\"></a> `id` | `string` | Message UUID. |\n| <a id=\"property-imported_author\"></a> `imported_author?` | `null` \\| [`ImportedAuthor`](ImportedAuthor.md) | - |\n| <a id=\"property-mentions\"></a> `mentions` | [`SimpleMention`](SimpleMention.md)[] | Tracked mentions, retained when a caller changes attachments only. |\n| <a id=\"property-parent\"></a> `parent` | [`MessageParent`](MessageParent.md) | Entity that owns this conversation. |\n| <a id=\"property-reactions\"></a> `reactions` | [`CountedReaction`](CountedReaction.md)[] | Aggregated reactions. |\n| <a id=\"property-sender_id\"></a> `sender_id` | `string` | Authenticated actor or owner of imported content. |\n| <a id=\"property-thread_id\"></a> `thread_id?` | `string` \\| `null` | Root message UUID for replies; absent on roots. |\n| <a id=\"property-triggered_by\"></a> `triggered_by?` | `string` \\| `null` | User who triggered a bot-authored message. |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` | Last persisted update. |\n\n\n<!-- generated/storage/types.gen/type-aliases/MessageAttachment.md -->\n# Type Alias: MessageAttachment\n\n> **MessageAttachment** = \\{ `created_at`: `string`; `entity_id`: `string`; `entity_type`: `string`; `height?`: `number` \\| `null`; `id`: `string`; `width?`: `number` \\| `null`; \\}\n\nAn entity attached to a message.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | When the attachment was added. |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | Attached entity identifier. |\n| <a id=\"property-entity_type\"></a> `entity_type` | `string` | Attached entity type. |\n| <a id=\"property-height\"></a> `height?` | `number` \\| `null` | Optional media height. |\n| <a id=\"property-id\"></a> `id` | `string` | Attachment UUID. |\n| <a id=\"property-width\"></a> `width?` | `number` \\| `null` | Optional media width. |\n\n\n<!-- generated/storage/types.gen/type-aliases/MessageCursor.md -->\n# Type Alias: MessageCursor\n\n> **MessageCursor** = \\{ `created_at`: `string`; `id`: `string`; \\}\n\nCursor for a chronological parent timeline.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | Last message creation time or activity occurrence time. |\n| <a id=\"property-id\"></a> `id` | `string` | Last entry UUID, used to break timestamp ties across both sources. |\n\n\n<!-- generated/storage/types.gen/type-aliases/MessageParent.md -->\n# Type Alias: MessageParent\n\n> **MessageParent** = \\{ `id`: `string`; `type`: `\"channel\"`; \\} \\| \\{ `id`: [`DocumentId`](DocumentId.md); `type`: `\"document\"`; \\} \\| \\{ `id`: `string`; `type`: `\"initiative\"`; \\} \\| \\{ `id`: `string`; `type`: `\"crm_company\"`; \\} \\| \\{ `id`: `string`; `type`: `\"crm_contact\"`; \\} \\| \\{ `id`: `string`; `type`: `\"call\"`; \\}\n\nThe entity whose permissions and lifecycle govern a message.\n\n## Union Members\n\n### Type Literal\n\n\\{ `id`: `string`; `type`: `\"channel\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | A channel, including direct messages. |\n| `type` | `\"channel\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: [`DocumentId`](DocumentId.md); `type`: `\"document\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | [`DocumentId`](DocumentId.md) | A document, including tasks and PDFs. |\n| `type` | `\"document\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: `string`; `type`: `\"initiative\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | An initiative, presented as a project in the application. |\n| `type` | `\"initiative\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: `string`; `type`: `\"crm_company\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | A CRM company. |\n| `type` | `\"crm_company\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: `string`; `type`: `\"crm_contact\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | A CRM contact. |\n| `type` | `\"crm_contact\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: `string`; `type`: `\"call\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | A video call and its persistent chat thread. |\n| `type` | `\"call\"` | - |\n\n\n<!-- generated/storage/types.gen/type-aliases/ParticipantRole.md -->\n# Type Alias: ParticipantRole\n\n> **ParticipantRole** = `\"owner\"` \\| `\"admin\"` \\| `\"member\"`\n\nThe role a user has within a channel.\n\n\n<!-- generated/storage/types.gen/type-aliases/SimpleMention.md -->\n# Type Alias: SimpleMention\n\n> **SimpleMention** = \\{ `entity_id`: `string`; `entity_type`: `string`; \\}\n\nA mention tracked in a message body.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | Mentioned entity identifier. |\n| <a id=\"property-entity_type\"></a> `entity_type` | `string` | Mentioned entity type. |\n\n\n<!-- generated/storage/types.gen/type-aliases/TeamRole.md -->\n# Type Alias: TeamRole\n\n> **TeamRole** = `\"member\"` \\| `\"admin\"` \\| `\"owner\"`\n\nThe role a user has within a team.\n\nOrdered least to most privileged so comparisons reflect access strength.\n\n\n<!-- src/entities/calls/call-record/classes/CallRecord.md -->\n# Class: CallRecord\n\nA Macro call record (an archived or still active call).\n\n## Extends\n\n- [`FavoritableEntity`](../../../entity/classes/FavoritableEntity.md)\\<`CallRecordDetail`\\>\n\n## Properties\n\n| Property | Modifier | Type | Default value | Description | Overrides | Inherited from |\n| ------ | ------ | ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-access\"></a> `access` | `readonly` | [`EntityAccess`](../../../sharing/access/classes/EntityAccess.md) | `...` | Access requests and direct user grants. | - | - |\n| <a id=\"property-channel\"></a> `channel` | `readonly` | () => `Promise`\\<[`Channel`](../../../channels/channel/classes/Channel.md) \\| `undefined`\\> | `...` | The channel the call belongs to, if it is a channel call. | - | - |\n| <a id=\"property-channelname\"></a> `channelName` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | `...` | The display name of the channel the call belongs to. | - | - |\n| <a id=\"property-creator\"></a> `creator` | `readonly` | () => `Promise`\\<[`User`](../../../users/user/classes/User.md)\\> | `...` | The user who started the call. | - | - |\n| <a id=\"property-durationms\"></a> `durationMs` | `readonly` | () => `Promise`\\<`number` \\| `undefined`\\> | `...` | Call duration in milliseconds (undefined if still active). | - | - |\n| <a id=\"property-endedat\"></a> `endedAt` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | `...` | When the call ended (undefined if still active). | - | - |\n| <a id=\"property-entitytype\"></a> `entityType` | `readonly` | `\"call\"` | `'call'` | Favorites identify call records as `call`. | [`FavoritableEntity`](../../../entity/classes/FavoritableEntity.md).[`entityType`](../../../entity/classes/FavoritableEntity.md#property-entitytype) | - |\n| <a id=\"property-guests\"></a> `guests` | `readonly` | () => `Promise`\\<[`CallRecordGuest`](../../../../../generated/storage/types.gen/type-aliases/CallRecordGuest.md)[]\\> | `...` | Current and past guests; each id matches its transcript speaker id. | - | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | `undefined` | - | - | [`FavoritableEntity`](../../../entity/classes/FavoritableEntity.md).[`id`](../../../entity/classes/FavoritableEntity.md#property-id) |\n| <a id=\"property-isactive\"></a> `isActive` | `readonly` | () => `Promise`\\<`boolean`\\> | `...` | Whether the call is still in progress. | - | - |\n| <a id=\"property-name\"></a> `name` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | `...` | The call's display name (user-supplied or AI-generated; unset while active). | - | - |\n| <a id=\"property-participants\"></a> `participants` | `readonly` | () => `Promise`\\<[`CallRecordParticipant`](../../../../../generated/storage/types.gen/type-aliases/CallRecordParticipant.md)[]\\> | `...` | Macro-account participants, both active and historic. | - | - |\n| <a id=\"property-recordingpreviewurl\"></a> `recordingPreviewUrl` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | `...` | URL of the recording preview (thumbnail), once available. | - | - |\n| <a id=\"property-recordingstartedat\"></a> `recordingStartedAt` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | `...` | When the recording started, if it was recorded. | - | - |\n| <a id=\"property-recordingurl\"></a> `recordingUrl` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | `...` | URL of the call recording, once available. | - | - |\n| <a id=\"property-roomname\"></a> `roomName` | `readonly` | () => `Promise`\\<`string`\\> | `...` | The realtime room the call runs in. | - | - |\n| <a id=\"property-sharewithteam\"></a> `shareWithTeam` | `readonly` | () => `Promise`\\<`boolean`\\> | `...` | Whether the call is shared with the creator's team: the pending toggle while the call is live, the canonical grant once it is archived. | - | - |\n| <a id=\"property-startedat\"></a> `startedAt` | `readonly` | () => `Promise`\\<`string`\\> | `...` | When the call started. | - | - |\n| <a id=\"property-status\"></a> `status` | `readonly` | () => `Promise`\\<`NonNullable`\\<CallStatus \\| null \\| undefined\\> \\| `undefined`\\> | `...` | The call's status (undefined until set). | - | - |\n| <a id=\"property-summary\"></a> `summary` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | `...` | AI-generated summary of the call, once summarization has run. | - | - |\n| <a id=\"property-teamshareaccesslevel\"></a> `teamShareAccessLevel` | `readonly` | () => `Promise`\\<`NonNullable`\\<AccessLevel \\| null \\| undefined\\> \\| `undefined`\\> | `...` | The canonical access level granted to the creator's team once the call is archived, or null when it is not shared. Calls only ever grant `'view'`; while the call is live this is null and [CallRecord.shareWithTeam](#property-sharewithteam) carries the pending toggle. | - | - |\n| <a id=\"property-transcript\"></a> `transcript` | `readonly` | () => `Promise`\\<[`CallRecordTranscriptSegment`](../../../../../generated/storage/types.gen/type-aliases/CallRecordTranscriptSegment.md)[]\\> | `...` | Transcript segments, ordered by sequence number. | - | - |\n| <a id=\"property-search\"></a> `search` | `static` | (`client`, `query`, `searchOpts?`) => `AsyncGenerator`\\<`CallRecord`\\> | `...` | Search calls by name and transcript, most relevant first, auto-paginated. | - | - |\n\n## Methods\n\n### delete()\n\n> **delete**(): `Promise`\\<`void`\\>\n\nDelete the call record.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### editTranscript()\n\n> **editTranscript**(`assignments`): `Promise`\\<`void`\\>\n\nUpdate custom speaker assignments in the transcript.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `assignments` | [`CustomSpeakerAssignment`](../../../../../generated/storage/types.gen/type-aliases/CustomSpeakerAssignment.md)[] |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### favorite()\n\n> **favorite**(): `Promise`\\<`CallRecord`\\>\n\nAdd this entity to the user's favorites. Returns this handle for chaining.\nPlain unwrap: favoriting alters the user's favorites collection, not this\nentity's own detail, so there's nothing cached to invalidate.\n\n#### Returns\n\n`Promise`\\<`CallRecord`\\>\n\n#### Inherited from\n\n[`FavoritableEntity`](../../../entity/classes/FavoritableEntity.md).[`favorite`](../../../entity/classes/FavoritableEntity.md#favorite)\n\n***\n\n### meeting()\n\n> **meeting**(): `Promise`\\<[`Meeting`](../../../meetings/meeting/classes/Meeting.md)\\>\n\nGet or create a shareable meeting for this call.\n\n#### Returns\n\n`Promise`\\<[`Meeting`](../../../meetings/meeting/classes/Meeting.md)\\>\n\n***\n\n### message()\n\n> **message**(`id`): [`CallMessage`](../../message/classes/CallMessage.md)\n\nA message in this call's persistent chat. Fields load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`CallMessage`](../../message/classes/CallMessage.md)\n\n***\n\n### messageThreadById()\n\n> **messageThreadById**(`id`): [`MessageThread`](../../../messages/thread/classes/MessageThread.md)\n\nA shared message thread scoped to this resource.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`MessageThread`](../../../messages/thread/classes/MessageThread.md)\n\n***\n\n### permission()\n\n> **permission**(): `Promise`\\<\\{ `permission`: [`EntityPermission`](../../../../../generated/storage/types.gen/type-aliases/EntityPermission.md); `status`: `\"access\"`; \\} \\| \\{ `status`: `\"no_access\"`; \\}\\>\n\nRead the caller's effective permission on this entity.\n\n#### Returns\n\n`Promise`\\<\\{ `permission`: [`EntityPermission`](../../../../../generated/storage/types.gen/type-aliases/EntityPermission.md); `status`: `\"access\"`; \\} \\| \\{ `status`: `\"no_access\"`; \\}\\>\n\n#### Inherited from\n\n[`FavoritableEntity`](../../../entity/classes/FavoritableEntity.md).[`permission`](../../../entity/classes/FavoritableEntity.md#permission)\n\n***\n\n### rename()\n\n> **rename**(`name`): `Promise`\\<`void`\\>\n\nRename the call or clear the custom name.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `name` | `string` \\| `null` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### setTeamShare()\n\n> **setTeamShare**(`shared`): `Promise`\\<`void`\\>\n\nShare the call with the creator's team (view access), or unshare it.\nWhile the call is live this sets the pending toggle any participant with\nedit access may change; once archived only the call's creator may change\nit and the API answers 403 otherwise.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `shared` | `boolean` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### timelinePage()\n\n> **timelinePage**(`selection?`): `Promise`\\<\\{ `entries`: (\\{ `activity`: \\{ `action`: `string`; `actor`: [`User`](../../../users/user/classes/User.md); `actor_id`: `string`; `id`: `string`; `occurred_at`: `string`; `payload?`: `unknown`; \\}; `message?`: `undefined`; `type`: `\"activity\"`; \\} \\| \\{ `activity?`: `undefined`; `message`: [`CallMessage`](../../message/classes/CallMessage.md); `type`: `\"message\"`; \\})[]; `nextCursor`: [`MessageCursor`](../../../../../generated/storage/types.gen/type-aliases/MessageCursor.md) \\| `undefined`; `previousCursor`: [`MessageCursor`](../../../../../generated/storage/types.gen/type-aliases/MessageCursor.md) \\| `undefined`; \\}\\>\n\nA mixed message and activity timeline page.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `selection?` | [`TimelineOptions`](../../../messages/thread/interfaces/TimelineOptions.md)\\<[`CallMessage`](../../message/classes/CallMessage.md)\\> |\n\n#### Returns\n\n`Promise`\\<\\{ `entries`: (\\{ `activity`: \\{ `action`: `string`; `actor`: [`User`](../../../users/user/classes/User.md); `actor_id`: `string`; `id`: `string`; `occurred_at`: `string`; `payload?`: `unknown`; \\}; `message?`: `undefined`; `type`: `\"activity\"`; \\} \\| \\{ `activity?`: `undefined`; `message`: [`CallMessage`](../../message/classes/CallMessage.md); `type`: `\"message\"`; \\})[]; `nextCursor`: [`MessageCursor`](../../../../../generated/storage/types.gen/type-aliases/MessageCursor.md) \\| `undefined`; `previousCursor`: [`MessageCursor`](../../../../../generated/storage/types.gen/type-aliases/MessageCursor.md) \\| `undefined`; \\}\\>\n\n***\n\n### toggleTeamShare()\n\n> **toggleTeamShare**(): `Promise`\\<`boolean`\\>\n\nToggle the server's share-with-team setting and return its new value.\n\n#### Returns\n\n`Promise`\\<`boolean`\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`CallRecord`](../../../../../generated/storage/types.gen/type-aliases/CallRecord.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`CallRecord`](../../../../../generated/storage/types.gen/type-aliases/CallRecord.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`CallRecord`](../../../../../generated/storage/types.gen/type-aliases/CallRecord.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`FavoritableEntity`](../../../entity/classes/FavoritableEntity.md).[`toJSON`](../../../entity/classes/FavoritableEntity.md#tojson)\n\n***\n\n### unfavorite()\n\n> **unfavorite**(): `Promise`\\<`CallRecord`\\>\n\nRemove this entity from the user's favorites. Returns this handle for chaining.\n\n#### Returns\n\n`Promise`\\<`CallRecord`\\>\n\n#### Inherited from\n\n[`FavoritableEntity`](../../../entity/classes/FavoritableEntity.md).[`unfavorite`](../../../entity/classes/FavoritableEntity.md#unfavorite)\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `id`): `CallRecord`\n\nA handle to a call record by id. Details load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `id` | `string` |\n\n#### Returns\n\n`CallRecord`\n\n\n<!-- src/entities/calls/message/classes/CallMessage.md -->\n# Class: CallMessage\n\nA message in a call's single persistent chat thread.\n\n## Extends\n\n- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\\<[`Message`](../../../../../generated/storage/types.gen/type-aliases/Message.md)\\>\n\n## Properties\n\n| Property | Modifier | Type | Description | Inherited from |\n| ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-callid\"></a> `callId` | `readonly` | `string` | - | - |\n| <a id=\"property-content\"></a> `content` | `readonly` | () => `Promise`\\<`string`\\> | The message body (markdown). | - |\n| <a id=\"property-createdat\"></a> `createdAt` | `readonly` | () => `Promise`\\<`string`\\> | When the message was created. | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |\n| <a id=\"property-updatedat\"></a> `updatedAt` | `readonly` | () => `Promise`\\<`string`\\> | When the message was last updated. | - |\n\n## Methods\n\n### author()\n\n> **author**(): `Promise`\\<[`User`](../../../users/user/classes/User.md)\\>\n\nThe user who sent this message.\n\n#### Returns\n\n`Promise`\\<[`User`](../../../users/user/classes/User.md)\\>\n\n***\n\n### call()\n\n> **call**(): [`CallRecord`](../../call-record/classes/CallRecord.md)\n\nThe call whose chat contains this message.\n\n#### Returns\n\n[`CallRecord`](../../call-record/classes/CallRecord.md)\n\n***\n\n### delete()\n\n> **delete**(): `Promise`\\<`void`\\>\n\nDelete this message, preserving the rest of the call's chat.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### edit()\n\n> **edit**(`body`): `Promise`\\<`CallMessage`\\>\n\nReplace this message's body.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `body` | `string` \\| [`RichMessage`](../../../../mentions/interfaces/RichMessage.md) |\n\n#### Returns\n\n`Promise`\\<`CallMessage`\\>\n\n***\n\n### reply()\n\n> **reply**(`body`): `Promise`\\<`CallMessage`\\>\n\nReply in the call's canonical thread, including when this is a reply.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `body` | `string` \\| [`RichMessage`](../../../../mentions/interfaces/RichMessage.md) |\n\n#### Returns\n\n`Promise`\\<`CallMessage`\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`Message`](../../../../../generated/storage/types.gen/type-aliases/Message.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`Message`](../../../../../generated/storage/types.gen/type-aliases/Message.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`Message`](../../../../../generated/storage/types.gen/type-aliases/Message.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `callId`, `id`): `CallMessage`\n\nA handle to a message by id. Fields load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `callId` | `string` |\n| `id` | `string` |\n\n#### Returns\n\n`CallMessage`\n\n***\n\n### from()\n\n> `static` **from**(`client`, `callId`, `record`): `CallMessage`\n\nBuild a message from its record without another fetch.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `callId` | `string` |\n| `record` | [`Message`](../../../../../generated/storage/types.gen/type-aliases/Message.md) |\n\n#### Returns\n\n`CallMessage`\n\n\n<!-- src/entities/calls/namespace/classes/CallRecordNamespace.md -->\n# Class: CallRecordNamespace\n\n## Constructors\n\n### Constructor\n\n> **new CallRecordNamespace**(`client`): `CallRecordNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`CallRecordNamespace`\n\n## Methods\n\n### byId()\n\n> **byId**(`id`): [`CallRecord`](../../call-record/classes/CallRecord.md)\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`CallRecord`](../../call-record/classes/CallRecord.md)\n\n***\n\n### search()\n\n> **search**(`query`, `opts?`): `AsyncGenerator`\\<[`CallRecord`](../../call-record/classes/CallRecord.md)\\>\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `query` | `string` |\n| `opts?` | [`SearchOpts`](../../../search/interfaces/SearchOpts.md) |\n\n#### Returns\n\n`AsyncGenerator`\\<[`CallRecord`](../../call-record/classes/CallRecord.md)\\>\n"},{"name": "channels","description": "Read and send channel messages.",- "overview": "<!-- src/entities/channels/namespace/classes/ChannelNamespace.md -->\n# Class: ChannelNamespace\n\n## Constructors\n\n### Constructor\n\n> **new ChannelNamespace**(`client`): `ChannelNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`ChannelNamespace`\n\n## Properties\n\n| Property | Modifier | Type | Description |\n| ------ | ------ | ------ | ------ |\n| <a id=\"property-labels\"></a> `labels` | `readonly` | [`ChannelLabelsNamespace`](../../labels/classes/ChannelLabelsNamespace.md) | Team-shared labels that group channels in the Chat sidebar. |\n\n## Methods\n\n### byId()\n\n> **byId**(`id`): [`Channel`](../../channel/classes/Channel.md)\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`Channel`](../../channel/classes/Channel.md)\n\n***\n\n### create()\n\n> **create**(`opts`): `Promise`\\<[`Channel`](../../channel/classes/Channel.md)\\>\n\nCreate a channel. The caller becomes the owner.\n\n#### Parameters\n\n| Parameter | Type | Description |\n| ------ | ------ | ------ |\n| `opts` | \\{ `name?`: `string`; `participants?`: [`User`](../../../users/user/classes/User.md)[]; `team?`: [`Team`](../../../teams/team/classes/Team.md); `type`: [`ChannelType`](../../../../../generated/storage/types.gen/type-aliases/ChannelType.md); \\} | - |\n| `opts.name?` | `string` | - |\n| `opts.participants?` | [`User`](../../../users/user/classes/User.md)[] | Participants to add, excluding the owner. |\n| `opts.team?` | [`Team`](../../../teams/team/classes/Team.md) | Team, for team channels. |\n| `opts.type` | [`ChannelType`](../../../../../generated/storage/types.gen/type-aliases/ChannelType.md) | - |\n\n#### Returns\n\n`Promise`\\<[`Channel`](../../channel/classes/Channel.md)\\>\n\n***\n\n### dm()\n\n> **dm**(`recipient`): `Promise`\\<[`Channel`](../../channel/classes/Channel.md)\\>\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `recipient` | [`User`](../../../users/user/classes/User.md) |\n\n#### Returns\n\n`Promise`\\<[`Channel`](../../channel/classes/Channel.md)\\>\n\n***\n\n### list()\n\n> **list**(): `Promise`\\<[`Channel`](../../channel/classes/Channel.md)[]\\>\n\nAll channels the authenticated user is a member of.\n\n#### Returns\n\n`Promise`\\<[`Channel`](../../channel/classes/Channel.md)[]\\>\n\n***\n\n### private()\n\n> **private**(`recipients`): `Promise`\\<[`Channel`](../../channel/classes/Channel.md)\\>\n\nOpen (creating if needed) the private group channel with a set of users.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `recipients` | [`User`](../../../users/user/classes/User.md)[] |\n\n#### Returns\n\n`Promise`\\<[`Channel`](../../channel/classes/Channel.md)\\>\n\n***\n\n### search()\n\n> **search**(`query`, `opts?`): `AsyncGenerator`\\<[`Channel`](../../channel/classes/Channel.md)\\>\n\nSearch channels by name (client-side fuzzy filter on the full channel list)\nor by content (server-side unified search).\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `query` | `string` |\n| `opts?` | [`SearchOpts`](../../../search/interfaces/SearchOpts.md) |\n\n#### Returns\n\n`AsyncGenerator`\\<[`Channel`](../../channel/classes/Channel.md)\\>\n",- "documentation": "# Macro SDK: channels\n\nGenerated by TypeDoc. Paths below refer to the canonical Markdown hierarchy. Other entity handles are documented in their named section; request core for shared SDK helpers.\n\n<!-- generated/properties/types.gen/type-aliases/BulkUpdateEntityPropertyOptionsResponse.md -->\n# Type Alias: BulkUpdateEntityPropertyOptionsResponse\n\n> **BulkUpdateEntityPropertyOptionsResponse** = \\{ `properties`: [`EntityPropertyOptionSelectionResponse`](EntityPropertyOptionSelectionResponse.md)[]; \\}\n\nResponse for a bulk option update: each property's reconciled final ids.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-properties\"></a> `properties` | [`EntityPropertyOptionSelectionResponse`](EntityPropertyOptionSelectionResponse.md)[] | The final option ids per updated property. |\n\n\n<!-- generated/properties/types.gen/type-aliases/DataType.md -->\n# Type Alias: DataType\n\n> **DataType** = `\"BOOLEAN\"` \\| `\"DATE\"` \\| `\"NUMBER\"` \\| `\"STRING\"` \\| `\"SELECT_NUMBER\"` \\| `\"SELECT_STRING\"` \\| `\"TAG\"` \\| `\"ENTITY\"` \\| `\"LINK\"`\n\nData type for property values, determining storage and validation.\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityProperty.md -->\n# Type Alias: EntityProperty\n\n> **EntityProperty** = \\{ `created_at`: `string`; `entity_id`: `string`; `entity_type`: [`EntityType`](EntityType.md); `id`: `string`; `property_definition_id`: `string`; `updated_at`: `string`; \\}\n\nAssignment of a property definition to a specific entity (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-created_at\"></a> `created_at` | `string` |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` |\n| <a id=\"property-entity_type\"></a> `entity_type` | [`EntityType`](EntityType.md) |\n| <a id=\"property-id\"></a> `id` | `string` |\n| <a id=\"property-property_definition_id\"></a> `property_definition_id` | `string` |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityPropertyOptionSelectionResponse.md -->\n# Type Alias: EntityPropertyOptionSelectionResponse\n\n> **EntityPropertyOptionSelectionResponse** = \\{ `option_ids`: `string`[]; `property_id`: `string`; \\}\n\nThe reconciled final option ids stored for one property after a bulk update.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-option_ids\"></a> `option_ids` | `string`[] | The final option ids the server persisted, in stored order. |\n| <a id=\"property-property_id\"></a> `property_id` | `string` | The property definition the options belong to. |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md -->\n# Type Alias: EntityPropertyWithDefinition\n\n> **EntityPropertyWithDefinition** = \\{ `definition`: [`PropertyDefinition`](PropertyDefinition.md); `options?`: [`PropertyOption`](PropertyOption.md)[] \\| `null`; `property`: [`EntityProperty`](EntityProperty.md); `value?`: `null` \\| [`PropertyValue`](PropertyValue.md); \\}\n\nEntity property with its definition, value, and options (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-definition\"></a> `definition` | [`PropertyDefinition`](PropertyDefinition.md) |\n| <a id=\"property-options\"></a> `options?` | [`PropertyOption`](PropertyOption.md)[] \\| `null` |\n| <a id=\"property-property\"></a> `property` | [`EntityProperty`](EntityProperty.md) |\n| <a id=\"property-value\"></a> `value?` | `null` \\| [`PropertyValue`](PropertyValue.md) |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityReference.md -->\n# Type Alias: EntityReference\n\n> **EntityReference** = \\{ `entity_id`: `string`; `entity_type`: [`EntityType`](EntityType.md); `specific_message_id?`: `string` \\| `null`; \\}\n\nEntity reference for entity-type property values.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | - |\n| <a id=\"property-entity_type\"></a> `entity_type` | [`EntityType`](EntityType.md) | - |\n| <a id=\"property-specific_message_id\"></a> `specific_message_id?` | `string` \\| `null` | For CHANNEL, CHAT, THREAD entity types - optional specific message ID. This allows referencing a specific message within a thread/channel/chat. |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityType.md -->\n# Type Alias: EntityType\n\n> **EntityType** = `\"CALENDAR_EVENT\"` \\| `\"CALL_RECORD\"` \\| `\"CHANNEL\"` \\| `\"CHAT\"` \\| `\"COMPANY\"` \\| `\"DATABASE_ROW\"` \\| `\"CONTACT\"` \\| `\"DOCUMENT\"` \\| `\"INITIATIVE\"` \\| `\"PROJECT\"` \\| `\"TASK\"` \\| `\"THREAD\"` \\| `\"USER\"`\n\nType of entity that can be referenced by entity properties.\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyDefinition.md -->\n# Type Alias: PropertyDefinition\n\n> **PropertyDefinition** = \\{ `created_at`: `string`; `data_type`: [`DataType`](DataType.md); `display_name`: `string`; `id`: `string`; `is_metadata`: `boolean`; `is_multi_select`: `boolean`; `is_system`: `boolean`; `owner`: [`PropertyOwner`](PropertyOwner.md); `specific_entity_type`: `null` \\| [`EntityType`](EntityType.md); `updated_at`: `string`; \\}\n\nProperty definition model (service representation).\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | - |\n| <a id=\"property-data_type\"></a> `data_type` | [`DataType`](DataType.md) | - |\n| <a id=\"property-display_name\"></a> `display_name` | `string` | - |\n| <a id=\"property-id\"></a> `id` | `string` | - |\n| <a id=\"property-is_metadata\"></a> `is_metadata` | `boolean` | Flag to indicate if this is a system-generated metadata property. Not stored in database - computed at service layer. |\n| <a id=\"property-is_multi_select\"></a> `is_multi_select` | `boolean` | - |\n| <a id=\"property-is_system\"></a> `is_system` | `boolean` | Flag to indicate if this is a system property (stored in DB). |\n| <a id=\"property-owner\"></a> `owner` | [`PropertyOwner`](PropertyOwner.md) | - |\n| <a id=\"property-specific_entity_type\"></a> `specific_entity_type` | `null` \\| [`EntityType`](EntityType.md) | - |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` | - |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyOption.md -->\n# Type Alias: PropertyOption\n\n> **PropertyOption** = \\{ `color`: `string` \\| `null`; `created_at`: `string`; `display_order`: `number`; `id`: `string`; `property_definition_id`: `string`; `updated_at`: `string`; `value`: [`PropertyOptionValue`](PropertyOptionValue.md); \\}\n\nA selectable option for select-type properties (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-color\"></a> `color` | `string` \\| `null` |\n| <a id=\"property-created_at\"></a> `created_at` | `string` |\n| <a id=\"property-display_order\"></a> `display_order` | `number` |\n| <a id=\"property-id\"></a> `id` | `string` |\n| <a id=\"property-property_definition_id\"></a> `property_definition_id` | `string` |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` |\n| <a id=\"property-value\"></a> `value` | [`PropertyOptionValue`](PropertyOptionValue.md) |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyOptionValue.md -->\n# Type Alias: PropertyOptionValue\n\n> **PropertyOptionValue** = \\{ `type`: `\"string\"`; `value`: `string`; \\} \\| \\{ `type`: `\"number\"`; `value`: `number`; \\}\n\nThe value of a property option - either a string or a number.\n\n## Union Members\n\n### Type Literal\n\n\\{ `type`: `\"string\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"string\"` | - |\n| `value` | `string` | String value for SelectString properties |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"number\"`; `value`: `number`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"number\"` | - |\n| `value` | `number` | Number value for SelectNumber properties |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyOwner.md -->\n# Type Alias: PropertyOwner\n\n> **PropertyOwner** = \\{ `scope`: `\"user\"`; `user_id`: `string`; \\} \\| \\{ `scope`: `\"team\"`; `team_id`: `string`; \\} \\| \\{ `database_id`: `string`; `scope`: `\"database\"`; \\} \\| \\{ `scope`: `\"system\"`; \\}\n\nDefines who owns a property - user-scoped, team-scoped, database-scoped, or system.\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyTargetEntityType.md -->\n# Type Alias: PropertyTargetEntityType\n\n> **PropertyTargetEntityType** = `\"CALL_RECORD\"` \\| `\"CHANNEL\"` \\| `\"CHAT\"` \\| `\"COMPANY\"` \\| `\"DATABASE_ROW\"` \\| `\"DOCUMENT\"` \\| `\"INITIATIVE\"` \\| `\"PROJECT\"` \\| `\"THREAD\"` \\| `\"USER\"`\n\nCanonical type of an entity receiving properties.\n\nTasks are documents at API boundaries. `Task` intentionally does not exist\nhere; task classification is resolved by the properties domain from the\ndocument subtype.\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyTargetReference.md -->\n# Type Alias: PropertyTargetReference\n\n> **PropertyTargetReference** = \\{ `entity_id`: `string`; `entity_type`: [`PropertyTargetEntityType`](PropertyTargetEntityType.md); \\}\n\nCanonical reference to an entity receiving properties.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | Entity identifier. |\n| <a id=\"property-entity_type\"></a> `entity_type` | [`PropertyTargetEntityType`](PropertyTargetEntityType.md) | Canonical entity type. |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyValue.md -->\n# Type Alias: PropertyValue\n\n> **PropertyValue** = \\{ `type`: `\"Boolean\"`; `value`: `boolean`; \\} \\| \\{ `type`: `\"Number\"`; `value`: `number`; \\} \\| \\{ `type`: `\"String\"`; `value`: `string`; \\} \\| \\{ `type`: `\"Date\"`; `value`: `string`; \\} \\| \\{ `type`: `\"SelectOption\"`; `value`: `string`[]; \\} \\| \\{ `type`: `\"EntityReference\"`; `value`: [`EntityReference`](EntityReference.md)[]; \\} \\| \\{ `type`: `\"Link\"`; `value`: `string`[]; \\}\n\nProperty value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to/from JSONB in the database.\n\n## Union Members\n\n### Type Literal\n\n\\{ `type`: `\"Boolean\"`; `value`: `boolean`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Boolean\"` | - |\n| `value` | `boolean` | Boolean value Serializes as: {\"type\": \"Boolean\", \"value\": true} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"Number\"`; `value`: `number`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Number\"` | - |\n| `value` | `number` | Numeric value Serializes as: {\"type\": \"Number\", \"value\": 42.5} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"String\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"String\"` | - |\n| `value` | `string` | String value Serializes as: {\"type\": \"String\", \"value\": \"text\"} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"Date\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Date\"` | - |\n| `value` | `string` | Date/timestamp value Serializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"SelectOption\"`; `value`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"SelectOption\"` | - |\n| `value` | `string`[] | Select option(s) - always an array (check is_multi_select to determine if single or multi) Single-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1) Multi-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+) |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"EntityReference\"`; `value`: [`EntityReference`](EntityReference.md)[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"EntityReference\"` | - |\n| `value` | [`EntityReference`](EntityReference.md)[] | Entity reference(s) - always an array (check is_multi_select to determine if single or multi) Single-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1) Multi-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+) |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"Link\"`; `value`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Link\"` | - |\n| `value` | `string`[] | Link value(s) - always an array (check is_multi_select to determine if single or multi) Single-select: {\"type\": \"Link\", \"value\": [\"https://example.com\"]} (length 0 or 1) Multi-select: {\"type\": \"Link\", \"value\": [\"https://example.com\", \"https://other.com\"]} (length 0+) |\n\n\n<!-- generated/properties/types.gen/type-aliases/SetPropertyValue.md -->\n# Type Alias: SetPropertyValue\n\n> **SetPropertyValue** = \\{ `type`: `\"boolean\"`; `value`: `boolean`; \\} \\| \\{ `type`: `\"date\"`; `value`: `string`; \\} \\| \\{ `type`: `\"number\"`; `value`: `number`; \\} \\| \\{ `type`: `\"string\"`; `value`: `string`; \\} \\| \\{ `option_id`: `string`; `type`: `\"select_option\"`; \\} \\| \\{ `option_ids`: `string`[]; `type`: `\"multi_select_option\"`; \\} \\| \\{ `reference`: [`EntityReference`](EntityReference.md); `type`: `\"entity_reference\"`; \\} \\| \\{ `references`: [`EntityReference`](EntityReference.md)[]; `type`: `\"multi_entity_reference\"`; \\} \\| \\{ `type`: `\"link\"`; `url`: `string`; \\} \\| \\{ `type`: `\"multi_link\"`; `urls`: `string`[]; \\}\n\nType-safe enum for setting entity property values - provides compile-time validation.\n\n\n<!-- generated/storage/types.gen/type-aliases/ApiChannelAttachment.md -->\n# Type Alias: ApiChannelAttachment\n\n> **ApiChannelAttachment** = \\{ `channel_id`: `string`; `created_at`: `string`; `entity_id`: `string`; `entity_type`: `string`; `height?`: `number` \\| `null`; `id`: `string`; `message_id`: `string`; `sender_id`: `string`; `width?`: `number` \\| `null`; \\}\n\nA channel-level attachment.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-channel_id\"></a> `channel_id` | `string` | Channel id. |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | When the attachment was created. |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | Entity id. |\n| <a id=\"property-entity_type\"></a> `entity_type` | `string` | Type of entity. |\n| <a id=\"property-height\"></a> `height?` | `number` \\| `null` | Height (for images). |\n| <a id=\"property-id\"></a> `id` | `string` | Attachment id. |\n| <a id=\"property-message_id\"></a> `message_id` | `string` | Message id this attachment belongs to. |\n| <a id=\"property-sender_id\"></a> `sender_id` | `string` | The user who sent the message containing this attachment. |\n| <a id=\"property-width\"></a> `width?` | `number` \\| `null` | Width (for images). |\n\n\n<!-- generated/storage/types.gen/type-aliases/ApiChannelAttachmentsPage.md -->\n# Type Alias: ApiChannelAttachmentsPage\n\n> **ApiChannelAttachmentsPage** = \\{ `items`: [`ApiChannelAttachment`](ApiChannelAttachment.md)[]; `next_cursor?`: `string` \\| `null`; \\}\n\nPaginated response of channel attachments.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-items\"></a> `items` | [`ApiChannelAttachment`](ApiChannelAttachment.md)[] | Attachments on this page. |\n| <a id=\"property-next_cursor\"></a> `next_cursor?` | `string` \\| `null` | Cursor for the next page, null if no more pages. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ApiChannelDetail.md -->\n# Type Alias: ApiChannelDetail\n\n> **ApiChannelDetail** = \\{ `channel_id`: `string`; `channel_name`: `string`; `channel_type`: [`ChannelType`](ChannelType.md); `participants`: [`ApiChannelParticipant`](ApiChannelParticipant.md)[]; \\}\n\nChannel detail: metadata and active participants.\n\nMessages are read through `/messages/channel/{channel_id}`.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-channel_id\"></a> `channel_id` | `string` | Channel id. |\n| <a id=\"property-channel_name\"></a> `channel_name` | `string` | Resolved display name from the viewer's perspective. |\n| <a id=\"property-channel_type\"></a> `channel_type` | [`ChannelType`](ChannelType.md) | Channel type. |\n| <a id=\"property-participants\"></a> `participants` | [`ApiChannelParticipant`](ApiChannelParticipant.md)[] | Active participants. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ApiChannelParticipant.md -->\n# Type Alias: ApiChannelParticipant\n\n> **ApiChannelParticipant** = \\{ `channel_id`: `string`; `joined_at`: `string`; `role`: [`ApiParticipantRole`](ApiParticipantRole.md); `user_id`: `string`; \\}\n\nA channel participant.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-channel_id\"></a> `channel_id` | `string` | Channel id. |\n| <a id=\"property-joined_at\"></a> `joined_at` | `string` | When the user joined. |\n| <a id=\"property-role\"></a> `role` | [`ApiParticipantRole`](ApiParticipantRole.md) | Role in the channel. |\n| <a id=\"property-user_id\"></a> `user_id` | `string` | User id. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ApiParticipantRole.md -->\n# Type Alias: ApiParticipantRole\n\n> **ApiParticipantRole** = `\"owner\"` \\| `\"admin\"` \\| `\"member\"`\n\nParticipant role in a channel.\n\n\n<!-- generated/storage/types.gen/type-aliases/BotSenderProfile.md -->\n# Type Alias: BotSenderProfile\n\n> **BotSenderProfile** = \\{ `avatar_url?`: `string` \\| `null`; `name`: `string`; \\}\n\nPublic bot profile attached to bot-authored messages.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-avatar_url\"></a> `avatar_url?` | `string` \\| `null` | Bot avatar URL. |\n| <a id=\"property-name\"></a> `name` | `string` | Bot display name. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ChannelLabel.md -->\n# Type Alias: ChannelLabel\n\n> **ChannelLabel** = \\{ `channelCount`: `number`; `channelIds`: `string`[]; `createdAt`: `string`; `id`: `string`; `name`: `string`; `rule?`: `null` \\| [`ChannelLabelRule`](ChannelLabelRule.md); `sortOrder`: `number`; `teamId?`: `string` \\| `null`; `updatedAt`: `string`; \\}\n\nA shared or account-private label grouping chat channels in the sidebar.\n\n`channel_ids` is viewer-relative: it lists only the labelled channels the\nrequesting user participates in. `channel_count` counts every channel in\nthe label so clients can warn accurately before a delete.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-channelcount\"></a> `channelCount` | `number` | All assignments for a manual label; visible matches for a smart tag. |\n| <a id=\"property-channelids\"></a> `channelIds` | `string`[] | Channels in this label that the requesting user participates in. |\n| <a id=\"property-createdat\"></a> `createdAt` | `string` | When the label was created. |\n| <a id=\"property-id\"></a> `id` | `string` | Stable label id. |\n| <a id=\"property-name\"></a> `name` | `string` | Display name, unique within the scope (case-insensitive). |\n| <a id=\"property-rule\"></a> `rule?` | `null` \\| [`ChannelLabelRule`](ChannelLabelRule.md) | - |\n| <a id=\"property-sortorder\"></a> `sortOrder` | `number` | Manual ordering value within the scope; lower sorts first. |\n| <a id=\"property-teamid\"></a> `teamId?` | `string` \\| `null` | Owning team, or `None` for account-private labels. |\n| <a id=\"property-updatedat\"></a> `updatedAt` | `string` | When the label was last renamed or reordered. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ChannelLabelRule.md -->\n# Type Alias: ChannelLabelRule\n\n> **ChannelLabelRule** = \\{ `attribute`: `\"name\"`; `contains`: `string`; \\}\n\nCase-insensitive, literal substring matching on the channel name.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-attribute\"></a> `attribute` | `\"name\"` | - |\n| <a id=\"property-contains\"></a> `contains` | `string` | The substring to find anywhere in the name. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ChannelType.md -->\n# Type Alias: ChannelType\n\n> **ChannelType** = `\"public\"` \\| `\"private\"` \\| `\"direct_message\"` \\| `\"team\"`\n\nType of channel.\n\n\n<!-- generated/storage/types.gen/type-aliases/CountedReaction.md -->\n# Type Alias: CountedReaction\n\n> **CountedReaction** = \\{ `emoji`: `string`; `users`: `string`[]; \\}\n\nReaction emoji and the users who added it.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-emoji\"></a> `emoji` | `string` | Emoji being reacted with. |\n| <a id=\"property-users\"></a> `users` | `string`[] | User identifiers. |\n\n\n<!-- generated/storage/types.gen/type-aliases/DocumentId.md -->\n# Type Alias: DocumentId\n\n> **DocumentId** = `string`\n\nA validated document identifier. Historical document ids need not be UUIDs.\n\n\n<!-- generated/storage/types.gen/type-aliases/GetChannelAttachmentsResponses.md -->\n# Type Alias: GetChannelAttachmentsResponses\n\n> **GetChannelAttachmentsResponses** = \\{ `200`: [`ApiChannelAttachmentsPage`](ApiChannelAttachmentsPage.md); \\}\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-200\"></a> `200` | [`ApiChannelAttachmentsPage`](ApiChannelAttachmentsPage.md) |\n\n\n<!-- generated/storage/types.gen/type-aliases/GetChannelParticipantsResponses.md -->\n# Type Alias: GetChannelParticipantsResponses\n\n> **GetChannelParticipantsResponses** = \\{ `200`: [`ApiChannelParticipant`](ApiChannelParticipant.md)[]; \\}\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-200\"></a> `200` | [`ApiChannelParticipant`](ApiChannelParticipant.md)[] |\n\n\n<!-- generated/storage/types.gen/type-aliases/ImportedAuthor.md -->\n# Type Alias: ImportedAuthor\n\n> **ImportedAuthor** = \\{ `name`: `string`; \\}\n\nDisplay attribution for a comment imported from an external document.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-name\"></a> `name` | `string` | Original author text; never interpreted as an authenticated principal. |\n\n\n<!-- generated/storage/types.gen/type-aliases/Message.md -->\n# Type Alias: Message\n\n> **Message** = \\{ `attachments`: [`MessageAttachment`](MessageAttachment.md)[]; `bot_profile?`: `null` \\| [`BotSenderProfile`](BotSenderProfile.md); `content`: `string`; `created_at`: `string`; `deleted_at?`: `string` \\| `null`; `edited_at?`: `string` \\| `null`; `guest_name?`: `string` \\| `null`; `id`: `string`; `imported_author?`: `null` \\| [`ImportedAuthor`](ImportedAuthor.md); `mentions`: [`SimpleMention`](SimpleMention.md)[]; `parent`: [`MessageParent`](MessageParent.md); `reactions`: [`CountedReaction`](CountedReaction.md)[]; `sender_id`: `string`; `thread_id?`: `string` \\| `null`; `triggered_by?`: `string` \\| `null`; `updated_at`: `string`; \\}\n\nShared message representation for channel timelines and entity discussions.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-attachments\"></a> `attachments` | [`MessageAttachment`](MessageAttachment.md)[] | Attached entities. |\n| <a id=\"property-bot_profile\"></a> `bot_profile?` | `null` \\| [`BotSenderProfile`](BotSenderProfile.md) | - |\n| <a id=\"property-content\"></a> `content` | `string` | Macro Markdown body. |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | Creation time. |\n| <a id=\"property-deleted_at\"></a> `deleted_at?` | `string` \\| `null` | Message tombstone, independent of thread deletion. |\n| <a id=\"property-edited_at\"></a> `edited_at?` | `string` \\| `null` | Last content edit, if any. |\n| <a id=\"property-guest_name\"></a> `guest_name?` | `string` \\| `null` | Display name of a verified call guest, retained after the call ends. |\n| <a id=\"property-id\"></a> `id` | `string` | Message UUID. |\n| <a id=\"property-imported_author\"></a> `imported_author?` | `null` \\| [`ImportedAuthor`](ImportedAuthor.md) | - |\n| <a id=\"property-mentions\"></a> `mentions` | [`SimpleMention`](SimpleMention.md)[] | Tracked mentions, retained when a caller changes attachments only. |\n| <a id=\"property-parent\"></a> `parent` | [`MessageParent`](MessageParent.md) | Entity that owns this conversation. |\n| <a id=\"property-reactions\"></a> `reactions` | [`CountedReaction`](CountedReaction.md)[] | Aggregated reactions. |\n| <a id=\"property-sender_id\"></a> `sender_id` | `string` | Authenticated actor or owner of imported content. |\n| <a id=\"property-thread_id\"></a> `thread_id?` | `string` \\| `null` | Root message UUID for replies; absent on roots. |\n| <a id=\"property-triggered_by\"></a> `triggered_by?` | `string` \\| `null` | User who triggered a bot-authored message. |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` | Last persisted update. |\n\n\n<!-- generated/storage/types.gen/type-aliases/MessageAttachment.md -->\n# Type Alias: MessageAttachment\n\n> **MessageAttachment** = \\{ `created_at`: `string`; `entity_id`: `string`; `entity_type`: `string`; `height?`: `number` \\| `null`; `id`: `string`; `width?`: `number` \\| `null`; \\}\n\nAn entity attached to a message.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | When the attachment was added. |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | Attached entity identifier. |\n| <a id=\"property-entity_type\"></a> `entity_type` | `string` | Attached entity type. |\n| <a id=\"property-height\"></a> `height?` | `number` \\| `null` | Optional media height. |\n| <a id=\"property-id\"></a> `id` | `string` | Attachment UUID. |\n| <a id=\"property-width\"></a> `width?` | `number` \\| `null` | Optional media width. |\n\n\n<!-- generated/storage/types.gen/type-aliases/MessageParent.md -->\n# Type Alias: MessageParent\n\n> **MessageParent** = \\{ `id`: `string`; `type`: `\"channel\"`; \\} \\| \\{ `id`: [`DocumentId`](DocumentId.md); `type`: `\"document\"`; \\} \\| \\{ `id`: `string`; `type`: `\"initiative\"`; \\} \\| \\{ `id`: `string`; `type`: `\"crm_company\"`; \\} \\| \\{ `id`: `string`; `type`: `\"crm_contact\"`; \\} \\| \\{ `id`: `string`; `type`: `\"call\"`; \\}\n\nThe entity whose permissions and lifecycle govern a message.\n\n## Union Members\n\n### Type Literal\n\n\\{ `id`: `string`; `type`: `\"channel\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | A channel, including direct messages. |\n| `type` | `\"channel\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: [`DocumentId`](DocumentId.md); `type`: `\"document\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | [`DocumentId`](DocumentId.md) | A document, including tasks and PDFs. |\n| `type` | `\"document\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: `string`; `type`: `\"initiative\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | An initiative, presented as a project in the application. |\n| `type` | `\"initiative\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: `string`; `type`: `\"crm_company\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | A CRM company. |\n| `type` | `\"crm_company\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: `string`; `type`: `\"crm_contact\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | A CRM contact. |\n| `type` | `\"crm_contact\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: `string`; `type`: `\"call\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | A video call and its persistent chat thread. |\n| `type` | `\"call\"` | - |\n\n\n<!-- generated/storage/types.gen/type-aliases/SimpleMention.md -->\n# Type Alias: SimpleMention\n\n> **SimpleMention** = \\{ `entity_id`: `string`; `entity_type`: `string`; \\}\n\nA mention tracked in a message body.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | Mentioned entity identifier. |\n| <a id=\"property-entity_type\"></a> `entity_type` | `string` | Mentioned entity type. |\n\n\n<!-- generated/storage/types.gen/type-aliases/SmartTagChannelMatch.md -->\n# Type Alias: SmartTagChannelMatch\n\n> **SmartTagChannelMatch** = \\{ `id`: `string`; `name`: `string`; \\}\n\nA channel visible to the caller that matches a smart tag rule.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-id\"></a> `id` | `string` | Channel id. |\n| <a id=\"property-name\"></a> `name` | `string` | Channel display name. |\n\n\n<!-- generated/storage/types.gen/type-aliases/SmartTagPreview.md -->\n# Type Alias: SmartTagPreview\n\n> **SmartTagPreview** = \\{ `channels`: [`SmartTagChannelMatch`](SmartTagChannelMatch.md)[]; `totalCount`: `number`; \\}\n\nA bounded preview and the total number of visible channels matching a rule.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-channels\"></a> `channels` | [`SmartTagChannelMatch`](SmartTagChannelMatch.md)[] | First matches, in alphabetical order. |\n| <a id=\"property-totalcount\"></a> `totalCount` | `number` | Number of matching channels the caller participates in, including overflow. |\n\n\n<!-- src/entities/channels/channel/classes/Channel.md -->\n# Class: Channel\n\nA channel.\n\n## Extends\n\n- [`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md)\\<`ChannelDetail`\\>\n\n## Properties\n\n| Property | Modifier | Type | Default value | Description | Overrides | Inherited from |\n| ------ | ------ | ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-entitytype\"></a> `entityType` | `readonly` | `\"channel\"` | `'channel'` | Favorites identify channels as `channel`. | [`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`entityType`](../../../entity/classes/PropertiedEntity.md#property-entitytype) | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | `undefined` | - | - | [`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`id`](../../../entity/classes/PropertiedEntity.md#property-id) |\n| <a id=\"property-name\"></a> `name` | `readonly` | () => `Promise`\\<`string`\\> | `...` | The channel's display name, resolved from the viewer's perspective. | - | - |\n| <a id=\"property-type\"></a> `type` | `readonly` | () => `Promise`\\<[`ChannelType`](../../../../../generated/storage/types.gen/type-aliases/ChannelType.md)\\> | `...` | The channel's type (e.g. `public`, `dm`, `private`). | - | - |\n| <a id=\"property-search\"></a> `search` | `static` | (`client`, `query`, `searchOpts?`) => `AsyncGenerator`\\<`Channel`\\> | `...` | Search channels by content, most relevant first, auto-paginated. | - | - |\n\n## Methods\n\n### addParticipants()\n\n> **addParticipants**(`users`): `Promise`\\<`void`\\>\n\nAdd users to the channel.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `users` | [`User`](../../../users/user/classes/User.md)[] |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### attachments()\n\n> **attachments**(`opts?`): `AsyncGenerator`\\<[`ApiChannelAttachment`](../../../../../generated/storage/types.gen/type-aliases/ApiChannelAttachment.md)\\>\n\nThe attachments posted in this channel, auto-paginated.\n\n#### Parameters\n\n| Parameter | Type | Description |\n| ------ | ------ | ------ |\n| `opts?` | \\{ `pageSize?`: `number`; `type?`: `string`; \\} | - |\n| `opts.pageSize?` | `number` | - |\n| `opts.type?` | `string` | Filter by type: `static` for images/videos, `dss` for documents. |\n\n#### Returns\n\n`AsyncGenerator`\\<[`ApiChannelAttachment`](../../../../../generated/storage/types.gen/type-aliases/ApiChannelAttachment.md)\\>\n\n***\n\n### delete()\n\n> **delete**(): `Promise`\\<`void`\\>\n\nDelete the channel. This is not reversible.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### deleteProperty()\n\n> **deleteProperty**(`assignment`): `Promise`\\<`void`\\>\n\nRemove a property from this entity, given its [properties](#properties) entry.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `assignment` | [`EntityPropertyWithDefinition`](../../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`deleteProperty`](../../../entity/classes/PropertiedEntity.md#deleteproperty)\n\n***\n\n### favorite()\n\n> **favorite**(): `Promise`\\<`Channel`\\>\n\nAdd this entity to the user's favorites. Returns this handle for chaining.\nPlain unwrap: favoriting alters the user's favorites collection, not this\nentity's own detail, so there's nothing cached to invalidate.\n\n#### Returns\n\n`Promise`\\<`Channel`\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`favorite`](../../../entity/classes/PropertiedEntity.md#favorite)\n\n***\n\n### join()\n\n> **join**(): `Promise`\\<`void`\\>\n\nJoin the channel as the current user.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### joinCode()\n\n> **joinCode**(): `Promise`\\<`string`\\>\n\nA reusable code that lets a user join this channel.\n\n#### Returns\n\n`Promise`\\<`string`\\>\n\n***\n\n### leave()\n\n> **leave**(): `Promise`\\<`void`\\>\n\nLeave the channel as the current user.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### message()\n\n> **message**(`id`): [`Message`](../../message/classes/Message.md)\n\nA handle to a message in this channel by id.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`Message`](../../message/classes/Message.md)\n\n***\n\n### messages()\n\n> **messages**(`opts?`): `AsyncGenerator`\\<[`Message`](../../message/classes/Message.md)\\>\n\nRoot messages in this channel, most recent first, auto-paginated.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts?` | \\{ `pageSize?`: `number`; \\} |\n| `opts.pageSize?` | `number` |\n\n#### Returns\n\n`AsyncGenerator`\\<[`Message`](../../message/classes/Message.md)\\>\n\n***\n\n### messagesAfter()\n\n> **messagesAfter**(`after`, `opts?`): `AsyncGenerator`\\<[`Message`](../../message/classes/Message.md)\\>\n\nRoot messages created or replied to at or after `after`, most recent\nfirst, auto-paginated. Use it to catch up after a disconnect.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `after` | `string` \\| `Date` |\n| `opts?` | \\{ `pageSize?`: `number`; \\} |\n| `opts.pageSize?` | `number` |\n\n#### Returns\n\n`AsyncGenerator`\\<[`Message`](../../message/classes/Message.md)\\>\n\n***\n\n### participants()\n\n> **participants**(): `Promise`\\<[`ApiChannelParticipant`](../../../../../generated/storage/types.gen/type-aliases/ApiChannelParticipant.md)[]\\>\n\nThe channel's members, with their roles and join times.\n\n#### Returns\n\n`Promise`\\<[`ApiChannelParticipant`](../../../../../generated/storage/types.gen/type-aliases/ApiChannelParticipant.md)[]\\>\n\n***\n\n### properties()\n\n> **properties**(`opts?`): `Promise`\\<[`EntityPropertyWithDefinition`](../../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md)[]\\>\n\nThe properties set on this entity, each with its definition, value, and options.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts?` | \\{ `includeMetadata?`: `boolean`; \\} |\n| `opts.includeMetadata?` | `boolean` |\n\n#### Returns\n\n`Promise`\\<[`EntityPropertyWithDefinition`](../../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md)[]\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`properties`](../../../entity/classes/PropertiedEntity.md#properties)\n\n***\n\n### propertyReference()\n\n> **propertyReference**(): [`PropertyTargetReference`](../../../../../generated/properties/types.gen/type-aliases/PropertyTargetReference.md)\n\nThis entity's reference for bulk property operations.\n\n#### Returns\n\n[`PropertyTargetReference`](../../../../../generated/properties/types.gen/type-aliases/PropertyTargetReference.md)\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`propertyReference`](../../../entity/classes/PropertiedEntity.md#propertyreference)\n\n***\n\n### removeParticipants()\n\n> **removeParticipants**(`users`): `Promise`\\<`void`\\>\n\nRemove users from the channel.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `users` | [`User`](../../../users/user/classes/User.md)[] |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### rename()\n\n> **rename**(`name`): `Promise`\\<`void`\\>\n\nRename the channel.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `name` | `string` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### send()\n\n> **send**(`body`, `opts?`): `Promise`\\<[`Message`](../../message/classes/Message.md)\\>\n\nPost a message. Plain text, or a rich body composed with `msg`.\n\nWorks with a channel webhook token as well as a normal one — see\n[postToChannel](../../post/functions/postToChannel.md) for which endpoint that picks and what it costs.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `body` | `string` \\| [`RichMessage`](../../../../mentions/interfaces/RichMessage.md) |\n| `opts?` | \\{ `thread?`: [`Thread`](../../thread/classes/Thread.md); \\} |\n| `opts.thread?` | [`Thread`](../../thread/classes/Thread.md) |\n\n#### Returns\n\n`Promise`\\<[`Message`](../../message/classes/Message.md)\\>\n\n***\n\n### setProperty()\n\n> **setProperty**(`property`, `value?`): `Promise`\\<`void`\\>\n\nSet a property value on this entity, or attach the property without a\nvalue when `value` is omitted.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `property` | [`PropertyDefinition`](../../../properties/property-definition/classes/PropertyDefinition.md) |\n| `value?` | [`SetPropertyValue`](../../../../../generated/properties/types.gen/type-aliases/SetPropertyValue.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`setProperty`](../../../entity/classes/PropertiedEntity.md#setproperty)\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`ApiChannelDetail`](../../../../../generated/storage/types.gen/type-aliases/ApiChannelDetail.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`ApiChannelDetail`](../../../../../generated/storage/types.gen/type-aliases/ApiChannelDetail.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`ApiChannelDetail`](../../../../../generated/storage/types.gen/type-aliases/ApiChannelDetail.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`toJSON`](../../../entity/classes/PropertiedEntity.md#tojson)\n\n***\n\n### typing()\n\n> **typing**(`action`, `opts?`): `Promise`\\<`void`\\>\n\nBroadcast a typing indicator, optionally scoped to a thread.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `action` | `\"stop\"` \\| `\"start\"` |\n| `opts?` | \\{ `thread?`: [`Thread`](../../thread/classes/Thread.md); \\} |\n| `opts.thread?` | [`Thread`](../../thread/classes/Thread.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### unfavorite()\n\n> **unfavorite**(): `Promise`\\<`Channel`\\>\n\nRemove this entity from the user's favorites. Returns this handle for chaining.\n\n#### Returns\n\n`Promise`\\<`Channel`\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`unfavorite`](../../../entity/classes/PropertiedEntity.md#unfavorite)\n\n***\n\n### updatePropertyOptions()\n\n> **updatePropertyOptions**(`changes`): `Promise`\\<[`BulkUpdateEntityPropertyOptionsResponse`](../../../../../generated/properties/types.gen/type-aliases/BulkUpdateEntityPropertyOptionsResponse.md)\\>\n\nApply multi-select option deltas atomically across this entity's properties.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `changes` | [`PropertyOptionDelta`](../../../entity/interfaces/PropertyOptionDelta.md)[] |\n\n#### Returns\n\n`Promise`\\<[`BulkUpdateEntityPropertyOptionsResponse`](../../../../../generated/properties/types.gen/type-aliases/BulkUpdateEntityPropertyOptionsResponse.md)\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`updatePropertyOptions`](../../../entity/classes/PropertiedEntity.md#updatepropertyoptions)\n\n***\n\n### webUrl()\n\n> **webUrl**(): `string`\n\nThe channel's URL in the Macro web app.\n\n#### Returns\n\n`string`\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `id`): `Channel`\n\nA handle to a channel by id. Details load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `id` | `string` |\n\n#### Returns\n\n`Channel`\n\n***\n\n### create()\n\n> `static` **create**(`client`, `opts`): `Promise`\\<`Channel`\\>\n\nCreate a channel. The caller becomes the owner.\n\n#### Parameters\n\n| Parameter | Type | Description |\n| ------ | ------ | ------ |\n| `client` | `MacroClient` | - |\n| `opts` | \\{ `name?`: `string`; `participants?`: [`User`](../../../users/user/classes/User.md)[]; `team?`: [`Team`](../../../teams/team/classes/Team.md); `type`: [`ChannelType`](../../../../../generated/storage/types.gen/type-aliases/ChannelType.md); \\} | - |\n| `opts.name?` | `string` | - |\n| `opts.participants?` | [`User`](../../../users/user/classes/User.md)[] | Participants to add, excluding the owner. |\n| `opts.team?` | [`Team`](../../../teams/team/classes/Team.md) | Team, for team channels. |\n| `opts.type` | [`ChannelType`](../../../../../generated/storage/types.gen/type-aliases/ChannelType.md) | - |\n\n#### Returns\n\n`Promise`\\<`Channel`\\>\n\n***\n\n### dm()\n\n> `static` **dm**(`client`, `recipient`): `Promise`\\<`Channel`\\>\n\nOpen (creating if needed) the DM channel with a user.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `recipient` | [`User`](../../../users/user/classes/User.md) |\n\n#### Returns\n\n`Promise`\\<`Channel`\\>\n\n***\n\n### private()\n\n> `static` **private**(`client`, `recipients`): `Promise`\\<`Channel`\\>\n\nOpen (creating if needed) the private group channel with a set of users.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `recipients` | [`User`](../../../users/user/classes/User.md)[] |\n\n#### Returns\n\n`Promise`\\<`Channel`\\>\n\n\n<!-- src/entities/channels/channel/type-aliases/ChannelAttachment.md -->\n# Type Alias: ChannelAttachment\n\n> **ChannelAttachment** = [`GetChannelAttachmentsResponses`](../../../../../generated/storage/types.gen/type-aliases/GetChannelAttachmentsResponses.md)\\[`200`\\]\\[`\"items\"`\\]\\[`number`\\]\n\nA file or entity attached to a message in a channel.\n\n\n<!-- src/entities/channels/channel/type-aliases/ChannelParticipant.md -->\n# Type Alias: ChannelParticipant\n\n> **ChannelParticipant** = [`GetChannelParticipantsResponses`](../../../../../generated/storage/types.gen/type-aliases/GetChannelParticipantsResponses.md)\\[`200`\\]\\[`number`\\]\n\nA member of a channel, with their role and join time.\n\n\n<!-- src/entities/channels/labels/classes/ChannelLabelsNamespace.md -->\n# Class: ChannelLabelsNamespace\n\nShared or private channel labels: named groups of channels shown in the Chat\nsidebar. Every member of the team sees the same labels in the same order,\nand any member may create, rename, delete, or move channels between them;\neach change applies to the whole team. Users without a team have private\nlabels belonging to their account.\n\nA label's `channelIds` lists only the channels the authenticated user is a\nmember of. Manual labels count all assignments; smart tags count visible\nmatches. A channel can be in one manual label and any number of matching\nsmart tags per team or account. Direct messages cannot be grouped.\n\n## Constructors\n\n### Constructor\n\n> **new ChannelLabelsNamespace**(`client`): `ChannelLabelsNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`ChannelLabelsNamespace`\n\n## Methods\n\n### create()\n\n> **create**(`name`, `channels?`): `Promise`\\<[`ChannelLabel`](../../../../../generated/storage/types.gen/type-aliases/ChannelLabel.md)\\>\n\nCreate a label and atomically move `channels` into it. Names are unique\nwithin the team or account, case-insensitively.\n\n#### Parameters\n\n| Parameter | Type | Default value |\n| ------ | ------ | ------ |\n| `name` | `string` | `undefined` |\n| `channels?` | [`Channel`](../../channel/classes/Channel.md)[] | `[]` |\n\n#### Returns\n\n`Promise`\\<[`ChannelLabel`](../../../../../generated/storage/types.gen/type-aliases/ChannelLabel.md)\\>\n\n***\n\n### createSmartTag()\n\n> **createSmartTag**(`name`, `rule`): `Promise`\\<[`ChannelLabel`](../../../../../generated/storage/types.gen/type-aliases/ChannelLabel.md)\\>\n\nCreate a smart tag whose membership follows an attribute rule automatically.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `name` | `string` |\n| `rule` | [`ChannelLabelRule`](../../../../../generated/storage/types.gen/type-aliases/ChannelLabelRule.md) |\n\n#### Returns\n\n`Promise`\\<[`ChannelLabel`](../../../../../generated/storage/types.gen/type-aliases/ChannelLabel.md)\\>\n\n***\n\n### delete()\n\n> **delete**(`label`): `Promise`\\<`void`\\>\n\nDelete a label for the whole team; its channels return to the plain list.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `label` | [`ChannelLabel`](../../../../../generated/storage/types.gen/type-aliases/ChannelLabel.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### list()\n\n> **list**(): `Promise`\\<[`ChannelLabel`](../../../../../generated/storage/types.gen/type-aliases/ChannelLabel.md)[]\\>\n\nEvery label in the authenticated user's shared or private scope.\n\n#### Returns\n\n`Promise`\\<[`ChannelLabel`](../../../../../generated/storage/types.gen/type-aliases/ChannelLabel.md)[]\\>\n\n***\n\n### previewSmartTag()\n\n> **previewSmartTag**(`rule`): `Promise`\\<[`SmartTagPreview`](../../../../../generated/storage/types.gen/type-aliases/SmartTagPreview.md)\\>\n\nPreview the first matches and total visible count without creating a tag.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `rule` | [`ChannelLabelRule`](../../../../../generated/storage/types.gen/type-aliases/ChannelLabelRule.md) |\n\n#### Returns\n\n`Promise`\\<[`SmartTagPreview`](../../../../../generated/storage/types.gen/type-aliases/SmartTagPreview.md)\\>\n\n***\n\n### rename()\n\n> **rename**(`label`, `name`): `Promise`\\<[`ChannelLabel`](../../../../../generated/storage/types.gen/type-aliases/ChannelLabel.md)\\>\n\nRename a label for the whole team.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `label` | [`ChannelLabel`](../../../../../generated/storage/types.gen/type-aliases/ChannelLabel.md) |\n| `name` | `string` |\n\n#### Returns\n\n`Promise`\\<[`ChannelLabel`](../../../../../generated/storage/types.gen/type-aliases/ChannelLabel.md)\\>\n\n***\n\n### setLabel()\n\n> **setLabel**(`channel`, `label`): `Promise`\\<`void`\\>\n\nMove a channel into `label`, or out of any label when `label` is `undefined`.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `channel` | [`Channel`](../../channel/classes/Channel.md) |\n| `label` | [`ChannelLabel`](../../../../../generated/storage/types.gen/type-aliases/ChannelLabel.md) \\| `undefined` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### updateSmartTag()\n\n> **updateSmartTag**(`label`, `name`, `rule`): `Promise`\\<[`ChannelLabel`](../../../../../generated/storage/types.gen/type-aliases/ChannelLabel.md)\\>\n\nUpdate the name and matching rule of an existing smart tag.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `label` | [`ChannelLabel`](../../../../../generated/storage/types.gen/type-aliases/ChannelLabel.md) |\n| `name` | `string` |\n| `rule` | [`ChannelLabelRule`](../../../../../generated/storage/types.gen/type-aliases/ChannelLabelRule.md) |\n\n#### Returns\n\n`Promise`\\<[`ChannelLabel`](../../../../../generated/storage/types.gen/type-aliases/ChannelLabel.md)\\>\n\n\n<!-- src/entities/channels/message/classes/Message.md -->\n# Class: Message\n\nA message in a channel. A thin handle: `id` and `channelId` are known up\nfront, and record-backed fields (`content`, `author`) load lazily on first\naccess and cache. Actions carry the ids for you.\n\n## Extends\n\n- [`FavoritableEntity`](../../../entity/classes/FavoritableEntity.md)\\<[`Message`](../../../../../generated/storage/types.gen/type-aliases/Message.md)\\>\n\n## Properties\n\n| Property | Modifier | Type | Default value | Description | Overrides | Inherited from |\n| ------ | ------ | ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-channelid\"></a> `channelId` | `readonly` | `string` | `undefined` | - | - | - |\n| <a id=\"property-content\"></a> `content` | `readonly` | () => `Promise`\\<`string`\\> | `...` | The message body. | - | - |\n| <a id=\"property-createdat\"></a> `createdAt` | `readonly` | () => `Promise`\\<`string`\\> | `...` | When the message was created. | - | - |\n| <a id=\"property-editedat\"></a> `editedAt` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | `...` | When the message was last edited, if it has been. | - | - |\n| <a id=\"property-entitytype\"></a> `entityType` | `readonly` | `\"channel_message\"` | `'channel_message'` | Favorites identify channel messages as `channel_message`. | [`FavoritableEntity`](../../../entity/classes/FavoritableEntity.md).[`entityType`](../../../entity/classes/FavoritableEntity.md#property-entitytype) | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | `undefined` | - | - | [`FavoritableEntity`](../../../entity/classes/FavoritableEntity.md).[`id`](../../../entity/classes/FavoritableEntity.md#property-id) |\n| <a id=\"property-mentions\"></a> `mentions` | `readonly` | [`SimpleMention`](../../../../../generated/storage/types.gen/type-aliases/SimpleMention.md)[] | `[]` | Entities mentioned in this message, when a list, thread, or event supplied them. | - | - |\n| <a id=\"property-updatedat\"></a> `updatedAt` | `readonly` | () => `Promise`\\<`string`\\> | `...` | When the message was last updated. | - | - |\n\n## Methods\n\n### author()\n\n> **author**(): `Promise`\\<[`User`](../../../users/user/classes/User.md)\\>\n\nThe user who sent this message.\n\n#### Returns\n\n`Promise`\\<[`User`](../../../users/user/classes/User.md)\\>\n\n***\n\n### channel()\n\n> **channel**(): [`Channel`](../../channel/classes/Channel.md)\n\nThe channel this message is in.\n\n#### Returns\n\n[`Channel`](../../channel/classes/Channel.md)\n\n***\n\n### delete()\n\n> **delete**(): `Promise`\\<`void`\\>\n\nDelete this message.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### edit()\n\n> **edit**(`body`): `Promise`\\<`Message`\\>\n\nReplace this message's body.\n\n#### Parameters\n\n| Parameter | Type | Description |\n| ------ | ------ | ------ |\n| `body` | `string` \\| [`RichMessage`](../../../../mentions/interfaces/RichMessage.md) | Plain text, or a rich body composed with msg. |\n\n#### Returns\n\n`Promise`\\<`Message`\\>\n\n***\n\n### favorite()\n\n> **favorite**(): `Promise`\\<`Message`\\>\n\nAdd this entity to the user's favorites. Returns this handle for chaining.\nPlain unwrap: favoriting alters the user's favorites collection, not this\nentity's own detail, so there's nothing cached to invalidate.\n\n#### Returns\n\n`Promise`\\<`Message`\\>\n\n#### Inherited from\n\n[`FavoritableEntity`](../../../entity/classes/FavoritableEntity.md).[`favorite`](../../../entity/classes/FavoritableEntity.md#favorite)\n\n***\n\n### react()\n\n> **react**(`emoji`): `Promise`\\<`Message`\\>\n\nAdd an emoji reaction to this message.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `emoji` | `string` |\n\n#### Returns\n\n`Promise`\\<`Message`\\>\n\n***\n\n### reply()\n\n> **reply**(`body`): `Promise`\\<`Message`\\>\n\nPost a reply in this message's thread.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `body` | `string` \\| [`RichMessage`](../../../../mentions/interfaces/RichMessage.md) |\n\n#### Returns\n\n`Promise`\\<`Message`\\>\n\n***\n\n### thread()\n\n> **thread**(): [`Thread`](../../thread/classes/Thread.md)\n\nThe thread rooted at this message.\n\n#### Returns\n\n[`Thread`](../../thread/classes/Thread.md)\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`Message`](../../../../../generated/storage/types.gen/type-aliases/Message.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`Message`](../../../../../generated/storage/types.gen/type-aliases/Message.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`Message`](../../../../../generated/storage/types.gen/type-aliases/Message.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`FavoritableEntity`](../../../entity/classes/FavoritableEntity.md).[`toJSON`](../../../entity/classes/FavoritableEntity.md#tojson)\n\n***\n\n### unfavorite()\n\n> **unfavorite**(): `Promise`\\<`Message`\\>\n\nRemove this entity from the user's favorites. Returns this handle for chaining.\n\n#### Returns\n\n`Promise`\\<`Message`\\>\n\n#### Inherited from\n\n[`FavoritableEntity`](../../../entity/classes/FavoritableEntity.md).[`unfavorite`](../../../entity/classes/FavoritableEntity.md#unfavorite)\n\n***\n\n### unreact()\n\n> **unreact**(`emoji`): `Promise`\\<`Message`\\>\n\nRemove one of your emoji reactions from this message.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `emoji` | `string` |\n\n#### Returns\n\n`Promise`\\<`Message`\\>\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `channelId`, `id`, `mentions?`): `Message`\n\nA handle to a message by id. Fields load on first access.\n\n#### Parameters\n\n| Parameter | Type | Default value |\n| ------ | ------ | ------ |\n| `client` | `MacroClient` | `undefined` |\n| `channelId` | `string` | `undefined` |\n| `id` | `string` | `undefined` |\n| `mentions?` | [`SimpleMention`](../../../../../generated/storage/types.gen/type-aliases/SimpleMention.md)[] | `[]` |\n\n#### Returns\n\n`Message`\n\n***\n\n### from()\n\n> `static` **from**(`client`, `channelId`, `data`): `Message`\n\nBuild a root or reply from a message record (pre-seeded, no fetch).\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `channelId` | `string` |\n| `data` | [`Message`](../../../../../generated/storage/types.gen/type-aliases/Message.md) |\n\n#### Returns\n\n`Message`\n\n\n<!-- src/entities/channels/message/type-aliases/MessageData.md -->\n# Type Alias: MessageData\n\n> **MessageData** = [`Message`](../../../../../generated/storage/types.gen/type-aliases/Message.md)\n\nThe API's representation of a message; the same record the document comment API returns.\n\n\n<!-- src/entities/channels/namespace/classes/ChannelNamespace.md -->\n# Class: ChannelNamespace\n\n## Constructors\n\n### Constructor\n\n> **new ChannelNamespace**(`client`): `ChannelNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`ChannelNamespace`\n\n## Properties\n\n| Property | Modifier | Type | Description |\n| ------ | ------ | ------ | ------ |\n| <a id=\"property-labels\"></a> `labels` | `readonly` | [`ChannelLabelsNamespace`](../../labels/classes/ChannelLabelsNamespace.md) | Team-shared labels that group channels in the Chat sidebar. |\n\n## Methods\n\n### byId()\n\n> **byId**(`id`): [`Channel`](../../channel/classes/Channel.md)\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`Channel`](../../channel/classes/Channel.md)\n\n***\n\n### create()\n\n> **create**(`opts`): `Promise`\\<[`Channel`](../../channel/classes/Channel.md)\\>\n\nCreate a channel. The caller becomes the owner.\n\n#### Parameters\n\n| Parameter | Type | Description |\n| ------ | ------ | ------ |\n| `opts` | \\{ `name?`: `string`; `participants?`: [`User`](../../../users/user/classes/User.md)[]; `team?`: [`Team`](../../../teams/team/classes/Team.md); `type`: [`ChannelType`](../../../../../generated/storage/types.gen/type-aliases/ChannelType.md); \\} | - |\n| `opts.name?` | `string` | - |\n| `opts.participants?` | [`User`](../../../users/user/classes/User.md)[] | Participants to add, excluding the owner. |\n| `opts.team?` | [`Team`](../../../teams/team/classes/Team.md) | Team, for team channels. |\n| `opts.type` | [`ChannelType`](../../../../../generated/storage/types.gen/type-aliases/ChannelType.md) | - |\n\n#### Returns\n\n`Promise`\\<[`Channel`](../../channel/classes/Channel.md)\\>\n\n***\n\n### dm()\n\n> **dm**(`recipient`): `Promise`\\<[`Channel`](../../channel/classes/Channel.md)\\>\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `recipient` | [`User`](../../../users/user/classes/User.md) |\n\n#### Returns\n\n`Promise`\\<[`Channel`](../../channel/classes/Channel.md)\\>\n\n***\n\n### list()\n\n> **list**(): `Promise`\\<[`Channel`](../../channel/classes/Channel.md)[]\\>\n\nAll channels the authenticated user is a member of.\n\n#### Returns\n\n`Promise`\\<[`Channel`](../../channel/classes/Channel.md)[]\\>\n\n***\n\n### private()\n\n> **private**(`recipients`): `Promise`\\<[`Channel`](../../channel/classes/Channel.md)\\>\n\nOpen (creating if needed) the private group channel with a set of users.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `recipients` | [`User`](../../../users/user/classes/User.md)[] |\n\n#### Returns\n\n`Promise`\\<[`Channel`](../../channel/classes/Channel.md)\\>\n\n***\n\n### search()\n\n> **search**(`query`, `opts?`): `AsyncGenerator`\\<[`Channel`](../../channel/classes/Channel.md)\\>\n\nSearch channels by name (client-side fuzzy filter on the full channel list)\nor by content (server-side unified search).\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `query` | `string` |\n| `opts?` | [`SearchOpts`](../../../search/interfaces/SearchOpts.md) |\n\n#### Returns\n\n`AsyncGenerator`\\<[`Channel`](../../channel/classes/Channel.md)\\>\n\n\n<!-- src/entities/channels/post/functions/postToChannel.md -->\n# Function: postToChannel()\n\n> **postToChannel**(`client`, `target`, `body`): `Promise`\\<`string`\\>\n\nPost a message using the endpoint supported by the caller's credentials.\n\nMost credentials use `POST /messages/channel/{id}`. User-owned bots without\nan acting user instead use `POST /channels/{id}/webhook`, which authorizes\nthrough channel membership. The bot owner is read from `GET /bots/me` and\ncached by the client.\n\nThe webhook endpoint supports content only. Mentions in `<m-*>` tags still\nwork, but threads and attachments are not supported.\n\nPosting to a `Thread` puts the message in that thread; to a `Channel`, at the\nchannel root. One target rather than a channel plus a thread id, so the two\ncan't disagree.\n\n## Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `target` | [`Channel`](../../channel/classes/Channel.md) \\| [`Thread`](../../thread/classes/Thread.md) |\n| `body` | [`RichMessage`](../../../../mentions/interfaces/RichMessage.md) |\n\n## Returns\n\n`Promise`\\<`string`\\>\n\n\n<!-- src/entities/channels/thread/classes/Thread.md -->\n# Class: Thread\n\nA thread within a channel, rooted at a top-level message. Replies and\nthread-scoped posting live here.\n\n## Constructors\n\n### Constructor\n\n> **new Thread**(`client`, `channelId`, `rootId`): `Thread`\n\n#### Parameters\n\n| Parameter | Type | Description |\n| ------ | ------ | ------ |\n| `client` | `MacroClient` | - |\n| `channelId` | `string` | - |\n| `rootId` | `string` | The id of the message this thread hangs off. |\n\n#### Returns\n\n`Thread`\n\n## Properties\n\n| Property | Modifier | Type | Description |\n| ------ | ------ | ------ | ------ |\n| <a id=\"property-channelid\"></a> `channelId` | `readonly` | `string` | - |\n| <a id=\"property-rootid\"></a> `rootId` | `readonly` | `string` | The id of the message this thread hangs off. |\n\n## Methods\n\n### channel()\n\n> **channel**(): [`Channel`](../../channel/classes/Channel.md)\n\nThe channel this thread is in.\n\n#### Returns\n\n[`Channel`](../../channel/classes/Channel.md)\n\n***\n\n### replies()\n\n> **replies**(): `Promise`\\<[`Message`](../../message/classes/Message.md)[]\\>\n\nList the replies in this thread, oldest first.\n\n#### Returns\n\n`Promise`\\<[`Message`](../../message/classes/Message.md)[]\\>\n\n***\n\n### reply()\n\n> **reply**(`body`): `Promise`\\<[`Message`](../../message/classes/Message.md)\\>\n\nPost a reply in this thread.\n\n#### Parameters\n\n| Parameter | Type | Description |\n| ------ | ------ | ------ |\n| `body` | `string` \\| [`RichMessage`](../../../../mentions/interfaces/RichMessage.md) | Plain text, or a rich body composed with msg. |\n\n#### Returns\n\n`Promise`\\<[`Message`](../../message/classes/Message.md)\\>\n\nThe created reply.\n\n***\n\n### root()\n\n> **root**(): [`Message`](../../message/classes/Message.md)\n\nThe message this thread hangs off.\n\n#### Returns\n\n[`Message`](../../message/classes/Message.md)\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `channelId`: `string`; `rootId`: `string`; \\}\n\nSerialize the thread identity without its authenticated client.\n\n#### Returns\n\n\\{ `channelId`: `string`; `rootId`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `channelId` | `string` |\n| `rootId` | `string` |\n"+ "overview": "<!-- src/entities/channels/namespace/classes/ChannelNamespace.md -->\n# Class: ChannelNamespace\n\n## Constructors\n\n### Constructor\n\n> **new ChannelNamespace**(`client`): `ChannelNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`ChannelNamespace`\n\n## Properties\n\n| Property | Modifier | Type | Description |\n| ------ | ------ | ------ | ------ |\n| <a id=\"property-labels\"></a> `labels` | `readonly` | [`ChannelLabelsNamespace`](../../labels/classes/ChannelLabelsNamespace.md) | Team-shared labels that group channels in the Chat sidebar. |\n\n## Methods\n\n### activity()\n\n> **activity**(): `Promise`\\<[`ChannelActivity`](../../activity/classes/ChannelActivity.md)[]\\>\n\nRecent channel activity, with channel and user handles.\n\n#### Returns\n\n`Promise`\\<[`ChannelActivity`](../../activity/classes/ChannelActivity.md)[]\\>\n\n***\n\n### byId()\n\n> **byId**(`id`): [`Channel`](../../channel/classes/Channel.md)\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`Channel`](../../channel/classes/Channel.md)\n\n***\n\n### create()\n\n> **create**(`opts`): `Promise`\\<[`Channel`](../../channel/classes/Channel.md)\\>\n\nCreate a channel. The caller becomes the owner.\n\n#### Parameters\n\n| Parameter | Type | Description |\n| ------ | ------ | ------ |\n| `opts` | \\{ `name?`: `string`; `participants?`: [`User`](../../../users/user/classes/User.md)[]; `team?`: [`Team`](../../../teams/team/classes/Team.md); `type`: [`ChannelType`](../../../../../generated/storage/types.gen/type-aliases/ChannelType.md); \\} | - |\n| `opts.name?` | `string` | - |\n| `opts.participants?` | [`User`](../../../users/user/classes/User.md)[] | Participants to add, excluding the owner. |\n| `opts.team?` | [`Team`](../../../teams/team/classes/Team.md) | Team, for team channels. |\n| `opts.type` | [`ChannelType`](../../../../../generated/storage/types.gen/type-aliases/ChannelType.md) | - |\n\n#### Returns\n\n`Promise`\\<[`Channel`](../../channel/classes/Channel.md)\\>\n\n***\n\n### dm()\n\n> **dm**(`recipient`): `Promise`\\<[`Channel`](../../channel/classes/Channel.md)\\>\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `recipient` | [`User`](../../../users/user/classes/User.md) |\n\n#### Returns\n\n`Promise`\\<[`Channel`](../../channel/classes/Channel.md)\\>\n\n***\n\n### list()\n\n> **list**(): `Promise`\\<[`Channel`](../../channel/classes/Channel.md)[]\\>\n\nAll channels the authenticated user is a member of.\n\n#### Returns\n\n`Promise`\\<[`Channel`](../../channel/classes/Channel.md)[]\\>\n\n***\n\n### private()\n\n> **private**(`recipients`): `Promise`\\<[`Channel`](../../channel/classes/Channel.md)\\>\n\nOpen (creating if needed) the private group channel with a set of users.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `recipients` | [`User`](../../../users/user/classes/User.md)[] |\n\n#### Returns\n\n`Promise`\\<[`Channel`](../../channel/classes/Channel.md)\\>\n\n***\n\n### search()\n\n> **search**(`query`, `opts?`): `AsyncGenerator`\\<[`Channel`](../../channel/classes/Channel.md)\\>\n\nSearch channels by name (client-side fuzzy filter on the full channel list)\nor by content (server-side unified search).\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `query` | `string` |\n| `opts?` | [`SearchOpts`](../../../search/interfaces/SearchOpts.md) |\n\n#### Returns\n\n`AsyncGenerator`\\<[`Channel`](../../channel/classes/Channel.md)\\>\n",+ "documentation": "# Macro SDK: channels\n\nGenerated by TypeDoc. Paths below refer to the canonical Markdown hierarchy. Other entity handles are documented in their named section; request core for shared SDK helpers.\n\n<!-- generated/properties/types.gen/type-aliases/BulkUpdateEntityPropertyOptionsResponse.md -->\n# Type Alias: BulkUpdateEntityPropertyOptionsResponse\n\n> **BulkUpdateEntityPropertyOptionsResponse** = \\{ `properties`: [`EntityPropertyOptionSelectionResponse`](EntityPropertyOptionSelectionResponse.md)[]; \\}\n\nResponse for a bulk option update: each property's reconciled final ids.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-properties\"></a> `properties` | [`EntityPropertyOptionSelectionResponse`](EntityPropertyOptionSelectionResponse.md)[] | The final option ids per updated property. |\n\n\n<!-- generated/properties/types.gen/type-aliases/DataType.md -->\n# Type Alias: DataType\n\n> **DataType** = `\"BOOLEAN\"` \\| `\"DATE\"` \\| `\"NUMBER\"` \\| `\"STRING\"` \\| `\"SELECT_NUMBER\"` \\| `\"SELECT_STRING\"` \\| `\"TAG\"` \\| `\"ENTITY\"` \\| `\"LINK\"`\n\nData type for property values, determining storage and validation.\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityProperty.md -->\n# Type Alias: EntityProperty\n\n> **EntityProperty** = \\{ `created_at`: `string`; `entity_id`: `string`; `entity_type`: [`EntityType`](EntityType.md); `id`: `string`; `property_definition_id`: `string`; `updated_at`: `string`; \\}\n\nAssignment of a property definition to a specific entity (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-created_at\"></a> `created_at` | `string` |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` |\n| <a id=\"property-entity_type\"></a> `entity_type` | [`EntityType`](EntityType.md) |\n| <a id=\"property-id\"></a> `id` | `string` |\n| <a id=\"property-property_definition_id\"></a> `property_definition_id` | `string` |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityPropertyOptionSelectionResponse.md -->\n# Type Alias: EntityPropertyOptionSelectionResponse\n\n> **EntityPropertyOptionSelectionResponse** = \\{ `option_ids`: `string`[]; `property_id`: `string`; \\}\n\nThe reconciled final option ids stored for one property after a bulk update.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-option_ids\"></a> `option_ids` | `string`[] | The final option ids the server persisted, in stored order. |\n| <a id=\"property-property_id\"></a> `property_id` | `string` | The property definition the options belong to. |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md -->\n# Type Alias: EntityPropertyWithDefinition\n\n> **EntityPropertyWithDefinition** = \\{ `definition`: [`PropertyDefinition`](PropertyDefinition.md); `options?`: [`PropertyOption`](PropertyOption.md)[] \\| `null`; `property`: [`EntityProperty`](EntityProperty.md); `value?`: `null` \\| [`PropertyValue`](PropertyValue.md); \\}\n\nEntity property with its definition, value, and options (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-definition\"></a> `definition` | [`PropertyDefinition`](PropertyDefinition.md) |\n| <a id=\"property-options\"></a> `options?` | [`PropertyOption`](PropertyOption.md)[] \\| `null` |\n| <a id=\"property-property\"></a> `property` | [`EntityProperty`](EntityProperty.md) |\n| <a id=\"property-value\"></a> `value?` | `null` \\| [`PropertyValue`](PropertyValue.md) |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityReference.md -->\n# Type Alias: EntityReference\n\n> **EntityReference** = \\{ `entity_id`: `string`; `entity_type`: [`EntityType`](EntityType.md); `specific_message_id?`: `string` \\| `null`; \\}\n\nEntity reference for entity-type property values.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | - |\n| <a id=\"property-entity_type\"></a> `entity_type` | [`EntityType`](EntityType.md) | - |\n| <a id=\"property-specific_message_id\"></a> `specific_message_id?` | `string` \\| `null` | For CHANNEL, CHAT, THREAD entity types - optional specific message ID. This allows referencing a specific message within a thread/channel/chat. |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityType.md -->\n# Type Alias: EntityType\n\n> **EntityType** = `\"CALENDAR_EVENT\"` \\| `\"CALL_RECORD\"` \\| `\"CHANNEL\"` \\| `\"CHAT\"` \\| `\"COMPANY\"` \\| `\"DATABASE_ROW\"` \\| `\"CONTACT\"` \\| `\"DOCUMENT\"` \\| `\"INITIATIVE\"` \\| `\"PROJECT\"` \\| `\"TASK\"` \\| `\"THREAD\"` \\| `\"USER\"`\n\nType of entity that can be referenced by entity properties.\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyDefinition.md -->\n# Type Alias: PropertyDefinition\n\n> **PropertyDefinition** = \\{ `created_at`: `string`; `data_type`: [`DataType`](DataType.md); `display_name`: `string`; `id`: `string`; `is_metadata`: `boolean`; `is_multi_select`: `boolean`; `is_system`: `boolean`; `owner`: [`PropertyOwner`](PropertyOwner.md); `specific_entity_type`: `null` \\| [`EntityType`](EntityType.md); `updated_at`: `string`; \\}\n\nProperty definition model (service representation).\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | - |\n| <a id=\"property-data_type\"></a> `data_type` | [`DataType`](DataType.md) | - |\n| <a id=\"property-display_name\"></a> `display_name` | `string` | - |\n| <a id=\"property-id\"></a> `id` | `string` | - |\n| <a id=\"property-is_metadata\"></a> `is_metadata` | `boolean` | Flag to indicate if this is a system-generated metadata property. Not stored in database - computed at service layer. |\n| <a id=\"property-is_multi_select\"></a> `is_multi_select` | `boolean` | - |\n| <a id=\"property-is_system\"></a> `is_system` | `boolean` | Flag to indicate if this is a system property (stored in DB). |\n| <a id=\"property-owner\"></a> `owner` | [`PropertyOwner`](PropertyOwner.md) | - |\n| <a id=\"property-specific_entity_type\"></a> `specific_entity_type` | `null` \\| [`EntityType`](EntityType.md) | - |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` | - |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyOption.md -->\n# Type Alias: PropertyOption\n\n> **PropertyOption** = \\{ `color`: `string` \\| `null`; `created_at`: `string`; `display_order`: `number`; `id`: `string`; `property_definition_id`: `string`; `updated_at`: `string`; `value`: [`PropertyOptionValue`](PropertyOptionValue.md); \\}\n\nA selectable option for select-type properties (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-color\"></a> `color` | `string` \\| `null` |\n| <a id=\"property-created_at\"></a> `created_at` | `string` |\n| <a id=\"property-display_order\"></a> `display_order` | `number` |\n| <a id=\"property-id\"></a> `id` | `string` |\n| <a id=\"property-property_definition_id\"></a> `property_definition_id` | `string` |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` |\n| <a id=\"property-value\"></a> `value` | [`PropertyOptionValue`](PropertyOptionValue.md) |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyOptionValue.md -->\n# Type Alias: PropertyOptionValue\n\n> **PropertyOptionValue** = \\{ `type`: `\"string\"`; `value`: `string`; \\} \\| \\{ `type`: `\"number\"`; `value`: `number`; \\}\n\nThe value of a property option - either a string or a number.\n\n## Union Members\n\n### Type Literal\n\n\\{ `type`: `\"string\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"string\"` | - |\n| `value` | `string` | String value for SelectString properties |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"number\"`; `value`: `number`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"number\"` | - |\n| `value` | `number` | Number value for SelectNumber properties |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyOwner.md -->\n# Type Alias: PropertyOwner\n\n> **PropertyOwner** = \\{ `scope`: `\"user\"`; `user_id`: `string`; \\} \\| \\{ `scope`: `\"team\"`; `team_id`: `string`; \\} \\| \\{ `database_id`: `string`; `scope`: `\"database\"`; \\} \\| \\{ `scope`: `\"system\"`; \\}\n\nDefines who owns a property - user-scoped, team-scoped, database-scoped, or system.\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyTargetEntityType.md -->\n# Type Alias: PropertyTargetEntityType\n\n> **PropertyTargetEntityType** = `\"CALL_RECORD\"` \\| `\"CHANNEL\"` \\| `\"CHAT\"` \\| `\"COMPANY\"` \\| `\"DATABASE_ROW\"` \\| `\"DOCUMENT\"` \\| `\"INITIATIVE\"` \\| `\"PROJECT\"` \\| `\"THREAD\"` \\| `\"USER\"`\n\nCanonical type of an entity receiving properties.\n\nTasks are documents at API boundaries. `Task` intentionally does not exist\nhere; task classification is resolved by the properties domain from the\ndocument subtype.\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyTargetReference.md -->\n# Type Alias: PropertyTargetReference\n\n> **PropertyTargetReference** = \\{ `entity_id`: `string`; `entity_type`: [`PropertyTargetEntityType`](PropertyTargetEntityType.md); \\}\n\nCanonical reference to an entity receiving properties.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | Entity identifier. |\n| <a id=\"property-entity_type\"></a> `entity_type` | [`PropertyTargetEntityType`](PropertyTargetEntityType.md) | Canonical entity type. |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyValue.md -->\n# Type Alias: PropertyValue\n\n> **PropertyValue** = \\{ `type`: `\"Boolean\"`; `value`: `boolean`; \\} \\| \\{ `type`: `\"Number\"`; `value`: `number`; \\} \\| \\{ `type`: `\"String\"`; `value`: `string`; \\} \\| \\{ `type`: `\"Date\"`; `value`: `string`; \\} \\| \\{ `type`: `\"SelectOption\"`; `value`: `string`[]; \\} \\| \\{ `type`: `\"EntityReference\"`; `value`: [`EntityReference`](EntityReference.md)[]; \\} \\| \\{ `type`: `\"Link\"`; `value`: `string`[]; \\}\n\nProperty value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to/from JSONB in the database.\n\n## Union Members\n\n### Type Literal\n\n\\{ `type`: `\"Boolean\"`; `value`: `boolean`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Boolean\"` | - |\n| `value` | `boolean` | Boolean value Serializes as: {\"type\": \"Boolean\", \"value\": true} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"Number\"`; `value`: `number`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Number\"` | - |\n| `value` | `number` | Numeric value Serializes as: {\"type\": \"Number\", \"value\": 42.5} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"String\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"String\"` | - |\n| `value` | `string` | String value Serializes as: {\"type\": \"String\", \"value\": \"text\"} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"Date\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Date\"` | - |\n| `value` | `string` | Date/timestamp value Serializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"SelectOption\"`; `value`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"SelectOption\"` | - |\n| `value` | `string`[] | Select option(s) - always an array (check is_multi_select to determine if single or multi) Single-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1) Multi-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+) |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"EntityReference\"`; `value`: [`EntityReference`](EntityReference.md)[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"EntityReference\"` | - |\n| `value` | [`EntityReference`](EntityReference.md)[] | Entity reference(s) - always an array (check is_multi_select to determine if single or multi) Single-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1) Multi-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+) |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"Link\"`; `value`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Link\"` | - |\n| `value` | `string`[] | Link value(s) - always an array (check is_multi_select to determine if single or multi) Single-select: {\"type\": \"Link\", \"value\": [\"https://example.com\"]} (length 0 or 1) Multi-select: {\"type\": \"Link\", \"value\": [\"https://example.com\", \"https://other.com\"]} (length 0+) |\n\n\n<!-- generated/properties/types.gen/type-aliases/SetPropertyValue.md -->\n# Type Alias: SetPropertyValue\n\n> **SetPropertyValue** = \\{ `type`: `\"boolean\"`; `value`: `boolean`; \\} \\| \\{ `type`: `\"date\"`; `value`: `string`; \\} \\| \\{ `type`: `\"number\"`; `value`: `number`; \\} \\| \\{ `type`: `\"string\"`; `value`: `string`; \\} \\| \\{ `option_id`: `string`; `type`: `\"select_option\"`; \\} \\| \\{ `option_ids`: `string`[]; `type`: `\"multi_select_option\"`; \\} \\| \\{ `reference`: [`EntityReference`](EntityReference.md); `type`: `\"entity_reference\"`; \\} \\| \\{ `references`: [`EntityReference`](EntityReference.md)[]; `type`: `\"multi_entity_reference\"`; \\} \\| \\{ `type`: `\"link\"`; `url`: `string`; \\} \\| \\{ `type`: `\"multi_link\"`; `urls`: `string`[]; \\}\n\nType-safe enum for setting entity property values - provides compile-time validation.\n\n\n<!-- generated/storage/types.gen/type-aliases/AccessLevel.md -->\n# Type Alias: AccessLevel\n\n> **AccessLevel** = `\"view\"` \\| `\"comment\"` \\| `\"edit\"` \\| `\"owner\"`\n\nOrdered from least to most access top -> bottom\n\n\n<!-- generated/storage/types.gen/type-aliases/ActivityType.md -->\n# Type Alias: ActivityType\n\n> **ActivityType** = `\"view\"` \\| `\"interact\"`\n\nThe kind of activity a user performs in a channel.\n\n\n<!-- generated/storage/types.gen/type-aliases/ApiActivity.md -->\n# Type Alias: ApiActivity\n\n> **ApiActivity** = \\{ `channel_id`: `string`; `created_at`: `string`; `id`: `string`; `interacted_at?`: `string` \\| `null`; `updated_at`: `string`; `user_id`: `string`; `viewed_at?`: `string` \\| `null`; \\}\n\nA user's activity (view/interaction) within a channel.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-channel_id\"></a> `channel_id` | `string` | Channel id. |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | When the activity row was created. |\n| <a id=\"property-id\"></a> `id` | `string` | Activity id. |\n| <a id=\"property-interacted_at\"></a> `interacted_at?` | `string` \\| `null` | The last time the user interacted with the channel. |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` | When the activity row was last updated. |\n| <a id=\"property-user_id\"></a> `user_id` | `string` | User id. |\n| <a id=\"property-viewed_at\"></a> `viewed_at?` | `string` \\| `null` | The last time the user viewed the channel. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ApiChannelAttachment.md -->\n# Type Alias: ApiChannelAttachment\n\n> **ApiChannelAttachment** = \\{ `channel_id`: `string`; `created_at`: `string`; `entity_id`: `string`; `entity_type`: `string`; `height?`: `number` \\| `null`; `id`: `string`; `message_id`: `string`; `sender_id`: `string`; `width?`: `number` \\| `null`; \\}\n\nA channel-level attachment.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-channel_id\"></a> `channel_id` | `string` | Channel id. |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | When the attachment was created. |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | Entity id. |\n| <a id=\"property-entity_type\"></a> `entity_type` | `string` | Type of entity. |\n| <a id=\"property-height\"></a> `height?` | `number` \\| `null` | Height (for images). |\n| <a id=\"property-id\"></a> `id` | `string` | Attachment id. |\n| <a id=\"property-message_id\"></a> `message_id` | `string` | Message id this attachment belongs to. |\n| <a id=\"property-sender_id\"></a> `sender_id` | `string` | The user who sent the message containing this attachment. |\n| <a id=\"property-width\"></a> `width?` | `number` \\| `null` | Width (for images). |\n\n\n<!-- generated/storage/types.gen/type-aliases/ApiChannelAttachmentsPage.md -->\n# Type Alias: ApiChannelAttachmentsPage\n\n> **ApiChannelAttachmentsPage** = \\{ `items`: [`ApiChannelAttachment`](ApiChannelAttachment.md)[]; `next_cursor?`: `string` \\| `null`; \\}\n\nPaginated response of channel attachments.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-items\"></a> `items` | [`ApiChannelAttachment`](ApiChannelAttachment.md)[] | Attachments on this page. |\n| <a id=\"property-next_cursor\"></a> `next_cursor?` | `string` \\| `null` | Cursor for the next page, null if no more pages. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ApiChannelDetail.md -->\n# Type Alias: ApiChannelDetail\n\n> **ApiChannelDetail** = \\{ `channel_id`: `string`; `channel_name`: `string`; `channel_type`: [`ChannelType`](ChannelType.md); `participants`: [`ApiChannelParticipant`](ApiChannelParticipant.md)[]; \\}\n\nChannel detail: metadata and active participants.\n\nMessages are read through `/messages/channel/{channel_id}`.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-channel_id\"></a> `channel_id` | `string` | Channel id. |\n| <a id=\"property-channel_name\"></a> `channel_name` | `string` | Resolved display name from the viewer's perspective. |\n| <a id=\"property-channel_type\"></a> `channel_type` | [`ChannelType`](ChannelType.md) | Channel type. |\n| <a id=\"property-participants\"></a> `participants` | [`ApiChannelParticipant`](ApiChannelParticipant.md)[] | Active participants. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ApiChannelParticipant.md -->\n# Type Alias: ApiChannelParticipant\n\n> **ApiChannelParticipant** = \\{ `channel_id`: `string`; `joined_at`: `string`; `role`: [`ApiParticipantRole`](ApiParticipantRole.md); `user_id`: `string`; \\}\n\nA channel participant.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-channel_id\"></a> `channel_id` | `string` | Channel id. |\n| <a id=\"property-joined_at\"></a> `joined_at` | `string` | When the user joined. |\n| <a id=\"property-role\"></a> `role` | [`ApiParticipantRole`](ApiParticipantRole.md) | Role in the channel. |\n| <a id=\"property-user_id\"></a> `user_id` | `string` | User id. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ApiParticipantRole.md -->\n# Type Alias: ApiParticipantRole\n\n> **ApiParticipantRole** = `\"owner\"` \\| `\"admin\"` \\| `\"member\"`\n\nParticipant role in a channel.\n\n\n<!-- generated/storage/types.gen/type-aliases/BotSenderProfile.md -->\n# Type Alias: BotSenderProfile\n\n> **BotSenderProfile** = \\{ `avatar_url?`: `string` \\| `null`; `name`: `string`; \\}\n\nPublic bot profile attached to bot-authored messages.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-avatar_url\"></a> `avatar_url?` | `string` \\| `null` | Bot avatar URL. |\n| <a id=\"property-name\"></a> `name` | `string` | Bot display name. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ChannelLabel.md -->\n# Type Alias: ChannelLabel\n\n> **ChannelLabel** = \\{ `channelCount`: `number`; `channelIds`: `string`[]; `createdAt`: `string`; `id`: `string`; `name`: `string`; `rule?`: `null` \\| [`ChannelLabelRule`](ChannelLabelRule.md); `sortOrder`: `number`; `teamId?`: `string` \\| `null`; `updatedAt`: `string`; \\}\n\nA shared or account-private label grouping chat channels in the sidebar.\n\n`channel_ids` is viewer-relative: it lists only the labelled channels the\nrequesting user participates in. `channel_count` counts every channel in\nthe label so clients can warn accurately before a delete.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-channelcount\"></a> `channelCount` | `number` | All assignments for a manual label; visible matches for a smart tag. |\n| <a id=\"property-channelids\"></a> `channelIds` | `string`[] | Channels in this label that the requesting user participates in. |\n| <a id=\"property-createdat\"></a> `createdAt` | `string` | When the label was created. |\n| <a id=\"property-id\"></a> `id` | `string` | Stable label id. |\n| <a id=\"property-name\"></a> `name` | `string` | Display name, unique within the scope (case-insensitive). |\n| <a id=\"property-rule\"></a> `rule?` | `null` \\| [`ChannelLabelRule`](ChannelLabelRule.md) | - |\n| <a id=\"property-sortorder\"></a> `sortOrder` | `number` | Manual ordering value within the scope; lower sorts first. |\n| <a id=\"property-teamid\"></a> `teamId?` | `string` \\| `null` | Owning team, or `None` for account-private labels. |\n| <a id=\"property-updatedat\"></a> `updatedAt` | `string` | When the label was last renamed or reordered. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ChannelLabelRule.md -->\n# Type Alias: ChannelLabelRule\n\n> **ChannelLabelRule** = \\{ `attribute`: `\"name\"`; `contains`: `string`; \\}\n\nCase-insensitive, literal substring matching on the channel name.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-attribute\"></a> `attribute` | `\"name\"` | - |\n| <a id=\"property-contains\"></a> `contains` | `string` | The substring to find anywhere in the name. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ChannelType.md -->\n# Type Alias: ChannelType\n\n> **ChannelType** = `\"public\"` \\| `\"private\"` \\| `\"direct_message\"` \\| `\"team\"`\n\nType of channel.\n\n\n<!-- generated/storage/types.gen/type-aliases/CountedReaction.md -->\n# Type Alias: CountedReaction\n\n> **CountedReaction** = \\{ `emoji`: `string`; `users`: `string`[]; \\}\n\nReaction emoji and the users who added it.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-emoji\"></a> `emoji` | `string` | Emoji being reacted with. |\n| <a id=\"property-users\"></a> `users` | `string`[] | User identifiers. |\n\n\n<!-- generated/storage/types.gen/type-aliases/DocumentId.md -->\n# Type Alias: DocumentId\n\n> **DocumentId** = `string`\n\nA validated document identifier. Historical document ids need not be UUIDs.\n\n\n<!-- generated/storage/types.gen/type-aliases/EntityPermission.md -->\n# Type Alias: EntityPermission\n\n> **EntityPermission** = \\{ `access_level`: [`AccessLevel`](AccessLevel.md); `type`: `\"access_level\"`; \\} \\| \\{ `type`: `\"channel_view_only\"`; \\} \\| \\{ `role`: [`ParticipantRole`](ParticipantRole.md); `type`: `\"channel_role\"`; \\} \\| \\{ `role`: [`TeamRole`](TeamRole.md); `type`: `\"team_role\"`; \\}\n\nA user's permission for an entity, discriminated by entity kind.\n\nItems (documents, chats, projects, threads) use access levels.\nChannels use view-only permission or participant roles.\n\n## Union Members\n\n### Type Literal\n\n\\{ `access_level`: [`AccessLevel`](AccessLevel.md); `type`: `\"access_level\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `access_level` | [`AccessLevel`](AccessLevel.md) | The access level the user has. |\n| `type` | `\"access_level\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"channel_view_only\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `role`: [`ParticipantRole`](ParticipantRole.md); `type`: `\"channel_role\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `role` | [`ParticipantRole`](ParticipantRole.md) | The role the user has in the channel. |\n| `type` | `\"channel_role\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `role`: [`TeamRole`](TeamRole.md); `type`: `\"team_role\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `role` | [`TeamRole`](TeamRole.md) | The role the user has in the team. |\n| `type` | `\"team_role\"` | - |\n\n\n<!-- generated/storage/types.gen/type-aliases/GetChannelAttachmentsResponses.md -->\n# Type Alias: GetChannelAttachmentsResponses\n\n> **GetChannelAttachmentsResponses** = \\{ `200`: [`ApiChannelAttachmentsPage`](ApiChannelAttachmentsPage.md); \\}\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-200\"></a> `200` | [`ApiChannelAttachmentsPage`](ApiChannelAttachmentsPage.md) |\n\n\n<!-- generated/storage/types.gen/type-aliases/GetChannelParticipantsResponses.md -->\n# Type Alias: GetChannelParticipantsResponses\n\n> **GetChannelParticipantsResponses** = \\{ `200`: [`ApiChannelParticipant`](ApiChannelParticipant.md)[]; \\}\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-200\"></a> `200` | [`ApiChannelParticipant`](ApiChannelParticipant.md)[] |\n\n\n<!-- generated/storage/types.gen/type-aliases/ImportedAuthor.md -->\n# Type Alias: ImportedAuthor\n\n> **ImportedAuthor** = \\{ `name`: `string`; \\}\n\nDisplay attribution for a comment imported from an external document.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-name\"></a> `name` | `string` | Original author text; never interpreted as an authenticated principal. |\n\n\n<!-- generated/storage/types.gen/type-aliases/Message.md -->\n# Type Alias: Message\n\n> **Message** = \\{ `attachments`: [`MessageAttachment`](MessageAttachment.md)[]; `bot_profile?`: `null` \\| [`BotSenderProfile`](BotSenderProfile.md); `content`: `string`; `created_at`: `string`; `deleted_at?`: `string` \\| `null`; `edited_at?`: `string` \\| `null`; `guest_name?`: `string` \\| `null`; `id`: `string`; `imported_author?`: `null` \\| [`ImportedAuthor`](ImportedAuthor.md); `mentions`: [`SimpleMention`](SimpleMention.md)[]; `parent`: [`MessageParent`](MessageParent.md); `reactions`: [`CountedReaction`](CountedReaction.md)[]; `sender_id`: `string`; `thread_id?`: `string` \\| `null`; `triggered_by?`: `string` \\| `null`; `updated_at`: `string`; \\}\n\nShared message representation for channel timelines and entity discussions.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-attachments\"></a> `attachments` | [`MessageAttachment`](MessageAttachment.md)[] | Attached entities. |\n| <a id=\"property-bot_profile\"></a> `bot_profile?` | `null` \\| [`BotSenderProfile`](BotSenderProfile.md) | - |\n| <a id=\"property-content\"></a> `content` | `string` | Macro Markdown body. |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | Creation time. |\n| <a id=\"property-deleted_at\"></a> `deleted_at?` | `string` \\| `null` | Message tombstone, independent of thread deletion. |\n| <a id=\"property-edited_at\"></a> `edited_at?` | `string` \\| `null` | Last content edit, if any. |\n| <a id=\"property-guest_name\"></a> `guest_name?` | `string` \\| `null` | Display name of a verified call guest, retained after the call ends. |\n| <a id=\"property-id\"></a> `id` | `string` | Message UUID. |\n| <a id=\"property-imported_author\"></a> `imported_author?` | `null` \\| [`ImportedAuthor`](ImportedAuthor.md) | - |\n| <a id=\"property-mentions\"></a> `mentions` | [`SimpleMention`](SimpleMention.md)[] | Tracked mentions, retained when a caller changes attachments only. |\n| <a id=\"property-parent\"></a> `parent` | [`MessageParent`](MessageParent.md) | Entity that owns this conversation. |\n| <a id=\"property-reactions\"></a> `reactions` | [`CountedReaction`](CountedReaction.md)[] | Aggregated reactions. |\n| <a id=\"property-sender_id\"></a> `sender_id` | `string` | Authenticated actor or owner of imported content. |\n| <a id=\"property-thread_id\"></a> `thread_id?` | `string` \\| `null` | Root message UUID for replies; absent on roots. |\n| <a id=\"property-triggered_by\"></a> `triggered_by?` | `string` \\| `null` | User who triggered a bot-authored message. |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` | Last persisted update. |\n\n\n<!-- generated/storage/types.gen/type-aliases/MessageAttachment.md -->\n# Type Alias: MessageAttachment\n\n> **MessageAttachment** = \\{ `created_at`: `string`; `entity_id`: `string`; `entity_type`: `string`; `height?`: `number` \\| `null`; `id`: `string`; `width?`: `number` \\| `null`; \\}\n\nAn entity attached to a message.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | When the attachment was added. |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | Attached entity identifier. |\n| <a id=\"property-entity_type\"></a> `entity_type` | `string` | Attached entity type. |\n| <a id=\"property-height\"></a> `height?` | `number` \\| `null` | Optional media height. |\n| <a id=\"property-id\"></a> `id` | `string` | Attachment UUID. |\n| <a id=\"property-width\"></a> `width?` | `number` \\| `null` | Optional media width. |\n\n\n<!-- generated/storage/types.gen/type-aliases/MessageCursor.md -->\n# Type Alias: MessageCursor\n\n> **MessageCursor** = \\{ `created_at`: `string`; `id`: `string`; \\}\n\nCursor for a chronological parent timeline.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | Last message creation time or activity occurrence time. |\n| <a id=\"property-id\"></a> `id` | `string` | Last entry UUID, used to break timestamp ties across both sources. |\n\n\n<!-- generated/storage/types.gen/type-aliases/MessageParent.md -->\n# Type Alias: MessageParent\n\n> **MessageParent** = \\{ `id`: `string`; `type`: `\"channel\"`; \\} \\| \\{ `id`: [`DocumentId`](DocumentId.md); `type`: `\"document\"`; \\} \\| \\{ `id`: `string`; `type`: `\"initiative\"`; \\} \\| \\{ `id`: `string`; `type`: `\"crm_company\"`; \\} \\| \\{ `id`: `string`; `type`: `\"crm_contact\"`; \\} \\| \\{ `id`: `string`; `type`: `\"call\"`; \\}\n\nThe entity whose permissions and lifecycle govern a message.\n\n## Union Members\n\n### Type Literal\n\n\\{ `id`: `string`; `type`: `\"channel\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | A channel, including direct messages. |\n| `type` | `\"channel\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: [`DocumentId`](DocumentId.md); `type`: `\"document\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | [`DocumentId`](DocumentId.md) | A document, including tasks and PDFs. |\n| `type` | `\"document\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: `string`; `type`: `\"initiative\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | An initiative, presented as a project in the application. |\n| `type` | `\"initiative\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: `string`; `type`: `\"crm_company\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | A CRM company. |\n| `type` | `\"crm_company\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: `string`; `type`: `\"crm_contact\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | A CRM contact. |\n| `type` | `\"crm_contact\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: `string`; `type`: `\"call\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | A video call and its persistent chat thread. |\n| `type` | `\"call\"` | - |\n\n\n<!-- generated/storage/types.gen/type-aliases/ParticipantRole.md -->\n# Type Alias: ParticipantRole\n\n> **ParticipantRole** = `\"owner\"` \\| `\"admin\"` \\| `\"member\"`\n\nThe role a user has within a channel.\n\n\n<!-- generated/storage/types.gen/type-aliases/SimpleMention.md -->\n# Type Alias: SimpleMention\n\n> **SimpleMention** = \\{ `entity_id`: `string`; `entity_type`: `string`; \\}\n\nA mention tracked in a message body.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | Mentioned entity identifier. |\n| <a id=\"property-entity_type\"></a> `entity_type` | `string` | Mentioned entity type. |\n\n\n<!-- generated/storage/types.gen/type-aliases/SmartTagChannelMatch.md -->\n# Type Alias: SmartTagChannelMatch\n\n> **SmartTagChannelMatch** = \\{ `id`: `string`; `name`: `string`; \\}\n\nA channel visible to the caller that matches a smart tag rule.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-id\"></a> `id` | `string` | Channel id. |\n| <a id=\"property-name\"></a> `name` | `string` | Channel display name. |\n\n\n<!-- generated/storage/types.gen/type-aliases/SmartTagPreview.md -->\n# Type Alias: SmartTagPreview\n\n> **SmartTagPreview** = \\{ `channels`: [`SmartTagChannelMatch`](SmartTagChannelMatch.md)[]; `totalCount`: `number`; \\}\n\nA bounded preview and the total number of visible channels matching a rule.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-channels\"></a> `channels` | [`SmartTagChannelMatch`](SmartTagChannelMatch.md)[] | First matches, in alphabetical order. |\n| <a id=\"property-totalcount\"></a> `totalCount` | `number` | Number of matching channels the caller participates in, including overflow. |\n\n\n<!-- generated/storage/types.gen/type-aliases/TeamRole.md -->\n# Type Alias: TeamRole\n\n> **TeamRole** = `\"member\"` \\| `\"admin\"` \\| `\"owner\"`\n\nThe role a user has within a team.\n\nOrdered least to most privileged so comparisons reflect access strength.\n\n\n<!-- src/entities/channels/activity/classes/ChannelActivity.md -->\n# Class: ChannelActivity\n\nA user's channel activity marker.\n\n## Constructors\n\n### Constructor\n\n> **new ChannelActivity**(`client`, `channel`, `record`): `ChannelActivity`\n\n#### Parameters\n\n| Parameter | Type | Description |\n| ------ | ------ | ------ |\n| `client` | `MacroClient` | - |\n| `channel` | [`Channel`](../../channel/classes/Channel.md) | Related channel. |\n| `record` | [`ApiActivity`](../../../../../generated/storage/types.gen/type-aliases/ApiActivity.md) | - |\n\n#### Returns\n\n`ChannelActivity`\n\n## Properties\n\n| Property | Modifier | Type | Description |\n| ------ | ------ | ------ | ------ |\n| <a id=\"property-channel\"></a> `channel` | `readonly` | [`Channel`](../../channel/classes/Channel.md) | Related channel. |\n\n## Accessors\n\n### id\n\n#### Get Signature\n\n> **get** **id**(): `string`\n\nActivity identity.\n\n##### Returns\n\n`string`\n\n## Methods\n\n### createdAt()\n\n> **createdAt**(): `string`\n\nCreation time.\n\n#### Returns\n\n`string`\n\n***\n\n### recordInteraction()\n\n> **recordInteraction**(`type`): `Promise`\\<`ChannelActivity`\\>\n\nRecord a view or interaction in this channel.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `type` | [`ActivityType`](../../../../../generated/storage/types.gen/type-aliases/ActivityType.md) |\n\n#### Returns\n\n`Promise`\\<`ChannelActivity`\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): [`ApiActivity`](../../../../../generated/storage/types.gen/type-aliases/ApiActivity.md)\n\nSerialize activity without credentials.\n\n#### Returns\n\n[`ApiActivity`](../../../../../generated/storage/types.gen/type-aliases/ApiActivity.md)\n\n***\n\n### user()\n\n> **user**(): [`User`](../../../users/user/classes/User.md)\n\nUser who interacted.\n\n#### Returns\n\n[`User`](../../../users/user/classes/User.md)\n\n\n<!-- src/entities/channels/channel/classes/Channel.md -->\n# Class: Channel\n\nA channel.\n\n## Extends\n\n- [`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md)\\<`ChannelDetail`\\>\n\n## Properties\n\n| Property | Modifier | Type | Default value | Description | Overrides | Inherited from |\n| ------ | ------ | ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-entitytype\"></a> `entityType` | `readonly` | `\"channel\"` | `'channel'` | Favorites identify channels as `channel`. | [`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`entityType`](../../../entity/classes/PropertiedEntity.md#property-entitytype) | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | `undefined` | - | - | [`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`id`](../../../entity/classes/PropertiedEntity.md#property-id) |\n| <a id=\"property-name\"></a> `name` | `readonly` | () => `Promise`\\<`string`\\> | `...` | The channel's display name, resolved from the viewer's perspective. | - | - |\n| <a id=\"property-type\"></a> `type` | `readonly` | () => `Promise`\\<[`ChannelType`](../../../../../generated/storage/types.gen/type-aliases/ChannelType.md)\\> | `...` | The channel's type (e.g. `public`, `dm`, `private`). | - | - |\n| <a id=\"property-search\"></a> `search` | `static` | (`client`, `query`, `searchOpts?`) => `AsyncGenerator`\\<`Channel`\\> | `...` | Search channels by content, most relevant first, auto-paginated. | - | - |\n\n## Methods\n\n### addParticipants()\n\n> **addParticipants**(`users`): `Promise`\\<`void`\\>\n\nAdd users to the channel.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `users` | [`User`](../../../users/user/classes/User.md)[] |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### agentConversations()\n\n> **agentConversations**(): `Promise`\\<[`AgentConversation`](../../../agent-sessions/conversation/classes/AgentConversation.md)[]\\>\n\nConversations maintained by agents in this channel.\n\n#### Returns\n\n`Promise`\\<[`AgentConversation`](../../../agent-sessions/conversation/classes/AgentConversation.md)[]\\>\n\n***\n\n### attachments()\n\n> **attachments**(`opts?`): `AsyncGenerator`\\<[`ApiChannelAttachment`](../../../../../generated/storage/types.gen/type-aliases/ApiChannelAttachment.md)\\>\n\nThe attachments posted in this channel, auto-paginated.\n\n#### Parameters\n\n| Parameter | Type | Description |\n| ------ | ------ | ------ |\n| `opts?` | \\{ `pageSize?`: `number`; `type?`: `string`; \\} | - |\n| `opts.pageSize?` | `number` | - |\n| `opts.type?` | `string` | Filter by type: `static` for images/videos, `dss` for documents. |\n\n#### Returns\n\n`AsyncGenerator`\\<[`ApiChannelAttachment`](../../../../../generated/storage/types.gen/type-aliases/ApiChannelAttachment.md)\\>\n\n***\n\n### delete()\n\n> **delete**(): `Promise`\\<`void`\\>\n\nDelete the channel. This is not reversible.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### deleteProperty()\n\n> **deleteProperty**(`assignment`): `Promise`\\<`void`\\>\n\nRemove a property from this entity, given its [properties](#properties) entry.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `assignment` | [`EntityPropertyWithDefinition`](../../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`deleteProperty`](../../../entity/classes/PropertiedEntity.md#deleteproperty)\n\n***\n\n### favorite()\n\n> **favorite**(): `Promise`\\<`Channel`\\>\n\nAdd this entity to the user's favorites. Returns this handle for chaining.\nPlain unwrap: favoriting alters the user's favorites collection, not this\nentity's own detail, so there's nothing cached to invalidate.\n\n#### Returns\n\n`Promise`\\<`Channel`\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`favorite`](../../../entity/classes/PropertiedEntity.md#favorite)\n\n***\n\n### join()\n\n> **join**(): `Promise`\\<`void`\\>\n\nJoin the channel as the current user.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### joinCode()\n\n> **joinCode**(): `Promise`\\<`string`\\>\n\nA reusable code that lets a user join this channel.\n\n#### Returns\n\n`Promise`\\<`string`\\>\n\n***\n\n### leave()\n\n> **leave**(): `Promise`\\<`void`\\>\n\nLeave the channel as the current user.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### message()\n\n> **message**(`id`): [`Message`](../../message/classes/Message.md)\n\nA handle to a message in this channel by id.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`Message`](../../message/classes/Message.md)\n\n***\n\n### messages()\n\n> **messages**(`opts?`): `AsyncGenerator`\\<[`Message`](../../message/classes/Message.md)\\>\n\nRoot messages in this channel, most recent first, auto-paginated.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts?` | \\{ `pageSize?`: `number`; \\} |\n| `opts.pageSize?` | `number` |\n\n#### Returns\n\n`AsyncGenerator`\\<[`Message`](../../message/classes/Message.md)\\>\n\n***\n\n### messagesAfter()\n\n> **messagesAfter**(`after`, `opts?`): `AsyncGenerator`\\<[`Message`](../../message/classes/Message.md)\\>\n\nRoot messages created or replied to at or after `after`, most recent\nfirst, auto-paginated. Use it to catch up after a disconnect.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `after` | `string` \\| `Date` |\n| `opts?` | \\{ `pageSize?`: `number`; \\} |\n| `opts.pageSize?` | `number` |\n\n#### Returns\n\n`AsyncGenerator`\\<[`Message`](../../message/classes/Message.md)\\>\n\n***\n\n### messageThreadById()\n\n> **messageThreadById**(`id`): [`MessageThread`](../../../messages/thread/classes/MessageThread.md)\n\nA shared message thread scoped to this resource.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`MessageThread`](../../../messages/thread/classes/MessageThread.md)\n\n***\n\n### participants()\n\n> **participants**(): `Promise`\\<[`ApiChannelParticipant`](../../../../../generated/storage/types.gen/type-aliases/ApiChannelParticipant.md)[]\\>\n\nThe channel's members, with their roles and join times.\n\n#### Returns\n\n`Promise`\\<[`ApiChannelParticipant`](../../../../../generated/storage/types.gen/type-aliases/ApiChannelParticipant.md)[]\\>\n\n***\n\n### permission()\n\n> **permission**(): `Promise`\\<\\{ `permission`: [`EntityPermission`](../../../../../generated/storage/types.gen/type-aliases/EntityPermission.md); `status`: `\"access\"`; \\} \\| \\{ `status`: `\"no_access\"`; \\}\\>\n\nRead the caller's effective permission on this entity.\n\n#### Returns\n\n`Promise`\\<\\{ `permission`: [`EntityPermission`](../../../../../generated/storage/types.gen/type-aliases/EntityPermission.md); `status`: `\"access\"`; \\} \\| \\{ `status`: `\"no_access\"`; \\}\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`permission`](../../../entity/classes/PropertiedEntity.md#permission)\n\n***\n\n### properties()\n\n> **properties**(`opts?`): `Promise`\\<[`EntityPropertyWithDefinition`](../../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md)[]\\>\n\nThe properties set on this entity, each with its definition, value, and options.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts?` | \\{ `includeMetadata?`: `boolean`; \\} |\n| `opts.includeMetadata?` | `boolean` |\n\n#### Returns\n\n`Promise`\\<[`EntityPropertyWithDefinition`](../../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md)[]\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`properties`](../../../entity/classes/PropertiedEntity.md#properties)\n\n***\n\n### propertyReference()\n\n> **propertyReference**(): [`PropertyTargetReference`](../../../../../generated/properties/types.gen/type-aliases/PropertyTargetReference.md)\n\nThis entity's reference for bulk property operations.\n\n#### Returns\n\n[`PropertyTargetReference`](../../../../../generated/properties/types.gen/type-aliases/PropertyTargetReference.md)\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`propertyReference`](../../../entity/classes/PropertiedEntity.md#propertyreference)\n\n***\n\n### recordActivity()\n\n> **recordActivity**(`type`): `Promise`\\<[`ChannelActivity`](../../activity/classes/ChannelActivity.md)\\>\n\nRecord a view or interaction in this channel.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `type` | [`ActivityType`](../../../../../generated/storage/types.gen/type-aliases/ActivityType.md) |\n\n#### Returns\n\n`Promise`\\<[`ChannelActivity`](../../activity/classes/ChannelActivity.md)\\>\n\n***\n\n### removeParticipants()\n\n> **removeParticipants**(`users`): `Promise`\\<`void`\\>\n\nRemove users from the channel.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `users` | [`User`](../../../users/user/classes/User.md)[] |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### rename()\n\n> **rename**(`name`): `Promise`\\<`void`\\>\n\nRename the channel.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `name` | `string` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### send()\n\n> **send**(`body`, `opts?`): `Promise`\\<[`Message`](../../message/classes/Message.md)\\>\n\nPost a message. Plain text, or a rich body composed with `msg`.\n\nWorks with a channel webhook token as well as a normal one — see\n[postToChannel](../../post/functions/postToChannel.md) for which endpoint that picks and what it costs.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `body` | `string` \\| [`RichMessage`](../../../../mentions/interfaces/RichMessage.md) |\n| `opts?` | \\{ `thread?`: [`Thread`](../../thread/classes/Thread.md); \\} |\n| `opts.thread?` | [`Thread`](../../thread/classes/Thread.md) |\n\n#### Returns\n\n`Promise`\\<[`Message`](../../message/classes/Message.md)\\>\n\n***\n\n### setPicture()\n\n> **setPicture**(`picture?`): `Promise`\\<`void`\\>\n\nSet an uploaded profile picture, or clear it.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `picture?` | [`ChannelPicture`](../../picture/classes/ChannelPicture.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### setProperty()\n\n> **setProperty**(`property`, `value?`): `Promise`\\<`void`\\>\n\nSet a property value on this entity, or attach the property without a\nvalue when `value` is omitted.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `property` | [`PropertyDefinition`](../../../properties/property-definition/classes/PropertyDefinition.md) |\n| `value?` | [`SetPropertyValue`](../../../../../generated/properties/types.gen/type-aliases/SetPropertyValue.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`setProperty`](../../../entity/classes/PropertiedEntity.md#setproperty)\n\n***\n\n### timelinePage()\n\n> **timelinePage**(`selection?`): `Promise`\\<\\{ `entries`: (\\{ `activity`: \\{ `action`: `string`; `actor`: [`User`](../../../users/user/classes/User.md); `actor_id`: `string`; `id`: `string`; `occurred_at`: `string`; `payload?`: `unknown`; \\}; `message?`: `undefined`; `type`: `\"activity\"`; \\} \\| \\{ `activity?`: `undefined`; `message`: [`Message`](../../message/classes/Message.md); `type`: `\"message\"`; \\})[]; `nextCursor`: [`MessageCursor`](../../../../../generated/storage/types.gen/type-aliases/MessageCursor.md) \\| `undefined`; `previousCursor`: [`MessageCursor`](../../../../../generated/storage/types.gen/type-aliases/MessageCursor.md) \\| `undefined`; \\}\\>\n\nA mixed message and activity timeline page.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `selection?` | [`TimelineOptions`](../../../messages/thread/interfaces/TimelineOptions.md)\\<[`Message`](../../message/classes/Message.md)\\> |\n\n#### Returns\n\n`Promise`\\<\\{ `entries`: (\\{ `activity`: \\{ `action`: `string`; `actor`: [`User`](../../../users/user/classes/User.md); `actor_id`: `string`; `id`: `string`; `occurred_at`: `string`; `payload?`: `unknown`; \\}; `message?`: `undefined`; `type`: `\"activity\"`; \\} \\| \\{ `activity?`: `undefined`; `message`: [`Message`](../../message/classes/Message.md); `type`: `\"message\"`; \\})[]; `nextCursor`: [`MessageCursor`](../../../../../generated/storage/types.gen/type-aliases/MessageCursor.md) \\| `undefined`; `previousCursor`: [`MessageCursor`](../../../../../generated/storage/types.gen/type-aliases/MessageCursor.md) \\| `undefined`; \\}\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`ApiChannelDetail`](../../../../../generated/storage/types.gen/type-aliases/ApiChannelDetail.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`ApiChannelDetail`](../../../../../generated/storage/types.gen/type-aliases/ApiChannelDetail.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`ApiChannelDetail`](../../../../../generated/storage/types.gen/type-aliases/ApiChannelDetail.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`toJSON`](../../../entity/classes/PropertiedEntity.md#tojson)\n\n***\n\n### typing()\n\n> **typing**(`action`, `opts?`): `Promise`\\<`void`\\>\n\nBroadcast a typing indicator, optionally scoped to a thread.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `action` | `\"stop\"` \\| `\"start\"` |\n| `opts?` | \\{ `thread?`: [`Thread`](../../thread/classes/Thread.md); \\} |\n| `opts.thread?` | [`Thread`](../../thread/classes/Thread.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### unfavorite()\n\n> **unfavorite**(): `Promise`\\<`Channel`\\>\n\nRemove this entity from the user's favorites. Returns this handle for chaining.\n\n#### Returns\n\n`Promise`\\<`Channel`\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`unfavorite`](../../../entity/classes/PropertiedEntity.md#unfavorite)\n\n***\n\n### updatePropertyOptions()\n\n> **updatePropertyOptions**(`changes`): `Promise`\\<[`BulkUpdateEntityPropertyOptionsResponse`](../../../../../generated/properties/types.gen/type-aliases/BulkUpdateEntityPropertyOptionsResponse.md)\\>\n\nApply multi-select option deltas atomically across this entity's properties.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `changes` | [`PropertyOptionDelta`](../../../entity/interfaces/PropertyOptionDelta.md)[] |\n\n#### Returns\n\n`Promise`\\<[`BulkUpdateEntityPropertyOptionsResponse`](../../../../../generated/properties/types.gen/type-aliases/BulkUpdateEntityPropertyOptionsResponse.md)\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`updatePropertyOptions`](../../../entity/classes/PropertiedEntity.md#updatepropertyoptions)\n\n***\n\n### webUrl()\n\n> **webUrl**(): `string`\n\nThe channel's URL in the Macro web app.\n\n#### Returns\n\n`string`\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `id`): `Channel`\n\nA handle to a channel by id. Details load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `id` | `string` |\n\n#### Returns\n\n`Channel`\n\n***\n\n### create()\n\n> `static` **create**(`client`, `opts`): `Promise`\\<`Channel`\\>\n\nCreate a channel. The caller becomes the owner.\n\n#### Parameters\n\n| Parameter | Type | Description |\n| ------ | ------ | ------ |\n| `client` | `MacroClient` | - |\n| `opts` | \\{ `name?`: `string`; `participants?`: [`User`](../../../users/user/classes/User.md)[]; `team?`: [`Team`](../../../teams/team/classes/Team.md); `type`: [`ChannelType`](../../../../../generated/storage/types.gen/type-aliases/ChannelType.md); \\} | - |\n| `opts.name?` | `string` | - |\n| `opts.participants?` | [`User`](../../../users/user/classes/User.md)[] | Participants to add, excluding the owner. |\n| `opts.team?` | [`Team`](../../../teams/team/classes/Team.md) | Team, for team channels. |\n| `opts.type` | [`ChannelType`](../../../../../generated/storage/types.gen/type-aliases/ChannelType.md) | - |\n\n#### Returns\n\n`Promise`\\<`Channel`\\>\n\n***\n\n### dm()\n\n> `static` **dm**(`client`, `recipient`): `Promise`\\<`Channel`\\>\n\nOpen (creating if needed) the DM channel with a user.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `recipient` | [`User`](../../../users/user/classes/User.md) |\n\n#### Returns\n\n`Promise`\\<`Channel`\\>\n\n***\n\n### private()\n\n> `static` **private**(`client`, `recipients`): `Promise`\\<`Channel`\\>\n\nOpen (creating if needed) the private group channel with a set of users.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `recipients` | [`User`](../../../users/user/classes/User.md)[] |\n\n#### Returns\n\n`Promise`\\<`Channel`\\>\n\n\n<!-- src/entities/channels/channel/type-aliases/ChannelAttachment.md -->\n# Type Alias: ChannelAttachment\n\n> **ChannelAttachment** = [`GetChannelAttachmentsResponses`](../../../../../generated/storage/types.gen/type-aliases/GetChannelAttachmentsResponses.md)\\[`200`\\]\\[`\"items\"`\\]\\[`number`\\]\n\nA file or entity attached to a message in a channel.\n\n\n<!-- src/entities/channels/channel/type-aliases/ChannelParticipant.md -->\n# Type Alias: ChannelParticipant\n\n> **ChannelParticipant** = [`GetChannelParticipantsResponses`](../../../../../generated/storage/types.gen/type-aliases/GetChannelParticipantsResponses.md)\\[`200`\\]\\[`number`\\]\n\nA member of a channel, with their role and join time.\n\n\n<!-- src/entities/channels/labels/classes/ChannelLabelsNamespace.md -->\n# Class: ChannelLabelsNamespace\n\nShared or private channel labels: named groups of channels shown in the Chat\nsidebar. Every member of the team sees the same labels in the same order,\nand any member may create, rename, delete, or move channels between them;\neach change applies to the whole team. Users without a team have private\nlabels belonging to their account.\n\nA label's `channelIds` lists only the channels the authenticated user is a\nmember of. Manual labels count all assignments; smart tags count visible\nmatches. A channel can be in one manual label and any number of matching\nsmart tags per team or account. Direct messages cannot be grouped.\n\n## Constructors\n\n### Constructor\n\n> **new ChannelLabelsNamespace**(`client`): `ChannelLabelsNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`ChannelLabelsNamespace`\n\n## Methods\n\n### create()\n\n> **create**(`name`, `channels?`): `Promise`\\<[`ChannelLabel`](../../../../../generated/storage/types.gen/type-aliases/ChannelLabel.md)\\>\n\nCreate a label and atomically move `channels` into it. Names are unique\nwithin the team or account, case-insensitively.\n\n#### Parameters\n\n| Parameter | Type | Default value |\n| ------ | ------ | ------ |\n| `name` | `string` | `undefined` |\n| `channels?` | [`Channel`](../../channel/classes/Channel.md)[] | `[]` |\n\n#### Returns\n\n`Promise`\\<[`ChannelLabel`](../../../../../generated/storage/types.gen/type-aliases/ChannelLabel.md)\\>\n\n***\n\n### createSmartTag()\n\n> **createSmartTag**(`name`, `rule`): `Promise`\\<[`ChannelLabel`](../../../../../generated/storage/types.gen/type-aliases/ChannelLabel.md)\\>\n\nCreate a smart tag whose membership follows an attribute rule automatically.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `name` | `string` |\n| `rule` | [`ChannelLabelRule`](../../../../../generated/storage/types.gen/type-aliases/ChannelLabelRule.md) |\n\n#### Returns\n\n`Promise`\\<[`ChannelLabel`](../../../../../generated/storage/types.gen/type-aliases/ChannelLabel.md)\\>\n\n***\n\n### delete()\n\n> **delete**(`label`): `Promise`\\<`void`\\>\n\nDelete a label for the whole team; its channels return to the plain list.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `label` | [`ChannelLabel`](../../../../../generated/storage/types.gen/type-aliases/ChannelLabel.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### list()\n\n> **list**(): `Promise`\\<[`ChannelLabel`](../../../../../generated/storage/types.gen/type-aliases/ChannelLabel.md)[]\\>\n\nEvery label in the authenticated user's shared or private scope.\n\n#### Returns\n\n`Promise`\\<[`ChannelLabel`](../../../../../generated/storage/types.gen/type-aliases/ChannelLabel.md)[]\\>\n\n***\n\n### previewSmartTag()\n\n> **previewSmartTag**(`rule`): `Promise`\\<[`SmartTagPreview`](../../../../../generated/storage/types.gen/type-aliases/SmartTagPreview.md)\\>\n\nPreview the first matches and total visible count without creating a tag.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `rule` | [`ChannelLabelRule`](../../../../../generated/storage/types.gen/type-aliases/ChannelLabelRule.md) |\n\n#### Returns\n\n`Promise`\\<[`SmartTagPreview`](../../../../../generated/storage/types.gen/type-aliases/SmartTagPreview.md)\\>\n\n***\n\n### rename()\n\n> **rename**(`label`, `name`): `Promise`\\<[`ChannelLabel`](../../../../../generated/storage/types.gen/type-aliases/ChannelLabel.md)\\>\n\nRename a label for the whole team.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `label` | [`ChannelLabel`](../../../../../generated/storage/types.gen/type-aliases/ChannelLabel.md) |\n| `name` | `string` |\n\n#### Returns\n\n`Promise`\\<[`ChannelLabel`](../../../../../generated/storage/types.gen/type-aliases/ChannelLabel.md)\\>\n\n***\n\n### setLabel()\n\n> **setLabel**(`channel`, `label`): `Promise`\\<`void`\\>\n\nMove a channel into `label`, or out of any label when `label` is `undefined`.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `channel` | [`Channel`](../../channel/classes/Channel.md) |\n| `label` | [`ChannelLabel`](../../../../../generated/storage/types.gen/type-aliases/ChannelLabel.md) \\| `undefined` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### updateSmartTag()\n\n> **updateSmartTag**(`label`, `name`, `rule`): `Promise`\\<[`ChannelLabel`](../../../../../generated/storage/types.gen/type-aliases/ChannelLabel.md)\\>\n\nUpdate the name and matching rule of an existing smart tag.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `label` | [`ChannelLabel`](../../../../../generated/storage/types.gen/type-aliases/ChannelLabel.md) |\n| `name` | `string` |\n| `rule` | [`ChannelLabelRule`](../../../../../generated/storage/types.gen/type-aliases/ChannelLabelRule.md) |\n\n#### Returns\n\n`Promise`\\<[`ChannelLabel`](../../../../../generated/storage/types.gen/type-aliases/ChannelLabel.md)\\>\n\n\n<!-- src/entities/channels/message/classes/Message.md -->\n# Class: Message\n\nA message in a channel. A thin handle: `id` and `channelId` are known up\nfront, and record-backed fields (`content`, `author`) load lazily on first\naccess and cache. Actions carry the ids for you.\n\n## Extends\n\n- [`FavoritableEntity`](../../../entity/classes/FavoritableEntity.md)\\<[`Message`](../../../../../generated/storage/types.gen/type-aliases/Message.md)\\>\n\n## Properties\n\n| Property | Modifier | Type | Default value | Description | Overrides | Inherited from |\n| ------ | ------ | ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-channelid\"></a> `channelId` | `readonly` | `string` | `undefined` | - | - | - |\n| <a id=\"property-content\"></a> `content` | `readonly` | () => `Promise`\\<`string`\\> | `...` | The message body. | - | - |\n| <a id=\"property-createdat\"></a> `createdAt` | `readonly` | () => `Promise`\\<`string`\\> | `...` | When the message was created. | - | - |\n| <a id=\"property-editedat\"></a> `editedAt` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | `...` | When the message was last edited, if it has been. | - | - |\n| <a id=\"property-entitytype\"></a> `entityType` | `readonly` | `\"channel_message\"` | `'channel_message'` | Favorites identify channel messages as `channel_message`. | [`FavoritableEntity`](../../../entity/classes/FavoritableEntity.md).[`entityType`](../../../entity/classes/FavoritableEntity.md#property-entitytype) | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | `undefined` | - | - | [`FavoritableEntity`](../../../entity/classes/FavoritableEntity.md).[`id`](../../../entity/classes/FavoritableEntity.md#property-id) |\n| <a id=\"property-mentions\"></a> `mentions` | `readonly` | [`SimpleMention`](../../../../../generated/storage/types.gen/type-aliases/SimpleMention.md)[] | `[]` | Entities mentioned in this message, when a list, thread, or event supplied them. | - | - |\n| <a id=\"property-updatedat\"></a> `updatedAt` | `readonly` | () => `Promise`\\<`string`\\> | `...` | When the message was last updated. | - | - |\n\n## Methods\n\n### author()\n\n> **author**(): `Promise`\\<[`User`](../../../users/user/classes/User.md)\\>\n\nThe user who sent this message.\n\n#### Returns\n\n`Promise`\\<[`User`](../../../users/user/classes/User.md)\\>\n\n***\n\n### channel()\n\n> **channel**(): [`Channel`](../../channel/classes/Channel.md)\n\nThe channel this message is in.\n\n#### Returns\n\n[`Channel`](../../channel/classes/Channel.md)\n\n***\n\n### delete()\n\n> **delete**(): `Promise`\\<`void`\\>\n\nDelete this message.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### edit()\n\n> **edit**(`body`): `Promise`\\<`Message`\\>\n\nReplace this message's body.\n\n#### Parameters\n\n| Parameter | Type | Description |\n| ------ | ------ | ------ |\n| `body` | `string` \\| [`RichMessage`](../../../../mentions/interfaces/RichMessage.md) | Plain text, or a rich body composed with msg. |\n\n#### Returns\n\n`Promise`\\<`Message`\\>\n\n***\n\n### favorite()\n\n> **favorite**(): `Promise`\\<`Message`\\>\n\nAdd this entity to the user's favorites. Returns this handle for chaining.\nPlain unwrap: favoriting alters the user's favorites collection, not this\nentity's own detail, so there's nothing cached to invalidate.\n\n#### Returns\n\n`Promise`\\<`Message`\\>\n\n#### Inherited from\n\n[`FavoritableEntity`](../../../entity/classes/FavoritableEntity.md).[`favorite`](../../../entity/classes/FavoritableEntity.md#favorite)\n\n***\n\n### permission()\n\n> **permission**(): `Promise`\\<\\{ `permission`: [`EntityPermission`](../../../../../generated/storage/types.gen/type-aliases/EntityPermission.md); `status`: `\"access\"`; \\} \\| \\{ `status`: `\"no_access\"`; \\}\\>\n\nRead the caller's effective permission on this entity.\n\n#### Returns\n\n`Promise`\\<\\{ `permission`: [`EntityPermission`](../../../../../generated/storage/types.gen/type-aliases/EntityPermission.md); `status`: `\"access\"`; \\} \\| \\{ `status`: `\"no_access\"`; \\}\\>\n\n#### Inherited from\n\n[`FavoritableEntity`](../../../entity/classes/FavoritableEntity.md).[`permission`](../../../entity/classes/FavoritableEntity.md#permission)\n\n***\n\n### react()\n\n> **react**(`emoji`): `Promise`\\<`Message`\\>\n\nAdd an emoji reaction to this message.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `emoji` | `string` |\n\n#### Returns\n\n`Promise`\\<`Message`\\>\n\n***\n\n### reply()\n\n> **reply**(`body`): `Promise`\\<`Message`\\>\n\nPost a reply in this message's thread.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `body` | `string` \\| [`RichMessage`](../../../../mentions/interfaces/RichMessage.md) |\n\n#### Returns\n\n`Promise`\\<`Message`\\>\n\n***\n\n### thread()\n\n> **thread**(): [`Thread`](../../thread/classes/Thread.md)\n\nThe thread rooted at this message.\n\n#### Returns\n\n[`Thread`](../../thread/classes/Thread.md)\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`Message`](../../../../../generated/storage/types.gen/type-aliases/Message.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`Message`](../../../../../generated/storage/types.gen/type-aliases/Message.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`Message`](../../../../../generated/storage/types.gen/type-aliases/Message.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`FavoritableEntity`](../../../entity/classes/FavoritableEntity.md).[`toJSON`](../../../entity/classes/FavoritableEntity.md#tojson)\n\n***\n\n### unfavorite()\n\n> **unfavorite**(): `Promise`\\<`Message`\\>\n\nRemove this entity from the user's favorites. Returns this handle for chaining.\n\n#### Returns\n\n`Promise`\\<`Message`\\>\n\n#### Inherited from\n\n[`FavoritableEntity`](../../../entity/classes/FavoritableEntity.md).[`unfavorite`](../../../entity/classes/FavoritableEntity.md#unfavorite)\n\n***\n\n### unreact()\n\n> **unreact**(`emoji`): `Promise`\\<`Message`\\>\n\nRemove one of your emoji reactions from this message.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `emoji` | `string` |\n\n#### Returns\n\n`Promise`\\<`Message`\\>\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `channelId`, `id`, `mentions?`): `Message`\n\nA handle to a message by id. Fields load on first access.\n\n#### Parameters\n\n| Parameter | Type | Default value |\n| ------ | ------ | ------ |\n| `client` | `MacroClient` | `undefined` |\n| `channelId` | `string` | `undefined` |\n| `id` | `string` | `undefined` |\n| `mentions?` | [`SimpleMention`](../../../../../generated/storage/types.gen/type-aliases/SimpleMention.md)[] | `[]` |\n\n#### Returns\n\n`Message`\n\n***\n\n### from()\n\n> `static` **from**(`client`, `channelId`, `data`): `Message`\n\nBuild a root or reply from a message record (pre-seeded, no fetch).\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `channelId` | `string` |\n| `data` | [`Message`](../../../../../generated/storage/types.gen/type-aliases/Message.md) |\n\n#### Returns\n\n`Message`\n\n\n<!-- src/entities/channels/message/type-aliases/MessageData.md -->\n# Type Alias: MessageData\n\n> **MessageData** = [`Message`](../../../../../generated/storage/types.gen/type-aliases/Message.md)\n\nThe API's representation of a message; the same record the document comment API returns.\n\n\n<!-- src/entities/channels/namespace/classes/ChannelNamespace.md -->\n# Class: ChannelNamespace\n\n## Constructors\n\n### Constructor\n\n> **new ChannelNamespace**(`client`): `ChannelNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`ChannelNamespace`\n\n## Properties\n\n| Property | Modifier | Type | Description |\n| ------ | ------ | ------ | ------ |\n| <a id=\"property-labels\"></a> `labels` | `readonly` | [`ChannelLabelsNamespace`](../../labels/classes/ChannelLabelsNamespace.md) | Team-shared labels that group channels in the Chat sidebar. |\n\n## Methods\n\n### activity()\n\n> **activity**(): `Promise`\\<[`ChannelActivity`](../../activity/classes/ChannelActivity.md)[]\\>\n\nRecent channel activity, with channel and user handles.\n\n#### Returns\n\n`Promise`\\<[`ChannelActivity`](../../activity/classes/ChannelActivity.md)[]\\>\n\n***\n\n### byId()\n\n> **byId**(`id`): [`Channel`](../../channel/classes/Channel.md)\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`Channel`](../../channel/classes/Channel.md)\n\n***\n\n### create()\n\n> **create**(`opts`): `Promise`\\<[`Channel`](../../channel/classes/Channel.md)\\>\n\nCreate a channel. The caller becomes the owner.\n\n#### Parameters\n\n| Parameter | Type | Description |\n| ------ | ------ | ------ |\n| `opts` | \\{ `name?`: `string`; `participants?`: [`User`](../../../users/user/classes/User.md)[]; `team?`: [`Team`](../../../teams/team/classes/Team.md); `type`: [`ChannelType`](../../../../../generated/storage/types.gen/type-aliases/ChannelType.md); \\} | - |\n| `opts.name?` | `string` | - |\n| `opts.participants?` | [`User`](../../../users/user/classes/User.md)[] | Participants to add, excluding the owner. |\n| `opts.team?` | [`Team`](../../../teams/team/classes/Team.md) | Team, for team channels. |\n| `opts.type` | [`ChannelType`](../../../../../generated/storage/types.gen/type-aliases/ChannelType.md) | - |\n\n#### Returns\n\n`Promise`\\<[`Channel`](../../channel/classes/Channel.md)\\>\n\n***\n\n### dm()\n\n> **dm**(`recipient`): `Promise`\\<[`Channel`](../../channel/classes/Channel.md)\\>\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `recipient` | [`User`](../../../users/user/classes/User.md) |\n\n#### Returns\n\n`Promise`\\<[`Channel`](../../channel/classes/Channel.md)\\>\n\n***\n\n### list()\n\n> **list**(): `Promise`\\<[`Channel`](../../channel/classes/Channel.md)[]\\>\n\nAll channels the authenticated user is a member of.\n\n#### Returns\n\n`Promise`\\<[`Channel`](../../channel/classes/Channel.md)[]\\>\n\n***\n\n### private()\n\n> **private**(`recipients`): `Promise`\\<[`Channel`](../../channel/classes/Channel.md)\\>\n\nOpen (creating if needed) the private group channel with a set of users.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `recipients` | [`User`](../../../users/user/classes/User.md)[] |\n\n#### Returns\n\n`Promise`\\<[`Channel`](../../channel/classes/Channel.md)\\>\n\n***\n\n### search()\n\n> **search**(`query`, `opts?`): `AsyncGenerator`\\<[`Channel`](../../channel/classes/Channel.md)\\>\n\nSearch channels by name (client-side fuzzy filter on the full channel list)\nor by content (server-side unified search).\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `query` | `string` |\n| `opts?` | [`SearchOpts`](../../../search/interfaces/SearchOpts.md) |\n\n#### Returns\n\n`AsyncGenerator`\\<[`Channel`](../../channel/classes/Channel.md)\\>\n\n\n<!-- src/entities/channels/picture/classes/ChannelPicture.md -->\n# Class: ChannelPicture\n\nAn uploaded channel profile picture in static file storage.\n\n## Properties\n\n| Property | Modifier | Type |\n| ------ | ------ | ------ |\n| <a id=\"property-id\"></a> `id` | `readonly` | `string` |\n\n## Methods\n\n### toJSON()\n\n> **toJSON**(): \\{ `id`: `string`; \\}\n\nSerialize the uploaded picture reference.\n\n#### Returns\n\n\\{ `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n***\n\n### byId()\n\n> `static` **byId**(`id`): `ChannelPicture`\n\nConstruct a reference from the upload receipt.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n`ChannelPicture`\n\n\n<!-- src/entities/channels/post/functions/postToChannel.md -->\n# Function: postToChannel()\n\n> **postToChannel**(`client`, `target`, `body`): `Promise`\\<`string`\\>\n\nPost a message using the endpoint supported by the caller's credentials.\n\nMost credentials use `POST /messages/channel/{id}`. User-owned bots without\nan acting user instead use `POST /channels/{id}/webhook`, which authorizes\nthrough channel membership. The bot owner is read from `GET /bots/me` and\ncached by the client.\n\nThe webhook endpoint supports content only. Mentions in `<m-*>` tags still\nwork, but threads and attachments are not supported.\n\nPosting to a `Thread` puts the message in that thread; to a `Channel`, at the\nchannel root. One target rather than a channel plus a thread id, so the two\ncan't disagree.\n\n## Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `target` | [`Channel`](../../channel/classes/Channel.md) \\| [`Thread`](../../thread/classes/Thread.md) |\n| `body` | [`RichMessage`](../../../../mentions/interfaces/RichMessage.md) |\n\n## Returns\n\n`Promise`\\<`string`\\>\n\n\n<!-- src/entities/channels/thread/classes/Thread.md -->\n# Class: Thread\n\nA thread within a channel, rooted at a top-level message. Replies and\nthread-scoped posting live here.\n\n## Constructors\n\n### Constructor\n\n> **new Thread**(`client`, `channelId`, `rootId`): `Thread`\n\n#### Parameters\n\n| Parameter | Type | Description |\n| ------ | ------ | ------ |\n| `client` | `MacroClient` | - |\n| `channelId` | `string` | - |\n| `rootId` | `string` | The id of the message this thread hangs off. |\n\n#### Returns\n\n`Thread`\n\n## Properties\n\n| Property | Modifier | Type | Description |\n| ------ | ------ | ------ | ------ |\n| <a id=\"property-channelid\"></a> `channelId` | `readonly` | `string` | - |\n| <a id=\"property-rootid\"></a> `rootId` | `readonly` | `string` | The id of the message this thread hangs off. |\n\n## Methods\n\n### channel()\n\n> **channel**(): [`Channel`](../../channel/classes/Channel.md)\n\nThe channel this thread is in.\n\n#### Returns\n\n[`Channel`](../../channel/classes/Channel.md)\n\n***\n\n### replies()\n\n> **replies**(): `Promise`\\<[`Message`](../../message/classes/Message.md)[]\\>\n\nList the replies in this thread, oldest first.\n\n#### Returns\n\n`Promise`\\<[`Message`](../../message/classes/Message.md)[]\\>\n\n***\n\n### reply()\n\n> **reply**(`body`): `Promise`\\<[`Message`](../../message/classes/Message.md)\\>\n\nPost a reply in this thread.\n\n#### Parameters\n\n| Parameter | Type | Description |\n| ------ | ------ | ------ |\n| `body` | `string` \\| [`RichMessage`](../../../../mentions/interfaces/RichMessage.md) | Plain text, or a rich body composed with msg. |\n\n#### Returns\n\n`Promise`\\<[`Message`](../../message/classes/Message.md)\\>\n\nThe created reply.\n\n***\n\n### root()\n\n> **root**(): [`Message`](../../message/classes/Message.md)\n\nThe message this thread hangs off.\n\n#### Returns\n\n[`Message`](../../message/classes/Message.md)\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `channelId`: `string`; `rootId`: `string`; \\}\n\nSerialize the thread identity without its authenticated client.\n\n#### Returns\n\n\\{ `channelId`: `string`; `rootId`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `channelId` | `string` |\n| `rootId` | `string` |\n"},{"name": "chats",- "description": "Read chat conversations.",+ "description": "Read and send AI chat messages and stop generations.","overview": "<!-- src/entities/chats/namespace/classes/ChatNamespace.md -->\n# Class: ChatNamespace\n\n## Constructors\n\n### Constructor\n\n> **new ChatNamespace**(`client`): `ChatNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`ChatNamespace`\n\n## Methods\n\n### byId()\n\n> **byId**(`id`): [`Chat`](../../chat/classes/Chat.md)\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`Chat`](../../chat/classes/Chat.md)\n\n***\n\n### create()\n\n> **create**(`opts?`): `Promise`\\<[`Chat`](../../chat/classes/Chat.md)\\>\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts?` | \\{ `name?`: `string`; `project?`: [`Project`](../../../projects/project/classes/Project.md); \\} |\n| `opts.name?` | `string` |\n| `opts.project?` | [`Project`](../../../projects/project/classes/Project.md) |\n\n#### Returns\n\n`Promise`\\<[`Chat`](../../chat/classes/Chat.md)\\>\n\n***\n\n### search()\n\n> **search**(`query`, `opts?`): `AsyncGenerator`\\<[`Chat`](../../chat/classes/Chat.md)\\>\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `query` | `string` |\n| `opts?` | [`SearchOpts`](../../../search/interfaces/SearchOpts.md) |\n\n#### Returns\n\n`AsyncGenerator`\\<[`Chat`](../../chat/classes/Chat.md)\\>\n",- "documentation": "# Macro SDK: chats\n\nGenerated by TypeDoc. Paths below refer to the canonical Markdown hierarchy. Other entity handles are documented in their named section; request core for shared SDK helpers.\n\n<!-- generated/cognition/types.gen/type-aliases/AssistantMessagePart.md -->\n# Type Alias: AssistantMessagePart\n\n> **AssistantMessagePart** = \\{ `text`: `string`; `type`: `\"text\"`; \\} \\| \\{ `id`: `string`; `json`: `unknown`; `name`: `string`; `type`: `\"toolCall\"`; \\} \\| \\{ `display_name?`: `string` \\| `null`; `id`: `string`; `json`: `unknown`; `name`: `string`; `service`: `string`; `type`: `\"mcpToolCall\"`; \\} \\| \\{ `id`: `string`; `json`: `unknown`; `name`: `string`; `type`: `\"toolCallResponseJson\"`; \\} \\| \\{ `description`: `string`; `id`: `string`; `name`: `string`; `type`: `\"toolCallErr\"`; \\} \\| \\{ `thinking`: `string`; `type`: `\"thinking\"`; \\}\n\nA structured part within an assistant message.\n\nWhen the model responds with tool calls the full turn is persisted as a\nflat sequence of these parts. [`crate::convert::to_rig_messages`]\nreconstructs the turn boundaries that providers expect.\n\n## Union Members\n\n### Type Literal\n\n\\{ `text`: `string`; `type`: `\"text\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `text` | `string` | The text content. |\n| `type` | `\"text\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: `string`; `json`: `unknown`; `name`: `string`; `type`: `\"toolCall\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | Provider-assigned call id. |\n| `json` | `unknown` | Tool arguments as JSON. |\n| `name` | `string` | Tool name. |\n| `type` | `\"toolCall\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `display_name?`: `string` \\| `null`; `id`: `string`; `json`: `unknown`; `name`: `string`; `service`: `string`; `type`: `\"mcpToolCall\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `display_name?` | `string` \\| `null` | Optional human-readable name. |\n| `id` | `string` | Provider-assigned call id. |\n| `json` | `unknown` | Tool arguments as JSON. |\n| `name` | `string` | Tool name. |\n| `service` | `string` | MCP service identifier. |\n| `type` | `\"mcpToolCall\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: `string`; `json`: `unknown`; `name`: `string`; `type`: `\"toolCallResponseJson\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | Corresponding call id. |\n| `json` | `unknown` | Response payload. |\n| `name` | `string` | Tool name. |\n| `type` | `\"toolCallResponseJson\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `description`: `string`; `id`: `string`; `name`: `string`; `type`: `\"toolCallErr\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `description` | `string` | Human-readable error description. |\n| `id` | `string` | Corresponding call id. |\n| `name` | `string` | Tool name. |\n| `type` | `\"toolCallErr\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `thinking`: `string`; `type`: `\"thinking\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `thinking` | `string` | The thinking text content. |\n| `type` | `\"thinking\"` | - |\n\n\n<!-- generated/cognition/types.gen/type-aliases/ChatMessageContent.md -->\n# Type Alias: ChatMessageContent\n\n> **ChatMessageContent** = `string` \\| [`AssistantMessagePart`](AssistantMessagePart.md)[]\n\nThe content of a [`ChatMessage`].\n\nFor user and system messages the content is plain [`Text`](Self::Text).\nFor assistant messages it may additionally be a sequence of\n[`AssistantMessagePart`]s that encode tool-call round trips.\n\n\n<!-- generated/cognition/types.gen/type-aliases/ChatMessageWithAttachments.md -->\n# Type Alias: ChatMessageWithAttachments\n\n> **ChatMessageWithAttachments** = \\{ `attachments`: [`Entity`](Entity.md)[]; `content`: [`ChatMessageContent`](ChatMessageContent.md); `id`: `string`; `role`: [`Role`](Role.md); \\}\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-attachments\"></a> `attachments` | [`Entity`](Entity.md)[] | The ids of the attachments used to generate the message |\n| <a id=\"property-content\"></a> `content` | [`ChatMessageContent`](ChatMessageContent.md) | Message content |\n| <a id=\"property-id\"></a> `id` | `string` | The chat message id |\n| <a id=\"property-role\"></a> `role` | [`Role`](Role.md) | Whether the chat is from the user or system |\n\n\n<!-- generated/cognition/types.gen/type-aliases/ChatResponse.md -->\n# Type Alias: ChatResponse\n\n> **ChatResponse** = \\{ `createdAt?`: `string` \\| `null`; `id`: `string`; `messages`: [`ChatMessageWithAttachments`](ChatMessageWithAttachments.md)[]; `model?`: `string` \\| `null`; `name`: `string`; `projectId?`: `string` \\| `null`; `updatedAt?`: `string` \\| `null`; `userId`: `string`; \\}\n\nThe full chat response, matching the DCS API response shape.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-createdat\"></a> `createdAt?` | `string` \\| `null` | The time the chat was created. |\n| <a id=\"property-id\"></a> `id` | `string` | The chat uuid. |\n| <a id=\"property-messages\"></a> `messages` | [`ChatMessageWithAttachments`](ChatMessageWithAttachments.md)[] | The messages in the chat. |\n| <a id=\"property-model\"></a> `model?` | `string` \\| `null` | The model used to generate the chat (`provider/model` id). |\n| <a id=\"property-name\"></a> `name` | `string` | The name of the chat. |\n| <a id=\"property-projectid\"></a> `projectId?` | `string` \\| `null` | The project id the chat belongs to. |\n| <a id=\"property-updatedat\"></a> `updatedAt?` | `string` \\| `null` | The time the chat was last updated. |\n| <a id=\"property-userid\"></a> `userId` | `string` | Who the chat belongs to. |\n\n\n<!-- generated/cognition/types.gen/type-aliases/ConversationRecord.md -->\n# Type Alias: ConversationRecord\n\n> **ConversationRecord** = \\{ `chat_id`: `string`; `messages`: [`MessageWithAttachments`](MessageWithAttachments.md)[]; `title`: `string`; \\}\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-chat_id\"></a> `chat_id` | `string` |\n| <a id=\"property-messages\"></a> `messages` | [`MessageWithAttachments`](MessageWithAttachments.md)[] |\n| <a id=\"property-title\"></a> `title` | `string` |\n\n\n<!-- generated/cognition/types.gen/type-aliases/Entity.md -->\n# Type Alias: Entity\n\n> **Entity** = \\{ `entity_id`: `string`; `entity_type`: [`EntityType`](EntityType.md); \\}\n\nThe Entity describes the minimum amount of information required to describe a unique thing in Macro\nThis contains the type of the entity [EntityType] and the string id of that entity\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | The id of that entity |\n| <a id=\"property-entity_type\"></a> `entity_type` | [`EntityType`](EntityType.md) | The type of entity we are describing |\n\n\n<!-- generated/cognition/types.gen/type-aliases/EntityType.md -->\n# Type Alias: EntityType\n\n> **EntityType** = `\"user\"` \\| `\"chat\"` \\| `\"channel\"` \\| `\"channel_message\"` \\| `\"document\"` \\| `\"project\"` \\| `\"email_thread\"` \\| `\"calendar_event\"` \\| `\"team\"` \\| `\"call\"` \\| `\"foreign_entity\"` \\| `\"static_file\"` \\| `\"crm_company\"` \\| `\"crm_contact\"` \\| `\"crm_pipeline\"` \\| `\"reminder\"` \\| `\"skill\"` \\| `\"agent_session\"` \\| `\"scheduled_action\"` \\| `\"initiative\"` \\| `\"database\"` \\| `\"database_row\"` \\| `\"form\"`\n\nThe type of an entity in Macro\n\n\n<!-- generated/cognition/types.gen/type-aliases/MessageWithAttachments.md -->\n# Type Alias: MessageWithAttachments\n\n> **MessageWithAttachments** = \\{ `attachmentIds`: `string`[]; `content`: `string`; `date`: `string`; \\}\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-attachmentids\"></a> `attachmentIds` | `string`[] |\n| <a id=\"property-content\"></a> `content` | `string` |\n| <a id=\"property-date\"></a> `date` | `string` |\n\n\n<!-- generated/cognition/types.gen/type-aliases/Role.md -->\n# Type Alias: Role\n\n> **Role** = `\"user\"` \\| `\"assistant\"` \\| `\"system\"`\n\nThe role of a message participant.\n\n\n<!-- generated/properties/types.gen/type-aliases/BulkUpdateEntityPropertyOptionsResponse.md -->\n# Type Alias: BulkUpdateEntityPropertyOptionsResponse\n\n> **BulkUpdateEntityPropertyOptionsResponse** = \\{ `properties`: [`EntityPropertyOptionSelectionResponse`](EntityPropertyOptionSelectionResponse.md)[]; \\}\n\nResponse for a bulk option update: each property's reconciled final ids.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-properties\"></a> `properties` | [`EntityPropertyOptionSelectionResponse`](EntityPropertyOptionSelectionResponse.md)[] | The final option ids per updated property. |\n\n\n<!-- generated/properties/types.gen/type-aliases/DataType.md -->\n# Type Alias: DataType\n\n> **DataType** = `\"BOOLEAN\"` \\| `\"DATE\"` \\| `\"NUMBER\"` \\| `\"STRING\"` \\| `\"SELECT_NUMBER\"` \\| `\"SELECT_STRING\"` \\| `\"TAG\"` \\| `\"ENTITY\"` \\| `\"LINK\"`\n\nData type for property values, determining storage and validation.\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityProperty.md -->\n# Type Alias: EntityProperty\n\n> **EntityProperty** = \\{ `created_at`: `string`; `entity_id`: `string`; `entity_type`: [`EntityType`](EntityType.md); `id`: `string`; `property_definition_id`: `string`; `updated_at`: `string`; \\}\n\nAssignment of a property definition to a specific entity (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-created_at\"></a> `created_at` | `string` |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` |\n| <a id=\"property-entity_type\"></a> `entity_type` | [`EntityType`](EntityType.md) |\n| <a id=\"property-id\"></a> `id` | `string` |\n| <a id=\"property-property_definition_id\"></a> `property_definition_id` | `string` |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityPropertyOptionSelectionResponse.md -->\n# Type Alias: EntityPropertyOptionSelectionResponse\n\n> **EntityPropertyOptionSelectionResponse** = \\{ `option_ids`: `string`[]; `property_id`: `string`; \\}\n\nThe reconciled final option ids stored for one property after a bulk update.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-option_ids\"></a> `option_ids` | `string`[] | The final option ids the server persisted, in stored order. |\n| <a id=\"property-property_id\"></a> `property_id` | `string` | The property definition the options belong to. |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md -->\n# Type Alias: EntityPropertyWithDefinition\n\n> **EntityPropertyWithDefinition** = \\{ `definition`: [`PropertyDefinition`](PropertyDefinition.md); `options?`: [`PropertyOption`](PropertyOption.md)[] \\| `null`; `property`: [`EntityProperty`](EntityProperty.md); `value?`: `null` \\| [`PropertyValue`](PropertyValue.md); \\}\n\nEntity property with its definition, value, and options (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-definition\"></a> `definition` | [`PropertyDefinition`](PropertyDefinition.md) |\n| <a id=\"property-options\"></a> `options?` | [`PropertyOption`](PropertyOption.md)[] \\| `null` |\n| <a id=\"property-property\"></a> `property` | [`EntityProperty`](EntityProperty.md) |\n| <a id=\"property-value\"></a> `value?` | `null` \\| [`PropertyValue`](PropertyValue.md) |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityReference.md -->\n# Type Alias: EntityReference\n\n> **EntityReference** = \\{ `entity_id`: `string`; `entity_type`: [`EntityType`](EntityType.md); `specific_message_id?`: `string` \\| `null`; \\}\n\nEntity reference for entity-type property values.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | - |\n| <a id=\"property-entity_type\"></a> `entity_type` | [`EntityType`](EntityType.md) | - |\n| <a id=\"property-specific_message_id\"></a> `specific_message_id?` | `string` \\| `null` | For CHANNEL, CHAT, THREAD entity types - optional specific message ID. This allows referencing a specific message within a thread/channel/chat. |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityType.md -->\n# Type Alias: EntityType\n\n> **EntityType** = `\"CALENDAR_EVENT\"` \\| `\"CALL_RECORD\"` \\| `\"CHANNEL\"` \\| `\"CHAT\"` \\| `\"COMPANY\"` \\| `\"DATABASE_ROW\"` \\| `\"CONTACT\"` \\| `\"DOCUMENT\"` \\| `\"INITIATIVE\"` \\| `\"PROJECT\"` \\| `\"TASK\"` \\| `\"THREAD\"` \\| `\"USER\"`\n\nType of entity that can be referenced by entity properties.\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyDefinition.md -->\n# Type Alias: PropertyDefinition\n\n> **PropertyDefinition** = \\{ `created_at`: `string`; `data_type`: [`DataType`](DataType.md); `display_name`: `string`; `id`: `string`; `is_metadata`: `boolean`; `is_multi_select`: `boolean`; `is_system`: `boolean`; `owner`: [`PropertyOwner`](PropertyOwner.md); `specific_entity_type`: `null` \\| [`EntityType`](EntityType.md); `updated_at`: `string`; \\}\n\nProperty definition model (service representation).\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | - |\n| <a id=\"property-data_type\"></a> `data_type` | [`DataType`](DataType.md) | - |\n| <a id=\"property-display_name\"></a> `display_name` | `string` | - |\n| <a id=\"property-id\"></a> `id` | `string` | - |\n| <a id=\"property-is_metadata\"></a> `is_metadata` | `boolean` | Flag to indicate if this is a system-generated metadata property. Not stored in database - computed at service layer. |\n| <a id=\"property-is_multi_select\"></a> `is_multi_select` | `boolean` | - |\n| <a id=\"property-is_system\"></a> `is_system` | `boolean` | Flag to indicate if this is a system property (stored in DB). |\n| <a id=\"property-owner\"></a> `owner` | [`PropertyOwner`](PropertyOwner.md) | - |\n| <a id=\"property-specific_entity_type\"></a> `specific_entity_type` | `null` \\| [`EntityType`](EntityType.md) | - |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` | - |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyOption.md -->\n# Type Alias: PropertyOption\n\n> **PropertyOption** = \\{ `color`: `string` \\| `null`; `created_at`: `string`; `display_order`: `number`; `id`: `string`; `property_definition_id`: `string`; `updated_at`: `string`; `value`: [`PropertyOptionValue`](PropertyOptionValue.md); \\}\n\nA selectable option for select-type properties (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-color\"></a> `color` | `string` \\| `null` |\n| <a id=\"property-created_at\"></a> `created_at` | `string` |\n| <a id=\"property-display_order\"></a> `display_order` | `number` |\n| <a id=\"property-id\"></a> `id` | `string` |\n| <a id=\"property-property_definition_id\"></a> `property_definition_id` | `string` |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` |\n| <a id=\"property-value\"></a> `value` | [`PropertyOptionValue`](PropertyOptionValue.md) |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyOptionValue.md -->\n# Type Alias: PropertyOptionValue\n\n> **PropertyOptionValue** = \\{ `type`: `\"string\"`; `value`: `string`; \\} \\| \\{ `type`: `\"number\"`; `value`: `number`; \\}\n\nThe value of a property option - either a string or a number.\n\n## Union Members\n\n### Type Literal\n\n\\{ `type`: `\"string\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"string\"` | - |\n| `value` | `string` | String value for SelectString properties |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"number\"`; `value`: `number`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"number\"` | - |\n| `value` | `number` | Number value for SelectNumber properties |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyOwner.md -->\n# Type Alias: PropertyOwner\n\n> **PropertyOwner** = \\{ `scope`: `\"user\"`; `user_id`: `string`; \\} \\| \\{ `scope`: `\"team\"`; `team_id`: `string`; \\} \\| \\{ `database_id`: `string`; `scope`: `\"database\"`; \\} \\| \\{ `scope`: `\"system\"`; \\}\n\nDefines who owns a property - user-scoped, team-scoped, database-scoped, or system.\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyTargetEntityType.md -->\n# Type Alias: PropertyTargetEntityType\n\n> **PropertyTargetEntityType** = `\"CALL_RECORD\"` \\| `\"CHANNEL\"` \\| `\"CHAT\"` \\| `\"COMPANY\"` \\| `\"DATABASE_ROW\"` \\| `\"DOCUMENT\"` \\| `\"INITIATIVE\"` \\| `\"PROJECT\"` \\| `\"THREAD\"` \\| `\"USER\"`\n\nCanonical type of an entity receiving properties.\n\nTasks are documents at API boundaries. `Task` intentionally does not exist\nhere; task classification is resolved by the properties domain from the\ndocument subtype.\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyTargetReference.md -->\n# Type Alias: PropertyTargetReference\n\n> **PropertyTargetReference** = \\{ `entity_id`: `string`; `entity_type`: [`PropertyTargetEntityType`](PropertyTargetEntityType.md); \\}\n\nCanonical reference to an entity receiving properties.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | Entity identifier. |\n| <a id=\"property-entity_type\"></a> `entity_type` | [`PropertyTargetEntityType`](PropertyTargetEntityType.md) | Canonical entity type. |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyValue.md -->\n# Type Alias: PropertyValue\n\n> **PropertyValue** = \\{ `type`: `\"Boolean\"`; `value`: `boolean`; \\} \\| \\{ `type`: `\"Number\"`; `value`: `number`; \\} \\| \\{ `type`: `\"String\"`; `value`: `string`; \\} \\| \\{ `type`: `\"Date\"`; `value`: `string`; \\} \\| \\{ `type`: `\"SelectOption\"`; `value`: `string`[]; \\} \\| \\{ `type`: `\"EntityReference\"`; `value`: [`EntityReference`](EntityReference.md)[]; \\} \\| \\{ `type`: `\"Link\"`; `value`: `string`[]; \\}\n\nProperty value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to/from JSONB in the database.\n\n## Union Members\n\n### Type Literal\n\n\\{ `type`: `\"Boolean\"`; `value`: `boolean`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Boolean\"` | - |\n| `value` | `boolean` | Boolean value Serializes as: {\"type\": \"Boolean\", \"value\": true} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"Number\"`; `value`: `number`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Number\"` | - |\n| `value` | `number` | Numeric value Serializes as: {\"type\": \"Number\", \"value\": 42.5} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"String\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"String\"` | - |\n| `value` | `string` | String value Serializes as: {\"type\": \"String\", \"value\": \"text\"} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"Date\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Date\"` | - |\n| `value` | `string` | Date/timestamp value Serializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"SelectOption\"`; `value`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"SelectOption\"` | - |\n| `value` | `string`[] | Select option(s) - always an array (check is_multi_select to determine if single or multi) Single-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1) Multi-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+) |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"EntityReference\"`; `value`: [`EntityReference`](EntityReference.md)[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"EntityReference\"` | - |\n| `value` | [`EntityReference`](EntityReference.md)[] | Entity reference(s) - always an array (check is_multi_select to determine if single or multi) Single-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1) Multi-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+) |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"Link\"`; `value`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Link\"` | - |\n| `value` | `string`[] | Link value(s) - always an array (check is_multi_select to determine if single or multi) Single-select: {\"type\": \"Link\", \"value\": [\"https://example.com\"]} (length 0 or 1) Multi-select: {\"type\": \"Link\", \"value\": [\"https://example.com\", \"https://other.com\"]} (length 0+) |\n\n\n<!-- generated/properties/types.gen/type-aliases/SetPropertyValue.md -->\n# Type Alias: SetPropertyValue\n\n> **SetPropertyValue** = \\{ `type`: `\"boolean\"`; `value`: `boolean`; \\} \\| \\{ `type`: `\"date\"`; `value`: `string`; \\} \\| \\{ `type`: `\"number\"`; `value`: `number`; \\} \\| \\{ `type`: `\"string\"`; `value`: `string`; \\} \\| \\{ `option_id`: `string`; `type`: `\"select_option\"`; \\} \\| \\{ `option_ids`: `string`[]; `type`: `\"multi_select_option\"`; \\} \\| \\{ `reference`: [`EntityReference`](EntityReference.md); `type`: `\"entity_reference\"`; \\} \\| \\{ `references`: [`EntityReference`](EntityReference.md)[]; `type`: `\"multi_entity_reference\"`; \\} \\| \\{ `type`: `\"link\"`; `url`: `string`; \\} \\| \\{ `type`: `\"multi_link\"`; `urls`: `string`[]; \\}\n\nType-safe enum for setting entity property values - provides compile-time validation.\n\n\n<!-- src/entities/chats/chat/classes/Chat.md -->\n# Class: Chat\n\nA Macro AI chat.\n\n## Extends\n\n- [`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md)\\<`ChatDetail`\\>\n\n## Implements\n\n- [`Mentionable`](../../../../mentions/interfaces/Mentionable.md)\n\n## Properties\n\n| Property | Modifier | Type | Default value | Description | Overrides | Inherited from |\n| ------ | ------ | ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-createdat\"></a> `createdAt` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | `...` | When the chat was created. | - | - |\n| <a id=\"property-entitytype\"></a> `entityType` | `readonly` | `\"chat\"` | `'chat'` | Favorites identify chats as `chat`. | [`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`entityType`](../../../entity/classes/PropertiedEntity.md#property-entitytype) | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | `undefined` | - | - | [`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`id`](../../../entity/classes/PropertiedEntity.md#property-id) |\n| <a id=\"property-messages\"></a> `messages` | `readonly` | () => `Promise`\\<[`ChatMessageWithAttachments`](../../../../../generated/cognition/types.gen/type-aliases/ChatMessageWithAttachments.md)[]\\> | `...` | The messages in the chat, with their attachments. | - | - |\n| <a id=\"property-model\"></a> `model` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | `...` | The model used to generate the chat (`provider/model` id), if set. | - | - |\n| <a id=\"property-name\"></a> `name` | `readonly` | () => `Promise`\\<`string`\\> | `...` | The chat's display name. | - | - |\n| <a id=\"property-project\"></a> `project` | `readonly` | () => `Promise`\\<[`Project`](../../../projects/project/classes/Project.md) \\| `undefined`\\> | `...` | The project this chat belongs to, if any. | - | - |\n| <a id=\"property-updatedat\"></a> `updatedAt` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | `...` | When the chat was last updated. | - | - |\n| <a id=\"property-search\"></a> `search` | `static` | (`client`, `query`, `searchOpts?`) => `AsyncGenerator`\\<`Chat`\\> | `...` | Search chats by name and content, most relevant first, auto-paginated. | - | - |\n\n## Methods\n\n### copy()\n\n> **copy**(): `Promise`\\<`Chat`\\>\n\nCopy the chat, returning a handle to the new copy.\n\n#### Returns\n\n`Promise`\\<`Chat`\\>\n\n***\n\n### delete()\n\n> **delete**(`opts?`): `Promise`\\<`void`\\>\n\nDelete the chat. Soft by default (reversible with [restore](#restore));\npass `permanent: true` to delete irreversibly.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts?` | \\{ `permanent?`: `boolean`; \\} |\n| `opts.permanent?` | `boolean` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### deleteProperty()\n\n> **deleteProperty**(`assignment`): `Promise`\\<`void`\\>\n\nRemove a property from this entity, given its [properties](#properties) entry.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `assignment` | [`EntityPropertyWithDefinition`](../../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`deleteProperty`](../../../entity/classes/PropertiedEntity.md#deleteproperty)\n\n***\n\n### favorite()\n\n> **favorite**(): `Promise`\\<`Chat`\\>\n\nAdd this entity to the user's favorites. Returns this handle for chaining.\nPlain unwrap: favoriting alters the user's favorites collection, not this\nentity's own detail, so there's nothing cached to invalidate.\n\n#### Returns\n\n`Promise`\\<`Chat`\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`favorite`](../../../entity/classes/PropertiedEntity.md#favorite)\n\n***\n\n### history()\n\n> **history**(): `Promise`\\<[`ConversationRecord`](../../../../../generated/cognition/types.gen/type-aliases/ConversationRecord.md)[]\\>\n\nThe chat's conversation history: titled records of messages with attachment ids.\n\n#### Returns\n\n`Promise`\\<[`ConversationRecord`](../../../../../generated/cognition/types.gen/type-aliases/ConversationRecord.md)[]\\>\n\n***\n\n### properties()\n\n> **properties**(`opts?`): `Promise`\\<[`EntityPropertyWithDefinition`](../../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md)[]\\>\n\nThe properties set on this entity, each with its definition, value, and options.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts?` | \\{ `includeMetadata?`: `boolean`; \\} |\n| `opts.includeMetadata?` | `boolean` |\n\n#### Returns\n\n`Promise`\\<[`EntityPropertyWithDefinition`](../../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md)[]\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`properties`](../../../entity/classes/PropertiedEntity.md#properties)\n\n***\n\n### propertyReference()\n\n> **propertyReference**(): [`PropertyTargetReference`](../../../../../generated/properties/types.gen/type-aliases/PropertyTargetReference.md)\n\nThis entity's reference for bulk property operations.\n\n#### Returns\n\n[`PropertyTargetReference`](../../../../../generated/properties/types.gen/type-aliases/PropertyTargetReference.md)\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`propertyReference`](../../../entity/classes/PropertiedEntity.md#propertyreference)\n\n***\n\n### rename()\n\n> **rename**(`name`): `Promise`\\<`void`\\>\n\nRename the chat.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `name` | `string` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### restore()\n\n> **restore**(): `Promise`\\<`void`\\>\n\nRestore a soft-deleted chat.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### setProperty()\n\n> **setProperty**(`property`, `value?`): `Promise`\\<`void`\\>\n\nSet a property value on this entity, or attach the property without a\nvalue when `value` is omitted.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `property` | [`PropertyDefinition`](../../../properties/property-definition/classes/PropertyDefinition.md) |\n| `value?` | [`SetPropertyValue`](../../../../../generated/properties/types.gen/type-aliases/SetPropertyValue.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`setProperty`](../../../entity/classes/PropertiedEntity.md#setproperty)\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`ChatResponse`](../../../../../generated/cognition/types.gen/type-aliases/ChatResponse.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`ChatResponse`](../../../../../generated/cognition/types.gen/type-aliases/ChatResponse.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`ChatResponse`](../../../../../generated/cognition/types.gen/type-aliases/ChatResponse.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`toJSON`](../../../entity/classes/PropertiedEntity.md#tojson)\n\n***\n\n### toMention()\n\n> **toMention**(): [`MentionPart`](../../../../mentions/interfaces/MentionPart.md)\n\n#### Returns\n\n[`MentionPart`](../../../../mentions/interfaces/MentionPart.md)\n\n#### Implementation of\n\n[`Mentionable`](../../../../mentions/interfaces/Mentionable.md).[`toMention`](../../../../mentions/interfaces/Mentionable.md#tomention)\n\n***\n\n### unfavorite()\n\n> **unfavorite**(): `Promise`\\<`Chat`\\>\n\nRemove this entity from the user's favorites. Returns this handle for chaining.\n\n#### Returns\n\n`Promise`\\<`Chat`\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`unfavorite`](../../../entity/classes/PropertiedEntity.md#unfavorite)\n\n***\n\n### updatePropertyOptions()\n\n> **updatePropertyOptions**(`changes`): `Promise`\\<[`BulkUpdateEntityPropertyOptionsResponse`](../../../../../generated/properties/types.gen/type-aliases/BulkUpdateEntityPropertyOptionsResponse.md)\\>\n\nApply multi-select option deltas atomically across this entity's properties.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `changes` | [`PropertyOptionDelta`](../../../entity/interfaces/PropertyOptionDelta.md)[] |\n\n#### Returns\n\n`Promise`\\<[`BulkUpdateEntityPropertyOptionsResponse`](../../../../../generated/properties/types.gen/type-aliases/BulkUpdateEntityPropertyOptionsResponse.md)\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`updatePropertyOptions`](../../../entity/classes/PropertiedEntity.md#updatepropertyoptions)\n\n***\n\n### webUrl()\n\n> **webUrl**(): `string`\n\nThe chat's URL in the Macro web app.\n\n#### Returns\n\n`string`\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `id`): `Chat`\n\nA handle to a chat by id. Details load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `id` | `string` |\n\n#### Returns\n\n`Chat`\n\n***\n\n### create()\n\n> `static` **create**(`client`, `opts?`): `Promise`\\<`Chat`\\>\n\nCreate a chat, optionally named and attached to a project.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `opts?` | \\{ `name?`: `string`; `project?`: [`Project`](../../../projects/project/classes/Project.md); \\} |\n| `opts.name?` | `string` |\n| `opts.project?` | [`Project`](../../../projects/project/classes/Project.md) |\n\n#### Returns\n\n`Promise`\\<`Chat`\\>\n\n\n<!-- src/entities/chats/namespace/classes/ChatNamespace.md -->\n# Class: ChatNamespace\n\n## Constructors\n\n### Constructor\n\n> **new ChatNamespace**(`client`): `ChatNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`ChatNamespace`\n\n## Methods\n\n### byId()\n\n> **byId**(`id`): [`Chat`](../../chat/classes/Chat.md)\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`Chat`](../../chat/classes/Chat.md)\n\n***\n\n### create()\n\n> **create**(`opts?`): `Promise`\\<[`Chat`](../../chat/classes/Chat.md)\\>\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts?` | \\{ `name?`: `string`; `project?`: [`Project`](../../../projects/project/classes/Project.md); \\} |\n| `opts.name?` | `string` |\n| `opts.project?` | [`Project`](../../../projects/project/classes/Project.md) |\n\n#### Returns\n\n`Promise`\\<[`Chat`](../../chat/classes/Chat.md)\\>\n\n***\n\n### search()\n\n> **search**(`query`, `opts?`): `AsyncGenerator`\\<[`Chat`](../../chat/classes/Chat.md)\\>\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `query` | `string` |\n| `opts?` | [`SearchOpts`](../../../search/interfaces/SearchOpts.md) |\n\n#### Returns\n\n`AsyncGenerator`\\<[`Chat`](../../chat/classes/Chat.md)\\>\n"+ "documentation": "# Macro SDK: chats\n\nGenerated by TypeDoc. Paths below refer to the canonical Markdown hierarchy. Other entity handles are documented in their named section; request core for shared SDK helpers.\n\n<!-- generated/cognition/types.gen/type-aliases/AssistantMessagePart.md -->\n# Type Alias: AssistantMessagePart\n\n> **AssistantMessagePart** = \\{ `text`: `string`; `type`: `\"text\"`; \\} \\| \\{ `id`: `string`; `json`: `unknown`; `name`: `string`; `type`: `\"toolCall\"`; \\} \\| \\{ `display_name?`: `string` \\| `null`; `id`: `string`; `json`: `unknown`; `name`: `string`; `service`: `string`; `type`: `\"mcpToolCall\"`; \\} \\| \\{ `id`: `string`; `json`: `unknown`; `name`: `string`; `type`: `\"toolCallResponseJson\"`; \\} \\| \\{ `description`: `string`; `id`: `string`; `name`: `string`; `type`: `\"toolCallErr\"`; \\} \\| \\{ `thinking`: `string`; `type`: `\"thinking\"`; \\}\n\nA structured part within an assistant message.\n\nWhen the model responds with tool calls the full turn is persisted as a\nflat sequence of these parts. [`crate::convert::to_rig_messages`]\nreconstructs the turn boundaries that providers expect.\n\n## Union Members\n\n### Type Literal\n\n\\{ `text`: `string`; `type`: `\"text\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `text` | `string` | The text content. |\n| `type` | `\"text\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: `string`; `json`: `unknown`; `name`: `string`; `type`: `\"toolCall\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | Provider-assigned call id. |\n| `json` | `unknown` | Tool arguments as JSON. |\n| `name` | `string` | Tool name. |\n| `type` | `\"toolCall\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `display_name?`: `string` \\| `null`; `id`: `string`; `json`: `unknown`; `name`: `string`; `service`: `string`; `type`: `\"mcpToolCall\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `display_name?` | `string` \\| `null` | Optional human-readable name. |\n| `id` | `string` | Provider-assigned call id. |\n| `json` | `unknown` | Tool arguments as JSON. |\n| `name` | `string` | Tool name. |\n| `service` | `string` | MCP service identifier. |\n| `type` | `\"mcpToolCall\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: `string`; `json`: `unknown`; `name`: `string`; `type`: `\"toolCallResponseJson\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | Corresponding call id. |\n| `json` | `unknown` | Response payload. |\n| `name` | `string` | Tool name. |\n| `type` | `\"toolCallResponseJson\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `description`: `string`; `id`: `string`; `name`: `string`; `type`: `\"toolCallErr\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `description` | `string` | Human-readable error description. |\n| `id` | `string` | Corresponding call id. |\n| `name` | `string` | Tool name. |\n| `type` | `\"toolCallErr\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `thinking`: `string`; `type`: `\"thinking\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `thinking` | `string` | The thinking text content. |\n| `type` | `\"thinking\"` | - |\n\n\n<!-- generated/cognition/types.gen/type-aliases/ChatMessageContent.md -->\n# Type Alias: ChatMessageContent\n\n> **ChatMessageContent** = `string` \\| [`AssistantMessagePart`](AssistantMessagePart.md)[]\n\nThe content of a [`ChatMessage`].\n\nFor user and system messages the content is plain [`Text`](Self::Text).\nFor assistant messages it may additionally be a sequence of\n[`AssistantMessagePart`]s that encode tool-call round trips.\n\n\n<!-- generated/cognition/types.gen/type-aliases/ChatMessageWithAttachments.md -->\n# Type Alias: ChatMessageWithAttachments\n\n> **ChatMessageWithAttachments** = \\{ `attachments`: [`Entity`](Entity.md)[]; `content`: [`ChatMessageContent`](ChatMessageContent.md); `id`: `string`; `role`: [`Role`](Role.md); \\}\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-attachments\"></a> `attachments` | [`Entity`](Entity.md)[] | The ids of the attachments used to generate the message |\n| <a id=\"property-content\"></a> `content` | [`ChatMessageContent`](ChatMessageContent.md) | Message content |\n| <a id=\"property-id\"></a> `id` | `string` | The chat message id |\n| <a id=\"property-role\"></a> `role` | [`Role`](Role.md) | Whether the chat is from the user or system |\n\n\n<!-- generated/cognition/types.gen/type-aliases/ChatResponse.md -->\n# Type Alias: ChatResponse\n\n> **ChatResponse** = \\{ `createdAt?`: `string` \\| `null`; `id`: `string`; `messages`: [`ChatMessageWithAttachments`](ChatMessageWithAttachments.md)[]; `model?`: `string` \\| `null`; `name`: `string`; `projectId?`: `string` \\| `null`; `updatedAt?`: `string` \\| `null`; `userId`: `string`; \\}\n\nThe full chat response, matching the DCS API response shape.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-createdat\"></a> `createdAt?` | `string` \\| `null` | The time the chat was created. |\n| <a id=\"property-id\"></a> `id` | `string` | The chat uuid. |\n| <a id=\"property-messages\"></a> `messages` | [`ChatMessageWithAttachments`](ChatMessageWithAttachments.md)[] | The messages in the chat. |\n| <a id=\"property-model\"></a> `model?` | `string` \\| `null` | The model used to generate the chat (`provider/model` id). |\n| <a id=\"property-name\"></a> `name` | `string` | The name of the chat. |\n| <a id=\"property-projectid\"></a> `projectId?` | `string` \\| `null` | The project id the chat belongs to. |\n| <a id=\"property-updatedat\"></a> `updatedAt?` | `string` \\| `null` | The time the chat was last updated. |\n| <a id=\"property-userid\"></a> `userId` | `string` | Who the chat belongs to. |\n\n\n<!-- generated/cognition/types.gen/type-aliases/ConversationRecord.md -->\n# Type Alias: ConversationRecord\n\n> **ConversationRecord** = \\{ `chat_id`: `string`; `messages`: [`MessageWithAttachments`](MessageWithAttachments.md)[]; `title`: `string`; \\}\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-chat_id\"></a> `chat_id` | `string` |\n| <a id=\"property-messages\"></a> `messages` | [`MessageWithAttachments`](MessageWithAttachments.md)[] |\n| <a id=\"property-title\"></a> `title` | `string` |\n\n\n<!-- generated/cognition/types.gen/type-aliases/Entity.md -->\n# Type Alias: Entity\n\n> **Entity** = \\{ `entity_id`: `string`; `entity_type`: [`EntityType`](EntityType.md); \\}\n\nThe Entity describes the minimum amount of information required to describe a unique thing in Macro\nThis contains the type of the entity [EntityType] and the string id of that entity\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | The id of that entity |\n| <a id=\"property-entity_type\"></a> `entity_type` | [`EntityType`](EntityType.md) | The type of entity we are describing |\n\n\n<!-- generated/cognition/types.gen/type-aliases/EntityType.md -->\n# Type Alias: EntityType\n\n> **EntityType** = `\"user\"` \\| `\"chat\"` \\| `\"channel\"` \\| `\"channel_message\"` \\| `\"document\"` \\| `\"project\"` \\| `\"email_thread\"` \\| `\"calendar_event\"` \\| `\"team\"` \\| `\"call\"` \\| `\"foreign_entity\"` \\| `\"static_file\"` \\| `\"crm_company\"` \\| `\"crm_contact\"` \\| `\"crm_pipeline\"` \\| `\"reminder\"` \\| `\"skill\"` \\| `\"agent_session\"` \\| `\"scheduled_action\"` \\| `\"initiative\"` \\| `\"database\"` \\| `\"database_row\"` \\| `\"form\"`\n\nThe type of an entity in Macro\n\n\n<!-- generated/cognition/types.gen/type-aliases/HttpSendChatMessageRequest.md -->\n# Type Alias: HttpSendChatMessageRequest\n\n> **HttpSendChatMessageRequest** = \\{ `additional_instructions?`: `string` \\| `null`; `attachments?`: [`Entity`](Entity.md)[] \\| `null`; `chat_id?`: `string` \\| `null`; `content`: `string`; `model`: `string`; `speed?`: [`ModelSpeed`](ModelSpeed.md); `toolset?`: [`ToolSet`](ToolSet.md); \\}\n\nHTTP request payload for sending a chat message.\nUnlike the WebSocket payload, this does not include stream_id as it's generated server-side.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-additional_instructions\"></a> `additional_instructions?` | `string` \\| `null` | Additional system instructions appended to the base system prompt |\n| <a id=\"property-attachments\"></a> `attachments?` | [`Entity`](Entity.md)[] \\| `null` | Attachments for the message |\n| <a id=\"property-chat_id\"></a> `chat_id?` | `string` \\| `null` | Id of the chat the message belongs to (optional - if not provided, a new chat is created) |\n| <a id=\"property-content\"></a> `content` | `string` | The content of the message |\n| <a id=\"property-model\"></a> `model` | `string` | The model to respond with (`provider/model` id) |\n| <a id=\"property-speed\"></a> `speed?` | [`ModelSpeed`](ModelSpeed.md) | Inference speed, validated against the selected model. Defaults to standard. |\n| <a id=\"property-toolset\"></a> `toolset?` | [`ToolSet`](ToolSet.md) | Which toolset to use. Defaults to `all` |\n\n\n<!-- generated/cognition/types.gen/type-aliases/MessageWithAttachments.md -->\n# Type Alias: MessageWithAttachments\n\n> **MessageWithAttachments** = \\{ `attachmentIds`: `string`[]; `content`: `string`; `date`: `string`; \\}\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-attachmentids\"></a> `attachmentIds` | `string`[] |\n| <a id=\"property-content\"></a> `content` | `string` |\n| <a id=\"property-date\"></a> `date` | `string` |\n\n\n<!-- generated/cognition/types.gen/type-aliases/ModelSpeed.md -->\n# Type Alias: ModelSpeed\n\n> **ModelSpeed** = `\"standard\"` \\| `\"fast\"` \\| `\"ultrafast\"`\n\nThe requested inference speed. Standard is backward compatible with old clients.\n\n\n<!-- generated/cognition/types.gen/type-aliases/Role.md -->\n# Type Alias: Role\n\n> **Role** = `\"user\"` \\| `\"assistant\"` \\| `\"system\"`\n\nThe role of a message participant.\n\n\n<!-- generated/cognition/types.gen/type-aliases/ToolSet.md -->\n# Type Alias: ToolSet\n\n> **ToolSet** = \\{ `type`: `\"all\"`; \\} \\| \\{ `type`: `\"none\"`; \\} \\| \\{ `type`: `\"databases\"`; \\} \\| \\{ `type`: `\"databases_read_only\"`; \\}\n\n\n<!-- generated/properties/types.gen/type-aliases/BulkUpdateEntityPropertyOptionsResponse.md -->\n# Type Alias: BulkUpdateEntityPropertyOptionsResponse\n\n> **BulkUpdateEntityPropertyOptionsResponse** = \\{ `properties`: [`EntityPropertyOptionSelectionResponse`](EntityPropertyOptionSelectionResponse.md)[]; \\}\n\nResponse for a bulk option update: each property's reconciled final ids.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-properties\"></a> `properties` | [`EntityPropertyOptionSelectionResponse`](EntityPropertyOptionSelectionResponse.md)[] | The final option ids per updated property. |\n\n\n<!-- generated/properties/types.gen/type-aliases/DataType.md -->\n# Type Alias: DataType\n\n> **DataType** = `\"BOOLEAN\"` \\| `\"DATE\"` \\| `\"NUMBER\"` \\| `\"STRING\"` \\| `\"SELECT_NUMBER\"` \\| `\"SELECT_STRING\"` \\| `\"TAG\"` \\| `\"ENTITY\"` \\| `\"LINK\"`\n\nData type for property values, determining storage and validation.\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityProperty.md -->\n# Type Alias: EntityProperty\n\n> **EntityProperty** = \\{ `created_at`: `string`; `entity_id`: `string`; `entity_type`: [`EntityType`](EntityType.md); `id`: `string`; `property_definition_id`: `string`; `updated_at`: `string`; \\}\n\nAssignment of a property definition to a specific entity (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-created_at\"></a> `created_at` | `string` |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` |\n| <a id=\"property-entity_type\"></a> `entity_type` | [`EntityType`](EntityType.md) |\n| <a id=\"property-id\"></a> `id` | `string` |\n| <a id=\"property-property_definition_id\"></a> `property_definition_id` | `string` |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityPropertyOptionSelectionResponse.md -->\n# Type Alias: EntityPropertyOptionSelectionResponse\n\n> **EntityPropertyOptionSelectionResponse** = \\{ `option_ids`: `string`[]; `property_id`: `string`; \\}\n\nThe reconciled final option ids stored for one property after a bulk update.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-option_ids\"></a> `option_ids` | `string`[] | The final option ids the server persisted, in stored order. |\n| <a id=\"property-property_id\"></a> `property_id` | `string` | The property definition the options belong to. |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md -->\n# Type Alias: EntityPropertyWithDefinition\n\n> **EntityPropertyWithDefinition** = \\{ `definition`: [`PropertyDefinition`](PropertyDefinition.md); `options?`: [`PropertyOption`](PropertyOption.md)[] \\| `null`; `property`: [`EntityProperty`](EntityProperty.md); `value?`: `null` \\| [`PropertyValue`](PropertyValue.md); \\}\n\nEntity property with its definition, value, and options (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-definition\"></a> `definition` | [`PropertyDefinition`](PropertyDefinition.md) |\n| <a id=\"property-options\"></a> `options?` | [`PropertyOption`](PropertyOption.md)[] \\| `null` |\n| <a id=\"property-property\"></a> `property` | [`EntityProperty`](EntityProperty.md) |\n| <a id=\"property-value\"></a> `value?` | `null` \\| [`PropertyValue`](PropertyValue.md) |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityReference.md -->\n# Type Alias: EntityReference\n\n> **EntityReference** = \\{ `entity_id`: `string`; `entity_type`: [`EntityType`](EntityType.md); `specific_message_id?`: `string` \\| `null`; \\}\n\nEntity reference for entity-type property values.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | - |\n| <a id=\"property-entity_type\"></a> `entity_type` | [`EntityType`](EntityType.md) | - |\n| <a id=\"property-specific_message_id\"></a> `specific_message_id?` | `string` \\| `null` | For CHANNEL, CHAT, THREAD entity types - optional specific message ID. This allows referencing a specific message within a thread/channel/chat. |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityType.md -->\n# Type Alias: EntityType\n\n> **EntityType** = `\"CALENDAR_EVENT\"` \\| `\"CALL_RECORD\"` \\| `\"CHANNEL\"` \\| `\"CHAT\"` \\| `\"COMPANY\"` \\| `\"DATABASE_ROW\"` \\| `\"CONTACT\"` \\| `\"DOCUMENT\"` \\| `\"INITIATIVE\"` \\| `\"PROJECT\"` \\| `\"TASK\"` \\| `\"THREAD\"` \\| `\"USER\"`\n\nType of entity that can be referenced by entity properties.\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyDefinition.md -->\n# Type Alias: PropertyDefinition\n\n> **PropertyDefinition** = \\{ `created_at`: `string`; `data_type`: [`DataType`](DataType.md); `display_name`: `string`; `id`: `string`; `is_metadata`: `boolean`; `is_multi_select`: `boolean`; `is_system`: `boolean`; `owner`: [`PropertyOwner`](PropertyOwner.md); `specific_entity_type`: `null` \\| [`EntityType`](EntityType.md); `updated_at`: `string`; \\}\n\nProperty definition model (service representation).\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | - |\n| <a id=\"property-data_type\"></a> `data_type` | [`DataType`](DataType.md) | - |\n| <a id=\"property-display_name\"></a> `display_name` | `string` | - |\n| <a id=\"property-id\"></a> `id` | `string` | - |\n| <a id=\"property-is_metadata\"></a> `is_metadata` | `boolean` | Flag to indicate if this is a system-generated metadata property. Not stored in database - computed at service layer. |\n| <a id=\"property-is_multi_select\"></a> `is_multi_select` | `boolean` | - |\n| <a id=\"property-is_system\"></a> `is_system` | `boolean` | Flag to indicate if this is a system property (stored in DB). |\n| <a id=\"property-owner\"></a> `owner` | [`PropertyOwner`](PropertyOwner.md) | - |\n| <a id=\"property-specific_entity_type\"></a> `specific_entity_type` | `null` \\| [`EntityType`](EntityType.md) | - |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` | - |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyOption.md -->\n# Type Alias: PropertyOption\n\n> **PropertyOption** = \\{ `color`: `string` \\| `null`; `created_at`: `string`; `display_order`: `number`; `id`: `string`; `property_definition_id`: `string`; `updated_at`: `string`; `value`: [`PropertyOptionValue`](PropertyOptionValue.md); \\}\n\nA selectable option for select-type properties (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-color\"></a> `color` | `string` \\| `null` |\n| <a id=\"property-created_at\"></a> `created_at` | `string` |\n| <a id=\"property-display_order\"></a> `display_order` | `number` |\n| <a id=\"property-id\"></a> `id` | `string` |\n| <a id=\"property-property_definition_id\"></a> `property_definition_id` | `string` |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` |\n| <a id=\"property-value\"></a> `value` | [`PropertyOptionValue`](PropertyOptionValue.md) |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyOptionValue.md -->\n# Type Alias: PropertyOptionValue\n\n> **PropertyOptionValue** = \\{ `type`: `\"string\"`; `value`: `string`; \\} \\| \\{ `type`: `\"number\"`; `value`: `number`; \\}\n\nThe value of a property option - either a string or a number.\n\n## Union Members\n\n### Type Literal\n\n\\{ `type`: `\"string\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"string\"` | - |\n| `value` | `string` | String value for SelectString properties |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"number\"`; `value`: `number`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"number\"` | - |\n| `value` | `number` | Number value for SelectNumber properties |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyOwner.md -->\n# Type Alias: PropertyOwner\n\n> **PropertyOwner** = \\{ `scope`: `\"user\"`; `user_id`: `string`; \\} \\| \\{ `scope`: `\"team\"`; `team_id`: `string`; \\} \\| \\{ `database_id`: `string`; `scope`: `\"database\"`; \\} \\| \\{ `scope`: `\"system\"`; \\}\n\nDefines who owns a property - user-scoped, team-scoped, database-scoped, or system.\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyTargetEntityType.md -->\n# Type Alias: PropertyTargetEntityType\n\n> **PropertyTargetEntityType** = `\"CALL_RECORD\"` \\| `\"CHANNEL\"` \\| `\"CHAT\"` \\| `\"COMPANY\"` \\| `\"DATABASE_ROW\"` \\| `\"DOCUMENT\"` \\| `\"INITIATIVE\"` \\| `\"PROJECT\"` \\| `\"THREAD\"` \\| `\"USER\"`\n\nCanonical type of an entity receiving properties.\n\nTasks are documents at API boundaries. `Task` intentionally does not exist\nhere; task classification is resolved by the properties domain from the\ndocument subtype.\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyTargetReference.md -->\n# Type Alias: PropertyTargetReference\n\n> **PropertyTargetReference** = \\{ `entity_id`: `string`; `entity_type`: [`PropertyTargetEntityType`](PropertyTargetEntityType.md); \\}\n\nCanonical reference to an entity receiving properties.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | Entity identifier. |\n| <a id=\"property-entity_type\"></a> `entity_type` | [`PropertyTargetEntityType`](PropertyTargetEntityType.md) | Canonical entity type. |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyValue.md -->\n# Type Alias: PropertyValue\n\n> **PropertyValue** = \\{ `type`: `\"Boolean\"`; `value`: `boolean`; \\} \\| \\{ `type`: `\"Number\"`; `value`: `number`; \\} \\| \\{ `type`: `\"String\"`; `value`: `string`; \\} \\| \\{ `type`: `\"Date\"`; `value`: `string`; \\} \\| \\{ `type`: `\"SelectOption\"`; `value`: `string`[]; \\} \\| \\{ `type`: `\"EntityReference\"`; `value`: [`EntityReference`](EntityReference.md)[]; \\} \\| \\{ `type`: `\"Link\"`; `value`: `string`[]; \\}\n\nProperty value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to/from JSONB in the database.\n\n## Union Members\n\n### Type Literal\n\n\\{ `type`: `\"Boolean\"`; `value`: `boolean`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Boolean\"` | - |\n| `value` | `boolean` | Boolean value Serializes as: {\"type\": \"Boolean\", \"value\": true} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"Number\"`; `value`: `number`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Number\"` | - |\n| `value` | `number` | Numeric value Serializes as: {\"type\": \"Number\", \"value\": 42.5} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"String\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"String\"` | - |\n| `value` | `string` | String value Serializes as: {\"type\": \"String\", \"value\": \"text\"} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"Date\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Date\"` | - |\n| `value` | `string` | Date/timestamp value Serializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"SelectOption\"`; `value`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"SelectOption\"` | - |\n| `value` | `string`[] | Select option(s) - always an array (check is_multi_select to determine if single or multi) Single-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1) Multi-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+) |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"EntityReference\"`; `value`: [`EntityReference`](EntityReference.md)[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"EntityReference\"` | - |\n| `value` | [`EntityReference`](EntityReference.md)[] | Entity reference(s) - always an array (check is_multi_select to determine if single or multi) Single-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1) Multi-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+) |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"Link\"`; `value`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Link\"` | - |\n| `value` | `string`[] | Link value(s) - always an array (check is_multi_select to determine if single or multi) Single-select: {\"type\": \"Link\", \"value\": [\"https://example.com\"]} (length 0 or 1) Multi-select: {\"type\": \"Link\", \"value\": [\"https://example.com\", \"https://other.com\"]} (length 0+) |\n\n\n<!-- generated/properties/types.gen/type-aliases/SetPropertyValue.md -->\n# Type Alias: SetPropertyValue\n\n> **SetPropertyValue** = \\{ `type`: `\"boolean\"`; `value`: `boolean`; \\} \\| \\{ `type`: `\"date\"`; `value`: `string`; \\} \\| \\{ `type`: `\"number\"`; `value`: `number`; \\} \\| \\{ `type`: `\"string\"`; `value`: `string`; \\} \\| \\{ `option_id`: `string`; `type`: `\"select_option\"`; \\} \\| \\{ `option_ids`: `string`[]; `type`: `\"multi_select_option\"`; \\} \\| \\{ `reference`: [`EntityReference`](EntityReference.md); `type`: `\"entity_reference\"`; \\} \\| \\{ `references`: [`EntityReference`](EntityReference.md)[]; `type`: `\"multi_entity_reference\"`; \\} \\| \\{ `type`: `\"link\"`; `url`: `string`; \\} \\| \\{ `type`: `\"multi_link\"`; `urls`: `string`[]; \\}\n\nType-safe enum for setting entity property values - provides compile-time validation.\n\n\n<!-- generated/storage/types.gen/type-aliases/AccessLevel.md -->\n# Type Alias: AccessLevel\n\n> **AccessLevel** = `\"view\"` \\| `\"comment\"` \\| `\"edit\"` \\| `\"owner\"`\n\nOrdered from least to most access top -> bottom\n\n\n<!-- generated/storage/types.gen/type-aliases/EntityPermission.md -->\n# Type Alias: EntityPermission\n\n> **EntityPermission** = \\{ `access_level`: [`AccessLevel`](AccessLevel.md); `type`: `\"access_level\"`; \\} \\| \\{ `type`: `\"channel_view_only\"`; \\} \\| \\{ `role`: [`ParticipantRole`](ParticipantRole.md); `type`: `\"channel_role\"`; \\} \\| \\{ `role`: [`TeamRole`](TeamRole.md); `type`: `\"team_role\"`; \\}\n\nA user's permission for an entity, discriminated by entity kind.\n\nItems (documents, chats, projects, threads) use access levels.\nChannels use view-only permission or participant roles.\n\n## Union Members\n\n### Type Literal\n\n\\{ `access_level`: [`AccessLevel`](AccessLevel.md); `type`: `\"access_level\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `access_level` | [`AccessLevel`](AccessLevel.md) | The access level the user has. |\n| `type` | `\"access_level\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"channel_view_only\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `role`: [`ParticipantRole`](ParticipantRole.md); `type`: `\"channel_role\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `role` | [`ParticipantRole`](ParticipantRole.md) | The role the user has in the channel. |\n| `type` | `\"channel_role\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `role`: [`TeamRole`](TeamRole.md); `type`: `\"team_role\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `role` | [`TeamRole`](TeamRole.md) | The role the user has in the team. |\n| `type` | `\"team_role\"` | - |\n\n\n<!-- generated/storage/types.gen/type-aliases/ParticipantRole.md -->\n# Type Alias: ParticipantRole\n\n> **ParticipantRole** = `\"owner\"` \\| `\"admin\"` \\| `\"member\"`\n\nThe role a user has within a channel.\n\n\n<!-- generated/storage/types.gen/type-aliases/TeamRole.md -->\n# Type Alias: TeamRole\n\n> **TeamRole** = `\"member\"` \\| `\"admin\"` \\| `\"owner\"`\n\nThe role a user has within a team.\n\nOrdered least to most privileged so comparisons reflect access strength.\n\n\n<!-- src/entities/chats/chat/classes/Chat.md -->\n# Class: Chat\n\nA Macro AI chat.\n\n## Extends\n\n- [`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md)\\<`ChatDetail`\\>\n\n## Implements\n\n- [`Mentionable`](../../../../mentions/interfaces/Mentionable.md)\n\n## Properties\n\n| Property | Modifier | Type | Default value | Description | Overrides | Inherited from |\n| ------ | ------ | ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-access\"></a> `access` | `readonly` | [`EntityAccess`](../../../sharing/access/classes/EntityAccess.md) | `...` | Access requests and direct user grants. | - | - |\n| <a id=\"property-createdat\"></a> `createdAt` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | `...` | When the chat was created. | - | - |\n| <a id=\"property-entitytype\"></a> `entityType` | `readonly` | `\"chat\"` | `'chat'` | Favorites identify chats as `chat`. | [`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`entityType`](../../../entity/classes/PropertiedEntity.md#property-entitytype) | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | `undefined` | - | - | [`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`id`](../../../entity/classes/PropertiedEntity.md#property-id) |\n| <a id=\"property-messages\"></a> `messages` | `readonly` | () => `Promise`\\<[`ChatMessageWithAttachments`](../../../../../generated/cognition/types.gen/type-aliases/ChatMessageWithAttachments.md)[]\\> | `...` | The messages in the chat, with their attachments. | - | - |\n| <a id=\"property-model\"></a> `model` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | `...` | The model used to generate the chat (`provider/model` id), if set. | - | - |\n| <a id=\"property-name\"></a> `name` | `readonly` | () => `Promise`\\<`string`\\> | `...` | The chat's display name. | - | - |\n| <a id=\"property-project\"></a> `project` | `readonly` | () => `Promise`\\<[`Project`](../../../projects/project/classes/Project.md) \\| `undefined`\\> | `...` | The project this chat belongs to, if any. | - | - |\n| <a id=\"property-updatedat\"></a> `updatedAt` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | `...` | When the chat was last updated. | - | - |\n| <a id=\"property-search\"></a> `search` | `static` | (`client`, `query`, `searchOpts?`) => `AsyncGenerator`\\<`Chat`\\> | `...` | Search chats by name and content, most relevant first, auto-paginated. | - | - |\n\n## Methods\n\n### copy()\n\n> **copy**(): `Promise`\\<`Chat`\\>\n\nCopy the chat, returning a handle to the new copy.\n\n#### Returns\n\n`Promise`\\<`Chat`\\>\n\n***\n\n### delete()\n\n> **delete**(`opts?`): `Promise`\\<`void`\\>\n\nDelete the chat. Soft by default (reversible with [restore](#restore));\npass `permanent: true` to delete irreversibly.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts?` | \\{ `permanent?`: `boolean`; \\} |\n| `opts.permanent?` | `boolean` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### deleteProperty()\n\n> **deleteProperty**(`assignment`): `Promise`\\<`void`\\>\n\nRemove a property from this entity, given its [properties](#properties) entry.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `assignment` | [`EntityPropertyWithDefinition`](../../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`deleteProperty`](../../../entity/classes/PropertiedEntity.md#deleteproperty)\n\n***\n\n### favorite()\n\n> **favorite**(): `Promise`\\<`Chat`\\>\n\nAdd this entity to the user's favorites. Returns this handle for chaining.\nPlain unwrap: favoriting alters the user's favorites collection, not this\nentity's own detail, so there's nothing cached to invalidate.\n\n#### Returns\n\n`Promise`\\<`Chat`\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`favorite`](../../../entity/classes/PropertiedEntity.md#favorite)\n\n***\n\n### history()\n\n> **history**(): `Promise`\\<[`ConversationRecord`](../../../../../generated/cognition/types.gen/type-aliases/ConversationRecord.md)[]\\>\n\nThe chat's conversation history: titled records of messages with attachment ids.\n\n#### Returns\n\n`Promise`\\<[`ConversationRecord`](../../../../../generated/cognition/types.gen/type-aliases/ConversationRecord.md)[]\\>\n\n***\n\n### permission()\n\n> **permission**(): `Promise`\\<\\{ `permission`: [`EntityPermission`](../../../../../generated/storage/types.gen/type-aliases/EntityPermission.md); `status`: `\"access\"`; \\} \\| \\{ `status`: `\"no_access\"`; \\}\\>\n\nRead the caller's effective permission on this entity.\n\n#### Returns\n\n`Promise`\\<\\{ `permission`: [`EntityPermission`](../../../../../generated/storage/types.gen/type-aliases/EntityPermission.md); `status`: `\"access\"`; \\} \\| \\{ `status`: `\"no_access\"`; \\}\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`permission`](../../../entity/classes/PropertiedEntity.md#permission)\n\n***\n\n### properties()\n\n> **properties**(`opts?`): `Promise`\\<[`EntityPropertyWithDefinition`](../../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md)[]\\>\n\nThe properties set on this entity, each with its definition, value, and options.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts?` | \\{ `includeMetadata?`: `boolean`; \\} |\n| `opts.includeMetadata?` | `boolean` |\n\n#### Returns\n\n`Promise`\\<[`EntityPropertyWithDefinition`](../../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md)[]\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`properties`](../../../entity/classes/PropertiedEntity.md#properties)\n\n***\n\n### propertyReference()\n\n> **propertyReference**(): [`PropertyTargetReference`](../../../../../generated/properties/types.gen/type-aliases/PropertyTargetReference.md)\n\nThis entity's reference for bulk property operations.\n\n#### Returns\n\n[`PropertyTargetReference`](../../../../../generated/properties/types.gen/type-aliases/PropertyTargetReference.md)\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`propertyReference`](../../../entity/classes/PropertiedEntity.md#propertyreference)\n\n***\n\n### rename()\n\n> **rename**(`name`): `Promise`\\<`void`\\>\n\nRename the chat.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `name` | `string` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### restore()\n\n> **restore**(): `Promise`\\<`void`\\>\n\nRestore a soft-deleted chat.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### send()\n\n> **send**(`options`): `Promise`\\<[`ChatGeneration`](../../generation/classes/ChatGeneration.md)\\>\n\nSend a message and start a background generation. Tools may perform writes.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | `Omit`\\<[`HttpSendChatMessageRequest`](../../../../../generated/cognition/types.gen/type-aliases/HttpSendChatMessageRequest.md), `\"chat_id\"` \\| `\"attachments\"` \\| `\"additional_instructions\"`\\> & \\{ `additionalInstructions?`: `string`; `attachments?`: [`EntityReference`](../../../reference/type-aliases/EntityReference.md)[]; \\} |\n\n#### Returns\n\n`Promise`\\<[`ChatGeneration`](../../generation/classes/ChatGeneration.md)\\>\n\n***\n\n### setProperty()\n\n> **setProperty**(`property`, `value?`): `Promise`\\<`void`\\>\n\nSet a property value on this entity, or attach the property without a\nvalue when `value` is omitted.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `property` | [`PropertyDefinition`](../../../properties/property-definition/classes/PropertyDefinition.md) |\n| `value?` | [`SetPropertyValue`](../../../../../generated/properties/types.gen/type-aliases/SetPropertyValue.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`setProperty`](../../../entity/classes/PropertiedEntity.md#setproperty)\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`ChatResponse`](../../../../../generated/cognition/types.gen/type-aliases/ChatResponse.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`ChatResponse`](../../../../../generated/cognition/types.gen/type-aliases/ChatResponse.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`ChatResponse`](../../../../../generated/cognition/types.gen/type-aliases/ChatResponse.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`toJSON`](../../../entity/classes/PropertiedEntity.md#tojson)\n\n***\n\n### toMention()\n\n> **toMention**(): [`MentionPart`](../../../../mentions/interfaces/MentionPart.md)\n\n#### Returns\n\n[`MentionPart`](../../../../mentions/interfaces/MentionPart.md)\n\n#### Implementation of\n\n[`Mentionable`](../../../../mentions/interfaces/Mentionable.md).[`toMention`](../../../../mentions/interfaces/Mentionable.md#tomention)\n\n***\n\n### unfavorite()\n\n> **unfavorite**(): `Promise`\\<`Chat`\\>\n\nRemove this entity from the user's favorites. Returns this handle for chaining.\n\n#### Returns\n\n`Promise`\\<`Chat`\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`unfavorite`](../../../entity/classes/PropertiedEntity.md#unfavorite)\n\n***\n\n### updatePropertyOptions()\n\n> **updatePropertyOptions**(`changes`): `Promise`\\<[`BulkUpdateEntityPropertyOptionsResponse`](../../../../../generated/properties/types.gen/type-aliases/BulkUpdateEntityPropertyOptionsResponse.md)\\>\n\nApply multi-select option deltas atomically across this entity's properties.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `changes` | [`PropertyOptionDelta`](../../../entity/interfaces/PropertyOptionDelta.md)[] |\n\n#### Returns\n\n`Promise`\\<[`BulkUpdateEntityPropertyOptionsResponse`](../../../../../generated/properties/types.gen/type-aliases/BulkUpdateEntityPropertyOptionsResponse.md)\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`updatePropertyOptions`](../../../entity/classes/PropertiedEntity.md#updatepropertyoptions)\n\n***\n\n### webUrl()\n\n> **webUrl**(): `string`\n\nThe chat's URL in the Macro web app.\n\n#### Returns\n\n`string`\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `id`): `Chat`\n\nA handle to a chat by id. Details load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `id` | `string` |\n\n#### Returns\n\n`Chat`\n\n***\n\n### create()\n\n> `static` **create**(`client`, `opts?`): `Promise`\\<`Chat`\\>\n\nCreate a chat, optionally named and attached to a project.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `opts?` | \\{ `name?`: `string`; `project?`: [`Project`](../../../projects/project/classes/Project.md); \\} |\n| `opts.name?` | `string` |\n| `opts.project?` | [`Project`](../../../projects/project/classes/Project.md) |\n\n#### Returns\n\n`Promise`\\<`Chat`\\>\n\n\n<!-- src/entities/chats/generation/classes/ChatGeneration.md -->\n# Class: ChatGeneration\n\nA background chat generation. The stream belongs to exactly one chat.\n\n## Properties\n\n| Property | Modifier | Type | Description |\n| ------ | ------ | ------ | ------ |\n| <a id=\"property-chat\"></a> `chat` | `readonly` | [`Chat`](../../chat/classes/Chat.md) | Parent chat. |\n| <a id=\"property-id\"></a> `id` | `readonly` | `string` | Stream identity. |\n| <a id=\"property-message\"></a> `message` | `readonly` | [`ChatMessage`](ChatMessage.md) | AI response message for this generation. |\n\n## Methods\n\n### stop()\n\n> **stop**(): `Promise`\\<`void`\\>\n\nRequest cancellation of this generation.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `chatId`: `string`; `id`: `string`; `messageId`: `string`; \\}\n\nSerialize scoped identity.\n\n#### Returns\n\n\\{ `chatId`: `string`; `id`: `string`; `messageId`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `chatId` | `string` |\n| `id` | `string` |\n| `messageId` | `string` |\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `chat`, `id`, `message`): `ChatGeneration`\n\nConstruct from a send receipt.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `chat` | [`Chat`](../../chat/classes/Chat.md) |\n| `id` | `string` |\n| `message` | [`ChatMessage`](ChatMessage.md) |\n\n#### Returns\n\n`ChatGeneration`\n\n\n<!-- src/entities/chats/generation/classes/ChatMessage.md -->\n# Class: ChatMessage\n\nA message scoped to an AI chat.\n\n## Extends\n\n- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\\<[`ChatMessageWithAttachments`](../../../../../generated/cognition/types.gen/type-aliases/ChatMessageWithAttachments.md)\\>\n\n## Properties\n\n| Property | Modifier | Type | Description | Inherited from |\n| ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-chat\"></a> `chat` | `readonly` | [`Chat`](../../chat/classes/Chat.md) | Parent chat. | - |\n| <a id=\"property-content\"></a> `content` | `readonly` | () => `Promise`\\<[`ChatMessageContent`](../../../../../generated/cognition/types.gen/type-aliases/ChatMessageContent.md)\\> | The message's generated content. | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |\n| <a id=\"property-role\"></a> `role` | `readonly` | () => `Promise`\\<[`Role`](../../../../../generated/cognition/types.gen/type-aliases/Role.md)\\> | Role of the message author. | - |\n\n## Methods\n\n### refresh()\n\n> **refresh**(): `Promise`\\<`void`\\>\n\nReload after a running generation changes or finishes.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `chatId`: `string`; `detail?`: [`ChatMessageWithAttachments`](../../../../../generated/cognition/types.gen/type-aliases/ChatMessageWithAttachments.md); `id`: `string`; \\}\n\nSerialize scoped identity and any loaded message.\n\n#### Returns\n\n\\{ `chatId`: `string`; `detail?`: [`ChatMessageWithAttachments`](../../../../../generated/cognition/types.gen/type-aliases/ChatMessageWithAttachments.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `chatId` | `string` |\n| `detail?` | [`ChatMessageWithAttachments`](../../../../../generated/cognition/types.gen/type-aliases/ChatMessageWithAttachments.md) |\n| `id` | `string` |\n\n#### Overrides\n\n[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `chat`, `id`): `ChatMessage`\n\nConstruct a chat message handle.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `chat` | [`Chat`](../../chat/classes/Chat.md) |\n| `id` | `string` |\n\n#### Returns\n\n`ChatMessage`\n\n\n<!-- src/entities/chats/namespace/classes/ChatNamespace.md -->\n# Class: ChatNamespace\n\n## Constructors\n\n### Constructor\n\n> **new ChatNamespace**(`client`): `ChatNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`ChatNamespace`\n\n## Methods\n\n### byId()\n\n> **byId**(`id`): [`Chat`](../../chat/classes/Chat.md)\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`Chat`](../../chat/classes/Chat.md)\n\n***\n\n### create()\n\n> **create**(`opts?`): `Promise`\\<[`Chat`](../../chat/classes/Chat.md)\\>\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts?` | \\{ `name?`: `string`; `project?`: [`Project`](../../../projects/project/classes/Project.md); \\} |\n| `opts.name?` | `string` |\n| `opts.project?` | [`Project`](../../../projects/project/classes/Project.md) |\n\n#### Returns\n\n`Promise`\\<[`Chat`](../../chat/classes/Chat.md)\\>\n\n***\n\n### search()\n\n> **search**(`query`, `opts?`): `AsyncGenerator`\\<[`Chat`](../../chat/classes/Chat.md)\\>\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `query` | `string` |\n| `opts?` | [`SearchOpts`](../../../search/interfaces/SearchOpts.md) |\n\n#### Returns\n\n`AsyncGenerator`\\<[`Chat`](../../chat/classes/Chat.md)\\>\n"},{"name": "crm",- "description": "Work with CRM records.",- "overview": "<!-- src/entities/crm/namespace/classes/CrmNamespace.md -->\n# Class: CrmNamespace\n\n## Constructors\n\n### Constructor\n\n> **new CrmNamespace**(`client`): `CrmNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`CrmNamespace`\n\n## Methods\n\n### companyById()\n\n> **companyById**(`id`): [`Company`](../../company/classes/Company.md)\n\nA handle to a CRM company by id.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`Company`](../../company/classes/Company.md)\n\n***\n\n### contactByEmail()\n\n> **contactByEmail**(`email`): `Promise`\\<[`Contact`](../../contact/classes/Contact.md) \\| `undefined`\\>\n\nResolve a CRM contact by email in the caller's current team, if present.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `email` | `string` |\n\n#### Returns\n\n`Promise`\\<[`Contact`](../../contact/classes/Contact.md) \\| `undefined`\\>\n\n***\n\n### contactById()\n\n> **contactById**(`id`): [`Contact`](../../contact/classes/Contact.md)\n\nA handle to a CRM contact by id.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`Contact`](../../contact/classes/Contact.md)\n\n***\n\n### createCompany()\n\n> **createCompany**(`opts`): `Promise`\\<[`Company`](../../company/classes/Company.md)\\>\n\nCreate a CRM company for the caller's current team.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts` | [`CreateCrmCompanyRequest`](../../../../../generated/storage/types.gen/type-aliases/CreateCrmCompanyRequest.md) |\n\n#### Returns\n\n`Promise`\\<[`Company`](../../company/classes/Company.md)\\>\n\n***\n\n### resetStages()\n\n> **resetStages**(): `Promise`\\<`void`\\>\n\nReset the caller's current team's deal stages to the defaults.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### searchCompanies()\n\n> **searchCompanies**(`query`): `AsyncGenerator`\\<[`Company`](../../company/classes/Company.md)\\>\n\nSearch CRM companies by name/domain, most relevant first, auto-paginated.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `query` | `string` |\n\n#### Returns\n\n`AsyncGenerator`\\<[`Company`](../../company/classes/Company.md)\\>\n\n***\n\n### searchContacts()\n\n> **searchContacts**(`query`, `opts?`): `Promise`\\<[`Contact`](../../contact/classes/Contact.md)[]\\>\n\nSearch the caller's current team's CRM contacts whose email or name\ncontains `query` (case-insensitive), most recently interacted first.\nAn empty query lists the most recent contacts.\n\n#### Parameters\n\n| Parameter | Type | Description |\n| ------ | ------ | ------ |\n| `query` | `string` | - |\n| `opts?` | \\{ `limit?`: `number`; \\} | - |\n| `opts.limit?` | `number` | Maximum contacts to return (1-500, default 20). |\n\n#### Returns\n\n`Promise`\\<[`Contact`](../../contact/classes/Contact.md)[]\\>\n\n***\n\n### setStages()\n\n> **setStages**(`stages`): `Promise`\\<[`CrmStagesResponse`](../../../../../generated/storage/types.gen/type-aliases/CrmStagesResponse.md)\\>\n\nReplace the caller's current team's deal stages, in pipeline order.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `stages` | [`ReplaceCrmStagesRequest`](../../../../../generated/storage/types.gen/type-aliases/ReplaceCrmStagesRequest.md) |\n\n#### Returns\n\n`Promise`\\<[`CrmStagesResponse`](../../../../../generated/storage/types.gen/type-aliases/CrmStagesResponse.md)\\>\n\n***\n\n### settings()\n\n> **settings**(): `Promise`\\<[`CrmTeamSettingsResponse`](../../../../../generated/storage/types.gen/type-aliases/CrmTeamSettingsResponse.md)\\>\n\nThe caller's current team's CRM settings.\n\n#### Returns\n\n`Promise`\\<[`CrmTeamSettingsResponse`](../../../../../generated/storage/types.gen/type-aliases/CrmTeamSettingsResponse.md)\\>\n\n***\n\n### updateSettings()\n\n> **updateSettings**(`settings`): `Promise`\\<[`CrmTeamSettingsResponse`](../../../../../generated/storage/types.gen/type-aliases/CrmTeamSettingsResponse.md)\\>\n\nPartially update the caller's current team's CRM settings.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `settings` | [`UpdateCrmTeamSettingsRequest`](../../../../../generated/storage/types.gen/type-aliases/UpdateCrmTeamSettingsRequest.md) |\n\n#### Returns\n\n`Promise`\\<[`CrmTeamSettingsResponse`](../../../../../generated/storage/types.gen/type-aliases/CrmTeamSettingsResponse.md)\\>\n",- "documentation": "# Macro SDK: crm\n\nGenerated by TypeDoc. Paths below refer to the canonical Markdown hierarchy. Other entity handles are documented in their named section; request core for shared SDK helpers.\n\n<!-- generated/properties/types.gen/type-aliases/BulkUpdateEntityPropertyOptionsResponse.md -->\n# Type Alias: BulkUpdateEntityPropertyOptionsResponse\n\n> **BulkUpdateEntityPropertyOptionsResponse** = \\{ `properties`: [`EntityPropertyOptionSelectionResponse`](EntityPropertyOptionSelectionResponse.md)[]; \\}\n\nResponse for a bulk option update: each property's reconciled final ids.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-properties\"></a> `properties` | [`EntityPropertyOptionSelectionResponse`](EntityPropertyOptionSelectionResponse.md)[] | The final option ids per updated property. |\n\n\n<!-- generated/properties/types.gen/type-aliases/DataType.md -->\n# Type Alias: DataType\n\n> **DataType** = `\"BOOLEAN\"` \\| `\"DATE\"` \\| `\"NUMBER\"` \\| `\"STRING\"` \\| `\"SELECT_NUMBER\"` \\| `\"SELECT_STRING\"` \\| `\"TAG\"` \\| `\"ENTITY\"` \\| `\"LINK\"`\n\nData type for property values, determining storage and validation.\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityProperty.md -->\n# Type Alias: EntityProperty\n\n> **EntityProperty** = \\{ `created_at`: `string`; `entity_id`: `string`; `entity_type`: [`EntityType`](EntityType.md); `id`: `string`; `property_definition_id`: `string`; `updated_at`: `string`; \\}\n\nAssignment of a property definition to a specific entity (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-created_at\"></a> `created_at` | `string` |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` |\n| <a id=\"property-entity_type\"></a> `entity_type` | [`EntityType`](EntityType.md) |\n| <a id=\"property-id\"></a> `id` | `string` |\n| <a id=\"property-property_definition_id\"></a> `property_definition_id` | `string` |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityPropertyOptionSelectionResponse.md -->\n# Type Alias: EntityPropertyOptionSelectionResponse\n\n> **EntityPropertyOptionSelectionResponse** = \\{ `option_ids`: `string`[]; `property_id`: `string`; \\}\n\nThe reconciled final option ids stored for one property after a bulk update.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-option_ids\"></a> `option_ids` | `string`[] | The final option ids the server persisted, in stored order. |\n| <a id=\"property-property_id\"></a> `property_id` | `string` | The property definition the options belong to. |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md -->\n# Type Alias: EntityPropertyWithDefinition\n\n> **EntityPropertyWithDefinition** = \\{ `definition`: [`PropertyDefinition`](PropertyDefinition.md); `options?`: [`PropertyOption`](PropertyOption.md)[] \\| `null`; `property`: [`EntityProperty`](EntityProperty.md); `value?`: `null` \\| [`PropertyValue`](PropertyValue.md); \\}\n\nEntity property with its definition, value, and options (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-definition\"></a> `definition` | [`PropertyDefinition`](PropertyDefinition.md) |\n| <a id=\"property-options\"></a> `options?` | [`PropertyOption`](PropertyOption.md)[] \\| `null` |\n| <a id=\"property-property\"></a> `property` | [`EntityProperty`](EntityProperty.md) |\n| <a id=\"property-value\"></a> `value?` | `null` \\| [`PropertyValue`](PropertyValue.md) |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityReference.md -->\n# Type Alias: EntityReference\n\n> **EntityReference** = \\{ `entity_id`: `string`; `entity_type`: [`EntityType`](EntityType.md); `specific_message_id?`: `string` \\| `null`; \\}\n\nEntity reference for entity-type property values.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | - |\n| <a id=\"property-entity_type\"></a> `entity_type` | [`EntityType`](EntityType.md) | - |\n| <a id=\"property-specific_message_id\"></a> `specific_message_id?` | `string` \\| `null` | For CHANNEL, CHAT, THREAD entity types - optional specific message ID. This allows referencing a specific message within a thread/channel/chat. |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityType.md -->\n# Type Alias: EntityType\n\n> **EntityType** = `\"CALENDAR_EVENT\"` \\| `\"CALL_RECORD\"` \\| `\"CHANNEL\"` \\| `\"CHAT\"` \\| `\"COMPANY\"` \\| `\"DATABASE_ROW\"` \\| `\"CONTACT\"` \\| `\"DOCUMENT\"` \\| `\"INITIATIVE\"` \\| `\"PROJECT\"` \\| `\"TASK\"` \\| `\"THREAD\"` \\| `\"USER\"`\n\nType of entity that can be referenced by entity properties.\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyDefinition.md -->\n# Type Alias: PropertyDefinition\n\n> **PropertyDefinition** = \\{ `created_at`: `string`; `data_type`: [`DataType`](DataType.md); `display_name`: `string`; `id`: `string`; `is_metadata`: `boolean`; `is_multi_select`: `boolean`; `is_system`: `boolean`; `owner`: [`PropertyOwner`](PropertyOwner.md); `specific_entity_type`: `null` \\| [`EntityType`](EntityType.md); `updated_at`: `string`; \\}\n\nProperty definition model (service representation).\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | - |\n| <a id=\"property-data_type\"></a> `data_type` | [`DataType`](DataType.md) | - |\n| <a id=\"property-display_name\"></a> `display_name` | `string` | - |\n| <a id=\"property-id\"></a> `id` | `string` | - |\n| <a id=\"property-is_metadata\"></a> `is_metadata` | `boolean` | Flag to indicate if this is a system-generated metadata property. Not stored in database - computed at service layer. |\n| <a id=\"property-is_multi_select\"></a> `is_multi_select` | `boolean` | - |\n| <a id=\"property-is_system\"></a> `is_system` | `boolean` | Flag to indicate if this is a system property (stored in DB). |\n| <a id=\"property-owner\"></a> `owner` | [`PropertyOwner`](PropertyOwner.md) | - |\n| <a id=\"property-specific_entity_type\"></a> `specific_entity_type` | `null` \\| [`EntityType`](EntityType.md) | - |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` | - |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyOption.md -->\n# Type Alias: PropertyOption\n\n> **PropertyOption** = \\{ `color`: `string` \\| `null`; `created_at`: `string`; `display_order`: `number`; `id`: `string`; `property_definition_id`: `string`; `updated_at`: `string`; `value`: [`PropertyOptionValue`](PropertyOptionValue.md); \\}\n\nA selectable option for select-type properties (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-color\"></a> `color` | `string` \\| `null` |\n| <a id=\"property-created_at\"></a> `created_at` | `string` |\n| <a id=\"property-display_order\"></a> `display_order` | `number` |\n| <a id=\"property-id\"></a> `id` | `string` |\n| <a id=\"property-property_definition_id\"></a> `property_definition_id` | `string` |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` |\n| <a id=\"property-value\"></a> `value` | [`PropertyOptionValue`](PropertyOptionValue.md) |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyOptionValue.md -->\n# Type Alias: PropertyOptionValue\n\n> **PropertyOptionValue** = \\{ `type`: `\"string\"`; `value`: `string`; \\} \\| \\{ `type`: `\"number\"`; `value`: `number`; \\}\n\nThe value of a property option - either a string or a number.\n\n## Union Members\n\n### Type Literal\n\n\\{ `type`: `\"string\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"string\"` | - |\n| `value` | `string` | String value for SelectString properties |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"number\"`; `value`: `number`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"number\"` | - |\n| `value` | `number` | Number value for SelectNumber properties |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyOwner.md -->\n# Type Alias: PropertyOwner\n\n> **PropertyOwner** = \\{ `scope`: `\"user\"`; `user_id`: `string`; \\} \\| \\{ `scope`: `\"team\"`; `team_id`: `string`; \\} \\| \\{ `database_id`: `string`; `scope`: `\"database\"`; \\} \\| \\{ `scope`: `\"system\"`; \\}\n\nDefines who owns a property - user-scoped, team-scoped, database-scoped, or system.\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyTargetEntityType.md -->\n# Type Alias: PropertyTargetEntityType\n\n> **PropertyTargetEntityType** = `\"CALL_RECORD\"` \\| `\"CHANNEL\"` \\| `\"CHAT\"` \\| `\"COMPANY\"` \\| `\"DATABASE_ROW\"` \\| `\"DOCUMENT\"` \\| `\"INITIATIVE\"` \\| `\"PROJECT\"` \\| `\"THREAD\"` \\| `\"USER\"`\n\nCanonical type of an entity receiving properties.\n\nTasks are documents at API boundaries. `Task` intentionally does not exist\nhere; task classification is resolved by the properties domain from the\ndocument subtype.\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyTargetReference.md -->\n# Type Alias: PropertyTargetReference\n\n> **PropertyTargetReference** = \\{ `entity_id`: `string`; `entity_type`: [`PropertyTargetEntityType`](PropertyTargetEntityType.md); \\}\n\nCanonical reference to an entity receiving properties.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | Entity identifier. |\n| <a id=\"property-entity_type\"></a> `entity_type` | [`PropertyTargetEntityType`](PropertyTargetEntityType.md) | Canonical entity type. |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyValue.md -->\n# Type Alias: PropertyValue\n\n> **PropertyValue** = \\{ `type`: `\"Boolean\"`; `value`: `boolean`; \\} \\| \\{ `type`: `\"Number\"`; `value`: `number`; \\} \\| \\{ `type`: `\"String\"`; `value`: `string`; \\} \\| \\{ `type`: `\"Date\"`; `value`: `string`; \\} \\| \\{ `type`: `\"SelectOption\"`; `value`: `string`[]; \\} \\| \\{ `type`: `\"EntityReference\"`; `value`: [`EntityReference`](EntityReference.md)[]; \\} \\| \\{ `type`: `\"Link\"`; `value`: `string`[]; \\}\n\nProperty value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to/from JSONB in the database.\n\n## Union Members\n\n### Type Literal\n\n\\{ `type`: `\"Boolean\"`; `value`: `boolean`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Boolean\"` | - |\n| `value` | `boolean` | Boolean value Serializes as: {\"type\": \"Boolean\", \"value\": true} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"Number\"`; `value`: `number`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Number\"` | - |\n| `value` | `number` | Numeric value Serializes as: {\"type\": \"Number\", \"value\": 42.5} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"String\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"String\"` | - |\n| `value` | `string` | String value Serializes as: {\"type\": \"String\", \"value\": \"text\"} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"Date\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Date\"` | - |\n| `value` | `string` | Date/timestamp value Serializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"SelectOption\"`; `value`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"SelectOption\"` | - |\n| `value` | `string`[] | Select option(s) - always an array (check is_multi_select to determine if single or multi) Single-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1) Multi-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+) |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"EntityReference\"`; `value`: [`EntityReference`](EntityReference.md)[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"EntityReference\"` | - |\n| `value` | [`EntityReference`](EntityReference.md)[] | Entity reference(s) - always an array (check is_multi_select to determine if single or multi) Single-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1) Multi-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+) |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"Link\"`; `value`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Link\"` | - |\n| `value` | `string`[] | Link value(s) - always an array (check is_multi_select to determine if single or multi) Single-select: {\"type\": \"Link\", \"value\": [\"https://example.com\"]} (length 0 or 1) Multi-select: {\"type\": \"Link\", \"value\": [\"https://example.com\", \"https://other.com\"]} (length 0+) |\n\n\n<!-- generated/properties/types.gen/type-aliases/SetPropertyValue.md -->\n# Type Alias: SetPropertyValue\n\n> **SetPropertyValue** = \\{ `type`: `\"boolean\"`; `value`: `boolean`; \\} \\| \\{ `type`: `\"date\"`; `value`: `string`; \\} \\| \\{ `type`: `\"number\"`; `value`: `number`; \\} \\| \\{ `type`: `\"string\"`; `value`: `string`; \\} \\| \\{ `option_id`: `string`; `type`: `\"select_option\"`; \\} \\| \\{ `option_ids`: `string`[]; `type`: `\"multi_select_option\"`; \\} \\| \\{ `reference`: [`EntityReference`](EntityReference.md); `type`: `\"entity_reference\"`; \\} \\| \\{ `references`: [`EntityReference`](EntityReference.md)[]; `type`: `\"multi_entity_reference\"`; \\} \\| \\{ `type`: `\"link\"`; `url`: `string`; \\} \\| \\{ `type`: `\"multi_link\"`; `urls`: `string`[]; \\}\n\nType-safe enum for setting entity property values - provides compile-time validation.\n\n\n<!-- generated/storage/types.gen/type-aliases/BotSenderProfile.md -->\n# Type Alias: BotSenderProfile\n\n> **BotSenderProfile** = \\{ `avatar_url?`: `string` \\| `null`; `name`: `string`; \\}\n\nPublic bot profile attached to bot-authored messages.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-avatar_url\"></a> `avatar_url?` | `string` \\| `null` | Bot avatar URL. |\n| <a id=\"property-name\"></a> `name` | `string` | Bot display name. |\n\n\n<!-- generated/storage/types.gen/type-aliases/CountedReaction.md -->\n# Type Alias: CountedReaction\n\n> **CountedReaction** = \\{ `emoji`: `string`; `users`: `string`[]; \\}\n\nReaction emoji and the users who added it.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-emoji\"></a> `emoji` | `string` | Emoji being reacted with. |\n| <a id=\"property-users\"></a> `users` | `string`[] | User identifiers. |\n\n\n<!-- generated/storage/types.gen/type-aliases/CreateCrmCompanyRequest.md -->\n# Type Alias: CreateCrmCompanyRequest\n\n> **CreateCrmCompanyRequest** = \\{ `domain`: `string`; `name`: `string`; \\}\n\nRequest body for `POST /crm/companies`.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-domain\"></a> `domain` | `string` | The company's email domain, e.g. \"acme.com\". Must be a bare domain (no scheme, path, or email) and not a generic email provider domain. |\n| <a id=\"property-name\"></a> `name` | `string` | Display name for the company. Team-scoped: overrides the domain-directory name on every read path. |\n\n\n<!-- generated/storage/types.gen/type-aliases/CrmCompanyResponse.md -->\n# Type Alias: CrmCompanyResponse\n\n> **CrmCompanyResponse** = \\{ `contacts`: [`CrmContactResponse`](CrmContactResponse.md)[]; `createdAt`: `string`; `description?`: `string` \\| `null`; `domains`: [`CrmDomainResponse`](CrmDomainResponse.md)[]; `emailSync`: `boolean`; `hidden`: `boolean`; `id`: `string`; `name?`: `string` \\| `null`; `teamId`: `string`; `updatedAt`: `string`; \\}\n\nA CRM company as returned by `GET /crm/companies/{company_id}`.\nMirrors the soup-listed `crmCompany` shape (`name` / `description`\nresolved from the primary domain's `crm_domain_directory` entry) and\nembeds the company's contacts so the panel can render in a single\nrequest.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-contacts\"></a> `contacts` | [`CrmContactResponse`](CrmContactResponse.md)[] | Contacts attached to this company. Hidden contacts are filtered out for non-admin viewers. |\n| <a id=\"property-createdat\"></a> `createdAt` | `string` | Earliest known interaction with this company. |\n| <a id=\"property-description\"></a> `description?` | `string` \\| `null` | Display description from the primary domain's directory entry. |\n| <a id=\"property-domains\"></a> `domains` | [`CrmDomainResponse`](CrmDomainResponse.md)[] | All domains associated with this company, ordered by creation time ascending (primary first). |\n| <a id=\"property-emailsync\"></a> `emailSync` | `boolean` | Whether email sync is enabled for this company. |\n| <a id=\"property-hidden\"></a> `hidden` | `boolean` | Whether the company is hidden from CRM listings for the requesting team. Non-admin viewers never see `hidden = true` rows (the endpoint 404s for them); admin/owner callers see hidden companies so they can render the right toggle state. |\n| <a id=\"property-id\"></a> `id` | `string` | The id of the company. |\n| <a id=\"property-name\"></a> `name?` | `string` \\| `null` | Display name from the primary domain's directory entry, or `None` when unresolved. |\n| <a id=\"property-teamid\"></a> `teamId` | `string` | The id of the team that owns this company record. |\n| <a id=\"property-updatedat\"></a> `updatedAt` | `string` | Most recent known interaction with this company. |\n\n\n<!-- generated/storage/types.gen/type-aliases/CrmContactResponse.md -->\n# Type Alias: CrmContactResponse\n\n> **CrmContactResponse** = \\{ `companyId`: `string`; `createdAt`: `string`; `email`: `string`; `firstInteraction`: `string`; `hidden`: `boolean`; `id`: `string`; `lastInteraction`: `string`; `name?`: `string` \\| `null`; `updatedAt`: `string`; \\}\n\nA CRM contact as returned by `GET /crm/companies/{company_id}/contacts`.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-companyid\"></a> `companyId` | `string` | The id of the company the contact belongs to. |\n| <a id=\"property-createdat\"></a> `createdAt` | `string` | When the contact record was created. |\n| <a id=\"property-email\"></a> `email` | `string` | The contact's email address. |\n| <a id=\"property-firstinteraction\"></a> `firstInteraction` | `string` | Earliest known interaction with this contact. |\n| <a id=\"property-hidden\"></a> `hidden` | `boolean` | Whether the contact is hidden from CRM listings for the requesting team. Non-admin viewers never see `hidden = true` rows (the endpoint filters them out); admin/owner callers see hidden contacts so they can render the right toggle state. |\n| <a id=\"property-id\"></a> `id` | `string` | The id of the contact record. |\n| <a id=\"property-lastinteraction\"></a> `lastInteraction` | `string` | Most recent known interaction with this contact. |\n| <a id=\"property-name\"></a> `name?` | `string` \\| `null` | Display name observed for the contact, if any. |\n| <a id=\"property-updatedat\"></a> `updatedAt` | `string` | When the contact record was last updated. |\n\n\n<!-- generated/storage/types.gen/type-aliases/CrmDomainResponse.md -->\n# Type Alias: CrmDomainResponse\n\n> **CrmDomainResponse** = \\{ `companyId`: `string`; `createdAt`: `string`; `domain`: `string`; `id`: `string`; \\}\n\nA CRM domain associated with a company.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-companyid\"></a> `companyId` | `string` | The id of the company the domain belongs to. |\n| <a id=\"property-createdat\"></a> `createdAt` | `string` | When the domain record was created. |\n| <a id=\"property-domain\"></a> `domain` | `string` | The domain (e.g. \"acme.com\"). |\n| <a id=\"property-id\"></a> `id` | `string` | The id of the domain record. |\n\n\n<!-- generated/storage/types.gen/type-aliases/CrmPermissionRole.md -->\n# Type Alias: CrmPermissionRole\n\n> **CrmPermissionRole** = `\"admin\"` \\| `\"owner\"`\n\nMinimum team role required for a CRM governance capability. Members\ncan edit visible CRM records (e.g. company properties), but the\ngovernance capabilities these settings gate stay restricted to\nadmin (default) vs owner. Maps to the `team_role` Postgres enum;\n`member` is deliberately not representable.\n\n\n<!-- generated/storage/types.gen/type-aliases/CrmStageInput.md -->\n# Type Alias: CrmStageInput\n\n> **CrmStageInput** = \\{ `id?`: `string` \\| `null`; `label`: `string`; \\}\n\nOne stage in a `PUT /crm/stages` body.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-id\"></a> `id?` | `string` \\| `null` | Existing stage to keep; omit to add one. |\n| <a id=\"property-label\"></a> `label` | `string` | Label after the update; non-blank and unique within the set. |\n\n\n<!-- generated/storage/types.gen/type-aliases/CrmStageResponse.md -->\n# Type Alias: CrmStageResponse\n\n> **CrmStageResponse** = \\{ `id`: `string`; `label`: `string`; \\}\n\nOne stage of the team's custom pipeline.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-id\"></a> `id` | `string` | Property option id companies carry as their stage value. |\n| <a id=\"property-label\"></a> `label` | `string` | Label. |\n\n\n<!-- generated/storage/types.gen/type-aliases/CrmStagesResponse.md -->\n# Type Alias: CrmStagesResponse\n\n> **CrmStagesResponse** = \\{ `definition_id`: `string`; `stages`: [`CrmStageResponse`](CrmStageResponse.md)[]; \\}\n\nThe team's custom stage set.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-definition_id\"></a> `definition_id` | `string` | Team-scoped stage definition id. |\n| <a id=\"property-stages\"></a> `stages` | [`CrmStageResponse`](CrmStageResponse.md)[] | Stages in pipeline order. |\n\n\n<!-- generated/storage/types.gen/type-aliases/CrmTeamSettingsResponse.md -->\n# Type Alias: CrmTeamSettingsResponse\n\n> **CrmTeamSettingsResponse** = \\{ `closed_stage_ids?`: `string`[] \\| `null`; `default_team_view_id?`: `string` \\| `null`; `delete_records_role`: [`CrmPermissionRole`](CrmPermissionRole.md); `edit_stages_role`: [`CrmPermissionRole`](CrmPermissionRole.md); `legacy_stage_ids`: \\{\\[`key`: `string`\\]: `string`; \\}; `move_closed_deals_role`: [`CrmPermissionRole`](CrmPermissionRole.md); `team_views`: `unknown`; \\}\n\nThe team's CRM configuration (everything on `team_crm_settings`\nexcept the `crm_enabled` killswitch, which is managed via\n`PATCH /team/crm` on the auth service).\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-closed_stage_ids\"></a> `closed_stage_ids?` | `string`[] \\| `null` | Stage option ids counting as closed deals; absent = the client falls back to its label heuristic. |\n| <a id=\"property-default_team_view_id\"></a> `default_team_view_id?` | `string` \\| `null` | Team view applied by default when a member opens the CRM view. |\n| <a id=\"property-delete_records_role\"></a> `delete_records_role` | [`CrmPermissionRole`](CrmPermissionRole.md) | Who can delete (hide) CRM records. |\n| <a id=\"property-edit_stages_role\"></a> `edit_stages_role` | [`CrmPermissionRole`](CrmPermissionRole.md) | Who can change the deal stage set in CRM settings. |\n| <a id=\"property-legacy_stage_ids\"></a> `legacy_stage_ids` | \\{\\[`key`: `string`\\]: `string`; \\} | System stage option id to team stage option id for seeded stages. |\n| <a id=\"property-move_closed_deals_role\"></a> `move_closed_deals_role` | [`CrmPermissionRole`](CrmPermissionRole.md) | Who can move deals out of a closed stage. |\n| <a id=\"property-team_views\"></a> `team_views` | `unknown` | Team saved views — an opaque JSON array owned by the frontend. |\n\n\n<!-- generated/storage/types.gen/type-aliases/DocumentId.md -->\n# Type Alias: DocumentId\n\n> **DocumentId** = `string`\n\nA validated document identifier. Historical document ids need not be UUIDs.\n\n\n<!-- generated/storage/types.gen/type-aliases/ImportedAuthor.md -->\n# Type Alias: ImportedAuthor\n\n> **ImportedAuthor** = \\{ `name`: `string`; \\}\n\nDisplay attribution for a comment imported from an external document.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-name\"></a> `name` | `string` | Original author text; never interpreted as an authenticated principal. |\n\n\n<!-- generated/storage/types.gen/type-aliases/Message.md -->\n# Type Alias: Message\n\n> **Message** = \\{ `attachments`: [`MessageAttachment`](MessageAttachment.md)[]; `bot_profile?`: `null` \\| [`BotSenderProfile`](BotSenderProfile.md); `content`: `string`; `created_at`: `string`; `deleted_at?`: `string` \\| `null`; `edited_at?`: `string` \\| `null`; `guest_name?`: `string` \\| `null`; `id`: `string`; `imported_author?`: `null` \\| [`ImportedAuthor`](ImportedAuthor.md); `mentions`: [`SimpleMention`](SimpleMention.md)[]; `parent`: [`MessageParent`](MessageParent.md); `reactions`: [`CountedReaction`](CountedReaction.md)[]; `sender_id`: `string`; `thread_id?`: `string` \\| `null`; `triggered_by?`: `string` \\| `null`; `updated_at`: `string`; \\}\n\nShared message representation for channel timelines and entity discussions.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-attachments\"></a> `attachments` | [`MessageAttachment`](MessageAttachment.md)[] | Attached entities. |\n| <a id=\"property-bot_profile\"></a> `bot_profile?` | `null` \\| [`BotSenderProfile`](BotSenderProfile.md) | - |\n| <a id=\"property-content\"></a> `content` | `string` | Macro Markdown body. |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | Creation time. |\n| <a id=\"property-deleted_at\"></a> `deleted_at?` | `string` \\| `null` | Message tombstone, independent of thread deletion. |\n| <a id=\"property-edited_at\"></a> `edited_at?` | `string` \\| `null` | Last content edit, if any. |\n| <a id=\"property-guest_name\"></a> `guest_name?` | `string` \\| `null` | Display name of a verified call guest, retained after the call ends. |\n| <a id=\"property-id\"></a> `id` | `string` | Message UUID. |\n| <a id=\"property-imported_author\"></a> `imported_author?` | `null` \\| [`ImportedAuthor`](ImportedAuthor.md) | - |\n| <a id=\"property-mentions\"></a> `mentions` | [`SimpleMention`](SimpleMention.md)[] | Tracked mentions, retained when a caller changes attachments only. |\n| <a id=\"property-parent\"></a> `parent` | [`MessageParent`](MessageParent.md) | Entity that owns this conversation. |\n| <a id=\"property-reactions\"></a> `reactions` | [`CountedReaction`](CountedReaction.md)[] | Aggregated reactions. |\n| <a id=\"property-sender_id\"></a> `sender_id` | `string` | Authenticated actor or owner of imported content. |\n| <a id=\"property-thread_id\"></a> `thread_id?` | `string` \\| `null` | Root message UUID for replies; absent on roots. |\n| <a id=\"property-triggered_by\"></a> `triggered_by?` | `string` \\| `null` | User who triggered a bot-authored message. |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` | Last persisted update. |\n\n\n<!-- generated/storage/types.gen/type-aliases/MessageAttachment.md -->\n# Type Alias: MessageAttachment\n\n> **MessageAttachment** = \\{ `created_at`: `string`; `entity_id`: `string`; `entity_type`: `string`; `height?`: `number` \\| `null`; `id`: `string`; `width?`: `number` \\| `null`; \\}\n\nAn entity attached to a message.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | When the attachment was added. |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | Attached entity identifier. |\n| <a id=\"property-entity_type\"></a> `entity_type` | `string` | Attached entity type. |\n| <a id=\"property-height\"></a> `height?` | `number` \\| `null` | Optional media height. |\n| <a id=\"property-id\"></a> `id` | `string` | Attachment UUID. |\n| <a id=\"property-width\"></a> `width?` | `number` \\| `null` | Optional media width. |\n\n\n<!-- generated/storage/types.gen/type-aliases/MessageParent.md -->\n# Type Alias: MessageParent\n\n> **MessageParent** = \\{ `id`: `string`; `type`: `\"channel\"`; \\} \\| \\{ `id`: [`DocumentId`](DocumentId.md); `type`: `\"document\"`; \\} \\| \\{ `id`: `string`; `type`: `\"initiative\"`; \\} \\| \\{ `id`: `string`; `type`: `\"crm_company\"`; \\} \\| \\{ `id`: `string`; `type`: `\"crm_contact\"`; \\} \\| \\{ `id`: `string`; `type`: `\"call\"`; \\}\n\nThe entity whose permissions and lifecycle govern a message.\n\n## Union Members\n\n### Type Literal\n\n\\{ `id`: `string`; `type`: `\"channel\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | A channel, including direct messages. |\n| `type` | `\"channel\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: [`DocumentId`](DocumentId.md); `type`: `\"document\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | [`DocumentId`](DocumentId.md) | A document, including tasks and PDFs. |\n| `type` | `\"document\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: `string`; `type`: `\"initiative\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | An initiative, presented as a project in the application. |\n| `type` | `\"initiative\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: `string`; `type`: `\"crm_company\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | A CRM company. |\n| `type` | `\"crm_company\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: `string`; `type`: `\"crm_contact\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | A CRM contact. |\n| `type` | `\"crm_contact\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: `string`; `type`: `\"call\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | A video call and its persistent chat thread. |\n| `type` | `\"call\"` | - |\n\n\n<!-- generated/storage/types.gen/type-aliases/ReplaceCrmStagesRequest.md -->\n# Type Alias: ReplaceCrmStagesRequest\n\n> **ReplaceCrmStagesRequest** = \\{ `stages`: [`CrmStageInput`](CrmStageInput.md)[]; \\}\n\nRequest body for `PUT /crm/stages`: the whole stage set in order.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-stages\"></a> `stages` | [`CrmStageInput`](CrmStageInput.md)[] | Stages first to last. |\n\n\n<!-- generated/storage/types.gen/type-aliases/SimpleMention.md -->\n# Type Alias: SimpleMention\n\n> **SimpleMention** = \\{ `entity_id`: `string`; `entity_type`: `string`; \\}\n\nA mention tracked in a message body.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | Mentioned entity identifier. |\n| <a id=\"property-entity_type\"></a> `entity_type` | `string` | Mentioned entity type. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ThreadAnchor.md -->\n# Type Alias: ThreadAnchor\n\n> **ThreadAnchor** = \\{ `mark_id`: `string`; `marked_text?`: `string` \\| `null`; `type`: `\"markdown\"`; \\} \\| \\{ `anchor_id`: `string`; `marked_text?`: `string` \\| `null`; `type`: `\"pdf_highlight\"`; \\} \\| \\{ `anchor_id`: `string`; `type`: `\"pdf_placeable\"`; \\} \\| \\{ `range`: `string`; `sheetId`: `string`; `sheetName`: `string`; `type`: `\"spreadsheet\"`; \\} \\| \\{ `nodeId?`: `string` \\| `null`; `pageId`: `string`; `type`: `\"fig\"`; `x`: `number`; `y`: `number`; \\}\n\nA thread's location within its document. PDF geometry remains annotation-owned.\n\n## Union Members\n\n### Type Literal\n\n\\{ `mark_id`: `string`; `marked_text?`: `string` \\| `null`; `type`: `\"markdown\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `mark_id` | `string` | Mark UUID serialized in the document. |\n| `marked_text?` | `string` \\| `null` | The marked text as it read when the discussion was created, already trimmed and bounded. Absent on threads created or imported before snapshots were captured: the text a mark covers cannot be recovered from the mark id alone. |\n| `type` | `\"markdown\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `anchor_id`: `string`; `marked_text?`: `string` \\| `null`; `type`: `\"pdf_highlight\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `anchor_id` | `string` | Highlight annotation UUID. |\n| `marked_text?` | `string` \\| `null` | The text the highlight covers, trimmed and bounded like a markdown snapshot. The highlight owns it and it can be edited there, so it is read from the highlight whenever the thread is, never stored on the thread. Absent when the highlight carries no text. |\n| `type` | `\"pdf_highlight\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `anchor_id`: `string`; `type`: `\"pdf_placeable\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `anchor_id` | `string` | Placeable annotation UUID. |\n| `type` | `\"pdf_placeable\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `range`: `string`; `sheetId`: `string`; `sheetName`: `string`; `type`: `\"spreadsheet\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `range` | `string` | A1 cell or range, such as B4 or B4:C9. |\n| `sheetId` | `string` | Stable sheet identity within the workbook. |\n| `sheetName` | `string` | Sheet name when the discussion was created. |\n| `type` | `\"spreadsheet\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `nodeId?`: `string` \\| `null`; `pageId`: `string`; `type`: `\"fig\"`; `x`: `number`; `y`: `number`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `nodeId?` | `string` \\| `null` | Layer the pin follows; absent for a pin on the bare canvas. |\n| `pageId` | `string` | Page (canvas) the pin is on. |\n| `type` | `\"fig\"` | - |\n| `x` | `number` | Horizontal offset from the layer's origin, or the page's when the pin is on no layer, in design units. |\n| `y` | `number` | Vertical offset, measured like `x`. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ThreadState.md -->\n# Type Alias: ThreadState\n\n> **ThreadState** = \\{ `anchor?`: `null` \\| [`ThreadAnchor`](ThreadAnchor.md); `created_at`: `string`; `deleted_at?`: `string` \\| `null`; `resolved`: `boolean`; `root_id`: `string`; `updated_at`: `string`; `user_id`: `string`; \\}\n\nState belonging to a whole thread, keyed by its root message.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-anchor\"></a> `anchor?` | `null` \\| [`ThreadAnchor`](ThreadAnchor.md) | - |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | Creation time of the discussion. |\n| <a id=\"property-deleted_at\"></a> `deleted_at?` | `string` \\| `null` | Explicit deletion of the entire thread, distinct from root deletion. |\n| <a id=\"property-resolved\"></a> `resolved` | `boolean` | Whether this discussion has been resolved. |\n| <a id=\"property-root_id\"></a> `root_id` | `string` | Root message UUID; there is no separate thread identity. |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` | Last state change. |\n| <a id=\"property-user_id\"></a> `user_id` | `string` | User who owns this discussion, including imported discussions. |\n\n\n<!-- generated/storage/types.gen/type-aliases/UpdateCrmTeamSettingsRequest.md -->\n# Type Alias: UpdateCrmTeamSettingsRequest\n\n> **UpdateCrmTeamSettingsRequest** = \\{ `closed_stage_ids?`: `string`[] \\| `null`; `default_team_view_id?`: `string` \\| `null`; `delete_records_role?`: `null` \\| [`CrmPermissionRole`](CrmPermissionRole.md); `edit_stages_role?`: `null` \\| [`CrmPermissionRole`](CrmPermissionRole.md); `move_closed_deals_role?`: `null` \\| [`CrmPermissionRole`](CrmPermissionRole.md); `team_views?`: `unknown`; \\}\n\nRequest body for `PUT /crm/settings`. Every field is optional:\nomitted fields keep their current values.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-closed_stage_ids\"></a> `closed_stage_ids?` | `string`[] \\| `null` | New closed-stage set. Omit to keep the current value; pass `null` to clear it (falling back to the client label heuristic). |\n| <a id=\"property-default_team_view_id\"></a> `default_team_view_id?` | `string` \\| `null` | New default team view id. Omit to keep the current value; pass `null` to clear it. |\n| <a id=\"property-delete_records_role\"></a> `delete_records_role?` | `null` \\| [`CrmPermissionRole`](CrmPermissionRole.md) | - |\n| <a id=\"property-edit_stages_role\"></a> `edit_stages_role?` | `null` \\| [`CrmPermissionRole`](CrmPermissionRole.md) | - |\n| <a id=\"property-move_closed_deals_role\"></a> `move_closed_deals_role?` | `null` \\| [`CrmPermissionRole`](CrmPermissionRole.md) | - |\n| <a id=\"property-team_views\"></a> `team_views?` | `unknown` | Replacement team-views array (whole-blob, last write wins). |\n\n\n<!-- src/entities/crm/comment/classes/CrmComment.md -->\n# Class: CrmComment\n\nA comment on a CRM company or contact: a message whose parent is the\nrecord, addressed by the record and the message UUID. Its record and\nmutations are the ones document comments and channel messages use.\n\n## Extends\n\n- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\\<[`Message`](../../../../../generated/storage/types.gen/type-aliases/Message.md)\\>\n\n## Properties\n\n| Property | Modifier | Type | Description | Inherited from |\n| ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-createdat\"></a> `createdAt` | `readonly` | () => `Promise`\\<`string`\\> | When the comment was created. | - |\n| <a id=\"property-deletedat\"></a> `deletedAt` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | When the comment was deleted, if it has been. | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |\n| <a id=\"property-parent\"></a> `parent` | `readonly` | [`CrmCommentParent`](../interfaces/CrmCommentParent.md) | The company or contact this comment belongs to. | - |\n| <a id=\"property-text\"></a> `text` | `readonly` | () => `Promise`\\<`string`\\> | The comment's text (markdown). | - |\n| <a id=\"property-updatedat\"></a> `updatedAt` | `readonly` | () => `Promise`\\<`string`\\> | When the comment was last updated. | - |\n\n## Methods\n\n### author()\n\n> **author**(): `Promise`\\<[`User`](../../../users/user/classes/User.md)\\>\n\nThe user who wrote this comment.\n\n#### Returns\n\n`Promise`\\<[`User`](../../../users/user/classes/User.md)\\>\n\n***\n\n### delete()\n\n> **delete**(): `Promise`\\<`void`\\>\n\nDelete this comment. Deleting a thread's root keeps its replies.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### edit()\n\n> **edit**(`body`): `Promise`\\<`CrmComment`\\>\n\nReplace the comment's text. Only its author may.\n\n#### Parameters\n\n| Parameter | Type | Description |\n| ------ | ------ | ------ |\n| `body` | `string` \\| [`RichMessage`](../../../../mentions/interfaces/RichMessage.md) | Plain text, or a rich body composed with msg. |\n\n#### Returns\n\n`Promise`\\<`CrmComment`\\>\n\n***\n\n### reply()\n\n> **reply**(`body`): `Promise`\\<`CrmComment`\\>\n\nReply in this comment's thread.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `body` | `string` \\| [`RichMessage`](../../../../mentions/interfaces/RichMessage.md) |\n\n#### Returns\n\n`Promise`\\<`CrmComment`\\>\n\n***\n\n### threadId()\n\n> **threadId**(): `Promise`\\<`string`\\>\n\nThe id of the thread this comment belongs to: its root, or itself for a root.\n\n#### Returns\n\n`Promise`\\<`string`\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`Message`](../../../../../generated/storage/types.gen/type-aliases/Message.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`Message`](../../../../../generated/storage/types.gen/type-aliases/Message.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`Message`](../../../../../generated/storage/types.gen/type-aliases/Message.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `parent`, `id`): `CrmComment`\n\nA handle to a comment by id. Fields load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `parent` | [`CrmCommentParent`](../interfaces/CrmCommentParent.md) |\n| `id` | `string` |\n\n#### Returns\n\n`CrmComment`\n\n***\n\n### from()\n\n> `static` **from**(`client`, `parent`, `record`): `CrmComment`\n\nBuild a comment from a message record (pre-seeded, no fetch).\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `parent` | [`CrmCommentParent`](../interfaces/CrmCommentParent.md) |\n| `record` | [`Message`](../../../../../generated/storage/types.gen/type-aliases/Message.md) |\n\n#### Returns\n\n`CrmComment`\n\n\n<!-- src/entities/crm/comment/functions/listCrmCommentThreads.md -->\n# Function: listCrmCommentThreads()\n\n> **listCrmCommentThreads**(`client`, `parent`): `Promise`\\<[`CrmCommentThread`](../interfaces/CrmCommentThread.md)[]\\>\n\nA CRM record's live comment threads, each with its comments, newest thread first.\n\n## Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `parent` | [`CrmCommentParent`](../interfaces/CrmCommentParent.md) |\n\n## Returns\n\n`Promise`\\<[`CrmCommentThread`](../interfaces/CrmCommentThread.md)[]\\>\n\n\n<!-- src/entities/crm/comment/functions/postCrmComment.md -->\n# Function: postCrmComment()\n\n> **postCrmComment**(`client`, `parent`, `body`, `opts?`): `Promise`\\<[`CrmComment`](../classes/CrmComment.md)\\>\n\nPost a comment on a CRM record: a new thread, or a reply when `threadId`\n(the thread's root comment id) is given.\n\n## Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `parent` | [`CrmCommentParent`](../interfaces/CrmCommentParent.md) |\n| `body` | `string` \\| [`RichMessage`](../../../../mentions/interfaces/RichMessage.md) |\n| `opts?` | \\{ `threadId?`: `string`; \\} |\n| `opts.threadId?` | `string` |\n\n## Returns\n\n`Promise`\\<[`CrmComment`](../classes/CrmComment.md)\\>\n\n\n<!-- src/entities/crm/comment/interfaces/CrmCommentParent.md -->\n# Interface: CrmCommentParent\n\nThe CRM record a discussion hangs off.\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-id\"></a> `id` | `string` |\n| <a id=\"property-type\"></a> `type` | `\"crm_company\"` \\| `\"crm_contact\"` |\n\n\n<!-- src/entities/crm/comment/interfaces/CrmCommentThread.md -->\n# Interface: CrmCommentThread\n\nOne of a CRM record's comment threads: its state and its comments.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-comments\"></a> `comments` | [`CrmComment`](../classes/CrmComment.md)[] | The thread's comments, root first, then replies oldest first. |\n| <a id=\"property-thread\"></a> `thread` | [`ThreadState`](../../../../../generated/storage/types.gen/type-aliases/ThreadState.md) | The thread state: root id, resolved flag, owner, timestamps. |\n\n\n<!-- src/entities/crm/company/classes/Company.md -->\n# Class: Company\n\nA CRM company: an organization the team has interacted with.\n\n## Extends\n\n- [`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md)\\<`CompanyDetail`\\>\n\n## Properties\n\n| Property | Modifier | Type | Default value | Description | Overrides | Inherited from |\n| ------ | ------ | ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-createdat\"></a> `createdAt` | `readonly` | () => `Promise`\\<`string`\\> | `...` | When the company was first created in the CRM. | - | - |\n| <a id=\"property-description\"></a> `description` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | `...` | The company's display description, if any. | - | - |\n| <a id=\"property-emailsync\"></a> `emailSync` | `readonly` | () => `Promise`\\<`boolean`\\> | `...` | Whether email sync is enabled for this company. | - | - |\n| <a id=\"property-entitytype\"></a> `entityType` | `readonly` | `\"crm_company\"` | `'crm_company'` | Favorites identify CRM companies as `crm_company`. | [`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`entityType`](../../../entity/classes/PropertiedEntity.md#property-entitytype) | - |\n| <a id=\"property-hidden\"></a> `hidden` | `readonly` | () => `Promise`\\<`boolean`\\> | `...` | Whether the company is hidden from CRM listings. | - | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | `undefined` | - | - | [`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`id`](../../../entity/classes/PropertiedEntity.md#property-id) |\n| <a id=\"property-name\"></a> `name` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | `...` | The company's display name, if resolved. | - | - |\n| <a id=\"property-team\"></a> `team` | `readonly` | () => `Promise`\\<[`Team`](../../../teams/team/classes/Team.md)\\> | `...` | The team that owns this company. | - | - |\n| <a id=\"property-updatedat\"></a> `updatedAt` | `readonly` | () => `Promise`\\<`string`\\> | `...` | When the company was last updated. | - | - |\n| <a id=\"property-search\"></a> `search` | `static` | (`client`, `query`, `searchOpts?`) => `AsyncGenerator`\\<`Company`\\> | `...` | Search CRM companies by name/domain, most relevant first, auto-paginated. | - | - |\n\n## Methods\n\n### comment()\n\n> **comment**(`body`, `opts?`): `Promise`\\<[`CrmComment`](../../comment/classes/CrmComment.md)\\>\n\nAdd a comment. Starts a new thread, or replies to an existing one when\n`threadId` (the thread's root comment id) is given.\n\n#### Parameters\n\n| Parameter | Type | Description |\n| ------ | ------ | ------ |\n| `body` | `string` \\| [`RichMessage`](../../../../mentions/interfaces/RichMessage.md) | Plain text, or a rich body composed with msg. |\n| `opts?` | \\{ `threadId?`: `string`; \\} | - |\n| `opts.threadId?` | `string` | - |\n\n#### Returns\n\n`Promise`\\<[`CrmComment`](../../comment/classes/CrmComment.md)\\>\n\n***\n\n### commentById()\n\n> **commentById**(`id`): [`CrmComment`](../../comment/classes/CrmComment.md)\n\nA handle to one of this company's comments by id.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`CrmComment`](../../comment/classes/CrmComment.md)\n\n***\n\n### comments()\n\n> **comments**(): `Promise`\\<[`CrmCommentThread`](../../comment/interfaces/CrmCommentThread.md)[]\\>\n\nThe comment threads on this company, newest thread first.\n\n#### Returns\n\n`Promise`\\<[`CrmCommentThread`](../../comment/interfaces/CrmCommentThread.md)[]\\>\n\n***\n\n### contacts()\n\n> **contacts**(): `Promise`\\<[`Contact`](../../contact/classes/Contact.md)[]\\>\n\nThe contacts attached to this company (hidden ones filtered for non-admins).\n\n#### Returns\n\n`Promise`\\<[`Contact`](../../contact/classes/Contact.md)[]\\>\n\n***\n\n### createContact()\n\n> **createContact**(`opts`): `Promise`\\<[`Contact`](../../contact/classes/Contact.md)\\>\n\nCreate a contact under this company.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts` | \\{ `email`: `string`; `name`: `string`; \\} |\n| `opts.email` | `string` |\n| `opts.name` | `string` |\n\n#### Returns\n\n`Promise`\\<[`Contact`](../../contact/classes/Contact.md)\\>\n\n***\n\n### deleteProperty()\n\n> **deleteProperty**(`assignment`): `Promise`\\<`void`\\>\n\nRemove a property from this entity, given its [properties](#properties) entry.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `assignment` | [`EntityPropertyWithDefinition`](../../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`deleteProperty`](../../../entity/classes/PropertiedEntity.md#deleteproperty)\n\n***\n\n### domain()\n\n> **domain**(): `Promise`\\<`string` \\| `undefined`\\>\n\nThe company's primary domain (e.g. `acme.com`), if any.\n\n#### Returns\n\n`Promise`\\<`string` \\| `undefined`\\>\n\n***\n\n### domains()\n\n> **domains**(): `Promise`\\<`string`[]\\>\n\nAll domains associated with the company, primary first.\n\n#### Returns\n\n`Promise`\\<`string`[]\\>\n\n***\n\n### favorite()\n\n> **favorite**(): `Promise`\\<`Company`\\>\n\nAdd this entity to the user's favorites. Returns this handle for chaining.\nPlain unwrap: favoriting alters the user's favorites collection, not this\nentity's own detail, so there's nothing cached to invalidate.\n\n#### Returns\n\n`Promise`\\<`Company`\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`favorite`](../../../entity/classes/PropertiedEntity.md#favorite)\n\n***\n\n### hide()\n\n> **hide**(): `Promise`\\<`void`\\>\n\nHide the company from CRM listings: disables email sync and soft-hides\nits contacts. Reversible with [unhide](#unhide).\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### properties()\n\n> **properties**(`opts?`): `Promise`\\<[`EntityPropertyWithDefinition`](../../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md)[]\\>\n\nThe properties set on this entity, each with its definition, value, and options.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts?` | \\{ `includeMetadata?`: `boolean`; \\} |\n| `opts.includeMetadata?` | `boolean` |\n\n#### Returns\n\n`Promise`\\<[`EntityPropertyWithDefinition`](../../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md)[]\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`properties`](../../../entity/classes/PropertiedEntity.md#properties)\n\n***\n\n### propertyReference()\n\n> **propertyReference**(): [`PropertyTargetReference`](../../../../../generated/properties/types.gen/type-aliases/PropertyTargetReference.md)\n\nThis entity's reference for bulk property operations.\n\n#### Returns\n\n[`PropertyTargetReference`](../../../../../generated/properties/types.gen/type-aliases/PropertyTargetReference.md)\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`propertyReference`](../../../entity/classes/PropertiedEntity.md#propertyreference)\n\n***\n\n### rename()\n\n> **rename**(`name`): `Promise`\\<`void`\\>\n\nRename the company for the caller's current team.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `name` | `string` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### setEmailSync()\n\n> **setEmailSync**(`enabled`): `Promise`\\<`void`\\>\n\nEnable or disable team-wide email sync for this company. Rejects with 409\nwhen enabling on a hidden company — [unhide](#unhide) first.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `enabled` | `boolean` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### setProperty()\n\n> **setProperty**(`property`, `value?`): `Promise`\\<`void`\\>\n\nSet a property value on this entity, or attach the property without a\nvalue when `value` is omitted.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `property` | [`PropertyDefinition`](../../../properties/property-definition/classes/PropertyDefinition.md) |\n| `value?` | [`SetPropertyValue`](../../../../../generated/properties/types.gen/type-aliases/SetPropertyValue.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`setProperty`](../../../entity/classes/PropertiedEntity.md#setproperty)\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`CrmCompanyResponse`](../../../../../generated/storage/types.gen/type-aliases/CrmCompanyResponse.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`CrmCompanyResponse`](../../../../../generated/storage/types.gen/type-aliases/CrmCompanyResponse.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`CrmCompanyResponse`](../../../../../generated/storage/types.gen/type-aliases/CrmCompanyResponse.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`toJSON`](../../../entity/classes/PropertiedEntity.md#tojson)\n\n***\n\n### unfavorite()\n\n> **unfavorite**(): `Promise`\\<`Company`\\>\n\nRemove this entity from the user's favorites. Returns this handle for chaining.\n\n#### Returns\n\n`Promise`\\<`Company`\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`unfavorite`](../../../entity/classes/PropertiedEntity.md#unfavorite)\n\n***\n\n### unhide()\n\n> **unhide**(): `Promise`\\<`void`\\>\n\nUn-hide the company, restoring it and its contacts to CRM listings.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### updatePropertyOptions()\n\n> **updatePropertyOptions**(`changes`): `Promise`\\<[`BulkUpdateEntityPropertyOptionsResponse`](../../../../../generated/properties/types.gen/type-aliases/BulkUpdateEntityPropertyOptionsResponse.md)\\>\n\nApply multi-select option deltas atomically across this entity's properties.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `changes` | [`PropertyOptionDelta`](../../../entity/interfaces/PropertyOptionDelta.md)[] |\n\n#### Returns\n\n`Promise`\\<[`BulkUpdateEntityPropertyOptionsResponse`](../../../../../generated/properties/types.gen/type-aliases/BulkUpdateEntityPropertyOptionsResponse.md)\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`updatePropertyOptions`](../../../entity/classes/PropertiedEntity.md#updatepropertyoptions)\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `id`): `Company`\n\nA handle to a CRM company by id. Details load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `id` | `string` |\n\n#### Returns\n\n`Company`\n\n***\n\n### from()\n\n> `static` **from**(`client`, `data`): `Company`\n\nBuild a company from an API record (pre-seeded, no fetch).\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `data` | [`CrmCompanyResponse`](../../../../../generated/storage/types.gen/type-aliases/CrmCompanyResponse.md) |\n\n#### Returns\n\n`Company`\n\n\n<!-- src/entities/crm/contact/classes/Contact.md -->\n# Class: Contact\n\nA CRM contact: a person observed interacting with the team.\n\n## Extends\n\n- [`FavoritableEntity`](../../../entity/classes/FavoritableEntity.md)\\<`ContactDetail`\\>\n\n## Properties\n\n| Property | Modifier | Type | Default value | Description | Overrides | Inherited from |\n| ------ | ------ | ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-company\"></a> `company` | `readonly` | () => `Promise`\\<[`Company`](../../company/classes/Company.md)\\> | `...` | The CRM company this contact belongs to. | - | - |\n| <a id=\"property-createdat\"></a> `createdAt` | `readonly` | () => `Promise`\\<`string`\\> | `...` | When the contact was first created in the CRM. | - | - |\n| <a id=\"property-email\"></a> `email` | `readonly` | () => `Promise`\\<`string`\\> | `...` | The contact's email address. | - | - |\n| <a id=\"property-entitytype\"></a> `entityType` | `readonly` | `\"crm_contact\"` | `'crm_contact'` | Favorites identify CRM contacts as `crm_contact`. | [`FavoritableEntity`](../../../entity/classes/FavoritableEntity.md).[`entityType`](../../../entity/classes/FavoritableEntity.md#property-entitytype) | - |\n| <a id=\"property-firstinteraction\"></a> `firstInteraction` | `readonly` | () => `Promise`\\<`string`\\> | `...` | When the team first interacted with this contact. | - | - |\n| <a id=\"property-hidden\"></a> `hidden` | `readonly` | () => `Promise`\\<`boolean`\\> | `...` | Whether the contact is hidden from CRM listings. | - | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | `undefined` | - | - | [`FavoritableEntity`](../../../entity/classes/FavoritableEntity.md).[`id`](../../../entity/classes/FavoritableEntity.md#property-id) |\n| <a id=\"property-lastinteraction\"></a> `lastInteraction` | `readonly` | () => `Promise`\\<`string`\\> | `...` | When the team last interacted with this contact. | - | - |\n| <a id=\"property-name\"></a> `name` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | `...` | The contact's display name, if one has been observed. | - | - |\n| <a id=\"property-updatedat\"></a> `updatedAt` | `readonly` | () => `Promise`\\<`string`\\> | `...` | When the contact was last updated. | - | - |\n\n## Methods\n\n### comment()\n\n> **comment**(`body`, `opts?`): `Promise`\\<[`CrmComment`](../../comment/classes/CrmComment.md)\\>\n\nAdd a comment. Starts a new thread, or replies to an existing one when\n`threadId` (the thread's root comment id) is given.\n\n#### Parameters\n\n| Parameter | Type | Description |\n| ------ | ------ | ------ |\n| `body` | `string` \\| [`RichMessage`](../../../../mentions/interfaces/RichMessage.md) | Plain text, or a rich body composed with msg. |\n| `opts?` | \\{ `threadId?`: `string`; \\} | - |\n| `opts.threadId?` | `string` | - |\n\n#### Returns\n\n`Promise`\\<[`CrmComment`](../../comment/classes/CrmComment.md)\\>\n\n***\n\n### commentById()\n\n> **commentById**(`id`): [`CrmComment`](../../comment/classes/CrmComment.md)\n\nA handle to one of this contact's comments by id.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`CrmComment`](../../comment/classes/CrmComment.md)\n\n***\n\n### comments()\n\n> **comments**(): `Promise`\\<[`CrmCommentThread`](../../comment/interfaces/CrmCommentThread.md)[]\\>\n\nThe comment threads on this contact, newest thread first.\n\n#### Returns\n\n`Promise`\\<[`CrmCommentThread`](../../comment/interfaces/CrmCommentThread.md)[]\\>\n\n***\n\n### favorite()\n\n> **favorite**(): `Promise`\\<`Contact`\\>\n\nAdd this entity to the user's favorites. Returns this handle for chaining.\nPlain unwrap: favoriting alters the user's favorites collection, not this\nentity's own detail, so there's nothing cached to invalidate.\n\n#### Returns\n\n`Promise`\\<`Contact`\\>\n\n#### Inherited from\n\n[`FavoritableEntity`](../../../entity/classes/FavoritableEntity.md).[`favorite`](../../../entity/classes/FavoritableEntity.md#favorite)\n\n***\n\n### hide()\n\n> **hide**(): `Promise`\\<`void`\\>\n\nHide the contact from CRM listings. Display-only; reversible with [unhide](#unhide).\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### rename()\n\n> **rename**(`name`): `Promise`\\<`void`\\>\n\nRename the contact for the caller's current team.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `name` | `string` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`CrmContactResponse`](../../../../../generated/storage/types.gen/type-aliases/CrmContactResponse.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`CrmContactResponse`](../../../../../generated/storage/types.gen/type-aliases/CrmContactResponse.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`CrmContactResponse`](../../../../../generated/storage/types.gen/type-aliases/CrmContactResponse.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`FavoritableEntity`](../../../entity/classes/FavoritableEntity.md).[`toJSON`](../../../entity/classes/FavoritableEntity.md#tojson)\n\n***\n\n### unfavorite()\n\n> **unfavorite**(): `Promise`\\<`Contact`\\>\n\nRemove this entity from the user's favorites. Returns this handle for chaining.\n\n#### Returns\n\n`Promise`\\<`Contact`\\>\n\n#### Inherited from\n\n[`FavoritableEntity`](../../../entity/classes/FavoritableEntity.md).[`unfavorite`](../../../entity/classes/FavoritableEntity.md#unfavorite)\n\n***\n\n### unhide()\n\n> **unhide**(): `Promise`\\<`void`\\>\n\nUn-hide the contact, restoring it to CRM listings.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `id`): `Contact`\n\nA handle to a CRM contact by id. Details load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `id` | `string` |\n\n#### Returns\n\n`Contact`\n\n***\n\n### from()\n\n> `static` **from**(`client`, `data`): `Contact`\n\nBuild a contact from an API record (pre-seeded, no fetch).\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `data` | [`CrmContactResponse`](../../../../../generated/storage/types.gen/type-aliases/CrmContactResponse.md) |\n\n#### Returns\n\n`Contact`\n\n\n<!-- src/entities/crm/namespace/classes/CrmNamespace.md -->\n# Class: CrmNamespace\n\n## Constructors\n\n### Constructor\n\n> **new CrmNamespace**(`client`): `CrmNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`CrmNamespace`\n\n## Methods\n\n### companyById()\n\n> **companyById**(`id`): [`Company`](../../company/classes/Company.md)\n\nA handle to a CRM company by id.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`Company`](../../company/classes/Company.md)\n\n***\n\n### contactByEmail()\n\n> **contactByEmail**(`email`): `Promise`\\<[`Contact`](../../contact/classes/Contact.md) \\| `undefined`\\>\n\nResolve a CRM contact by email in the caller's current team, if present.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `email` | `string` |\n\n#### Returns\n\n`Promise`\\<[`Contact`](../../contact/classes/Contact.md) \\| `undefined`\\>\n\n***\n\n### contactById()\n\n> **contactById**(`id`): [`Contact`](../../contact/classes/Contact.md)\n\nA handle to a CRM contact by id.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`Contact`](../../contact/classes/Contact.md)\n\n***\n\n### createCompany()\n\n> **createCompany**(`opts`): `Promise`\\<[`Company`](../../company/classes/Company.md)\\>\n\nCreate a CRM company for the caller's current team.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts` | [`CreateCrmCompanyRequest`](../../../../../generated/storage/types.gen/type-aliases/CreateCrmCompanyRequest.md) |\n\n#### Returns\n\n`Promise`\\<[`Company`](../../company/classes/Company.md)\\>\n\n***\n\n### resetStages()\n\n> **resetStages**(): `Promise`\\<`void`\\>\n\nReset the caller's current team's deal stages to the defaults.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### searchCompanies()\n\n> **searchCompanies**(`query`): `AsyncGenerator`\\<[`Company`](../../company/classes/Company.md)\\>\n\nSearch CRM companies by name/domain, most relevant first, auto-paginated.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `query` | `string` |\n\n#### Returns\n\n`AsyncGenerator`\\<[`Company`](../../company/classes/Company.md)\\>\n\n***\n\n### searchContacts()\n\n> **searchContacts**(`query`, `opts?`): `Promise`\\<[`Contact`](../../contact/classes/Contact.md)[]\\>\n\nSearch the caller's current team's CRM contacts whose email or name\ncontains `query` (case-insensitive), most recently interacted first.\nAn empty query lists the most recent contacts.\n\n#### Parameters\n\n| Parameter | Type | Description |\n| ------ | ------ | ------ |\n| `query` | `string` | - |\n| `opts?` | \\{ `limit?`: `number`; \\} | - |\n| `opts.limit?` | `number` | Maximum contacts to return (1-500, default 20). |\n\n#### Returns\n\n`Promise`\\<[`Contact`](../../contact/classes/Contact.md)[]\\>\n\n***\n\n### setStages()\n\n> **setStages**(`stages`): `Promise`\\<[`CrmStagesResponse`](../../../../../generated/storage/types.gen/type-aliases/CrmStagesResponse.md)\\>\n\nReplace the caller's current team's deal stages, in pipeline order.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `stages` | [`ReplaceCrmStagesRequest`](../../../../../generated/storage/types.gen/type-aliases/ReplaceCrmStagesRequest.md) |\n\n#### Returns\n\n`Promise`\\<[`CrmStagesResponse`](../../../../../generated/storage/types.gen/type-aliases/CrmStagesResponse.md)\\>\n\n***\n\n### settings()\n\n> **settings**(): `Promise`\\<[`CrmTeamSettingsResponse`](../../../../../generated/storage/types.gen/type-aliases/CrmTeamSettingsResponse.md)\\>\n\nThe caller's current team's CRM settings.\n\n#### Returns\n\n`Promise`\\<[`CrmTeamSettingsResponse`](../../../../../generated/storage/types.gen/type-aliases/CrmTeamSettingsResponse.md)\\>\n\n***\n\n### updateSettings()\n\n> **updateSettings**(`settings`): `Promise`\\<[`CrmTeamSettingsResponse`](../../../../../generated/storage/types.gen/type-aliases/CrmTeamSettingsResponse.md)\\>\n\nPartially update the caller's current team's CRM settings.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `settings` | [`UpdateCrmTeamSettingsRequest`](../../../../../generated/storage/types.gen/type-aliases/UpdateCrmTeamSettingsRequest.md) |\n\n#### Returns\n\n`Promise`\\<[`CrmTeamSettingsResponse`](../../../../../generated/storage/types.gen/type-aliases/CrmTeamSettingsResponse.md)\\>\n"+ "description": "Work with CRM records and pipeline tables, columns, rows and sharing.",+ "overview": "<!-- src/entities/crm/namespace/classes/CrmNamespace.md -->\n# Class: CrmNamespace\n\n## Constructors\n\n### Constructor\n\n> **new CrmNamespace**(`client`): `CrmNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`CrmNamespace`\n\n## Properties\n\n| Property | Modifier | Type | Description |\n| ------ | ------ | ------ | ------ |\n| <a id=\"property-pipelines\"></a> `pipelines` | `readonly` | [`PipelineNamespace`](../../pipelines/classes/PipelineNamespace.md) | Pipelines, their records and sharing settings. |\n\n## Methods\n\n### companyById()\n\n> **companyById**(`id`): [`Company`](../../company/classes/Company.md)\n\nA handle to a CRM company by id.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`Company`](../../company/classes/Company.md)\n\n***\n\n### contactByEmail()\n\n> **contactByEmail**(`email`): `Promise`\\<[`Contact`](../../contact/classes/Contact.md) \\| `undefined`\\>\n\nResolve a CRM contact by email in the caller's current team, if present.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `email` | `string` |\n\n#### Returns\n\n`Promise`\\<[`Contact`](../../contact/classes/Contact.md) \\| `undefined`\\>\n\n***\n\n### contactById()\n\n> **contactById**(`id`): [`Contact`](../../contact/classes/Contact.md)\n\nA handle to a CRM contact by id.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`Contact`](../../contact/classes/Contact.md)\n\n***\n\n### createCompany()\n\n> **createCompany**(`opts`): `Promise`\\<[`Company`](../../company/classes/Company.md)\\>\n\nCreate a CRM company for the caller's current team.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts` | [`CreateCrmCompanyRequest`](../../../../../generated/storage/types.gen/type-aliases/CreateCrmCompanyRequest.md) |\n\n#### Returns\n\n`Promise`\\<[`Company`](../../company/classes/Company.md)\\>\n\n***\n\n### resetStages()\n\n> **resetStages**(): `Promise`\\<`void`\\>\n\nReset the caller's current team's deal stages to the defaults.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### searchCompanies()\n\n> **searchCompanies**(`query`): `AsyncGenerator`\\<[`Company`](../../company/classes/Company.md)\\>\n\nSearch CRM companies by name/domain, most relevant first, auto-paginated.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `query` | `string` |\n\n#### Returns\n\n`AsyncGenerator`\\<[`Company`](../../company/classes/Company.md)\\>\n\n***\n\n### searchContacts()\n\n> **searchContacts**(`query`, `opts?`): `Promise`\\<[`Contact`](../../contact/classes/Contact.md)[]\\>\n\nSearch the caller's current team's CRM contacts whose email or name\ncontains `query` (case-insensitive), most recently interacted first.\nAn empty query lists the most recent contacts.\n\n#### Parameters\n\n| Parameter | Type | Description |\n| ------ | ------ | ------ |\n| `query` | `string` | - |\n| `opts?` | \\{ `limit?`: `number`; \\} | - |\n| `opts.limit?` | `number` | Maximum contacts to return (1-500, default 20). |\n\n#### Returns\n\n`Promise`\\<[`Contact`](../../contact/classes/Contact.md)[]\\>\n\n***\n\n### setStages()\n\n> **setStages**(`stages`): `Promise`\\<[`CrmStagesResponse`](../../../../../generated/storage/types.gen/type-aliases/CrmStagesResponse.md)\\>\n\nReplace the caller's current team's deal stages, in pipeline order.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `stages` | [`ReplaceCrmStagesRequest`](../../../../../generated/storage/types.gen/type-aliases/ReplaceCrmStagesRequest.md) |\n\n#### Returns\n\n`Promise`\\<[`CrmStagesResponse`](../../../../../generated/storage/types.gen/type-aliases/CrmStagesResponse.md)\\>\n\n***\n\n### settings()\n\n> **settings**(): `Promise`\\<[`CrmTeamSettingsResponse`](../../../../../generated/storage/types.gen/type-aliases/CrmTeamSettingsResponse.md)\\>\n\nThe caller's current team's CRM settings.\n\n#### Returns\n\n`Promise`\\<[`CrmTeamSettingsResponse`](../../../../../generated/storage/types.gen/type-aliases/CrmTeamSettingsResponse.md)\\>\n\n***\n\n### updateSettings()\n\n> **updateSettings**(`settings`): `Promise`\\<[`CrmTeamSettingsResponse`](../../../../../generated/storage/types.gen/type-aliases/CrmTeamSettingsResponse.md)\\>\n\nPartially update the caller's current team's CRM settings.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `settings` | [`UpdateCrmTeamSettingsRequest`](../../../../../generated/storage/types.gen/type-aliases/UpdateCrmTeamSettingsRequest.md) |\n\n#### Returns\n\n`Promise`\\<[`CrmTeamSettingsResponse`](../../../../../generated/storage/types.gen/type-aliases/CrmTeamSettingsResponse.md)\\>\n",+ "documentation": "# Macro SDK: crm\n\nGenerated by TypeDoc. Paths below refer to the canonical Markdown hierarchy. Other entity handles are documented in their named section; request core for shared SDK helpers.\n\n<!-- generated/properties/types.gen/type-aliases/BulkUpdateEntityPropertyOptionsResponse.md -->\n# Type Alias: BulkUpdateEntityPropertyOptionsResponse\n\n> **BulkUpdateEntityPropertyOptionsResponse** = \\{ `properties`: [`EntityPropertyOptionSelectionResponse`](EntityPropertyOptionSelectionResponse.md)[]; \\}\n\nResponse for a bulk option update: each property's reconciled final ids.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-properties\"></a> `properties` | [`EntityPropertyOptionSelectionResponse`](EntityPropertyOptionSelectionResponse.md)[] | The final option ids per updated property. |\n\n\n<!-- generated/properties/types.gen/type-aliases/DataType.md -->\n# Type Alias: DataType\n\n> **DataType** = `\"BOOLEAN\"` \\| `\"DATE\"` \\| `\"NUMBER\"` \\| `\"STRING\"` \\| `\"SELECT_NUMBER\"` \\| `\"SELECT_STRING\"` \\| `\"TAG\"` \\| `\"ENTITY\"` \\| `\"LINK\"`\n\nData type for property values, determining storage and validation.\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityProperty.md -->\n# Type Alias: EntityProperty\n\n> **EntityProperty** = \\{ `created_at`: `string`; `entity_id`: `string`; `entity_type`: [`EntityType`](EntityType.md); `id`: `string`; `property_definition_id`: `string`; `updated_at`: `string`; \\}\n\nAssignment of a property definition to a specific entity (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-created_at\"></a> `created_at` | `string` |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` |\n| <a id=\"property-entity_type\"></a> `entity_type` | [`EntityType`](EntityType.md) |\n| <a id=\"property-id\"></a> `id` | `string` |\n| <a id=\"property-property_definition_id\"></a> `property_definition_id` | `string` |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityPropertyOptionSelectionResponse.md -->\n# Type Alias: EntityPropertyOptionSelectionResponse\n\n> **EntityPropertyOptionSelectionResponse** = \\{ `option_ids`: `string`[]; `property_id`: `string`; \\}\n\nThe reconciled final option ids stored for one property after a bulk update.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-option_ids\"></a> `option_ids` | `string`[] | The final option ids the server persisted, in stored order. |\n| <a id=\"property-property_id\"></a> `property_id` | `string` | The property definition the options belong to. |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md -->\n# Type Alias: EntityPropertyWithDefinition\n\n> **EntityPropertyWithDefinition** = \\{ `definition`: [`PropertyDefinition`](PropertyDefinition.md); `options?`: [`PropertyOption`](PropertyOption.md)[] \\| `null`; `property`: [`EntityProperty`](EntityProperty.md); `value?`: `null` \\| [`PropertyValue`](PropertyValue.md); \\}\n\nEntity property with its definition, value, and options (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-definition\"></a> `definition` | [`PropertyDefinition`](PropertyDefinition.md) |\n| <a id=\"property-options\"></a> `options?` | [`PropertyOption`](PropertyOption.md)[] \\| `null` |\n| <a id=\"property-property\"></a> `property` | [`EntityProperty`](EntityProperty.md) |\n| <a id=\"property-value\"></a> `value?` | `null` \\| [`PropertyValue`](PropertyValue.md) |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityReference.md -->\n# Type Alias: EntityReference\n\n> **EntityReference** = \\{ `entity_id`: `string`; `entity_type`: [`EntityType`](EntityType.md); `specific_message_id?`: `string` \\| `null`; \\}\n\nEntity reference for entity-type property values.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | - |\n| <a id=\"property-entity_type\"></a> `entity_type` | [`EntityType`](EntityType.md) | - |\n| <a id=\"property-specific_message_id\"></a> `specific_message_id?` | `string` \\| `null` | For CHANNEL, CHAT, THREAD entity types - optional specific message ID. This allows referencing a specific message within a thread/channel/chat. |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityType.md -->\n# Type Alias: EntityType\n\n> **EntityType** = `\"CALENDAR_EVENT\"` \\| `\"CALL_RECORD\"` \\| `\"CHANNEL\"` \\| `\"CHAT\"` \\| `\"COMPANY\"` \\| `\"DATABASE_ROW\"` \\| `\"CONTACT\"` \\| `\"DOCUMENT\"` \\| `\"INITIATIVE\"` \\| `\"PROJECT\"` \\| `\"TASK\"` \\| `\"THREAD\"` \\| `\"USER\"`\n\nType of entity that can be referenced by entity properties.\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyDefinition.md -->\n# Type Alias: PropertyDefinition\n\n> **PropertyDefinition** = \\{ `created_at`: `string`; `data_type`: [`DataType`](DataType.md); `display_name`: `string`; `id`: `string`; `is_metadata`: `boolean`; `is_multi_select`: `boolean`; `is_system`: `boolean`; `owner`: [`PropertyOwner`](PropertyOwner.md); `specific_entity_type`: `null` \\| [`EntityType`](EntityType.md); `updated_at`: `string`; \\}\n\nProperty definition model (service representation).\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | - |\n| <a id=\"property-data_type\"></a> `data_type` | [`DataType`](DataType.md) | - |\n| <a id=\"property-display_name\"></a> `display_name` | `string` | - |\n| <a id=\"property-id\"></a> `id` | `string` | - |\n| <a id=\"property-is_metadata\"></a> `is_metadata` | `boolean` | Flag to indicate if this is a system-generated metadata property. Not stored in database - computed at service layer. |\n| <a id=\"property-is_multi_select\"></a> `is_multi_select` | `boolean` | - |\n| <a id=\"property-is_system\"></a> `is_system` | `boolean` | Flag to indicate if this is a system property (stored in DB). |\n| <a id=\"property-owner\"></a> `owner` | [`PropertyOwner`](PropertyOwner.md) | - |\n| <a id=\"property-specific_entity_type\"></a> `specific_entity_type` | `null` \\| [`EntityType`](EntityType.md) | - |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` | - |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyOption.md -->\n# Type Alias: PropertyOption\n\n> **PropertyOption** = \\{ `color`: `string` \\| `null`; `created_at`: `string`; `display_order`: `number`; `id`: `string`; `property_definition_id`: `string`; `updated_at`: `string`; `value`: [`PropertyOptionValue`](PropertyOptionValue.md); \\}\n\nA selectable option for select-type properties (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-color\"></a> `color` | `string` \\| `null` |\n| <a id=\"property-created_at\"></a> `created_at` | `string` |\n| <a id=\"property-display_order\"></a> `display_order` | `number` |\n| <a id=\"property-id\"></a> `id` | `string` |\n| <a id=\"property-property_definition_id\"></a> `property_definition_id` | `string` |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` |\n| <a id=\"property-value\"></a> `value` | [`PropertyOptionValue`](PropertyOptionValue.md) |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyOptionValue.md -->\n# Type Alias: PropertyOptionValue\n\n> **PropertyOptionValue** = \\{ `type`: `\"string\"`; `value`: `string`; \\} \\| \\{ `type`: `\"number\"`; `value`: `number`; \\}\n\nThe value of a property option - either a string or a number.\n\n## Union Members\n\n### Type Literal\n\n\\{ `type`: `\"string\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"string\"` | - |\n| `value` | `string` | String value for SelectString properties |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"number\"`; `value`: `number`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"number\"` | - |\n| `value` | `number` | Number value for SelectNumber properties |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyOwner.md -->\n# Type Alias: PropertyOwner\n\n> **PropertyOwner** = \\{ `scope`: `\"user\"`; `user_id`: `string`; \\} \\| \\{ `scope`: `\"team\"`; `team_id`: `string`; \\} \\| \\{ `database_id`: `string`; `scope`: `\"database\"`; \\} \\| \\{ `scope`: `\"system\"`; \\}\n\nDefines who owns a property - user-scoped, team-scoped, database-scoped, or system.\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyTargetEntityType.md -->\n# Type Alias: PropertyTargetEntityType\n\n> **PropertyTargetEntityType** = `\"CALL_RECORD\"` \\| `\"CHANNEL\"` \\| `\"CHAT\"` \\| `\"COMPANY\"` \\| `\"DATABASE_ROW\"` \\| `\"DOCUMENT\"` \\| `\"INITIATIVE\"` \\| `\"PROJECT\"` \\| `\"THREAD\"` \\| `\"USER\"`\n\nCanonical type of an entity receiving properties.\n\nTasks are documents at API boundaries. `Task` intentionally does not exist\nhere; task classification is resolved by the properties domain from the\ndocument subtype.\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyTargetReference.md -->\n# Type Alias: PropertyTargetReference\n\n> **PropertyTargetReference** = \\{ `entity_id`: `string`; `entity_type`: [`PropertyTargetEntityType`](PropertyTargetEntityType.md); \\}\n\nCanonical reference to an entity receiving properties.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | Entity identifier. |\n| <a id=\"property-entity_type\"></a> `entity_type` | [`PropertyTargetEntityType`](PropertyTargetEntityType.md) | Canonical entity type. |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyValue.md -->\n# Type Alias: PropertyValue\n\n> **PropertyValue** = \\{ `type`: `\"Boolean\"`; `value`: `boolean`; \\} \\| \\{ `type`: `\"Number\"`; `value`: `number`; \\} \\| \\{ `type`: `\"String\"`; `value`: `string`; \\} \\| \\{ `type`: `\"Date\"`; `value`: `string`; \\} \\| \\{ `type`: `\"SelectOption\"`; `value`: `string`[]; \\} \\| \\{ `type`: `\"EntityReference\"`; `value`: [`EntityReference`](EntityReference.md)[]; \\} \\| \\{ `type`: `\"Link\"`; `value`: `string`[]; \\}\n\nProperty value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to/from JSONB in the database.\n\n## Union Members\n\n### Type Literal\n\n\\{ `type`: `\"Boolean\"`; `value`: `boolean`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Boolean\"` | - |\n| `value` | `boolean` | Boolean value Serializes as: {\"type\": \"Boolean\", \"value\": true} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"Number\"`; `value`: `number`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Number\"` | - |\n| `value` | `number` | Numeric value Serializes as: {\"type\": \"Number\", \"value\": 42.5} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"String\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"String\"` | - |\n| `value` | `string` | String value Serializes as: {\"type\": \"String\", \"value\": \"text\"} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"Date\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Date\"` | - |\n| `value` | `string` | Date/timestamp value Serializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"SelectOption\"`; `value`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"SelectOption\"` | - |\n| `value` | `string`[] | Select option(s) - always an array (check is_multi_select to determine if single or multi) Single-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1) Multi-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+) |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"EntityReference\"`; `value`: [`EntityReference`](EntityReference.md)[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"EntityReference\"` | - |\n| `value` | [`EntityReference`](EntityReference.md)[] | Entity reference(s) - always an array (check is_multi_select to determine if single or multi) Single-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1) Multi-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+) |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"Link\"`; `value`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Link\"` | - |\n| `value` | `string`[] | Link value(s) - always an array (check is_multi_select to determine if single or multi) Single-select: {\"type\": \"Link\", \"value\": [\"https://example.com\"]} (length 0 or 1) Multi-select: {\"type\": \"Link\", \"value\": [\"https://example.com\", \"https://other.com\"]} (length 0+) |\n\n\n<!-- generated/properties/types.gen/type-aliases/SetPropertyValue.md -->\n# Type Alias: SetPropertyValue\n\n> **SetPropertyValue** = \\{ `type`: `\"boolean\"`; `value`: `boolean`; \\} \\| \\{ `type`: `\"date\"`; `value`: `string`; \\} \\| \\{ `type`: `\"number\"`; `value`: `number`; \\} \\| \\{ `type`: `\"string\"`; `value`: `string`; \\} \\| \\{ `option_id`: `string`; `type`: `\"select_option\"`; \\} \\| \\{ `option_ids`: `string`[]; `type`: `\"multi_select_option\"`; \\} \\| \\{ `reference`: [`EntityReference`](EntityReference.md); `type`: `\"entity_reference\"`; \\} \\| \\{ `references`: [`EntityReference`](EntityReference.md)[]; `type`: `\"multi_entity_reference\"`; \\} \\| \\{ `type`: `\"link\"`; `url`: `string`; \\} \\| \\{ `type`: `\"multi_link\"`; `urls`: `string`[]; \\}\n\nType-safe enum for setting entity property values - provides compile-time validation.\n\n\n<!-- generated/storage/types.gen/type-aliases/AccessLevel.md -->\n# Type Alias: AccessLevel\n\n> **AccessLevel** = `\"view\"` \\| `\"comment\"` \\| `\"edit\"` \\| `\"owner\"`\n\nOrdered from least to most access top -> bottom\n\n\n<!-- generated/storage/types.gen/type-aliases/AccessiblePipeline.md -->\n# Type Alias: AccessiblePipeline\n\n> **AccessiblePipeline** = [`Pipeline`](Pipeline.md) & \\{ `grant`: [`AccessLevel`](AccessLevel.md); \\}\n\nMetadata together with the caller's effective grant.\n\n## Type Declaration\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `grant` | [`AccessLevel`](AccessLevel.md) | Highest effective access. |\n\n\n<!-- generated/storage/types.gen/type-aliases/AppliedOps.md -->\n# Type Alias: AppliedOps\n\n> **AppliedOps** = \\{ `changes`: [`CommittedChange`](CommittedChange.md)[]; `results`: [`OpResult`](OpResult.md)[]; \\}\n\nWhat a committed batch answers: a result per op, and the journal's change\nfor each table version it produced.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-changes\"></a> `changes` | [`CommittedChange`](CommittedChange.md)[] | The journal's changes. |\n| <a id=\"property-results\"></a> `results` | [`OpResult`](OpResult.md)[] | One result per op, in order. |\n\n\n<!-- generated/storage/types.gen/type-aliases/BotSenderProfile.md -->\n# Type Alias: BotSenderProfile\n\n> **BotSenderProfile** = \\{ `avatar_url?`: `string` \\| `null`; `name`: `string`; \\}\n\nPublic bot profile attached to bot-authored messages.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-avatar_url\"></a> `avatar_url?` | `string` \\| `null` | Bot avatar URL. |\n| <a id=\"property-name\"></a> `name` | `string` | Bot display name. |\n\n\n<!-- generated/storage/types.gen/type-aliases/CardPosition.md -->\n# Type Alias: CardPosition\n\n> **CardPosition** = \\{ `lane`: [`LaneKey`](LaneKey.md); `position`: `string`; `row`: `string`; \\}\n\nWhere one card sits on a board: its lane, and its fractional key there.\nA card whose row has since moved to another lane has no place until it is\nmoved again.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-lane\"></a> `lane` | [`LaneKey`](LaneKey.md) | The lane. |\n| <a id=\"property-position\"></a> `position` | `string` | The card's key in that lane. |\n| <a id=\"property-row\"></a> `row` | `string` | The card's row. |\n\n\n<!-- generated/storage/types.gen/type-aliases/CellValue.md -->\n# Type Alias: CellValue\n\n> **CellValue** = \\{ `type`: `\"text\"`; `value`: `string`; \\} \\| \\{ `type`: `\"number\"`; `value`: `number`; \\} \\| \\{ `type`: `\"boolean\"`; `value`: `boolean`; \\} \\| \\{ `type`: `\"date\"`; `value`: `string`; \\} \\| \\{ `type`: `\"link\"`; `value`: `string`[]; \\} \\| \\{ `type`: `\"options\"`; `value`: [`OptionRef`](OptionRef.md)[]; \\} \\| \\{ `type`: `\"entities\"`; `value`: [`EntityRef`](EntityRef.md)[]; \\} \\| \\{ `type`: `\"rows\"`; `value`: `string`[]; \\} \\| \\{ `type`: `\"clear\"`; \\}\n\nA cell's value. It must fit the column's type: text for a text column,\noptions of the column for a select, and so on.\n\n## Union Members\n\n### Type Literal\n\n\\{ `type`: `\"text\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"text\"` | - |\n| `value` | `string` | Free text. |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"number\"`; `value`: `number`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"number\"` | - |\n| `value` | `number` | A finite number. |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"boolean\"`; `value`: `boolean`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"boolean\"` | - |\n| `value` | `boolean` | A checkbox. |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"date\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"date\"` | - |\n| `value` | `string` | A date-time. |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"link\"`; `value`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"link\"` | - |\n| `value` | `string`[] | Complete http or https URLs; at most one for a single-valued column. |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"options\"`; `value`: [`OptionRef`](OptionRef.md)[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"options\"` | - |\n| `value` | [`OptionRef`](OptionRef.md)[] | Options of a select or tag column; at most one for a single-valued column. |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"entities\"`; `value`: [`EntityRef`](EntityRef.md)[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"entities\"` | - |\n| `value` | [`EntityRef`](EntityRef.md)[] | References to Macro entities of the kind the column points at; at most one for a single-valued column. |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"rows\"`; `value`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"rows\"` | - |\n| `value` | `string`[] | Rows of the table a relation column points at. |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"clear\"`; \\}\n\n\n<!-- generated/storage/types.gen/type-aliases/CellWrite.md -->\n# Type Alias: CellWrite\n\n> **CellWrite** = \\{ `column`: `string`; `value`: [`CellValue`](CellValue.md); \\}\n\nOne cell of a row: which column, and its new value.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-column\"></a> `column` | `string` | The column placement. |\n| <a id=\"property-value\"></a> `value` | [`CellValue`](CellValue.md) | The value, or [`CellValue::Clear`] to empty the cell. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ChannelSharePermission.md -->\n# Type Alias: ChannelSharePermission\n\n> **ChannelSharePermission** = \\{ `access_level`: [`AccessLevel`](AccessLevel.md); `channel_id`: `string`; \\}\n\nThe channel share permission\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-access_level\"></a> `access_level` | [`AccessLevel`](AccessLevel.md) | The access level for the channel |\n| <a id=\"property-channel_id\"></a> `channel_id` | `string` | The channel id |\n\n\n<!-- generated/storage/types.gen/type-aliases/Column.md -->\n# Type Alias: Column\n\n> **Column** = \\{ `config`: `null` \\| [`ColumnConfig`](ColumnConfig.md); `display_name`: `string` \\| `null`; `id`: `string`; `infer_type`: `boolean`; `nullable?`: `boolean`; `position`: `string`; `property_definition_id`: `string`; `protections?`: [`ColumnProtection`](ColumnProtection.md)[]; `table_id`: `string`; \\}\n\nA column: the placement of a property definition on a table.\n\nThe definition carries name, [`DataType`], multi-select flag, and options;\nthis carries only where it appears and column-kind configuration.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-config\"></a> `config` | `null` \\| [`ColumnConfig`](ColumnConfig.md) | - |\n| <a id=\"property-display_name\"></a> `display_name` | `string` \\| `null` | The placement's own label, which also names it in SQL; `None` shows the definition's name. |\n| <a id=\"property-id\"></a> `id` | `string` | Identifier of the placement. |\n| <a id=\"property-infer_type\"></a> `infer_type` | `boolean` | Whether the first nonempty value may settle this new text column's type. |\n| <a id=\"property-nullable\"></a> `nullable?` | `boolean` | Whether a row may omit this cell; empty collections also count as absent. |\n| <a id=\"property-position\"></a> `position` | `string` | Fractional index for column ordering. |\n| <a id=\"property-property_definition_id\"></a> `property_definition_id` | `string` | The bound property definition. |\n| <a id=\"property-protections\"></a> `protections?` | [`ColumnProtection`](ColumnProtection.md)[] | Schema operations reserved by a feature; ordinary edits cannot clear them. |\n| <a id=\"property-table_id\"></a> `table_id` | `string` | Table the column appears on. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ColumnChange.md -->\n# Type Alias: ColumnChange\n\n> **ColumnChange** = \\{ `after?`: `string`; `definition`: [`NewColumn`](NewColumn.md); `kind`: `\"create\"`; \\} \\| \\{ `kind`: `\"rename\"`; `name`: `string`; `previousName?`: `string`; \\} \\| \\{ `kind`: `\"change_type\"`; `to`: [`ColumnKind`](ColumnKind.md); \\} \\| \\{ `kind`: `\"delete\"`; \\} \\| \\{ `kind`: `\"add_options\"`; `options`: [`NewOption`](NewOption.md)[]; \\} \\| \\{ `color?`: `string` \\| `null`; `kind`: `\"update_option\"`; `label?`: `string`; `option`: `string`; \\} \\| \\{ `formula`: [`Formula`](Formula.md); `kind`: `\"set_formula\"`; \\} \\| \\{ `kind`: `\"delete_option\"`; `option`: `string`; \\}\n\nA change to one column.\n\n## Union Members\n\n### Type Literal\n\n\\{ `after?`: `string`; `definition`: [`NewColumn`](NewColumn.md); `kind`: `\"create\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `after?` | `string` | The column it goes right after; left out, it goes after the table's last column. |\n| `definition` | [`NewColumn`](NewColumn.md) | What the column holds. |\n| `kind` | `\"create\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"rename\"`; `name`: `string`; `previousName?`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"rename\"` | - |\n| `name` | `string` | Its new name, unique within the table ignoring case. |\n| `previousName?` | `string` | The name the caller saw. Given, the rename is refused if the column goes by another one now. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"change_type\"`; `to`: [`ColumnKind`](ColumnKind.md); \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"change_type\"` | - |\n| `to` | [`ColumnKind`](ColumnKind.md) | The type it becomes. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"delete\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"add_options\"`; `options`: [`NewOption`](NewOption.md)[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"add_options\"` | - |\n| `options` | [`NewOption`](NewOption.md)[] | The options, each under an id the client mints. |\n\n***\n\n### Type Literal\n\n\\{ `color?`: `string` \\| `null`; `kind`: `\"update_option\"`; `label?`: `string`; `option`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `color?` | `string` \\| `null` | Its new colour, a hex string like `#RRGGBB`, or `null` to clear it; left out, it keeps its own. A tag option always has one. |\n| `kind` | `\"update_option\"` | - |\n| `label?` | `string` | Its new label; left out, it keeps its own. Labels are unique within a column, ignoring case. |\n| `option` | `string` | The option. |\n\n***\n\n### Type Literal\n\n\\{ `formula`: [`Formula`](Formula.md); `kind`: `\"set_formula\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `formula` | [`Formula`](Formula.md) | The formula, over the table's other columns. |\n| `kind` | `\"set_formula\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"delete_option\"`; `option`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"delete_option\"` | - |\n| `option` | `string` | The option. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ColumnConfig.md -->\n# Type Alias: ColumnConfig\n\n> **ColumnConfig** = \\{ `database_id`: `string`; `kind`: `\"link\"`; `table_id`: `string`; \\} \\| \\{ `formula`: [`Formula`](Formula.md); `kind`: `\"derived\"`; \\}\n\nColumn-kind specific configuration stored on the placement.\n\n## Union Members\n\n### Type Literal\n\n\\{ `database_id`: `string`; `kind`: `\"link\"`; `table_id`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `database_id` | `string` | Target database. |\n| `kind` | `\"link\"` | - |\n| `table_id` | `string` | Target table. |\n\n***\n\n### Type Literal\n\n\\{ `formula`: [`Formula`](Formula.md); `kind`: `\"derived\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `formula` | [`Formula`](Formula.md) | How its cells are computed. |\n| `kind` | `\"derived\"` | - |\n\n\n<!-- generated/storage/types.gen/type-aliases/ColumnDetail.md -->\n# Type Alias: ColumnDetail\n\n> **ColumnDetail** = \\{ `column`: [`Column`](Column.md); `definition`: [`PropertyDefinitionWithOptions`](PropertyDefinitionWithOptions.md); `shared_outside_database`: `boolean`; `sql_name`: `string`; `writable`: `boolean`; \\}\n\nOne column placement with the definition behind it.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-column\"></a> `column` | [`Column`](Column.md) | The placement. |\n| <a id=\"property-definition\"></a> `definition` | [`PropertyDefinitionWithOptions`](PropertyDefinitionWithOptions.md) | The bound definition (name, type, options). |\n| <a id=\"property-shared_outside_database\"></a> `shared_outside_database` | `boolean` | Whether the definition belongs to something beyond this database (a person's, a team's or a system property), so changing its options changes them everywhere that property is used. |\n| <a id=\"property-sql_name\"></a> `sql_name` | `string` | The name SQL refers to the column by: its display name, quoted. |\n| <a id=\"property-writable\"></a> `writable` | `boolean` | Whether SQL may write this column. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ColumnKind.md -->\n# Type Alias: ColumnKind\n\n> **ColumnKind** = \\{ `type`: `\"text\"`; \\} \\| \\{ `type`: `\"number\"`; \\} \\| \\{ `type`: `\"boolean\"`; \\} \\| \\{ `type`: `\"date\"`; \\} \\| \\{ `type`: `\"link\"`; \\} \\| \\{ `multi`: `boolean`; `type`: `\"select\"`; \\} \\| \\{ `multi`: `boolean`; `type`: `\"select_number\"`; \\} \\| \\{ `type`: `\"tag\"`; \\} \\| \\{ `multi`: `boolean`; `target`: [`EntityKind`](EntityKind.md); `type`: `\"entity\"`; \\} \\| \\{ `database`: `string`; `table`: `string`; `type`: `\"relation\"`; \\}\n\nA type a column can have.\n\n## Union Members\n\n### Type Literal\n\n\\{ `type`: `\"text\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"number\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"boolean\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"date\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"link\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `multi`: `boolean`; `type`: `\"select\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `multi` | `boolean` | Whether a cell holds several options. |\n| `type` | `\"select\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `multi`: `boolean`; `type`: `\"select_number\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `multi` | `boolean` | Whether a cell holds several options. |\n| `type` | `\"select_number\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"tag\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `multi`: `boolean`; `target`: [`EntityKind`](EntityKind.md); `type`: `\"entity\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `multi` | `boolean` | Whether a cell holds several references. |\n| `target` | [`EntityKind`](EntityKind.md) | What the references point at. |\n| `type` | `\"entity\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `database`: `string`; `table`: `string`; `type`: `\"relation\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `database` | `string` | The database of the related table. |\n| `table` | `string` | The related table. |\n| `type` | `\"relation\"` | - |\n\n\n<!-- generated/storage/types.gen/type-aliases/ColumnProtection.md -->\n# Type Alias: ColumnProtection\n\n> **ColumnProtection** = `\"delete\"` \\| `\"change_type\"`\n\nA schema operation reserved by a feature using a column.\n\n\n<!-- generated/storage/types.gen/type-aliases/ColumnResult.md -->\n# Type Alias: ColumnResult\n\n> **ColumnResult** = \\{ `kind`: `\"created\"`; \\} \\| \\{ `kind`: `\"renamed\"`; \\} \\| \\{ `kind`: `\"type_changed\"`; \\} \\| \\{ `kind`: `\"deleted\"`; \\} \\| \\{ `added`: `string`[]; `kind`: `\"options_added\"`; \\} \\| \\{ `kind`: `\"option_updated\"`; \\} \\| \\{ `kind`: `\"option_deleted\"`; \\} \\| \\{ `kind`: `\"formula_set\"`; \\}\n\nWhat happened to a column.\n\n## Union Members\n\n### Type Literal\n\n\\{ `kind`: `\"created\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"renamed\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"type_changed\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"deleted\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `added`: `string`[]; `kind`: `\"options_added\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `added` | `string`[] | The options created, in order: those sent, less any whose label the column already had. |\n| `kind` | `\"options_added\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"option_updated\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"option_deleted\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"formula_set\"`; \\}\n\n\n<!-- generated/storage/types.gen/type-aliases/CommittedChange.md -->\n# Type Alias: CommittedChange\n\n> **CommittedChange** = \\{ `change`: `number`; `table`: `string`; `version`: [`TableVersion`](TableVersion.md); \\}\n\nOne change a committed batch journaled: a table, the version the batch\nproduced, and the journal's id for it.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-change\"></a> `change` | `number` | The journal's id of the change. |\n| <a id=\"property-table\"></a> `table` | `string` | The table. |\n| <a id=\"property-version\"></a> `version` | [`TableVersion`](TableVersion.md) | The version the batch produced. |\n\n\n<!-- generated/storage/types.gen/type-aliases/Conjunction.md -->\n# Type Alias: Conjunction\n\n> **Conjunction** = `\"and\"` \\| `\"or\"`\n\nHow a group's conditions combine.\n\n\n<!-- generated/storage/types.gen/type-aliases/CountedReaction.md -->\n# Type Alias: CountedReaction\n\n> **CountedReaction** = \\{ `emoji`: `string`; `users`: `string`[]; \\}\n\nReaction emoji and the users who added it.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-emoji\"></a> `emoji` | `string` | Emoji being reacted with. |\n| <a id=\"property-users\"></a> `users` | `string`[] | User identifiers. |\n\n\n<!-- generated/storage/types.gen/type-aliases/CreateCrmCompanyRequest.md -->\n# Type Alias: CreateCrmCompanyRequest\n\n> **CreateCrmCompanyRequest** = \\{ `domain`: `string`; `name`: `string`; \\}\n\nRequest body for `POST /crm/companies`.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-domain\"></a> `domain` | `string` | The company's email domain, e.g. \"acme.com\". Must be a bare domain (no scheme, path, or email) and not a generic email provider domain. |\n| <a id=\"property-name\"></a> `name` | `string` | Display name for the company. Team-scoped: overrides the domain-directory name on every read path. |\n\n\n<!-- generated/storage/types.gen/type-aliases/CreatePipeline.md -->\n# Type Alias: CreatePipeline\n\n> **CreatePipeline** = \\{ `name`: `string`; `recordType`: [`PipelineRecordType`](PipelineRecordType.md); `sharing?`: [`PipelineSharing`](PipelineSharing.md); \\}\n\nRequest to create an empty pipeline with the standard CRM columns.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-name\"></a> `name` | `string` | Pipeline name. |\n| <a id=\"property-recordtype\"></a> `recordType` | [`PipelineRecordType`](PipelineRecordType.md) | Company or contact entries. |\n| <a id=\"property-sharing\"></a> `sharing?` | [`PipelineSharing`](PipelineSharing.md) | Defaults to private. |\n\n\n<!-- generated/storage/types.gen/type-aliases/CrmCompanyResponse.md -->\n# Type Alias: CrmCompanyResponse\n\n> **CrmCompanyResponse** = \\{ `contacts`: [`CrmContactResponse`](CrmContactResponse.md)[]; `createdAt`: `string`; `description?`: `string` \\| `null`; `domains`: [`CrmDomainResponse`](CrmDomainResponse.md)[]; `emailSync`: `boolean`; `hidden`: `boolean`; `id`: `string`; `name?`: `string` \\| `null`; `teamId`: `string`; `updatedAt`: `string`; \\}\n\nA CRM company as returned by `GET /crm/companies/{company_id}`.\nMirrors the soup-listed `crmCompany` shape (`name` / `description`\nresolved from the primary domain's `crm_domain_directory` entry) and\nembeds the company's contacts so the panel can render in a single\nrequest.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-contacts\"></a> `contacts` | [`CrmContactResponse`](CrmContactResponse.md)[] | Contacts attached to this company. Hidden contacts are filtered out for non-admin viewers. |\n| <a id=\"property-createdat\"></a> `createdAt` | `string` | Earliest known interaction with this company. |\n| <a id=\"property-description\"></a> `description?` | `string` \\| `null` | Display description from the primary domain's directory entry. |\n| <a id=\"property-domains\"></a> `domains` | [`CrmDomainResponse`](CrmDomainResponse.md)[] | All domains associated with this company, ordered by creation time ascending (primary first). |\n| <a id=\"property-emailsync\"></a> `emailSync` | `boolean` | Whether email sync is enabled for this company. |\n| <a id=\"property-hidden\"></a> `hidden` | `boolean` | Whether the company is hidden from CRM listings for the requesting team. Non-admin viewers never see `hidden = true` rows (the endpoint 404s for them); admin/owner callers see hidden companies so they can render the right toggle state. |\n| <a id=\"property-id\"></a> `id` | `string` | The id of the company. |\n| <a id=\"property-name\"></a> `name?` | `string` \\| `null` | Display name from the primary domain's directory entry, or `None` when unresolved. |\n| <a id=\"property-teamid\"></a> `teamId` | `string` | The id of the team that owns this company record. |\n| <a id=\"property-updatedat\"></a> `updatedAt` | `string` | Most recent known interaction with this company. |\n\n\n<!-- generated/storage/types.gen/type-aliases/CrmContactResponse.md -->\n# Type Alias: CrmContactResponse\n\n> **CrmContactResponse** = \\{ `companyId`: `string`; `createdAt`: `string`; `email`: `string`; `firstInteraction`: `string`; `hidden`: `boolean`; `id`: `string`; `lastInteraction`: `string`; `name?`: `string` \\| `null`; `updatedAt`: `string`; \\}\n\nA CRM contact as returned by `GET /crm/companies/{company_id}/contacts`.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-companyid\"></a> `companyId` | `string` | The id of the company the contact belongs to. |\n| <a id=\"property-createdat\"></a> `createdAt` | `string` | When the contact record was created. |\n| <a id=\"property-email\"></a> `email` | `string` | The contact's email address. |\n| <a id=\"property-firstinteraction\"></a> `firstInteraction` | `string` | Earliest known interaction with this contact. |\n| <a id=\"property-hidden\"></a> `hidden` | `boolean` | Whether the contact is hidden from CRM listings for the requesting team. Non-admin viewers never see `hidden = true` rows (the endpoint filters them out); admin/owner callers see hidden contacts so they can render the right toggle state. |\n| <a id=\"property-id\"></a> `id` | `string` | The id of the contact record. |\n| <a id=\"property-lastinteraction\"></a> `lastInteraction` | `string` | Most recent known interaction with this contact. |\n| <a id=\"property-name\"></a> `name?` | `string` \\| `null` | Display name observed for the contact, if any. |\n| <a id=\"property-updatedat\"></a> `updatedAt` | `string` | When the contact record was last updated. |\n\n\n<!-- generated/storage/types.gen/type-aliases/CrmDomainResponse.md -->\n# Type Alias: CrmDomainResponse\n\n> **CrmDomainResponse** = \\{ `companyId`: `string`; `createdAt`: `string`; `domain`: `string`; `id`: `string`; \\}\n\nA CRM domain associated with a company.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-companyid\"></a> `companyId` | `string` | The id of the company the domain belongs to. |\n| <a id=\"property-createdat\"></a> `createdAt` | `string` | When the domain record was created. |\n| <a id=\"property-domain\"></a> `domain` | `string` | The domain (e.g. \"acme.com\"). |\n| <a id=\"property-id\"></a> `id` | `string` | The id of the domain record. |\n\n\n<!-- generated/storage/types.gen/type-aliases/CrmPermissionRole.md -->\n# Type Alias: CrmPermissionRole\n\n> **CrmPermissionRole** = `\"admin\"` \\| `\"owner\"`\n\nMinimum team role required for a CRM governance capability. Members\ncan edit visible CRM records (e.g. company properties), but the\ngovernance capabilities these settings gate stay restricted to\nadmin (default) vs owner. Maps to the `team_role` Postgres enum;\n`member` is deliberately not representable.\n\n\n<!-- generated/storage/types.gen/type-aliases/CrmStageInput.md -->\n# Type Alias: CrmStageInput\n\n> **CrmStageInput** = \\{ `id?`: `string` \\| `null`; `label`: `string`; \\}\n\nOne stage in a `PUT /crm/stages` body.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-id\"></a> `id?` | `string` \\| `null` | Existing stage to keep; omit to add one. |\n| <a id=\"property-label\"></a> `label` | `string` | Label after the update; non-blank and unique within the set. |\n\n\n<!-- generated/storage/types.gen/type-aliases/CrmStageResponse.md -->\n# Type Alias: CrmStageResponse\n\n> **CrmStageResponse** = \\{ `id`: `string`; `label`: `string`; \\}\n\nOne stage of the team's custom pipeline.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-id\"></a> `id` | `string` | Property option id companies carry as their stage value. |\n| <a id=\"property-label\"></a> `label` | `string` | Label. |\n\n\n<!-- generated/storage/types.gen/type-aliases/CrmStagesResponse.md -->\n# Type Alias: CrmStagesResponse\n\n> **CrmStagesResponse** = \\{ `definition_id`: `string`; `stages`: [`CrmStageResponse`](CrmStageResponse.md)[]; \\}\n\nThe team's custom stage set.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-definition_id\"></a> `definition_id` | `string` | Team-scoped stage definition id. |\n| <a id=\"property-stages\"></a> `stages` | [`CrmStageResponse`](CrmStageResponse.md)[] | Stages in pipeline order. |\n\n\n<!-- generated/storage/types.gen/type-aliases/CrmTeamSettingsResponse.md -->\n# Type Alias: CrmTeamSettingsResponse\n\n> **CrmTeamSettingsResponse** = \\{ `closed_stage_ids?`: `string`[] \\| `null`; `default_team_view_id?`: `string` \\| `null`; `delete_records_role`: [`CrmPermissionRole`](CrmPermissionRole.md); `edit_stages_role`: [`CrmPermissionRole`](CrmPermissionRole.md); `legacy_stage_ids`: \\{\\[`key`: `string`\\]: `string`; \\}; `move_closed_deals_role`: [`CrmPermissionRole`](CrmPermissionRole.md); `team_views`: `unknown`; \\}\n\nThe team's CRM configuration (everything on `team_crm_settings`\nexcept the `crm_enabled` killswitch, which is managed via\n`PATCH /team/crm` on the auth service).\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-closed_stage_ids\"></a> `closed_stage_ids?` | `string`[] \\| `null` | Stage option ids counting as closed deals; absent = the client falls back to its label heuristic. |\n| <a id=\"property-default_team_view_id\"></a> `default_team_view_id?` | `string` \\| `null` | Team view applied by default when a member opens the CRM view. |\n| <a id=\"property-delete_records_role\"></a> `delete_records_role` | [`CrmPermissionRole`](CrmPermissionRole.md) | Who can delete (hide) CRM records. |\n| <a id=\"property-edit_stages_role\"></a> `edit_stages_role` | [`CrmPermissionRole`](CrmPermissionRole.md) | Who can change the deal stage set in CRM settings. |\n| <a id=\"property-legacy_stage_ids\"></a> `legacy_stage_ids` | \\{\\[`key`: `string`\\]: `string`; \\} | System stage option id to team stage option id for seeded stages. |\n| <a id=\"property-move_closed_deals_role\"></a> `move_closed_deals_role` | [`CrmPermissionRole`](CrmPermissionRole.md) | Who can move deals out of a closed stage. |\n| <a id=\"property-team_views\"></a> `team_views` | `unknown` | Team saved views — an opaque JSON array owned by the frontend. |\n\n\n<!-- generated/storage/types.gen/type-aliases/DataType.md -->\n# Type Alias: DataType\n\n> **DataType** = `\"BOOLEAN\"` \\| `\"DATE\"` \\| `\"NUMBER\"` \\| `\"STRING\"` \\| `\"SELECT_NUMBER\"` \\| `\"SELECT_STRING\"` \\| `\"TAG\"` \\| `\"ENTITY\"` \\| `\"LINK\"`\n\nData type for property values, determining storage and validation.\n\n\n<!-- generated/storage/types.gen/type-aliases/DatabaseOp.md -->\n# Type Alias: DatabaseOp\n\n> **DatabaseOp** = \\{ `change`: [`TableChange`](TableChange.md); `kind`: `\"table\"`; `table`: `string`; \\} \\| \\{ `change`: [`ColumnChange`](ColumnChange.md); `column`: `string`; `kind`: `\"column\"`; `table`: `string`; \\} \\| \\{ `change`: [`RowsChange`](RowsChange.md); `kind`: `\"rows\"`; `table`: `string`; \\} \\| \\{ `change`: [`ViewChange`](ViewChange.md); `kind`: `\"view\"`; `table`: `string`; `view`: `string`; \\} \\| \\{ `kind`: `\"reorder_tables\"`; `order`: `string`[]; \\}\n\nOne write to a database: its tables, columns, options, rows or views,\ngrouped by the resource it changes. A request's ops apply in order and\ntogether, or not at all, and every op names a table of the database the\nrequest is for (or, creating one, adds it there).\n\n## Union Members\n\n### Type Literal\n\n\\{ `change`: [`TableChange`](TableChange.md); `kind`: `\"table\"`; `table`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `change` | [`TableChange`](TableChange.md) | What changes. |\n| `kind` | `\"table\"` | - |\n| `table` | `string` | The table; for a creation, its new id, minted by the client, which later ops of the request may name. |\n\n***\n\n### Type Literal\n\n\\{ `change`: [`ColumnChange`](ColumnChange.md); `column`: `string`; `kind`: `\"column\"`; `table`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `change` | [`ColumnChange`](ColumnChange.md) | What changes. |\n| `column` | `string` | The column; for a creation, its new id, minted by the client, which later ops of the request may name. |\n| `kind` | `\"column\"` | - |\n| `table` | `string` | The table. |\n\n***\n\n### Type Literal\n\n\\{ `change`: [`RowsChange`](RowsChange.md); `kind`: `\"rows\"`; `table`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `change` | [`RowsChange`](RowsChange.md) | What changes. |\n| `kind` | `\"rows\"` | - |\n| `table` | `string` | The table the rows belong to. |\n\n***\n\n### Type Literal\n\n\\{ `change`: [`ViewChange`](ViewChange.md); `kind`: `\"view\"`; `table`: `string`; `view`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `change` | [`ViewChange`](ViewChange.md) | What changes. |\n| `kind` | `\"view\"` | - |\n| `table` | `string` | The view's table. |\n| `view` | `string` | The view; for a creation, its new id, minted by the client. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"reorder_tables\"`; `order`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"reorder_tables\"` | - |\n| `order` | `string`[] | Every table, in its new order. |\n\n\n<!-- generated/storage/types.gen/type-aliases/DatabaseView.md -->\n# Type Alias: DatabaseView\n\n> **DatabaseView** = \\{ `createdAt`: `string`; `databaseId`: `string`; `id`: `string`; `layout`: [`ViewLayout`](ViewLayout.md); `name`: `string`; `position`: `string`; `query`: [`ViewQuery`](ViewQuery.md); `tableId`: `string`; `updatedAt`: `string`; \\}\n\nA view of one table, as stored.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-createdat\"></a> `createdAt` | `string` | When it was created. |\n| <a id=\"property-databaseid\"></a> `databaseId` | `string` | The database the table belongs to. |\n| <a id=\"property-id\"></a> `id` | `string` | The view. |\n| <a id=\"property-layout\"></a> `layout` | [`ViewLayout`](ViewLayout.md) | How it draws them. |\n| <a id=\"property-name\"></a> `name` | `string` | Its name, unique among the table's views ignoring case. |\n| <a id=\"property-position\"></a> `position` | `string` | Where it sorts among the table's views: a fractional key. |\n| <a id=\"property-query\"></a> `query` | [`ViewQuery`](ViewQuery.md) | Which rows it shows, in what order. |\n| <a id=\"property-tableid\"></a> `tableId` | `string` | The table it shows. |\n| <a id=\"property-updatedat\"></a> `updatedAt` | `string` | When it last changed. |\n\n\n<!-- generated/storage/types.gen/type-aliases/DateOperator.md -->\n# Type Alias: DateOperator\n\n> **DateOperator** = `\"before\"` \\| `\"after\"` \\| `\"onOrBefore\"` \\| `\"onOrAfter\"`\n\nHow a date cell compares to a date-time.\n\n\n<!-- generated/storage/types.gen/type-aliases/DocumentId.md -->\n# Type Alias: DocumentId\n\n> **DocumentId** = `string`\n\nA validated document identifier. Historical document ids need not be UUIDs.\n\n\n<!-- generated/storage/types.gen/type-aliases/EntityKind.md -->\n# Type Alias: EntityKind\n\n> **EntityKind** = `\"USER\"` \\| `\"DOCUMENT\"` \\| `\"TASK\"` \\| `\"COMPANY\"` \\| `\"CONTACT\"` \\| `\"CALL_RECORD\"` \\| `\"CHANNEL\"` \\| `\"CHAT\"` \\| `\"PROJECT\"` \\| `\"THREAD\"` \\| `\"CALENDAR_EVENT\"` \\| `\"INITIATIVE\"`\n\nA kind of Macro entity a reference column can point at.\n\n\n<!-- generated/storage/types.gen/type-aliases/EntityPermission.md -->\n# Type Alias: EntityPermission\n\n> **EntityPermission** = \\{ `access_level`: [`AccessLevel`](AccessLevel.md); `type`: `\"access_level\"`; \\} \\| \\{ `type`: `\"channel_view_only\"`; \\} \\| \\{ `role`: [`ParticipantRole`](ParticipantRole.md); `type`: `\"channel_role\"`; \\} \\| \\{ `role`: [`TeamRole`](TeamRole.md); `type`: `\"team_role\"`; \\}\n\nA user's permission for an entity, discriminated by entity kind.\n\nItems (documents, chats, projects, threads) use access levels.\nChannels use view-only permission or participant roles.\n\n## Union Members\n\n### Type Literal\n\n\\{ `access_level`: [`AccessLevel`](AccessLevel.md); `type`: `\"access_level\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `access_level` | [`AccessLevel`](AccessLevel.md) | The access level the user has. |\n| `type` | `\"access_level\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"channel_view_only\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `role`: [`ParticipantRole`](ParticipantRole.md); `type`: `\"channel_role\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `role` | [`ParticipantRole`](ParticipantRole.md) | The role the user has in the channel. |\n| `type` | `\"channel_role\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `role`: [`TeamRole`](TeamRole.md); `type`: `\"team_role\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `role` | [`TeamRole`](TeamRole.md) | The role the user has in the team. |\n| `type` | `\"team_role\"` | - |\n\n\n<!-- generated/storage/types.gen/type-aliases/EntityRef.md -->\n# Type Alias: EntityRef\n\n> **EntityRef** = \\{ `entityId`: `string`; `entityType`: [`EntityKind`](EntityKind.md); \\}\n\nA reference to one Macro entity.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entityid\"></a> `entityId` | `string` | The entity's id. |\n| <a id=\"property-entitytype\"></a> `entityType` | [`EntityKind`](EntityKind.md) | What kind of entity it is; it must be the kind the column points at. |\n\n\n<!-- generated/storage/types.gen/type-aliases/EntityReference.md -->\n# Type Alias: EntityReference\n\n> **EntityReference** = \\{ `entity_id`: `string`; `entity_type`: [`EntityType`](EntityType.md); `specific_message_id?`: `string` \\| `null`; \\}\n\nEntity reference for entity-type property values.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | - |\n| <a id=\"property-entity_type\"></a> `entity_type` | [`EntityType`](EntityType.md) | - |\n| <a id=\"property-specific_message_id\"></a> `specific_message_id?` | `string` \\| `null` | For CHANNEL, CHAT, THREAD entity types - optional specific message ID. This allows referencing a specific message within a thread/channel/chat. |\n\n\n<!-- generated/storage/types.gen/type-aliases/EntityType.md -->\n# Type Alias: EntityType\n\n> **EntityType** = `\"CALENDAR_EVENT\"` \\| `\"CALL_RECORD\"` \\| `\"CHANNEL\"` \\| `\"CHAT\"` \\| `\"COMPANY\"` \\| `\"DATABASE_ROW\"` \\| `\"CONTACT\"` \\| `\"DOCUMENT\"` \\| `\"INITIATIVE\"` \\| `\"PROJECT\"` \\| `\"TASK\"` \\| `\"THREAD\"` \\| `\"USER\"`\n\nType of entity that can be referenced by entity properties.\n\n\n<!-- generated/storage/types.gen/type-aliases/FilterCondition.md -->\n# Type Alias: FilterCondition\n\n> **FilterCondition** = \\{ `column`: `string`; `test`: [`FilterTest`](FilterTest.md); \\}\n\nA test of one column's cells.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-column\"></a> `column` | `string` | The column tested. |\n| <a id=\"property-test\"></a> `test` | [`FilterTest`](FilterTest.md) | What its cell must be. The test's kind must fit the column's type. |\n\n\n<!-- generated/storage/types.gen/type-aliases/FilterGroup.md -->\n# Type Alias: FilterGroup\n\n> **FilterGroup** = \\{ `conditions`: [`FilterNode`](FilterNode.md)[]; `conjunction`: [`Conjunction`](Conjunction.md); \\}\n\nConditions joined by one conjunction.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-conditions\"></a> `conditions` | [`FilterNode`](FilterNode.md)[] | The conditions and nested groups. A group without any keeps every row. |\n| <a id=\"property-conjunction\"></a> `conjunction` | [`Conjunction`](Conjunction.md) | Whether every condition must hold, or any one. |\n\n\n<!-- generated/storage/types.gen/type-aliases/FilterNode.md -->\n# Type Alias: FilterNode\n\n> **FilterNode** = [`FilterCondition`](FilterCondition.md) & \\{ `kind`: `\"condition\"`; \\} \\| [`FilterGroup`](FilterGroup.md) & \\{ `kind`: `\"group\"`; \\}\n\nOne entry of a group: a condition, or a group of its own.\n\n\n<!-- generated/storage/types.gen/type-aliases/FilterTest.md -->\n# Type Alias: FilterTest\n\n> **FilterTest** = \\{ `kind`: `\"presence\"`; `operator`: [`PresenceOperator`](PresenceOperator.md); \\} \\| \\{ `kind`: `\"text\"`; `operator`: [`TextOperator`](TextOperator.md); `value`: `string`; \\} \\| \\{ `kind`: `\"number\"`; `operator`: [`NumberOperator`](NumberOperator.md); `value`: `number`; \\} \\| \\{ `kind`: `\"date\"`; `operator`: [`DateOperator`](DateOperator.md); `value`: `string`; \\} \\| \\{ `checked`: `boolean`; `kind`: `\"checkbox\"`; \\} \\| \\{ `kind`: `\"options\"`; `operator`: [`SetOperator`](SetOperator.md); `options`: `string`[]; \\} \\| \\{ `entities`: `string`[]; `kind`: `\"entities\"`; `operator`: [`SetOperator`](SetOperator.md); \\}\n\nWhat a column's cell must be, by the kind of value the column holds.\n\n## Union Members\n\n### Type Literal\n\n\\{ `kind`: `\"presence\"`; `operator`: [`PresenceOperator`](PresenceOperator.md); \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"presence\"` | - |\n| `operator` | [`PresenceOperator`](PresenceOperator.md) | Empty, or not. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"text\"`; `operator`: [`TextOperator`](TextOperator.md); `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"text\"` | - |\n| `operator` | [`TextOperator`](TextOperator.md) | How the cell compares. |\n| `value` | `string` | The text compared against, ignoring case for the containment tests. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"number\"`; `operator`: [`NumberOperator`](NumberOperator.md); `value`: `number`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"number\"` | - |\n| `operator` | [`NumberOperator`](NumberOperator.md) | How the cell compares. |\n| `value` | `number` | The number compared against; finite. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"date\"`; `operator`: [`DateOperator`](DateOperator.md); `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"date\"` | - |\n| `operator` | [`DateOperator`](DateOperator.md) | How the cell compares. |\n| `value` | `string` | The date-time compared against. |\n\n***\n\n### Type Literal\n\n\\{ `checked`: `boolean`; `kind`: `\"checkbox\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `checked` | `boolean` | Whether the box is checked. |\n| `kind` | `\"checkbox\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"options\"`; `operator`: [`SetOperator`](SetOperator.md); `options`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"options\"` | - |\n| `operator` | [`SetOperator`](SetOperator.md) | How the cell's options relate to these. |\n| `options` | `string`[] | Options of the column; at least one. |\n\n***\n\n### Type Literal\n\n\\{ `entities`: `string`[]; `kind`: `\"entities\"`; `operator`: [`SetOperator`](SetOperator.md); \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `entities` | `string`[] | Entity ids, or for a relation the related rows' ids; at least one. |\n| `kind` | `\"entities\"` | - |\n| `operator` | [`SetOperator`](SetOperator.md) | How the cell's references relate to these. |\n\n\n<!-- generated/storage/types.gen/type-aliases/Formula.md -->\n# Type Alias: Formula\n\n> **Formula** = \\{ `column`: `string`; `kind`: `\"column\"`; \\} \\| \\{ `kind`: `\"number\"`; `value`: `number`; \\} \\| \\{ `kind`: `\"binary\"`; `left`: `Formula`; `operator`: [`Operator`](Operator.md); `right`: `Formula`; \\} \\| \\{ `kind`: `\"negate\"`; `operand`: `Formula`; \\}\n\nAn expression over one row's cells.\n\n## Union Members\n\n### Type Literal\n\n\\{ `column`: `string`; `kind`: `\"column\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `column` | `string` | The column placement. |\n| `kind` | `\"column\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"number\"`; `value`: `number`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"number\"` | - |\n| `value` | `number` | The value; finite. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"binary\"`; `left`: `Formula`; `operator`: [`Operator`](Operator.md); `right`: `Formula`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"binary\"` | - |\n| `left` | `Formula` | The left operand. |\n| `operator` | [`Operator`](Operator.md) | How. |\n| `right` | `Formula` | The right operand. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"negate\"`; `operand`: `Formula`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"negate\"` | - |\n| `operand` | `Formula` | The expression negated; a number. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ImportedAuthor.md -->\n# Type Alias: ImportedAuthor\n\n> **ImportedAuthor** = \\{ `name`: `string`; \\}\n\nDisplay attribution for a comment imported from an external document.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-name\"></a> `name` | `string` | Original author text; never interpreted as an authenticated principal. |\n\n\n<!-- generated/storage/types.gen/type-aliases/Lane.md -->\n# Type Alias: Lane\n\n> **Lane** = \\{ `hidden?`: `boolean`; `key`: [`LaneKey`](LaneKey.md); \\}\n\nHow one lane shows in a board layout.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-hidden\"></a> `hidden?` | `boolean` | Whether it is hidden. |\n| <a id=\"property-key\"></a> `key` | [`LaneKey`](LaneKey.md) | The lane. |\n\n\n<!-- generated/storage/types.gen/type-aliases/LaneKey.md -->\n# Type Alias: LaneKey\n\n> **LaneKey** = \\{ `id`: `string`; `kind`: `\"option\"`; \\} \\| \\{ `id`: `string`; `kind`: `\"user\"`; \\} \\| \\{ `kind`: `\"none\"`; \\}\n\nA lane of a board, named by what its cards' grouping cells hold: one\noption of a select, one person, or nothing.\n\n## Union Members\n\n### Type Literal\n\n\\{ `id`: `string`; `kind`: `\"option\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | The cards holding this option of the board's select column. |\n| `kind` | `\"option\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: `string`; `kind`: `\"user\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | The cards naming this person in the board's person column. |\n| `kind` | `\"user\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"none\"`; \\}\n\n\n<!-- generated/storage/types.gen/type-aliases/LinkShare.md -->\n# Type Alias: LinkShare\n\n> **LinkShare** = `\"PUBLIC\"` \\| `\"TEAM\"`\n\nDefines who can access an item through its share link.\n\n\n<!-- generated/storage/types.gen/type-aliases/Message.md -->\n# Type Alias: Message\n\n> **Message** = \\{ `attachments`: [`MessageAttachment`](MessageAttachment.md)[]; `bot_profile?`: `null` \\| [`BotSenderProfile`](BotSenderProfile.md); `content`: `string`; `created_at`: `string`; `deleted_at?`: `string` \\| `null`; `edited_at?`: `string` \\| `null`; `guest_name?`: `string` \\| `null`; `id`: `string`; `imported_author?`: `null` \\| [`ImportedAuthor`](ImportedAuthor.md); `mentions`: [`SimpleMention`](SimpleMention.md)[]; `parent`: [`MessageParent`](MessageParent.md); `reactions`: [`CountedReaction`](CountedReaction.md)[]; `sender_id`: `string`; `thread_id?`: `string` \\| `null`; `triggered_by?`: `string` \\| `null`; `updated_at`: `string`; \\}\n\nShared message representation for channel timelines and entity discussions.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-attachments\"></a> `attachments` | [`MessageAttachment`](MessageAttachment.md)[] | Attached entities. |\n| <a id=\"property-bot_profile\"></a> `bot_profile?` | `null` \\| [`BotSenderProfile`](BotSenderProfile.md) | - |\n| <a id=\"property-content\"></a> `content` | `string` | Macro Markdown body. |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | Creation time. |\n| <a id=\"property-deleted_at\"></a> `deleted_at?` | `string` \\| `null` | Message tombstone, independent of thread deletion. |\n| <a id=\"property-edited_at\"></a> `edited_at?` | `string` \\| `null` | Last content edit, if any. |\n| <a id=\"property-guest_name\"></a> `guest_name?` | `string` \\| `null` | Display name of a verified call guest, retained after the call ends. |\n| <a id=\"property-id\"></a> `id` | `string` | Message UUID. |\n| <a id=\"property-imported_author\"></a> `imported_author?` | `null` \\| [`ImportedAuthor`](ImportedAuthor.md) | - |\n| <a id=\"property-mentions\"></a> `mentions` | [`SimpleMention`](SimpleMention.md)[] | Tracked mentions, retained when a caller changes attachments only. |\n| <a id=\"property-parent\"></a> `parent` | [`MessageParent`](MessageParent.md) | Entity that owns this conversation. |\n| <a id=\"property-reactions\"></a> `reactions` | [`CountedReaction`](CountedReaction.md)[] | Aggregated reactions. |\n| <a id=\"property-sender_id\"></a> `sender_id` | `string` | Authenticated actor or owner of imported content. |\n| <a id=\"property-thread_id\"></a> `thread_id?` | `string` \\| `null` | Root message UUID for replies; absent on roots. |\n| <a id=\"property-triggered_by\"></a> `triggered_by?` | `string` \\| `null` | User who triggered a bot-authored message. |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` | Last persisted update. |\n\n\n<!-- generated/storage/types.gen/type-aliases/MessageAttachment.md -->\n# Type Alias: MessageAttachment\n\n> **MessageAttachment** = \\{ `created_at`: `string`; `entity_id`: `string`; `entity_type`: `string`; `height?`: `number` \\| `null`; `id`: `string`; `width?`: `number` \\| `null`; \\}\n\nAn entity attached to a message.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | When the attachment was added. |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | Attached entity identifier. |\n| <a id=\"property-entity_type\"></a> `entity_type` | `string` | Attached entity type. |\n| <a id=\"property-height\"></a> `height?` | `number` \\| `null` | Optional media height. |\n| <a id=\"property-id\"></a> `id` | `string` | Attachment UUID. |\n| <a id=\"property-width\"></a> `width?` | `number` \\| `null` | Optional media width. |\n\n\n<!-- generated/storage/types.gen/type-aliases/MessageCursor.md -->\n# Type Alias: MessageCursor\n\n> **MessageCursor** = \\{ `created_at`: `string`; `id`: `string`; \\}\n\nCursor for a chronological parent timeline.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | Last message creation time or activity occurrence time. |\n| <a id=\"property-id\"></a> `id` | `string` | Last entry UUID, used to break timestamp ties across both sources. |\n\n\n<!-- generated/storage/types.gen/type-aliases/MessageParent.md -->\n# Type Alias: MessageParent\n\n> **MessageParent** = \\{ `id`: `string`; `type`: `\"channel\"`; \\} \\| \\{ `id`: [`DocumentId`](DocumentId.md); `type`: `\"document\"`; \\} \\| \\{ `id`: `string`; `type`: `\"initiative\"`; \\} \\| \\{ `id`: `string`; `type`: `\"crm_company\"`; \\} \\| \\{ `id`: `string`; `type`: `\"crm_contact\"`; \\} \\| \\{ `id`: `string`; `type`: `\"call\"`; \\}\n\nThe entity whose permissions and lifecycle govern a message.\n\n## Union Members\n\n### Type Literal\n\n\\{ `id`: `string`; `type`: `\"channel\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | A channel, including direct messages. |\n| `type` | `\"channel\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: [`DocumentId`](DocumentId.md); `type`: `\"document\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | [`DocumentId`](DocumentId.md) | A document, including tasks and PDFs. |\n| `type` | `\"document\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: `string`; `type`: `\"initiative\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | An initiative, presented as a project in the application. |\n| `type` | `\"initiative\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: `string`; `type`: `\"crm_company\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | A CRM company. |\n| `type` | `\"crm_company\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: `string`; `type`: `\"crm_contact\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | A CRM contact. |\n| `type` | `\"crm_contact\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: `string`; `type`: `\"call\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | A video call and its persistent chat thread. |\n| `type` | `\"call\"` | - |\n\n\n<!-- generated/storage/types.gen/type-aliases/NewColumn.md -->\n# Type Alias: NewColumn\n\n> **NewColumn** = \\{ `inferType?`: `boolean`; `name`: `string`; `options?`: [`NewOption`](NewOption.md)[]; `source`: `\"new\"`; `type`: [`ColumnKind`](ColumnKind.md); \\} \\| \\{ `formula`: [`Formula`](Formula.md); `name`: `string`; `source`: `\"derived\"`; \\} \\| \\{ `property`: `string`; `source`: `\"existing\"`; \\}\n\nWhat a new column holds.\n\n## Union Members\n\n### Type Literal\n\n\\{ `inferType?`: `boolean`; `name`: `string`; `options?`: [`NewOption`](NewOption.md)[]; `source`: `\"new\"`; `type`: [`ColumnKind`](ColumnKind.md); \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `inferType?` | `boolean` | Let the column's first value settle its type: only for a plain text column. |\n| `name` | `string` | The column's name, unique within the table ignoring case. |\n| `options?` | [`NewOption`](NewOption.md)[] | For a select or tag column, the options it starts with, in order, each under an id the client mints. A select column with none accepts nothing until options are added. |\n| `source` | `\"new\"` | - |\n| `type` | [`ColumnKind`](ColumnKind.md) | Its type. A relation names the table whose rows it holds, one the caller can see. |\n\n***\n\n### Type Literal\n\n\\{ `formula`: [`Formula`](Formula.md); `name`: `string`; `source`: `\"derived\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `formula` | [`Formula`](Formula.md) | How its cells are computed: arithmetic over the table's number, date and other derived columns. |\n| `name` | `string` | The column's name, unique within the table ignoring case. |\n| `source` | `\"derived\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `property`: `string`; `source`: `\"existing\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `property` | `string` | The property's definition. |\n| `source` | `\"existing\"` | - |\n\n\n<!-- generated/storage/types.gen/type-aliases/NewOption.md -->\n# Type Alias: NewOption\n\n> **NewOption** = \\{ `id`: `string`; `label`: `string`; \\}\n\nA select or tag option to create.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-id\"></a> `id` | `string` | Its id, minted by the client; later ops of the request may name it. |\n| <a id=\"property-label\"></a> `label` | `string` | Its label, unique within the column ignoring case. A numeric select's labels are numbers. |\n\n\n<!-- generated/storage/types.gen/type-aliases/NewView.md -->\n# Type Alias: NewView\n\n> **NewView** = \\{ `layout`: [`RequestedLayout`](RequestedLayout.md); `name`: `string`; `query?`: [`ViewQuery`](ViewQuery.md); \\}\n\nA view's contents as an op creates it; the server gives it its id,\nposition and times.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-layout\"></a> `layout` | [`RequestedLayout`](RequestedLayout.md) | How it draws them; a board left without a card title gets the table's first column. |\n| <a id=\"property-name\"></a> `name` | `string` | Its name. |\n| <a id=\"property-query\"></a> `query?` | [`ViewQuery`](ViewQuery.md) | Which rows it shows, in what order. |\n\n\n<!-- generated/storage/types.gen/type-aliases/NumberOperator.md -->\n# Type Alias: NumberOperator\n\n> **NumberOperator** = `\"is\"` \\| `\"isNot\"` \\| `\"greaterThan\"` \\| `\"greaterThanOrEqual\"` \\| `\"lessThan\"` \\| `\"lessThanOrEqual\"`\n\nHow a number cell compares to a number.\n\n\n<!-- generated/storage/types.gen/type-aliases/OpResult.md -->\n# Type Alias: OpResult\n\n> **OpResult** = \\{ `change`: [`TableResult`](TableResult.md); `kind`: `\"table\"`; `table`: `string`; `tableVersion?`: [`TableVersion`](TableVersion.md); \\} \\| \\{ `change`: [`ColumnResult`](ColumnResult.md); `column`: `string`; `kind`: `\"column\"`; `table`: `string`; `tableVersion`: [`TableVersion`](TableVersion.md); \\} \\| \\{ `change`: [`RowsResult`](RowsResult.md); `kind`: `\"rows\"`; `table`: `string`; `tableVersion`: [`TableVersion`](TableVersion.md); \\} \\| \\{ `change`: [`ViewResult`](ViewResult.md); `kind`: `\"view\"`; `table`: `string`; `tableVersion`: [`TableVersion`](TableVersion.md); `view`: `string`; \\} \\| \\{ `kind`: `\"reorder_tables\"`; `tables`: [`VersionedTable`](VersionedTable.md)[]; \\}\n\nWhat one op did, in the order the ops were sent, grouped as the ops are:\na result's `kind` is its op's, naming the same resource, and its\n`change` says what happened to it.\n\n## Union Members\n\n### Type Literal\n\n\\{ `change`: [`TableResult`](TableResult.md); `kind`: `\"table\"`; `table`: `string`; `tableVersion?`: [`TableVersion`](TableVersion.md); \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `change` | [`TableResult`](TableResult.md) | What happened to it. |\n| `kind` | `\"table\"` | - |\n| `table` | `string` | The table. |\n| `tableVersion?` | [`TableVersion`](TableVersion.md) | Its version once the request committed; left out when the op removed it. |\n\n***\n\n### Type Literal\n\n\\{ `change`: [`ColumnResult`](ColumnResult.md); `column`: `string`; `kind`: `\"column\"`; `table`: `string`; `tableVersion`: [`TableVersion`](TableVersion.md); \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `change` | [`ColumnResult`](ColumnResult.md) | What happened to it. |\n| `column` | `string` | The column. |\n| `kind` | `\"column\"` | - |\n| `table` | `string` | The table. |\n| `tableVersion` | [`TableVersion`](TableVersion.md) | The table's version once the request committed. |\n\n***\n\n### Type Literal\n\n\\{ `change`: [`RowsResult`](RowsResult.md); `kind`: `\"rows\"`; `table`: `string`; `tableVersion`: [`TableVersion`](TableVersion.md); \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `change` | [`RowsResult`](RowsResult.md) | What happened to them. |\n| `kind` | `\"rows\"` | - |\n| `table` | `string` | The table. |\n| `tableVersion` | [`TableVersion`](TableVersion.md) | The table's version once the request committed. |\n\n***\n\n### Type Literal\n\n\\{ `change`: [`ViewResult`](ViewResult.md); `kind`: `\"view\"`; `table`: `string`; `tableVersion`: [`TableVersion`](TableVersion.md); `view`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `change` | [`ViewResult`](ViewResult.md) | What happened to it. |\n| `kind` | `\"view\"` | - |\n| `table` | `string` | The view's table. |\n| `tableVersion` | [`TableVersion`](TableVersion.md) | The table's version once the request committed. |\n| `view` | `string` | The view. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"reorder_tables\"`; `tables`: [`VersionedTable`](VersionedTable.md)[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"reorder_tables\"` | - |\n| `tables` | [`VersionedTable`](VersionedTable.md)[] | Every table, in its new order, with its version once the request committed. |\n\n\n<!-- generated/storage/types.gen/type-aliases/Operator.md -->\n# Type Alias: Operator\n\n> **Operator** = `\"add\"` \\| `\"subtract\"` \\| `\"multiply\"` \\| `\"divide\"`\n\nAn arithmetic operator.\n\n\n<!-- generated/storage/types.gen/type-aliases/OptionRef.md -->\n# Type Alias: OptionRef\n\n> **OptionRef** = \\{ `id`: `string`; \\} \\| \\{ `label`: `string`; \\}\n\nA select option, by its id or by its label.\n\n## Union Members\n\n### Type Literal\n\n\\{ `id`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | An option the column has. |\n\n***\n\n### Type Literal\n\n\\{ `label`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `label` | `string` | An option's label, matched without regard to case. An unknown label is refused. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ParticipantRole.md -->\n# Type Alias: ParticipantRole\n\n> **ParticipantRole** = `\"owner\"` \\| `\"admin\"` \\| `\"member\"`\n\nThe role a user has within a channel.\n\n\n<!-- generated/storage/types.gen/type-aliases/Pipeline.md -->\n# Type Alias: Pipeline\n\n> **Pipeline** = \\{ `createdAt`: `string`; `databaseId`: `string`; `id`: `string`; `name`: `string`; `primaryColumnId`: `string`; `recordType`: [`PipelineRecordType`](PipelineRecordType.md); `sharing`: [`PipelineSharing`](PipelineSharing.md); `tableId`: `string`; `teamId`: `string`; `trashedAt`: `string` \\| `null`; `userId`: `string`; \\}\n\nPipeline metadata; table schema and data are read through the database service.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-createdat\"></a> `createdAt` | `string` | Creation time. |\n| <a id=\"property-databaseid\"></a> `databaseId` | `string` | Dedicated backing database. |\n| <a id=\"property-id\"></a> `id` | `string` | Entity identity, used with `CrmPipeline` access receipts. |\n| <a id=\"property-name\"></a> `name` | `string` | Pipeline display name. |\n| <a id=\"property-primarycolumnid\"></a> `primaryColumnId` | `string` | Protected primary column. |\n| <a id=\"property-recordtype\"></a> `recordType` | [`PipelineRecordType`](PipelineRecordType.md) | Kind of the primary reference. |\n| <a id=\"property-sharing\"></a> `sharing` | [`PipelineSharing`](PipelineSharing.md) | Whether the pipeline has a team grant. |\n| <a id=\"property-tableid\"></a> `tableId` | `string` | Table of entries. |\n| <a id=\"property-teamid\"></a> `teamId` | `string` | Team owning the pipeline; references retain their own access controls. |\n| <a id=\"property-trashedat\"></a> `trashedAt` | `string` \\| `null` | Trashed pipelines are omitted from navigation. |\n| <a id=\"property-userid\"></a> `userId` | `string` | Owning user; sharing never changes ownership. |\n\n\n<!-- generated/storage/types.gen/type-aliases/PipelineRecordType.md -->\n# Type Alias: PipelineRecordType\n\n> **PipelineRecordType** = `\"company\"` \\| `\"contact\"`\n\nWhich CRM entity each row references. Fixed when a pipeline is created.\n\n\n<!-- generated/storage/types.gen/type-aliases/PipelineSharing.md -->\n# Type Alias: PipelineSharing\n\n> **PipelineSharing** = `\"private\"` \\| `\"team\"`\n\nInitial sharing, or the desired team grant. Individual ownership is preserved.\n\n\n<!-- generated/storage/types.gen/type-aliases/PresenceOperator.md -->\n# Type Alias: PresenceOperator\n\n> **PresenceOperator** = `\"isEmpty\"` \\| `\"isNotEmpty\"`\n\nWhether a cell is empty.\n\n\n<!-- generated/storage/types.gen/type-aliases/PropertyDefinition.md -->\n# Type Alias: PropertyDefinition\n\n> **PropertyDefinition** = \\{ `created_at`: `string`; `data_type`: [`DataType`](DataType.md); `display_name`: `string`; `id`: `string`; `is_metadata`: `boolean`; `is_multi_select`: `boolean`; `is_system`: `boolean`; `owner`: [`PropertyOwner`](PropertyOwner.md); `specific_entity_type`: `null` \\| [`EntityType`](EntityType.md); `updated_at`: `string`; \\}\n\nProperty definition model (service representation).\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | - |\n| <a id=\"property-data_type\"></a> `data_type` | [`DataType`](DataType.md) | - |\n| <a id=\"property-display_name\"></a> `display_name` | `string` | - |\n| <a id=\"property-id\"></a> `id` | `string` | - |\n| <a id=\"property-is_metadata\"></a> `is_metadata` | `boolean` | Flag to indicate if this is a system-generated metadata property. Not stored in database - computed at service layer. |\n| <a id=\"property-is_multi_select\"></a> `is_multi_select` | `boolean` | - |\n| <a id=\"property-is_system\"></a> `is_system` | `boolean` | Flag to indicate if this is a system property (stored in DB). |\n| <a id=\"property-owner\"></a> `owner` | [`PropertyOwner`](PropertyOwner.md) | - |\n| <a id=\"property-specific_entity_type\"></a> `specific_entity_type` | `null` \\| [`EntityType`](EntityType.md) | - |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` | - |\n\n\n<!-- generated/storage/types.gen/type-aliases/PropertyDefinitionWithOptions.md -->\n# Type Alias: PropertyDefinitionWithOptions\n\n> **PropertyDefinitionWithOptions** = \\{ `definition`: [`PropertyDefinition`](PropertyDefinition.md); `property_options`: [`PropertyOption`](PropertyOption.md)[]; \\}\n\nProperty definition with its associated options (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-definition\"></a> `definition` | [`PropertyDefinition`](PropertyDefinition.md) |\n| <a id=\"property-property_options\"></a> `property_options` | [`PropertyOption`](PropertyOption.md)[] |\n\n\n<!-- generated/storage/types.gen/type-aliases/PropertyOption.md -->\n# Type Alias: PropertyOption\n\n> **PropertyOption** = \\{ `color`: `string` \\| `null`; `created_at`: `string`; `display_order`: `number`; `id`: `string`; `property_definition_id`: `string`; `updated_at`: `string`; `value`: [`PropertyOptionValue`](PropertyOptionValue.md); \\}\n\nA selectable option for select-type properties (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-color\"></a> `color` | `string` \\| `null` |\n| <a id=\"property-created_at\"></a> `created_at` | `string` |\n| <a id=\"property-display_order\"></a> `display_order` | `number` |\n| <a id=\"property-id\"></a> `id` | `string` |\n| <a id=\"property-property_definition_id\"></a> `property_definition_id` | `string` |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` |\n| <a id=\"property-value\"></a> `value` | [`PropertyOptionValue`](PropertyOptionValue.md) |\n\n\n<!-- generated/storage/types.gen/type-aliases/PropertyOptionValue.md -->\n# Type Alias: PropertyOptionValue\n\n> **PropertyOptionValue** = \\{ `type`: `\"string\"`; `value`: `string`; \\} \\| \\{ `type`: `\"number\"`; `value`: `number`; \\}\n\nThe value of a property option - either a string or a number.\n\n## Union Members\n\n### Type Literal\n\n\\{ `type`: `\"string\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"string\"` | - |\n| `value` | `string` | String value for SelectString properties |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"number\"`; `value`: `number`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"number\"` | - |\n| `value` | `number` | Number value for SelectNumber properties |\n\n\n<!-- generated/storage/types.gen/type-aliases/PropertyOwner.md -->\n# Type Alias: PropertyOwner\n\n> **PropertyOwner** = \\{ `scope`: `\"user\"`; `user_id`: `string`; \\} \\| \\{ `scope`: `\"team\"`; `team_id`: `string`; \\} \\| \\{ `database_id`: `string`; `scope`: `\"database\"`; \\} \\| \\{ `scope`: `\"system\"`; \\}\n\nDefines who owns a property - user-scoped, team-scoped, database-scoped, or system.\n\n\n<!-- generated/storage/types.gen/type-aliases/PropertyValue.md -->\n# Type Alias: PropertyValue\n\n> **PropertyValue** = \\{ `type`: `\"Boolean\"`; `value`: `boolean`; \\} \\| \\{ `type`: `\"Number\"`; `value`: `number`; \\} \\| \\{ `type`: `\"String\"`; `value`: `string`; \\} \\| \\{ `type`: `\"Date\"`; `value`: `string`; \\} \\| \\{ `type`: `\"SelectOption\"`; `value`: `string`[]; \\} \\| \\{ `type`: `\"EntityReference\"`; `value`: [`EntityReference`](EntityReference.md)[]; \\} \\| \\{ `type`: `\"Link\"`; `value`: `string`[]; \\}\n\nProperty value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to/from JSONB in the database.\n\n## Union Members\n\n### Type Literal\n\n\\{ `type`: `\"Boolean\"`; `value`: `boolean`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Boolean\"` | - |\n| `value` | `boolean` | Boolean value Serializes as: {\"type\": \"Boolean\", \"value\": true} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"Number\"`; `value`: `number`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Number\"` | - |\n| `value` | `number` | Numeric value Serializes as: {\"type\": \"Number\", \"value\": 42.5} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"String\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"String\"` | - |\n| `value` | `string` | String value Serializes as: {\"type\": \"String\", \"value\": \"text\"} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"Date\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Date\"` | - |\n| `value` | `string` | Date/timestamp value Serializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"SelectOption\"`; `value`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"SelectOption\"` | - |\n| `value` | `string`[] | Select option(s) - always an array (check is_multi_select to determine if single or multi) Single-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1) Multi-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+) |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"EntityReference\"`; `value`: [`EntityReference`](EntityReference.md)[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"EntityReference\"` | - |\n| `value` | [`EntityReference`](EntityReference.md)[] | Entity reference(s) - always an array (check is_multi_select to determine if single or multi) Single-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1) Multi-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+) |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"Link\"`; `value`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Link\"` | - |\n| `value` | `string`[] | Link value(s) - always an array (check is_multi_select to determine if single or multi) Single-select: {\"type\": \"Link\", \"value\": [\"https://example.com\"]} (length 0 or 1) Multi-select: {\"type\": \"Link\", \"value\": [\"https://example.com\", \"https://other.com\"]} (length 0+) |\n\n\n<!-- generated/storage/types.gen/type-aliases/ReplaceCrmStagesRequest.md -->\n# Type Alias: ReplaceCrmStagesRequest\n\n> **ReplaceCrmStagesRequest** = \\{ `stages`: [`CrmStageInput`](CrmStageInput.md)[]; \\}\n\nRequest body for `PUT /crm/stages`: the whole stage set in order.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-stages\"></a> `stages` | [`CrmStageInput`](CrmStageInput.md)[] | Stages first to last. |\n\n\n<!-- generated/storage/types.gen/type-aliases/RequestedLayout.md -->\n# Type Alias: RequestedLayout\n\n> **RequestedLayout** = \\{ `columns`: [`ViewColumn`](ViewColumn.md)[]; `kind`: `\"table\"`; \\} \\| \\{ `cardFields`: `string`[]; `groupBy`: `string`; `hideEmptyLanes`: `boolean`; `kind`: `\"board\"`; `lanes`: [`Lane`](Lane.md)[]; `title?`: `string`; \\}\n\nA layout as an op asks for it: a board may leave its card title out.\n\n## Union Members\n\n### Type Literal\n\n\\{ `columns`: [`ViewColumn`](ViewColumn.md)[]; `kind`: `\"table\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `columns` | [`ViewColumn`](ViewColumn.md)[] | How columns show, in display order. A column left out shows after the listed ones, in the table's order. |\n| `kind` | `\"table\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `cardFields`: `string`[]; `groupBy`: `string`; `hideEmptyLanes`: `boolean`; `kind`: `\"board\"`; `lanes`: [`Lane`](Lane.md)[]; `title?`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `cardFields` | `string`[] | The columns a card shows under its title, in order. |\n| `groupBy` | `string` | The single-select or single-person column whose values are the lanes. |\n| `hideEmptyLanes` | `boolean` | Whether a lane with no cards is hidden. |\n| `kind` | `\"board\"` | - |\n| `lanes` | [`Lane`](Lane.md)[] | How lanes show, in display order. |\n| `title?` | `string` | The column a card is titled by. Left out, a board keeps the title it has, and a new board takes the table's first column. |\n\n\n<!-- generated/storage/types.gen/type-aliases/RowChange.md -->\n# Type Alias: RowChange\n\n> **RowChange** = \\{ `cells`: [`CellWrite`](CellWrite.md)[]; `row`: `string`; \\}\n\nOne row's cells in a [`RowChanges::PerRow`] update.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-cells\"></a> `cells` | [`CellWrite`](CellWrite.md)[] | Its new cells. |\n| <a id=\"property-row\"></a> `row` | `string` | The row. |\n\n\n<!-- generated/storage/types.gen/type-aliases/RowChanges.md -->\n# Type Alias: RowChanges\n\n> **RowChanges** = \\{ `cells`: [`CellWrite`](CellWrite.md)[]; `kind`: `\"uniform\"`; `rows`: `string`[]; \\} \\| \\{ `kind`: `\"per_row\"`; `rows`: [`RowChange`](RowChange.md)[]; \\}\n\nWhich rows an update writes, and with what.\n\n## Union Members\n\n### Type Literal\n\n\\{ `cells`: [`CellWrite`](CellWrite.md)[]; `kind`: `\"uniform\"`; `rows`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `cells` | [`CellWrite`](CellWrite.md)[] | The cells each of them gets. |\n| `kind` | `\"uniform\"` | - |\n| `rows` | `string`[] | The rows. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"per_row\"`; `rows`: [`RowChange`](RowChange.md)[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"per_row\"` | - |\n| `rows` | [`RowChange`](RowChange.md)[] | The rows and their cells, in order. |\n\n\n<!-- generated/storage/types.gen/type-aliases/RowId.md -->\n# Type Alias: RowId\n\n> **RowId** = `string`\n\nIdentifier of a row.\n\n\n<!-- generated/storage/types.gen/type-aliases/RowsChange.md -->\n# Type Alias: RowsChange\n\n> **RowsChange** = \\{ `kind`: `\"insert\"`; `rows`: [`CellWrite`](CellWrite.md)[][]; \\} \\| \\{ `changes`: [`RowChanges`](RowChanges.md); `kind`: `\"update\"`; \\} \\| \\{ `kind`: `\"delete\"`; `rows`: `string`[]; \\}\n\nA write to a table's rows.\n\n## Union Members\n\n### Type Literal\n\n\\{ `kind`: `\"insert\"`; `rows`: [`CellWrite`](CellWrite.md)[][]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"insert\"` | - |\n| `rows` | [`CellWrite`](CellWrite.md)[][] | One entry per new row: the cells it starts with. Columns left out start empty. |\n\n***\n\n### Type Literal\n\n\\{ `changes`: [`RowChanges`](RowChanges.md); `kind`: `\"update\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `changes` | [`RowChanges`](RowChanges.md) | Which rows get which cells. |\n| `kind` | `\"update\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"delete\"`; `rows`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"delete\"` | - |\n| `rows` | `string`[] | The rows, each named once. |\n\n\n<!-- generated/storage/types.gen/type-aliases/RowsResult.md -->\n# Type Alias: RowsResult\n\n> **RowsResult** = \\{ `kind`: `\"inserted\"`; `rows`: `string`[]; \\} \\| \\{ `affected`: `number`; `kind`: `\"updated\"`; \\} \\| \\{ `affected`: `number`; `kind`: `\"deleted\"`; \\}\n\nWhat happened to a table's rows.\n\n## Union Members\n\n### Type Literal\n\n\\{ `kind`: `\"inserted\"`; `rows`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"inserted\"` | - |\n| `rows` | `string`[] | The new rows, in the order they were sent. |\n\n***\n\n### Type Literal\n\n\\{ `affected`: `number`; `kind`: `\"updated\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `affected` | `number` | How many rows the op updated. |\n| `kind` | `\"updated\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `affected`: `number`; `kind`: `\"deleted\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `affected` | `number` | How many rows the op deleted. |\n| `kind` | `\"deleted\"` | - |\n\n\n<!-- generated/storage/types.gen/type-aliases/SetOperator.md -->\n# Type Alias: SetOperator\n\n> **SetOperator** = `\"isAnyOf\"` \\| `\"isNoneOf\"` \\| `\"hasAny\"` \\| `\"hasAll\"` \\| `\"hasNone\"`\n\nHow a cell's options or references relate to a set of them. The first\ntwo fit a column holding one value, the last three one holding several.\n\n\n<!-- generated/storage/types.gen/type-aliases/SharePermissionV2.md -->\n# Type Alias: SharePermissionV2\n\n> **SharePermissionV2** = \\{ `channelSharePermissions?`: [`ChannelSharePermission`](ChannelSharePermission.md)[] \\| `null`; `id`: `string`; `linkShare?`: `null` \\| [`LinkShare`](LinkShare.md); `linkShareAccessLevel?`: `null` \\| [`AccessLevel`](AccessLevel.md); `owner`: `string`; `teamShareAccessLevel?`: `null` \\| [`AccessLevel`](AccessLevel.md); \\}\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-channelsharepermissions\"></a> `channelSharePermissions?` | [`ChannelSharePermission`](ChannelSharePermission.md)[] \\| `null` | The channel share permissions for the item |\n| <a id=\"property-id\"></a> `id` | `string` | The share permission id |\n| <a id=\"property-linkshare\"></a> `linkShare?` | `null` \\| [`LinkShare`](LinkShare.md) | - |\n| <a id=\"property-linkshareaccesslevel\"></a> `linkShareAccessLevel?` | `null` \\| [`AccessLevel`](AccessLevel.md) | - |\n| <a id=\"property-owner\"></a> `owner` | `string` | The owner of the item |\n| <a id=\"property-teamshareaccesslevel\"></a> `teamShareAccessLevel?` | `null` \\| [`AccessLevel`](AccessLevel.md) | - |\n\n\n<!-- generated/storage/types.gen/type-aliases/SimpleMention.md -->\n# Type Alias: SimpleMention\n\n> **SimpleMention** = \\{ `entity_id`: `string`; `entity_type`: `string`; \\}\n\nA mention tracked in a message body.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | Mentioned entity identifier. |\n| <a id=\"property-entity_type\"></a> `entity_type` | `string` | Mentioned entity type. |\n\n\n<!-- generated/storage/types.gen/type-aliases/SortDirection.md -->\n# Type Alias: SortDirection\n\n> **SortDirection** = `\"ascending\"` \\| `\"descending\"`\n\nA sort direction. Empty cells sort last either way.\n\n\n<!-- generated/storage/types.gen/type-aliases/SortKey.md -->\n# Type Alias: SortKey\n\n> **SortKey** = \\{ `column`: `string`; `direction`: [`SortDirection`](SortDirection.md); \\}\n\nOne sort key.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-column\"></a> `column` | `string` | The column sorted on. |\n| <a id=\"property-direction\"></a> `direction` | [`SortDirection`](SortDirection.md) | Which way. |\n\n\n<!-- generated/storage/types.gen/type-aliases/StorageRow.md -->\n# Type Alias: StorageRow\n\n> **StorageRow** = \\{ `cells`: \\{\\[`key`: `string`\\]: [`PropertyValue`](PropertyValue.md); \\}; `rowId`: [`RowId`](RowId.md); \\}\n\nOne storage row, with cells keyed by column placement.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-cells\"></a> `cells` | \\{\\[`key`: `string`\\]: [`PropertyValue`](PropertyValue.md); \\} | Populated cells. |\n| <a id=\"property-rowid\"></a> `rowId` | [`RowId`](RowId.md) | Row identity, independent of any referenced entity. |\n\n\n<!-- generated/storage/types.gen/type-aliases/Table.md -->\n# Type Alias: Table\n\n> **Table** = \\{ `database_id`: `string`; `id`: `string`; `name`: `string`; `position`: `string`; `version`: [`TableVersion`](TableVersion.md); \\}\n\nOne table (tab) of a database.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-database_id\"></a> `database_id` | `string` | Owning database. |\n| <a id=\"property-id\"></a> `id` | `string` | Identifier. |\n| <a id=\"property-name\"></a> `name` | `string` | Display name; also the basis of the table's SQL name. |\n| <a id=\"property-position\"></a> `position` | `string` | Fractional index for tab ordering. |\n| <a id=\"property-version\"></a> `version` | [`TableVersion`](TableVersion.md) | Current version. |\n\n\n<!-- generated/storage/types.gen/type-aliases/TableChange.md -->\n# Type Alias: TableChange\n\n> **TableChange** = \\{ `kind`: `\"create\"`; `name`: `string`; \\} \\| \\{ `kind`: `\"rename\"`; `name`: `string`; `previousName?`: `string`; \\} \\| \\{ `kind`: `\"delete\"`; \\} \\| \\{ `kind`: `\"reorder_columns\"`; `order`: `string`[]; \\} \\| \\{ `kind`: `\"reorder_views\"`; `order`: `string`[]; \\}\n\nA change to a table itself.\n\n## Union Members\n\n### Type Literal\n\n\\{ `kind`: `\"create\"`; `name`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"create\"` | - |\n| `name` | `string` | Its name, unique within the database ignoring case. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"rename\"`; `name`: `string`; `previousName?`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"rename\"` | - |\n| `name` | `string` | Its new name, unique within the database ignoring case. |\n| `previousName?` | `string` | The name the caller saw. Given, the rename is refused if the table goes by another one now, so a concurrent rename is not overwritten. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"delete\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"reorder_columns\"`; `order`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"reorder_columns\"` | - |\n| `order` | `string`[] | Its columns, in their new order. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"reorder_views\"`; `order`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"reorder_views\"` | - |\n| `order` | `string`[] | Its views, in their new order. |\n\n\n<!-- generated/storage/types.gen/type-aliases/TableDetail.md -->\n# Type Alias: TableDetail\n\n> **TableDetail** = \\{ `columns`: [`ColumnDetail`](ColumnDetail.md)[]; `sql_name`: `string`; `table`: [`Table`](Table.md); `views`: [`DatabaseView`](DatabaseView.md)[]; \\}\n\nOne table with its columns and SQL name.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-columns\"></a> `columns` | [`ColumnDetail`](ColumnDetail.md)[] | Columns in display order. |\n| <a id=\"property-sql_name\"></a> `sql_name` | `string` | The name SQL refers to the table by: its display name quoted and qualified by the database's (`FROM \"Plans\".\"Table 1\"`). |\n| <a id=\"property-table\"></a> `table` | [`Table`](Table.md) | The table. |\n| <a id=\"property-views\"></a> `views` | [`DatabaseView`](DatabaseView.md)[] | The table's views, in their order. |\n\n\n<!-- generated/storage/types.gen/type-aliases/TableResult.md -->\n# Type Alias: TableResult\n\n> **TableResult** = \\{ `kind`: `\"created\"`; \\} \\| \\{ `kind`: `\"renamed\"`; \\} \\| \\{ `kind`: `\"deleted\"`; \\} \\| \\{ `kind`: `\"columns_reordered\"`; \\} \\| \\{ `kind`: `\"views_reordered\"`; `positions`: [`ViewPosition`](ViewPosition.md)[]; \\}\n\nWhat happened to a table.\n\n## Union Members\n\n### Type Literal\n\n\\{ `kind`: `\"created\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"renamed\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"deleted\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"columns_reordered\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"views_reordered\"`; `positions`: [`ViewPosition`](ViewPosition.md)[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"views_reordered\"` | - |\n| `positions` | [`ViewPosition`](ViewPosition.md)[] | Every view's key, in their new order. |\n\n\n<!-- generated/storage/types.gen/type-aliases/TableVersion.md -->\n# Type Alias: TableVersion\n\n> **TableVersion** = `number`\n\nMonotonic per-table version, bumped once by every committed change to a\ntable's schema or rows. Schema edits name the version they were made\nagainst, and change events carry the new one.\n\n\n<!-- generated/storage/types.gen/type-aliases/TeamRole.md -->\n# Type Alias: TeamRole\n\n> **TeamRole** = `\"member\"` \\| `\"admin\"` \\| `\"owner\"`\n\nThe role a user has within a team.\n\nOrdered least to most privileged so comparisons reflect access strength.\n\n\n<!-- generated/storage/types.gen/type-aliases/TextOperator.md -->\n# Type Alias: TextOperator\n\n> **TextOperator** = `\"is\"` \\| `\"isNot\"` \\| `\"contains\"` \\| `\"doesNotContain\"` \\| `\"startsWith\"` \\| `\"endsWith\"`\n\nHow a text cell compares to a text.\n\n\n<!-- generated/storage/types.gen/type-aliases/ThreadAnchor.md -->\n# Type Alias: ThreadAnchor\n\n> **ThreadAnchor** = \\{ `mark_id`: `string`; `marked_text?`: `string` \\| `null`; `type`: `\"markdown\"`; \\} \\| \\{ `anchor_id`: `string`; `marked_text?`: `string` \\| `null`; `type`: `\"pdf_highlight\"`; \\} \\| \\{ `anchor_id`: `string`; `type`: `\"pdf_placeable\"`; \\} \\| \\{ `range`: `string`; `sheetId`: `string`; `sheetName`: `string`; `type`: `\"spreadsheet\"`; \\} \\| \\{ `nodeId?`: `string` \\| `null`; `pageId`: `string`; `type`: `\"fig\"`; `x`: `number`; `y`: `number`; \\}\n\nA thread's location within its document. PDF geometry remains annotation-owned.\n\n## Union Members\n\n### Type Literal\n\n\\{ `mark_id`: `string`; `marked_text?`: `string` \\| `null`; `type`: `\"markdown\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `mark_id` | `string` | Mark UUID serialized in the document. |\n| `marked_text?` | `string` \\| `null` | The marked text as it read when the discussion was created, already trimmed and bounded. Absent on threads created or imported before snapshots were captured: the text a mark covers cannot be recovered from the mark id alone. |\n| `type` | `\"markdown\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `anchor_id`: `string`; `marked_text?`: `string` \\| `null`; `type`: `\"pdf_highlight\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `anchor_id` | `string` | Highlight annotation UUID. |\n| `marked_text?` | `string` \\| `null` | The text the highlight covers, trimmed and bounded like a markdown snapshot. The highlight owns it and it can be edited there, so it is read from the highlight whenever the thread is, never stored on the thread. Absent when the highlight carries no text. |\n| `type` | `\"pdf_highlight\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `anchor_id`: `string`; `type`: `\"pdf_placeable\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `anchor_id` | `string` | Placeable annotation UUID. |\n| `type` | `\"pdf_placeable\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `range`: `string`; `sheetId`: `string`; `sheetName`: `string`; `type`: `\"spreadsheet\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `range` | `string` | A1 cell or range, such as B4 or B4:C9. |\n| `sheetId` | `string` | Stable sheet identity within the workbook. |\n| `sheetName` | `string` | Sheet name when the discussion was created. |\n| `type` | `\"spreadsheet\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `nodeId?`: `string` \\| `null`; `pageId`: `string`; `type`: `\"fig\"`; `x`: `number`; `y`: `number`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `nodeId?` | `string` \\| `null` | Layer the pin follows; absent for a pin on the bare canvas. |\n| `pageId` | `string` | Page (canvas) the pin is on. |\n| `type` | `\"fig\"` | - |\n| `x` | `number` | Horizontal offset from the layer's origin, or the page's when the pin is on no layer, in design units. |\n| `y` | `number` | Vertical offset, measured like `x`. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ThreadState.md -->\n# Type Alias: ThreadState\n\n> **ThreadState** = \\{ `anchor?`: `null` \\| [`ThreadAnchor`](ThreadAnchor.md); `created_at`: `string`; `deleted_at?`: `string` \\| `null`; `resolved`: `boolean`; `root_id`: `string`; `updated_at`: `string`; `user_id`: `string`; \\}\n\nState belonging to a whole thread, keyed by its root message.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-anchor\"></a> `anchor?` | `null` \\| [`ThreadAnchor`](ThreadAnchor.md) | - |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | Creation time of the discussion. |\n| <a id=\"property-deleted_at\"></a> `deleted_at?` | `string` \\| `null` | Explicit deletion of the entire thread, distinct from root deletion. |\n| <a id=\"property-resolved\"></a> `resolved` | `boolean` | Whether this discussion has been resolved. |\n| <a id=\"property-root_id\"></a> `root_id` | `string` | Root message UUID; there is no separate thread identity. |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` | Last state change. |\n| <a id=\"property-user_id\"></a> `user_id` | `string` | User who owns this discussion, including imported discussions. |\n\n\n<!-- generated/storage/types.gen/type-aliases/UpdateCrmTeamSettingsRequest.md -->\n# Type Alias: UpdateCrmTeamSettingsRequest\n\n> **UpdateCrmTeamSettingsRequest** = \\{ `closed_stage_ids?`: `string`[] \\| `null`; `default_team_view_id?`: `string` \\| `null`; `delete_records_role?`: `null` \\| [`CrmPermissionRole`](CrmPermissionRole.md); `edit_stages_role?`: `null` \\| [`CrmPermissionRole`](CrmPermissionRole.md); `move_closed_deals_role?`: `null` \\| [`CrmPermissionRole`](CrmPermissionRole.md); `team_views?`: `unknown`; \\}\n\nRequest body for `PUT /crm/settings`. Every field is optional:\nomitted fields keep their current values.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-closed_stage_ids\"></a> `closed_stage_ids?` | `string`[] \\| `null` | New closed-stage set. Omit to keep the current value; pass `null` to clear it (falling back to the client label heuristic). |\n| <a id=\"property-default_team_view_id\"></a> `default_team_view_id?` | `string` \\| `null` | New default team view id. Omit to keep the current value; pass `null` to clear it. |\n| <a id=\"property-delete_records_role\"></a> `delete_records_role?` | `null` \\| [`CrmPermissionRole`](CrmPermissionRole.md) | - |\n| <a id=\"property-edit_stages_role\"></a> `edit_stages_role?` | `null` \\| [`CrmPermissionRole`](CrmPermissionRole.md) | - |\n| <a id=\"property-move_closed_deals_role\"></a> `move_closed_deals_role?` | `null` \\| [`CrmPermissionRole`](CrmPermissionRole.md) | - |\n| <a id=\"property-team_views\"></a> `team_views?` | `unknown` | Replacement team-views array (whole-blob, last write wins). |\n\n\n<!-- generated/storage/types.gen/type-aliases/VersionedTable.md -->\n# Type Alias: VersionedTable\n\n> **VersionedTable** = \\{ `table`: `string`; `version`: [`TableVersion`](TableVersion.md); \\}\n\nA table and its version.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-table\"></a> `table` | `string` | The table. |\n| <a id=\"property-version\"></a> `version` | [`TableVersion`](TableVersion.md) | Its version. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ViewChange.md -->\n# Type Alias: ViewChange\n\n> **ViewChange** = \\{ `kind`: `\"create\"`; `view`: [`NewView`](NewView.md); \\} \\| \\{ `kind`: `\"update\"`; `layout?`: [`RequestedLayout`](RequestedLayout.md); `name?`: `string`; `query?`: [`ViewQuery`](ViewQuery.md); \\} \\| \\{ `kind`: `\"delete\"`; \\} \\| \\{ `after?`: `string` \\| `null`; `before?`: `string` \\| `null`; `kind`: `\"move_card\"`; `lane`: [`LaneKey`](LaneKey.md); `row`: `string`; \\}\n\nA change to one view.\n\n## Union Members\n\n### Type Literal\n\n\\{ `kind`: `\"create\"`; `view`: [`NewView`](NewView.md); \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"create\"` | - |\n| `view` | [`NewView`](NewView.md) | What it shows and how. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"update\"`; `layout?`: [`RequestedLayout`](RequestedLayout.md); `name?`: `string`; `query?`: [`ViewQuery`](ViewQuery.md); \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"update\"` | - |\n| `layout?` | [`RequestedLayout`](RequestedLayout.md) | Its new layout. A board grouped by another column forgets where its cards were; a board left without a card title keeps the one it has, or takes the table's first column. |\n| `name?` | `string` | Its new name. |\n| `query?` | [`ViewQuery`](ViewQuery.md) | Its new query. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"delete\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `after?`: `string` \\| `null`; `before?`: `string` \\| `null`; `kind`: `\"move_card\"`; `lane`: [`LaneKey`](LaneKey.md); `row`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `after?` | `string` \\| `null` | The card that ends up just after it, if any. Given with `before`, it must be the card right after `before`; with neither, the card goes to the end of the lane. |\n| `before?` | `string` \\| `null` | The card that ends up just before it (it lands right after this one), if any. |\n| `kind` | `\"move_card\"` | - |\n| `lane` | [`LaneKey`](LaneKey.md) | The lane it goes to: an option of a select board's column, a person for a board grouped by people, or the lane of empty cells. |\n| `row` | `string` | The card's row. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ViewColumn.md -->\n# Type Alias: ViewColumn\n\n> **ViewColumn** = \\{ `column`: `string`; `width`: `number` \\| `null`; \\}\n\nHow one column shows in a table layout.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-column\"></a> `column` | `string` | The column. |\n| <a id=\"property-width\"></a> `width` | `number` \\| `null` | Its width in pixels; the default when unset. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ViewLayout.md -->\n# Type Alias: ViewLayout\n\n> **ViewLayout** = \\{ `columns`: [`ViewColumn`](ViewColumn.md)[]; `kind`: `\"table\"`; \\} \\| \\{ `cardFields`: `string`[]; `groupBy`: `string`; `hideEmptyLanes`: `boolean`; `kind`: `\"board\"`; `lanes`: [`Lane`](Lane.md)[]; `title`: `string`; \\}\n\nHow a view draws its rows.\n\n## Union Members\n\n### Type Literal\n\n\\{ `columns`: [`ViewColumn`](ViewColumn.md)[]; `kind`: `\"table\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `columns` | [`ViewColumn`](ViewColumn.md)[] | How columns show, in display order. A column left out shows after the listed ones, in the table's order. |\n| `kind` | `\"table\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `cardFields`: `string`[]; `groupBy`: `string`; `hideEmptyLanes`: `boolean`; `kind`: `\"board\"`; `lanes`: [`Lane`](Lane.md)[]; `title`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `cardFields` | `string`[] | The columns a card shows under its title, in order. |\n| `groupBy` | `string` | The single-select or single-person column whose values are the lanes; moving a card to another lane sets this column. |\n| `hideEmptyLanes` | `boolean` | Whether a lane with no cards is hidden. |\n| `kind` | `\"board\"` | - |\n| `lanes` | [`Lane`](Lane.md)[] | How lanes show, in display order. A lane left out shows after the listed ones: the lane of empty cells first, then options in the column's order, or people by id. |\n| `title` | `string` | The column a card is titled by, of any type. Removing it titles the cards by the table's first remaining column. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ViewPosition.md -->\n# Type Alias: ViewPosition\n\n> **ViewPosition** = \\{ `position`: `string`; `view`: `string`; \\}\n\nA view's place among its table's views.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-position\"></a> `position` | `string` | Its key. |\n| <a id=\"property-view\"></a> `view` | `string` | The view. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ViewQuery.md -->\n# Type Alias: ViewQuery\n\n> **ViewQuery** = \\{ `filter`: `null` \\| [`FilterGroup`](FilterGroup.md); `sort?`: [`SortKey`](SortKey.md)[]; \\}\n\nWhich rows of the table a view shows, and in what order: a filter and a\nsort, nothing that joins, groups or reshapes rows.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-filter\"></a> `filter` | `null` \\| [`FilterGroup`](FilterGroup.md) | - |\n| <a id=\"property-sort\"></a> `sort?` | [`SortKey`](SortKey.md)[] | The sort keys, first key first. Rows the keys leave tied keep the table's own order; with no keys, the table's order is the view's. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ViewResult.md -->\n# Type Alias: ViewResult\n\n> **ViewResult** = \\{ `kind`: `\"created\"`; `view`: [`DatabaseView`](DatabaseView.md); \\} \\| \\{ `kind`: `\"updated\"`; `view`: [`DatabaseView`](DatabaseView.md); \\} \\| \\{ `kind`: `\"deleted\"`; \\} \\| \\{ `kind`: `\"card_moved\"`; `positions`: [`CardPosition`](CardPosition.md)[]; \\}\n\nWhat happened to a view.\n\n## Union Members\n\n### Type Literal\n\n\\{ `kind`: `\"created\"`; `view`: [`DatabaseView`](DatabaseView.md); \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"created\"` | - |\n| `view` | [`DatabaseView`](DatabaseView.md) | The view as stored. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"updated\"`; `view`: [`DatabaseView`](DatabaseView.md); \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"updated\"` | - |\n| `view` | [`DatabaseView`](DatabaseView.md) | The view as stored. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"deleted\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"card_moved\"`; `positions`: [`CardPosition`](CardPosition.md)[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"card_moved\"` | - |\n| `positions` | [`CardPosition`](CardPosition.md)[] | The positions written, the moved card's last. |\n\n\n<!-- src/entities/crm/comment/classes/CrmComment.md -->\n# Class: CrmComment\n\nA comment on a CRM company or contact: a message whose parent is the\nrecord, addressed by the record and the message UUID. Its record and\nmutations are the ones document comments and channel messages use.\n\n## Extends\n\n- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\\<[`Message`](../../../../../generated/storage/types.gen/type-aliases/Message.md)\\>\n\n## Properties\n\n| Property | Modifier | Type | Description | Inherited from |\n| ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-createdat\"></a> `createdAt` | `readonly` | () => `Promise`\\<`string`\\> | When the comment was created. | - |\n| <a id=\"property-deletedat\"></a> `deletedAt` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | When the comment was deleted, if it has been. | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |\n| <a id=\"property-parent\"></a> `parent` | `readonly` | [`CrmCommentParent`](../interfaces/CrmCommentParent.md) | The company or contact this comment belongs to. | - |\n| <a id=\"property-text\"></a> `text` | `readonly` | () => `Promise`\\<`string`\\> | The comment's text (markdown). | - |\n| <a id=\"property-updatedat\"></a> `updatedAt` | `readonly` | () => `Promise`\\<`string`\\> | When the comment was last updated. | - |\n\n## Methods\n\n### author()\n\n> **author**(): `Promise`\\<[`User`](../../../users/user/classes/User.md)\\>\n\nThe user who wrote this comment.\n\n#### Returns\n\n`Promise`\\<[`User`](../../../users/user/classes/User.md)\\>\n\n***\n\n### delete()\n\n> **delete**(): `Promise`\\<`void`\\>\n\nDelete this comment. Deleting a thread's root keeps its replies.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### edit()\n\n> **edit**(`body`): `Promise`\\<`CrmComment`\\>\n\nReplace the comment's text. Only its author may.\n\n#### Parameters\n\n| Parameter | Type | Description |\n| ------ | ------ | ------ |\n| `body` | `string` \\| [`RichMessage`](../../../../mentions/interfaces/RichMessage.md) | Plain text, or a rich body composed with msg. |\n\n#### Returns\n\n`Promise`\\<`CrmComment`\\>\n\n***\n\n### reply()\n\n> **reply**(`body`): `Promise`\\<`CrmComment`\\>\n\nReply in this comment's thread.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `body` | `string` \\| [`RichMessage`](../../../../mentions/interfaces/RichMessage.md) |\n\n#### Returns\n\n`Promise`\\<`CrmComment`\\>\n\n***\n\n### threadId()\n\n> **threadId**(): `Promise`\\<`string`\\>\n\nThe id of the thread this comment belongs to: its root, or itself for a root.\n\n#### Returns\n\n`Promise`\\<`string`\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`Message`](../../../../../generated/storage/types.gen/type-aliases/Message.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`Message`](../../../../../generated/storage/types.gen/type-aliases/Message.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`Message`](../../../../../generated/storage/types.gen/type-aliases/Message.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `parent`, `id`): `CrmComment`\n\nA handle to a comment by id. Fields load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `parent` | [`CrmCommentParent`](../interfaces/CrmCommentParent.md) |\n| `id` | `string` |\n\n#### Returns\n\n`CrmComment`\n\n***\n\n### from()\n\n> `static` **from**(`client`, `parent`, `record`): `CrmComment`\n\nBuild a comment from a message record (pre-seeded, no fetch).\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `parent` | [`CrmCommentParent`](../interfaces/CrmCommentParent.md) |\n| `record` | [`Message`](../../../../../generated/storage/types.gen/type-aliases/Message.md) |\n\n#### Returns\n\n`CrmComment`\n\n\n<!-- src/entities/crm/comment/functions/listCrmCommentThreads.md -->\n# Function: listCrmCommentThreads()\n\n> **listCrmCommentThreads**(`client`, `parent`): `Promise`\\<[`CrmCommentThread`](../interfaces/CrmCommentThread.md)[]\\>\n\nA CRM record's live comment threads, each with its comments, newest thread first.\n\n## Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `parent` | [`CrmCommentParent`](../interfaces/CrmCommentParent.md) |\n\n## Returns\n\n`Promise`\\<[`CrmCommentThread`](../interfaces/CrmCommentThread.md)[]\\>\n\n\n<!-- src/entities/crm/comment/functions/postCrmComment.md -->\n# Function: postCrmComment()\n\n> **postCrmComment**(`client`, `parent`, `body`, `opts?`): `Promise`\\<[`CrmComment`](../classes/CrmComment.md)\\>\n\nPost a comment on a CRM record: a new thread, or a reply when `threadId`\n(the thread's root comment id) is given.\n\n## Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `parent` | [`CrmCommentParent`](../interfaces/CrmCommentParent.md) |\n| `body` | `string` \\| [`RichMessage`](../../../../mentions/interfaces/RichMessage.md) |\n| `opts?` | \\{ `threadId?`: `string`; \\} |\n| `opts.threadId?` | `string` |\n\n## Returns\n\n`Promise`\\<[`CrmComment`](../classes/CrmComment.md)\\>\n\n\n<!-- src/entities/crm/comment/interfaces/CrmCommentParent.md -->\n# Interface: CrmCommentParent\n\nThe CRM record a discussion hangs off.\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-id\"></a> `id` | `string` |\n| <a id=\"property-type\"></a> `type` | `\"crm_company\"` \\| `\"crm_contact\"` |\n\n\n<!-- src/entities/crm/comment/interfaces/CrmCommentThread.md -->\n# Interface: CrmCommentThread\n\nOne of a CRM record's comment threads: its state and its comments.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-comments\"></a> `comments` | [`CrmComment`](../classes/CrmComment.md)[] | The thread's comments, root first, then replies oldest first. |\n| <a id=\"property-thread\"></a> `thread` | [`ThreadState`](../../../../../generated/storage/types.gen/type-aliases/ThreadState.md) | The thread state: root id, resolved flag, owner, timestamps. |\n\n\n<!-- src/entities/crm/company/classes/Company.md -->\n# Class: Company\n\nA CRM company: an organization the team has interacted with.\n\n## Extends\n\n- [`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md)\\<`CompanyDetail`\\>\n\n## Properties\n\n| Property | Modifier | Type | Default value | Description | Overrides | Inherited from |\n| ------ | ------ | ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-createdat\"></a> `createdAt` | `readonly` | () => `Promise`\\<`string`\\> | `...` | When the company was first created in the CRM. | - | - |\n| <a id=\"property-description\"></a> `description` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | `...` | The company's display description, if any. | - | - |\n| <a id=\"property-emailsync\"></a> `emailSync` | `readonly` | () => `Promise`\\<`boolean`\\> | `...` | Whether email sync is enabled for this company. | - | - |\n| <a id=\"property-entitytype\"></a> `entityType` | `readonly` | `\"crm_company\"` | `'crm_company'` | Favorites identify CRM companies as `crm_company`. | [`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`entityType`](../../../entity/classes/PropertiedEntity.md#property-entitytype) | - |\n| <a id=\"property-hidden\"></a> `hidden` | `readonly` | () => `Promise`\\<`boolean`\\> | `...` | Whether the company is hidden from CRM listings. | - | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | `undefined` | - | - | [`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`id`](../../../entity/classes/PropertiedEntity.md#property-id) |\n| <a id=\"property-name\"></a> `name` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | `...` | The company's display name, if resolved. | - | - |\n| <a id=\"property-team\"></a> `team` | `readonly` | () => `Promise`\\<[`Team`](../../../teams/team/classes/Team.md)\\> | `...` | The team that owns this company. | - | - |\n| <a id=\"property-updatedat\"></a> `updatedAt` | `readonly` | () => `Promise`\\<`string`\\> | `...` | When the company was last updated. | - | - |\n| <a id=\"property-search\"></a> `search` | `static` | (`client`, `query`, `searchOpts?`) => `AsyncGenerator`\\<`Company`\\> | `...` | Search CRM companies by name/domain, most relevant first, auto-paginated. | - | - |\n\n## Methods\n\n### comment()\n\n> **comment**(`body`, `opts?`): `Promise`\\<[`CrmComment`](../../comment/classes/CrmComment.md)\\>\n\nAdd a comment. Starts a new thread, or replies to an existing one when\n`threadId` (the thread's root comment id) is given.\n\n#### Parameters\n\n| Parameter | Type | Description |\n| ------ | ------ | ------ |\n| `body` | `string` \\| [`RichMessage`](../../../../mentions/interfaces/RichMessage.md) | Plain text, or a rich body composed with msg. |\n| `opts?` | \\{ `threadId?`: `string`; \\} | - |\n| `opts.threadId?` | `string` | - |\n\n#### Returns\n\n`Promise`\\<[`CrmComment`](../../comment/classes/CrmComment.md)\\>\n\n***\n\n### commentById()\n\n> **commentById**(`id`): [`CrmComment`](../../comment/classes/CrmComment.md)\n\nA handle to one of this company's comments by id.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`CrmComment`](../../comment/classes/CrmComment.md)\n\n***\n\n### comments()\n\n> **comments**(): `Promise`\\<[`CrmCommentThread`](../../comment/interfaces/CrmCommentThread.md)[]\\>\n\nThe comment threads on this company, newest thread first.\n\n#### Returns\n\n`Promise`\\<[`CrmCommentThread`](../../comment/interfaces/CrmCommentThread.md)[]\\>\n\n***\n\n### contacts()\n\n> **contacts**(): `Promise`\\<[`Contact`](../../contact/classes/Contact.md)[]\\>\n\nThe contacts attached to this company (hidden ones filtered for non-admins).\n\n#### Returns\n\n`Promise`\\<[`Contact`](../../contact/classes/Contact.md)[]\\>\n\n***\n\n### createContact()\n\n> **createContact**(`opts`): `Promise`\\<[`Contact`](../../contact/classes/Contact.md)\\>\n\nCreate a contact under this company.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts` | \\{ `email`: `string`; `name`: `string`; \\} |\n| `opts.email` | `string` |\n| `opts.name` | `string` |\n\n#### Returns\n\n`Promise`\\<[`Contact`](../../contact/classes/Contact.md)\\>\n\n***\n\n### deleteProperty()\n\n> **deleteProperty**(`assignment`): `Promise`\\<`void`\\>\n\nRemove a property from this entity, given its [properties](#properties) entry.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `assignment` | [`EntityPropertyWithDefinition`](../../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`deleteProperty`](../../../entity/classes/PropertiedEntity.md#deleteproperty)\n\n***\n\n### domain()\n\n> **domain**(): `Promise`\\<`string` \\| `undefined`\\>\n\nThe company's primary domain (e.g. `acme.com`), if any.\n\n#### Returns\n\n`Promise`\\<`string` \\| `undefined`\\>\n\n***\n\n### domains()\n\n> **domains**(): `Promise`\\<`string`[]\\>\n\nAll domains associated with the company, primary first.\n\n#### Returns\n\n`Promise`\\<`string`[]\\>\n\n***\n\n### favorite()\n\n> **favorite**(): `Promise`\\<`Company`\\>\n\nAdd this entity to the user's favorites. Returns this handle for chaining.\nPlain unwrap: favoriting alters the user's favorites collection, not this\nentity's own detail, so there's nothing cached to invalidate.\n\n#### Returns\n\n`Promise`\\<`Company`\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`favorite`](../../../entity/classes/PropertiedEntity.md#favorite)\n\n***\n\n### hide()\n\n> **hide**(): `Promise`\\<`void`\\>\n\nHide the company from CRM listings: disables email sync and soft-hides\nits contacts. Reversible with [unhide](#unhide).\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### messageThreadById()\n\n> **messageThreadById**(`id`): [`MessageThread`](../../../messages/thread/classes/MessageThread.md)\n\nA shared message thread scoped to this resource.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`MessageThread`](../../../messages/thread/classes/MessageThread.md)\n\n***\n\n### permission()\n\n> **permission**(): `Promise`\\<\\{ `permission`: [`EntityPermission`](../../../../../generated/storage/types.gen/type-aliases/EntityPermission.md); `status`: `\"access\"`; \\} \\| \\{ `status`: `\"no_access\"`; \\}\\>\n\nRead the caller's effective permission on this entity.\n\n#### Returns\n\n`Promise`\\<\\{ `permission`: [`EntityPermission`](../../../../../generated/storage/types.gen/type-aliases/EntityPermission.md); `status`: `\"access\"`; \\} \\| \\{ `status`: `\"no_access\"`; \\}\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`permission`](../../../entity/classes/PropertiedEntity.md#permission)\n\n***\n\n### properties()\n\n> **properties**(`opts?`): `Promise`\\<[`EntityPropertyWithDefinition`](../../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md)[]\\>\n\nThe properties set on this entity, each with its definition, value, and options.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts?` | \\{ `includeMetadata?`: `boolean`; \\} |\n| `opts.includeMetadata?` | `boolean` |\n\n#### Returns\n\n`Promise`\\<[`EntityPropertyWithDefinition`](../../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md)[]\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`properties`](../../../entity/classes/PropertiedEntity.md#properties)\n\n***\n\n### propertyReference()\n\n> **propertyReference**(): [`PropertyTargetReference`](../../../../../generated/properties/types.gen/type-aliases/PropertyTargetReference.md)\n\nThis entity's reference for bulk property operations.\n\n#### Returns\n\n[`PropertyTargetReference`](../../../../../generated/properties/types.gen/type-aliases/PropertyTargetReference.md)\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`propertyReference`](../../../entity/classes/PropertiedEntity.md#propertyreference)\n\n***\n\n### rename()\n\n> **rename**(`name`): `Promise`\\<`void`\\>\n\nRename the company for the caller's current team.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `name` | `string` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### setEmailSync()\n\n> **setEmailSync**(`enabled`): `Promise`\\<`void`\\>\n\nEnable or disable team-wide email sync for this company. Rejects with 409\nwhen enabling on a hidden company — [unhide](#unhide) first.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `enabled` | `boolean` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### setProperty()\n\n> **setProperty**(`property`, `value?`): `Promise`\\<`void`\\>\n\nSet a property value on this entity, or attach the property without a\nvalue when `value` is omitted.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `property` | [`PropertyDefinition`](../../../properties/property-definition/classes/PropertyDefinition.md) |\n| `value?` | [`SetPropertyValue`](../../../../../generated/properties/types.gen/type-aliases/SetPropertyValue.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`setProperty`](../../../entity/classes/PropertiedEntity.md#setproperty)\n\n***\n\n### timelinePage()\n\n> **timelinePage**(`selection?`): `Promise`\\<\\{ `entries`: (\\{ `activity`: \\{ `action`: `string`; `actor`: [`User`](../../../users/user/classes/User.md); `actor_id`: `string`; `id`: `string`; `occurred_at`: `string`; `payload?`: `unknown`; \\}; `message?`: `undefined`; `type`: `\"activity\"`; \\} \\| \\{ `activity?`: `undefined`; `message`: [`CrmComment`](../../comment/classes/CrmComment.md); `type`: `\"message\"`; \\})[]; `nextCursor`: [`MessageCursor`](../../../../../generated/storage/types.gen/type-aliases/MessageCursor.md) \\| `undefined`; `previousCursor`: [`MessageCursor`](../../../../../generated/storage/types.gen/type-aliases/MessageCursor.md) \\| `undefined`; \\}\\>\n\nA mixed message and activity timeline page.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `selection?` | [`TimelineOptions`](../../../messages/thread/interfaces/TimelineOptions.md)\\<[`CrmComment`](../../comment/classes/CrmComment.md)\\> |\n\n#### Returns\n\n`Promise`\\<\\{ `entries`: (\\{ `activity`: \\{ `action`: `string`; `actor`: [`User`](../../../users/user/classes/User.md); `actor_id`: `string`; `id`: `string`; `occurred_at`: `string`; `payload?`: `unknown`; \\}; `message?`: `undefined`; `type`: `\"activity\"`; \\} \\| \\{ `activity?`: `undefined`; `message`: [`CrmComment`](../../comment/classes/CrmComment.md); `type`: `\"message\"`; \\})[]; `nextCursor`: [`MessageCursor`](../../../../../generated/storage/types.gen/type-aliases/MessageCursor.md) \\| `undefined`; `previousCursor`: [`MessageCursor`](../../../../../generated/storage/types.gen/type-aliases/MessageCursor.md) \\| `undefined`; \\}\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`CrmCompanyResponse`](../../../../../generated/storage/types.gen/type-aliases/CrmCompanyResponse.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`CrmCompanyResponse`](../../../../../generated/storage/types.gen/type-aliases/CrmCompanyResponse.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`CrmCompanyResponse`](../../../../../generated/storage/types.gen/type-aliases/CrmCompanyResponse.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`toJSON`](../../../entity/classes/PropertiedEntity.md#tojson)\n\n***\n\n### unfavorite()\n\n> **unfavorite**(): `Promise`\\<`Company`\\>\n\nRemove this entity from the user's favorites. Returns this handle for chaining.\n\n#### Returns\n\n`Promise`\\<`Company`\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`unfavorite`](../../../entity/classes/PropertiedEntity.md#unfavorite)\n\n***\n\n### unhide()\n\n> **unhide**(): `Promise`\\<`void`\\>\n\nUn-hide the company, restoring it and its contacts to CRM listings.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### updatePropertyOptions()\n\n> **updatePropertyOptions**(`changes`): `Promise`\\<[`BulkUpdateEntityPropertyOptionsResponse`](../../../../../generated/properties/types.gen/type-aliases/BulkUpdateEntityPropertyOptionsResponse.md)\\>\n\nApply multi-select option deltas atomically across this entity's properties.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `changes` | [`PropertyOptionDelta`](../../../entity/interfaces/PropertyOptionDelta.md)[] |\n\n#### Returns\n\n`Promise`\\<[`BulkUpdateEntityPropertyOptionsResponse`](../../../../../generated/properties/types.gen/type-aliases/BulkUpdateEntityPropertyOptionsResponse.md)\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`updatePropertyOptions`](../../../entity/classes/PropertiedEntity.md#updatepropertyoptions)\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `id`): `Company`\n\nA handle to a CRM company by id. Details load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `id` | `string` |\n\n#### Returns\n\n`Company`\n\n***\n\n### from()\n\n> `static` **from**(`client`, `data`): `Company`\n\nBuild a company from an API record (pre-seeded, no fetch).\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `data` | [`CrmCompanyResponse`](../../../../../generated/storage/types.gen/type-aliases/CrmCompanyResponse.md) |\n\n#### Returns\n\n`Company`\n\n\n<!-- src/entities/crm/contact/classes/Contact.md -->\n# Class: Contact\n\nA CRM contact: a person observed interacting with the team.\n\n## Extends\n\n- [`FavoritableEntity`](../../../entity/classes/FavoritableEntity.md)\\<`ContactDetail`\\>\n\n## Properties\n\n| Property | Modifier | Type | Default value | Description | Overrides | Inherited from |\n| ------ | ------ | ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-company\"></a> `company` | `readonly` | () => `Promise`\\<[`Company`](../../company/classes/Company.md)\\> | `...` | The CRM company this contact belongs to. | - | - |\n| <a id=\"property-createdat\"></a> `createdAt` | `readonly` | () => `Promise`\\<`string`\\> | `...` | When the contact was first created in the CRM. | - | - |\n| <a id=\"property-email\"></a> `email` | `readonly` | () => `Promise`\\<`string`\\> | `...` | The contact's email address. | - | - |\n| <a id=\"property-entitytype\"></a> `entityType` | `readonly` | `\"crm_contact\"` | `'crm_contact'` | Favorites identify CRM contacts as `crm_contact`. | [`FavoritableEntity`](../../../entity/classes/FavoritableEntity.md).[`entityType`](../../../entity/classes/FavoritableEntity.md#property-entitytype) | - |\n| <a id=\"property-firstinteraction\"></a> `firstInteraction` | `readonly` | () => `Promise`\\<`string`\\> | `...` | When the team first interacted with this contact. | - | - |\n| <a id=\"property-hidden\"></a> `hidden` | `readonly` | () => `Promise`\\<`boolean`\\> | `...` | Whether the contact is hidden from CRM listings. | - | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | `undefined` | - | - | [`FavoritableEntity`](../../../entity/classes/FavoritableEntity.md).[`id`](../../../entity/classes/FavoritableEntity.md#property-id) |\n| <a id=\"property-lastinteraction\"></a> `lastInteraction` | `readonly` | () => `Promise`\\<`string`\\> | `...` | When the team last interacted with this contact. | - | - |\n| <a id=\"property-name\"></a> `name` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | `...` | The contact's display name, if one has been observed. | - | - |\n| <a id=\"property-updatedat\"></a> `updatedAt` | `readonly` | () => `Promise`\\<`string`\\> | `...` | When the contact was last updated. | - | - |\n\n## Methods\n\n### comment()\n\n> **comment**(`body`, `opts?`): `Promise`\\<[`CrmComment`](../../comment/classes/CrmComment.md)\\>\n\nAdd a comment. Starts a new thread, or replies to an existing one when\n`threadId` (the thread's root comment id) is given.\n\n#### Parameters\n\n| Parameter | Type | Description |\n| ------ | ------ | ------ |\n| `body` | `string` \\| [`RichMessage`](../../../../mentions/interfaces/RichMessage.md) | Plain text, or a rich body composed with msg. |\n| `opts?` | \\{ `threadId?`: `string`; \\} | - |\n| `opts.threadId?` | `string` | - |\n\n#### Returns\n\n`Promise`\\<[`CrmComment`](../../comment/classes/CrmComment.md)\\>\n\n***\n\n### commentById()\n\n> **commentById**(`id`): [`CrmComment`](../../comment/classes/CrmComment.md)\n\nA handle to one of this contact's comments by id.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`CrmComment`](../../comment/classes/CrmComment.md)\n\n***\n\n### comments()\n\n> **comments**(): `Promise`\\<[`CrmCommentThread`](../../comment/interfaces/CrmCommentThread.md)[]\\>\n\nThe comment threads on this contact, newest thread first.\n\n#### Returns\n\n`Promise`\\<[`CrmCommentThread`](../../comment/interfaces/CrmCommentThread.md)[]\\>\n\n***\n\n### favorite()\n\n> **favorite**(): `Promise`\\<`Contact`\\>\n\nAdd this entity to the user's favorites. Returns this handle for chaining.\nPlain unwrap: favoriting alters the user's favorites collection, not this\nentity's own detail, so there's nothing cached to invalidate.\n\n#### Returns\n\n`Promise`\\<`Contact`\\>\n\n#### Inherited from\n\n[`FavoritableEntity`](../../../entity/classes/FavoritableEntity.md).[`favorite`](../../../entity/classes/FavoritableEntity.md#favorite)\n\n***\n\n### hide()\n\n> **hide**(): `Promise`\\<`void`\\>\n\nHide the contact from CRM listings. Display-only; reversible with [unhide](#unhide).\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### messageThreadById()\n\n> **messageThreadById**(`id`): [`MessageThread`](../../../messages/thread/classes/MessageThread.md)\n\nA shared message thread scoped to this resource.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`MessageThread`](../../../messages/thread/classes/MessageThread.md)\n\n***\n\n### permission()\n\n> **permission**(): `Promise`\\<\\{ `permission`: [`EntityPermission`](../../../../../generated/storage/types.gen/type-aliases/EntityPermission.md); `status`: `\"access\"`; \\} \\| \\{ `status`: `\"no_access\"`; \\}\\>\n\nRead the caller's effective permission on this entity.\n\n#### Returns\n\n`Promise`\\<\\{ `permission`: [`EntityPermission`](../../../../../generated/storage/types.gen/type-aliases/EntityPermission.md); `status`: `\"access\"`; \\} \\| \\{ `status`: `\"no_access\"`; \\}\\>\n\n#### Inherited from\n\n[`FavoritableEntity`](../../../entity/classes/FavoritableEntity.md).[`permission`](../../../entity/classes/FavoritableEntity.md#permission)\n\n***\n\n### rename()\n\n> **rename**(`name`): `Promise`\\<`void`\\>\n\nRename the contact for the caller's current team.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `name` | `string` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### timelinePage()\n\n> **timelinePage**(`selection?`): `Promise`\\<\\{ `entries`: (\\{ `activity`: \\{ `action`: `string`; `actor`: [`User`](../../../users/user/classes/User.md); `actor_id`: `string`; `id`: `string`; `occurred_at`: `string`; `payload?`: `unknown`; \\}; `message?`: `undefined`; `type`: `\"activity\"`; \\} \\| \\{ `activity?`: `undefined`; `message`: [`CrmComment`](../../comment/classes/CrmComment.md); `type`: `\"message\"`; \\})[]; `nextCursor`: [`MessageCursor`](../../../../../generated/storage/types.gen/type-aliases/MessageCursor.md) \\| `undefined`; `previousCursor`: [`MessageCursor`](../../../../../generated/storage/types.gen/type-aliases/MessageCursor.md) \\| `undefined`; \\}\\>\n\nA mixed message and activity timeline page.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `selection?` | [`TimelineOptions`](../../../messages/thread/interfaces/TimelineOptions.md)\\<[`CrmComment`](../../comment/classes/CrmComment.md)\\> |\n\n#### Returns\n\n`Promise`\\<\\{ `entries`: (\\{ `activity`: \\{ `action`: `string`; `actor`: [`User`](../../../users/user/classes/User.md); `actor_id`: `string`; `id`: `string`; `occurred_at`: `string`; `payload?`: `unknown`; \\}; `message?`: `undefined`; `type`: `\"activity\"`; \\} \\| \\{ `activity?`: `undefined`; `message`: [`CrmComment`](../../comment/classes/CrmComment.md); `type`: `\"message\"`; \\})[]; `nextCursor`: [`MessageCursor`](../../../../../generated/storage/types.gen/type-aliases/MessageCursor.md) \\| `undefined`; `previousCursor`: [`MessageCursor`](../../../../../generated/storage/types.gen/type-aliases/MessageCursor.md) \\| `undefined`; \\}\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`CrmContactResponse`](../../../../../generated/storage/types.gen/type-aliases/CrmContactResponse.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`CrmContactResponse`](../../../../../generated/storage/types.gen/type-aliases/CrmContactResponse.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`CrmContactResponse`](../../../../../generated/storage/types.gen/type-aliases/CrmContactResponse.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`FavoritableEntity`](../../../entity/classes/FavoritableEntity.md).[`toJSON`](../../../entity/classes/FavoritableEntity.md#tojson)\n\n***\n\n### unfavorite()\n\n> **unfavorite**(): `Promise`\\<`Contact`\\>\n\nRemove this entity from the user's favorites. Returns this handle for chaining.\n\n#### Returns\n\n`Promise`\\<`Contact`\\>\n\n#### Inherited from\n\n[`FavoritableEntity`](../../../entity/classes/FavoritableEntity.md).[`unfavorite`](../../../entity/classes/FavoritableEntity.md#unfavorite)\n\n***\n\n### unhide()\n\n> **unhide**(): `Promise`\\<`void`\\>\n\nUn-hide the contact, restoring it to CRM listings.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `id`): `Contact`\n\nA handle to a CRM contact by id. Details load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `id` | `string` |\n\n#### Returns\n\n`Contact`\n\n***\n\n### from()\n\n> `static` **from**(`client`, `data`): `Contact`\n\nBuild a contact from an API record (pre-seeded, no fetch).\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `data` | [`CrmContactResponse`](../../../../../generated/storage/types.gen/type-aliases/CrmContactResponse.md) |\n\n#### Returns\n\n`Contact`\n\n\n<!-- src/entities/crm/namespace/classes/CrmNamespace.md -->\n# Class: CrmNamespace\n\n## Constructors\n\n### Constructor\n\n> **new CrmNamespace**(`client`): `CrmNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`CrmNamespace`\n\n## Properties\n\n| Property | Modifier | Type | Description |\n| ------ | ------ | ------ | ------ |\n| <a id=\"property-pipelines\"></a> `pipelines` | `readonly` | [`PipelineNamespace`](../../pipelines/classes/PipelineNamespace.md) | Pipelines, their records and sharing settings. |\n\n## Methods\n\n### companyById()\n\n> **companyById**(`id`): [`Company`](../../company/classes/Company.md)\n\nA handle to a CRM company by id.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`Company`](../../company/classes/Company.md)\n\n***\n\n### contactByEmail()\n\n> **contactByEmail**(`email`): `Promise`\\<[`Contact`](../../contact/classes/Contact.md) \\| `undefined`\\>\n\nResolve a CRM contact by email in the caller's current team, if present.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `email` | `string` |\n\n#### Returns\n\n`Promise`\\<[`Contact`](../../contact/classes/Contact.md) \\| `undefined`\\>\n\n***\n\n### contactById()\n\n> **contactById**(`id`): [`Contact`](../../contact/classes/Contact.md)\n\nA handle to a CRM contact by id.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`Contact`](../../contact/classes/Contact.md)\n\n***\n\n### createCompany()\n\n> **createCompany**(`opts`): `Promise`\\<[`Company`](../../company/classes/Company.md)\\>\n\nCreate a CRM company for the caller's current team.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts` | [`CreateCrmCompanyRequest`](../../../../../generated/storage/types.gen/type-aliases/CreateCrmCompanyRequest.md) |\n\n#### Returns\n\n`Promise`\\<[`Company`](../../company/classes/Company.md)\\>\n\n***\n\n### resetStages()\n\n> **resetStages**(): `Promise`\\<`void`\\>\n\nReset the caller's current team's deal stages to the defaults.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### searchCompanies()\n\n> **searchCompanies**(`query`): `AsyncGenerator`\\<[`Company`](../../company/classes/Company.md)\\>\n\nSearch CRM companies by name/domain, most relevant first, auto-paginated.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `query` | `string` |\n\n#### Returns\n\n`AsyncGenerator`\\<[`Company`](../../company/classes/Company.md)\\>\n\n***\n\n### searchContacts()\n\n> **searchContacts**(`query`, `opts?`): `Promise`\\<[`Contact`](../../contact/classes/Contact.md)[]\\>\n\nSearch the caller's current team's CRM contacts whose email or name\ncontains `query` (case-insensitive), most recently interacted first.\nAn empty query lists the most recent contacts.\n\n#### Parameters\n\n| Parameter | Type | Description |\n| ------ | ------ | ------ |\n| `query` | `string` | - |\n| `opts?` | \\{ `limit?`: `number`; \\} | - |\n| `opts.limit?` | `number` | Maximum contacts to return (1-500, default 20). |\n\n#### Returns\n\n`Promise`\\<[`Contact`](../../contact/classes/Contact.md)[]\\>\n\n***\n\n### setStages()\n\n> **setStages**(`stages`): `Promise`\\<[`CrmStagesResponse`](../../../../../generated/storage/types.gen/type-aliases/CrmStagesResponse.md)\\>\n\nReplace the caller's current team's deal stages, in pipeline order.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `stages` | [`ReplaceCrmStagesRequest`](../../../../../generated/storage/types.gen/type-aliases/ReplaceCrmStagesRequest.md) |\n\n#### Returns\n\n`Promise`\\<[`CrmStagesResponse`](../../../../../generated/storage/types.gen/type-aliases/CrmStagesResponse.md)\\>\n\n***\n\n### settings()\n\n> **settings**(): `Promise`\\<[`CrmTeamSettingsResponse`](../../../../../generated/storage/types.gen/type-aliases/CrmTeamSettingsResponse.md)\\>\n\nThe caller's current team's CRM settings.\n\n#### Returns\n\n`Promise`\\<[`CrmTeamSettingsResponse`](../../../../../generated/storage/types.gen/type-aliases/CrmTeamSettingsResponse.md)\\>\n\n***\n\n### updateSettings()\n\n> **updateSettings**(`settings`): `Promise`\\<[`CrmTeamSettingsResponse`](../../../../../generated/storage/types.gen/type-aliases/CrmTeamSettingsResponse.md)\\>\n\nPartially update the caller's current team's CRM settings.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `settings` | [`UpdateCrmTeamSettingsRequest`](../../../../../generated/storage/types.gen/type-aliases/UpdateCrmTeamSettingsRequest.md) |\n\n#### Returns\n\n`Promise`\\<[`CrmTeamSettingsResponse`](../../../../../generated/storage/types.gen/type-aliases/CrmTeamSettingsResponse.md)\\>\n\n\n<!-- src/entities/crm/pipeline/classes/CrmPipeline.md -->\n# Class: CrmPipeline\n\nA CRM pipeline with its own sharing boundary and backing table.\n\n## Extends\n\n- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\\<[`AccessiblePipeline`](../../../../../generated/storage/types.gen/type-aliases/AccessiblePipeline.md)\\>\n\n## Properties\n\n| Property | Modifier | Type | Description | Inherited from |\n| ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-accesslevel\"></a> `accessLevel` | `readonly` | () => `Promise`\\<[`AccessLevel`](../../../../../generated/storage/types.gen/type-aliases/AccessLevel.md)\\> | Current caller's access level. | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |\n| <a id=\"property-name\"></a> `name` | `readonly` | () => `Promise`\\<`string`\\> | Display name. | - |\n| <a id=\"property-owner\"></a> `owner` | `readonly` | () => `Promise`\\<[`User`](../../../users/user/classes/User.md)\\> | Owner. | - |\n| <a id=\"property-recordtype\"></a> `recordType` | `readonly` | () => `Promise`\\<[`PipelineRecordType`](../../../../../generated/storage/types.gen/type-aliases/PipelineRecordType.md)\\> | CRM record type. | - |\n| <a id=\"property-sharing\"></a> `sharing` | `readonly` | () => `Promise`\\<[`PipelineSharing`](../../../../../generated/storage/types.gen/type-aliases/PipelineSharing.md)\\> | Sharing scope. | - |\n| <a id=\"property-team\"></a> `team` | `readonly` | () => `Promise`\\<[`Team`](../../../teams/team/classes/Team.md)\\> | Owning team. | - |\n\n## Methods\n\n### applyOps()\n\n> **applyOps**(`ops`, `options?`): `Promise`\\<[`AppliedOps`](../../../../../generated/storage/types.gen/type-aliases/AppliedOps.md)\\>\n\nApply an atomic generated database operation batch through this pipeline.\nAs with Database.applyOps, batch-local UUIDs may name resources minted earlier in the batch.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `ops` | [`DatabaseOp`](../../../../../generated/storage/types.gen/type-aliases/DatabaseOp.md)[] |\n| `options?` | \\{ `baseVersions?`: \\{ `table`: [`PipelineTable`](PipelineTable.md); `version`: `number`; \\}[]; \\} |\n| `options.baseVersions?` | \\{ `table`: [`PipelineTable`](PipelineTable.md); `version`: `number`; \\}[] |\n\n#### Returns\n\n`Promise`\\<[`AppliedOps`](../../../../../generated/storage/types.gen/type-aliases/AppliedOps.md)\\>\n\n***\n\n### queryRows()\n\n> **queryRows**(`options?`): `AsyncGenerator`\\<[`PipelineRow`](PipelineRow.md)\\>\n\nQuery pipeline rows, optionally restricting the query to typed row handles.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options?` | \\{ `query?`: [`ViewQuery`](../../../../../generated/storage/types.gen/type-aliases/ViewQuery.md); `rows?`: [`PipelineRow`](PipelineRow.md)[]; \\} |\n| `options.query?` | [`ViewQuery`](../../../../../generated/storage/types.gen/type-aliases/ViewQuery.md) |\n| `options.rows?` | [`PipelineRow`](PipelineRow.md)[] |\n\n#### Returns\n\n`AsyncGenerator`\\<[`PipelineRow`](PipelineRow.md)\\>\n\n***\n\n### rename()\n\n> **rename**(`name`): `Promise`\\<`void`\\>\n\nRename this pipeline.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `name` | `string` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### rows()\n\n> **rows**(): `AsyncGenerator`\\<[`PipelineRow`](PipelineRow.md)\\>\n\nRows in pipeline order, automatically paginated.\n\n#### Returns\n\n`AsyncGenerator`\\<[`PipelineRow`](PipelineRow.md)\\>\n\n***\n\n### setSharing()\n\n> **setSharing**(`sharing`): `Promise`\\<`void`\\>\n\nChange its sharing scope.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `sharing` | [`PipelineSharing`](../../../../../generated/storage/types.gen/type-aliases/PipelineSharing.md) \\| `undefined` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### setTrashed()\n\n> **setTrashed**(`trashed`): `Promise`\\<`void`\\>\n\nTrash or restore the pipeline.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `trashed` | `boolean` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### sharePermissions()\n\n> **sharePermissions**(): `Promise`\\<[`SharePermissionV2`](../../../../../generated/storage/types.gen/type-aliases/SharePermissionV2.md)\\>\n\nRead sharing grants.\n\n#### Returns\n\n`Promise`\\<[`SharePermissionV2`](../../../../../generated/storage/types.gen/type-aliases/SharePermissionV2.md)\\>\n\n***\n\n### table()\n\n> **table**(): `Promise`\\<[`PipelineTable`](PipelineTable.md)\\>\n\nRead the backing table through the pipeline's authorization boundary.\n\n#### Returns\n\n`Promise`\\<[`PipelineTable`](PipelineTable.md)\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`AccessiblePipeline`](../../../../../generated/storage/types.gen/type-aliases/AccessiblePipeline.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`AccessiblePipeline`](../../../../../generated/storage/types.gen/type-aliases/AccessiblePipeline.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`AccessiblePipeline`](../../../../../generated/storage/types.gen/type-aliases/AccessiblePipeline.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)\n\n***\n\n### updateSharePermissions()\n\n> **updateSharePermissions**(`options`): `Promise`\\<[`SharePermissionV2`](../../../../../generated/storage/types.gen/type-aliases/SharePermissionV2.md)\\>\n\nUpdate sharing grants.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | [`SharePermissionOptions`](../../../sharing/permissions/type-aliases/SharePermissionOptions.md) |\n\n#### Returns\n\n`Promise`\\<[`SharePermissionV2`](../../../../../generated/storage/types.gen/type-aliases/SharePermissionV2.md)\\>\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `id`): `CrmPipeline`\n\nConstruct a lazy pipeline handle.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `id` | `string` |\n\n#### Returns\n\n`CrmPipeline`\n\n***\n\n### from()\n\n> `static` **from**(`client`, `record`): `CrmPipeline`\n\nSeed from a server record.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `record` | [`AccessiblePipeline`](../../../../../generated/storage/types.gen/type-aliases/AccessiblePipeline.md) |\n\n#### Returns\n\n`CrmPipeline`\n\n\n<!-- src/entities/crm/pipeline/classes/PipelineColumn.md -->\n# Class: PipelineColumn\n\nA column belonging to a pipeline table.\n\n## Extends\n\n- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\\<[`ColumnDetail`](../../../../../generated/storage/types.gen/type-aliases/ColumnDetail.md)\\>\n\n## Properties\n\n| Property | Modifier | Type | Description | Inherited from |\n| ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |\n| <a id=\"property-table\"></a> `table` | `readonly` | [`PipelineTable`](PipelineTable.md) | Parent table. | - |\n\n## Methods\n\n### name()\n\n> **name**(): `Promise`\\<`string`\\>\n\nCurrent column label.\n\n#### Returns\n\n`Promise`\\<`string`\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`ColumnDetail`](../../../../../generated/storage/types.gen/type-aliases/ColumnDetail.md); `id`: `string`; `pipelineId`: `string`; `tableId`: `string`; \\}\n\nSerialize identity within its pipeline.\n\n#### Returns\n\n\\{ `detail?`: [`ColumnDetail`](../../../../../generated/storage/types.gen/type-aliases/ColumnDetail.md); `id`: `string`; `pipelineId`: `string`; `tableId`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`ColumnDetail`](../../../../../generated/storage/types.gen/type-aliases/ColumnDetail.md) |\n| `id` | `string` |\n| `pipelineId` | `string` |\n| `tableId` | `string` |\n\n#### Overrides\n\n[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)\n\n***\n\n### writable()\n\n> **writable**(): `Promise`\\<`boolean`\\>\n\nWhether the caller can write this column.\n\n#### Returns\n\n`Promise`\\<`boolean`\\>\n\n***\n\n### from()\n\n> `static` **from**(`client`, `table`, `record`): `PipelineColumn`\n\nSeed a column handle.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `table` | [`PipelineTable`](PipelineTable.md) |\n| `record` | [`ColumnDetail`](../../../../../generated/storage/types.gen/type-aliases/ColumnDetail.md) |\n\n#### Returns\n\n`PipelineColumn`\n\n\n<!-- src/entities/crm/pipeline/classes/PipelineRow.md -->\n# Class: PipelineRow\n\nOne pipeline row.\n\n## Extends\n\n- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\\<[`StorageRow`](../../../../../generated/storage/types.gen/type-aliases/StorageRow.md)\\>\n\n## Properties\n\n| Property | Modifier | Type | Description | Inherited from |\n| ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-cells\"></a> `cells` | `readonly` | () => `Promise`\\<\\{\\[`key`: `string`\\]: [`PropertyValue`](../../../../../generated/storage/types.gen/type-aliases/PropertyValue.md); \\}\\> | Values keyed by property definition. | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |\n| <a id=\"property-pipeline\"></a> `pipeline` | `readonly` | [`CrmPipeline`](CrmPipeline.md) | Parent pipeline. | - |\n\n## Methods\n\n### refresh()\n\n> **refresh**(): `Promise`\\<`void`\\>\n\nReload this row after an operation batch.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`StorageRow`](../../../../../generated/storage/types.gen/type-aliases/StorageRow.md); `id`: `string`; `pipelineId`: `string`; \\}\n\nSerialize identity within its pipeline.\n\n#### Returns\n\n\\{ `detail?`: [`StorageRow`](../../../../../generated/storage/types.gen/type-aliases/StorageRow.md); `id`: `string`; `pipelineId`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`StorageRow`](../../../../../generated/storage/types.gen/type-aliases/StorageRow.md) |\n| `id` | `string` |\n| `pipelineId` | `string` |\n\n#### Overrides\n\n[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `pipeline`, `id`): `PipelineRow`\n\nConstruct a scoped row handle.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `pipeline` | [`CrmPipeline`](CrmPipeline.md) |\n| `id` | `string` |\n\n#### Returns\n\n`PipelineRow`\n\n***\n\n### from()\n\n> `static` **from**(`client`, `pipeline`, `record`): `PipelineRow`\n\nSeed a listed row.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `pipeline` | [`CrmPipeline`](CrmPipeline.md) |\n| `record` | [`StorageRow`](../../../../../generated/storage/types.gen/type-aliases/StorageRow.md) |\n\n#### Returns\n\n`PipelineRow`\n\n\n<!-- src/entities/crm/pipeline/classes/PipelineTable.md -->\n# Class: PipelineTable\n\nBacking table of a CRM pipeline.\n\n## Extends\n\n- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\\<[`TableDetail`](../../../../../generated/storage/types.gen/type-aliases/TableDetail.md)\\>\n\n## Properties\n\n| Property | Modifier | Type | Description | Inherited from |\n| ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |\n| <a id=\"property-pipeline\"></a> `pipeline` | `readonly` | [`CrmPipeline`](CrmPipeline.md) | Parent pipeline. | - |\n\n## Methods\n\n### columns()\n\n> **columns**(): `Promise`\\<[`PipelineColumn`](PipelineColumn.md)[]\\>\n\nColumns in this table.\n\n#### Returns\n\n`Promise`\\<[`PipelineColumn`](PipelineColumn.md)[]\\>\n\n***\n\n### rowById()\n\n> **rowById**(`id`): [`PipelineRow`](PipelineRow.md)\n\nA scoped row handle.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`PipelineRow`](PipelineRow.md)\n\n***\n\n### rows()\n\n> **rows**(): `AsyncGenerator`\\<[`PipelineRow`](PipelineRow.md)\\>\n\nRows from the authorized pipeline surface.\n\n#### Returns\n\n`AsyncGenerator`\\<[`PipelineRow`](PipelineRow.md)\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`TableDetail`](../../../../../generated/storage/types.gen/type-aliases/TableDetail.md); `id`: `string`; `pipelineId`: `string`; \\}\n\nSerialize identity within its pipeline.\n\n#### Returns\n\n\\{ `detail?`: [`TableDetail`](../../../../../generated/storage/types.gen/type-aliases/TableDetail.md); `id`: `string`; `pipelineId`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`TableDetail`](../../../../../generated/storage/types.gen/type-aliases/TableDetail.md) |\n| `id` | `string` |\n| `pipelineId` | `string` |\n\n#### Overrides\n\n[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)\n\n***\n\n### version()\n\n> **version**(): `Promise`\\<`number`\\>\n\nTable version for optimistic operation batches.\n\n#### Returns\n\n`Promise`\\<`number`\\>\n\n***\n\n### from()\n\n> `static` **from**(`client`, `pipeline`, `record`): `PipelineTable`\n\nSeed a table from a pipeline table response.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `pipeline` | [`CrmPipeline`](CrmPipeline.md) |\n| `record` | [`TableDetail`](../../../../../generated/storage/types.gen/type-aliases/TableDetail.md) |\n\n#### Returns\n\n`PipelineTable`\n\n\n<!-- src/entities/crm/pipelines/classes/PipelineNamespace.md -->\n# Class: PipelineNamespace\n\nCRM pipelines in the caller's team.\n\n## Constructors\n\n### Constructor\n\n> **new PipelineNamespace**(`client`): `PipelineNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`PipelineNamespace`\n\n## Methods\n\n### byId()\n\n> **byId**(`id`): [`CrmPipeline`](../../pipeline/classes/CrmPipeline.md)\n\nConstruct a lazy pipeline handle.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`CrmPipeline`](../../pipeline/classes/CrmPipeline.md)\n\n***\n\n### create()\n\n> **create**(`options`): `Promise`\\<[`CrmPipeline`](../../pipeline/classes/CrmPipeline.md)\\>\n\nCreate a pipeline and its backing storage.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | [`CreatePipeline`](../../../../../generated/storage/types.gen/type-aliases/CreatePipeline.md) |\n\n#### Returns\n\n`Promise`\\<[`CrmPipeline`](../../pipeline/classes/CrmPipeline.md)\\>\n\n***\n\n### list()\n\n> **list**(): `Promise`\\<[`CrmPipeline`](../../pipeline/classes/CrmPipeline.md)[]\\>\n\nList accessible pipelines.\n\n#### Returns\n\n`Promise`\\<[`CrmPipeline`](../../pipeline/classes/CrmPipeline.md)[]\\>\n"},{"name": "databases","description": "Read and edit database schemas, rows, and cells.",- "overview": "<!-- src/entities/databases/namespace/classes/DatabaseNamespace.md -->\n# Class: DatabaseNamespace\n\nMacro databases: named collections of tables, owned and shared as one\nentity.\n\n## Constructors\n\n### Constructor\n\n> **new DatabaseNamespace**(`client`): `DatabaseNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`DatabaseNamespace`\n\n## Methods\n\n### byId()\n\n> **byId**(`id`): [`Database`](../../database/classes/Database.md)\n\nA handle to a database by id. Details load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`Database`](../../database/classes/Database.md)\n\n***\n\n### create()\n\n> **create**(`options`): `Promise`\\<[`Database`](../../database/classes/Database.md)\\>\n\nCreate a database owned by the caller.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | \\{ `name`: `string`; \\} |\n| `options.name` | `string` |\n\n#### Returns\n\n`Promise`\\<[`Database`](../../database/classes/Database.md)\\>\n\n***\n\n### list()\n\n> **list**(): `Promise`\\<[`Database`](../../database/classes/Database.md)[]\\>\n\nThe databases the caller can see.\n\n#### Returns\n\n`Promise`\\<[`Database`](../../database/classes/Database.md)[]\\>\n",- "documentation": "# Macro SDK: databases\n\nGenerated by TypeDoc. Paths below refer to the canonical Markdown hierarchy. Other entity handles are documented in their named section; request core for shared SDK helpers.\n\n<!-- generated/storage/types.gen/type-aliases/AccessLevel.md -->\n# Type Alias: AccessLevel\n\n> **AccessLevel** = `\"view\"` \\| `\"comment\"` \\| `\"edit\"` \\| `\"owner\"`\n\nOrdered from least to most access top -> bottom\n\n\n<!-- generated/storage/types.gen/type-aliases/CardPosition.md -->\n# Type Alias: CardPosition\n\n> **CardPosition** = \\{ `lane`: [`LaneKey`](LaneKey.md); `position`: `string`; `row`: `string`; \\}\n\nWhere one card sits on a board: its lane, and its fractional key there.\nA card whose row has since moved to another lane has no place until it is\nmoved again.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-lane\"></a> `lane` | [`LaneKey`](LaneKey.md) | The lane. |\n| <a id=\"property-position\"></a> `position` | `string` | The card's key in that lane. |\n| <a id=\"property-row\"></a> `row` | `string` | The card's row. |\n\n\n<!-- generated/storage/types.gen/type-aliases/CastVerdict.md -->\n# Type Alias: CastVerdict\n\n> **CastVerdict** = `\"safe\"` \\| `\"checked\"` \\| `\"never\"`\n\nWhether a column's values convert to a type.\n\n\n<!-- generated/storage/types.gen/type-aliases/CellValue.md -->\n# Type Alias: CellValue\n\n> **CellValue** = \\{ `type`: `\"text\"`; `value`: `string`; \\} \\| \\{ `type`: `\"number\"`; `value`: `number`; \\} \\| \\{ `type`: `\"boolean\"`; `value`: `boolean`; \\} \\| \\{ `type`: `\"date\"`; `value`: `string`; \\} \\| \\{ `type`: `\"link\"`; `value`: `string`[]; \\} \\| \\{ `type`: `\"options\"`; `value`: [`OptionRef`](OptionRef.md)[]; \\} \\| \\{ `type`: `\"entities\"`; `value`: [`EntityRef`](EntityRef.md)[]; \\} \\| \\{ `type`: `\"rows\"`; `value`: `string`[]; \\} \\| \\{ `type`: `\"clear\"`; \\}\n\nA cell's value. It must fit the column's type: text for a text column,\noptions of the column for a select, and so on.\n\n## Union Members\n\n### Type Literal\n\n\\{ `type`: `\"text\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"text\"` | - |\n| `value` | `string` | Free text. |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"number\"`; `value`: `number`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"number\"` | - |\n| `value` | `number` | A finite number. |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"boolean\"`; `value`: `boolean`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"boolean\"` | - |\n| `value` | `boolean` | A checkbox. |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"date\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"date\"` | - |\n| `value` | `string` | A date-time. |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"link\"`; `value`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"link\"` | - |\n| `value` | `string`[] | Complete http or https URLs; at most one for a single-valued column. |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"options\"`; `value`: [`OptionRef`](OptionRef.md)[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"options\"` | - |\n| `value` | [`OptionRef`](OptionRef.md)[] | Options of a select or tag column; at most one for a single-valued column. |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"entities\"`; `value`: [`EntityRef`](EntityRef.md)[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"entities\"` | - |\n| `value` | [`EntityRef`](EntityRef.md)[] | References to Macro entities of the kind the column points at; at most one for a single-valued column. |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"rows\"`; `value`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"rows\"` | - |\n| `value` | `string`[] | Rows of the table a relation column points at. |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"clear\"`; \\}\n\n\n<!-- generated/storage/types.gen/type-aliases/CellWrite.md -->\n# Type Alias: CellWrite\n\n> **CellWrite** = \\{ `column`: `string`; `value`: [`CellValue`](CellValue.md); \\}\n\nOne cell of a row: which column, and its new value.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-column\"></a> `column` | `string` | The column placement. |\n| <a id=\"property-value\"></a> `value` | [`CellValue`](CellValue.md) | The value, or [`CellValue::Clear`] to empty the cell. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ChannelSharePermission.md -->\n# Type Alias: ChannelSharePermission\n\n> **ChannelSharePermission** = \\{ `access_level`: [`AccessLevel`](AccessLevel.md); `channel_id`: `string`; \\}\n\nThe channel share permission\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-access_level\"></a> `access_level` | [`AccessLevel`](AccessLevel.md) | The access level for the channel |\n| <a id=\"property-channel_id\"></a> `channel_id` | `string` | The channel id |\n\n\n<!-- generated/storage/types.gen/type-aliases/Column.md -->\n# Type Alias: Column\n\n> **Column** = \\{ `config`: `null` \\| [`ColumnConfig`](ColumnConfig.md); `display_name`: `string` \\| `null`; `id`: `string`; `infer_type`: `boolean`; `nullable?`: `boolean`; `position`: `string`; `property_definition_id`: `string`; `protections?`: [`ColumnProtection`](ColumnProtection.md)[]; `table_id`: `string`; \\}\n\nA column: the placement of a property definition on a table.\n\nThe definition carries name, [`DataType`], multi-select flag, and options;\nthis carries only where it appears and column-kind configuration.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-config\"></a> `config` | `null` \\| [`ColumnConfig`](ColumnConfig.md) | - |\n| <a id=\"property-display_name\"></a> `display_name` | `string` \\| `null` | The placement's own label, which also names it in SQL; `None` shows the definition's name. |\n| <a id=\"property-id\"></a> `id` | `string` | Identifier of the placement. |\n| <a id=\"property-infer_type\"></a> `infer_type` | `boolean` | Whether the first nonempty value may settle this new text column's type. |\n| <a id=\"property-nullable\"></a> `nullable?` | `boolean` | Whether a row may omit this cell; empty collections also count as absent. |\n| <a id=\"property-position\"></a> `position` | `string` | Fractional index for column ordering. |\n| <a id=\"property-property_definition_id\"></a> `property_definition_id` | `string` | The bound property definition. |\n| <a id=\"property-protections\"></a> `protections?` | [`ColumnProtection`](ColumnProtection.md)[] | Schema operations reserved by a feature; ordinary edits cannot clear them. |\n| <a id=\"property-table_id\"></a> `table_id` | `string` | Table the column appears on. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ColumnCast.md -->\n# Type Alias: ColumnCast\n\n> **ColumnCast** = \\{ `cast`: [`CastVerdict`](CastVerdict.md); `data_type`: [`DataType`](DataType.md); `examples`: `string`[]; `failures`: `number`; `is_multi_select`: `boolean`; `reason`: `string` \\| `null`; `relation`: `boolean`; `specific_entity_type`: `null` \\| [`EntityType`](EntityType.md); `summary`: `string` \\| `null`; \\}\n\nWhat changing a column to one type would do to its values: the dry run\nof a type change, for one target.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-cast\"></a> `cast` | [`CastVerdict`](CastVerdict.md) | Whether the values convert. |\n| <a id=\"property-data_type\"></a> `data_type` | [`DataType`](DataType.md) | The target property type. |\n| <a id=\"property-examples\"></a> `examples` | `string`[] | Up to three of the values that would not convert. |\n| <a id=\"property-failures\"></a> `failures` | `number` | For a `checked` cast, how many cells would not convert. |\n| <a id=\"property-is_multi_select\"></a> `is_multi_select` | `boolean` | Whether the target holds several values. |\n| <a id=\"property-reason\"></a> `reason` | `string` \\| `null` | Why nothing converts, for a `never` cast. |\n| <a id=\"property-relation\"></a> `relation` | `boolean` | Whether the target is a relation to another table's rows. |\n| <a id=\"property-specific_entity_type\"></a> `specific_entity_type` | `null` \\| [`EntityType`](EntityType.md) | - |\n| <a id=\"property-summary\"></a> `summary` | `string` \\| `null` | For a `checked` cast with failures, what is wrong with them, as in `3 values aren't numbers`. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ColumnChange.md -->\n# Type Alias: ColumnChange\n\n> **ColumnChange** = \\{ `after?`: `string`; `definition`: [`NewColumn`](NewColumn.md); `kind`: `\"create\"`; \\} \\| \\{ `kind`: `\"rename\"`; `name`: `string`; `previousName?`: `string`; \\} \\| \\{ `kind`: `\"change_type\"`; `to`: [`ColumnKind`](ColumnKind.md); \\} \\| \\{ `kind`: `\"delete\"`; \\} \\| \\{ `kind`: `\"add_options\"`; `options`: [`NewOption`](NewOption.md)[]; \\} \\| \\{ `color?`: `string` \\| `null`; `kind`: `\"update_option\"`; `label?`: `string`; `option`: `string`; \\} \\| \\{ `formula`: [`Formula`](Formula.md); `kind`: `\"set_formula\"`; \\} \\| \\{ `kind`: `\"delete_option\"`; `option`: `string`; \\}\n\nA change to one column.\n\n## Union Members\n\n### Type Literal\n\n\\{ `after?`: `string`; `definition`: [`NewColumn`](NewColumn.md); `kind`: `\"create\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `after?` | `string` | The column it goes right after; left out, it goes after the table's last column. |\n| `definition` | [`NewColumn`](NewColumn.md) | What the column holds. |\n| `kind` | `\"create\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"rename\"`; `name`: `string`; `previousName?`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"rename\"` | - |\n| `name` | `string` | Its new name, unique within the table ignoring case. |\n| `previousName?` | `string` | The name the caller saw. Given, the rename is refused if the column goes by another one now. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"change_type\"`; `to`: [`ColumnKind`](ColumnKind.md); \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"change_type\"` | - |\n| `to` | [`ColumnKind`](ColumnKind.md) | The type it becomes. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"delete\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"add_options\"`; `options`: [`NewOption`](NewOption.md)[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"add_options\"` | - |\n| `options` | [`NewOption`](NewOption.md)[] | The options, each under an id the client mints. |\n\n***\n\n### Type Literal\n\n\\{ `color?`: `string` \\| `null`; `kind`: `\"update_option\"`; `label?`: `string`; `option`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `color?` | `string` \\| `null` | Its new colour, a hex string like `#RRGGBB`, or `null` to clear it; left out, it keeps its own. A tag option always has one. |\n| `kind` | `\"update_option\"` | - |\n| `label?` | `string` | Its new label; left out, it keeps its own. Labels are unique within a column, ignoring case. |\n| `option` | `string` | The option. |\n\n***\n\n### Type Literal\n\n\\{ `formula`: [`Formula`](Formula.md); `kind`: `\"set_formula\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `formula` | [`Formula`](Formula.md) | The formula, over the table's other columns. |\n| `kind` | `\"set_formula\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"delete_option\"`; `option`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"delete_option\"` | - |\n| `option` | `string` | The option. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ColumnConfig.md -->\n# Type Alias: ColumnConfig\n\n> **ColumnConfig** = \\{ `database_id`: `string`; `kind`: `\"link\"`; `table_id`: `string`; \\} \\| \\{ `formula`: [`Formula`](Formula.md); `kind`: `\"derived\"`; \\}\n\nColumn-kind specific configuration stored on the placement.\n\n## Union Members\n\n### Type Literal\n\n\\{ `database_id`: `string`; `kind`: `\"link\"`; `table_id`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `database_id` | `string` | Target database. |\n| `kind` | `\"link\"` | - |\n| `table_id` | `string` | Target table. |\n\n***\n\n### Type Literal\n\n\\{ `formula`: [`Formula`](Formula.md); `kind`: `\"derived\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `formula` | [`Formula`](Formula.md) | How its cells are computed. |\n| `kind` | `\"derived\"` | - |\n\n\n<!-- generated/storage/types.gen/type-aliases/ColumnConversion.md -->\n# Type Alias: ColumnConversion\n\n> **ColumnConversion** = \\{ `cells`: [`ConvertedCell`](ConvertedCell.md)[]; `misfits`: `number`; `options`: `string`[]; `tableVersion`: [`TableVersion`](TableVersion.md); \\}\n\nWhat a column's values become under another type, for a new column of\nthat type beside it: the values that convert, the options they need,\nand how many do not convert. Nothing is changed by reading it.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-cells\"></a> `cells` | [`ConvertedCell`](ConvertedCell.md)[] | Each row whose value converts, with that value, options named by label. |\n| <a id=\"property-misfits\"></a> `misfits` | `number` | How many values do not convert, and are left out. |\n| <a id=\"property-options\"></a> `options` | `string`[] | The option labels a new select or tag column needs, in order. |\n| <a id=\"property-tableversion\"></a> `tableVersion` | [`TableVersion`](TableVersion.md) | The table's version the cells were read at; a batch writing the new column sends it as its base version. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ColumnDetail.md -->\n# Type Alias: ColumnDetail\n\n> **ColumnDetail** = \\{ `column`: [`Column`](Column.md); `definition`: [`PropertyDefinitionWithOptions`](PropertyDefinitionWithOptions.md); `shared_outside_database`: `boolean`; `sql_name`: `string`; `writable`: `boolean`; \\}\n\nOne column placement with the definition behind it.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-column\"></a> `column` | [`Column`](Column.md) | The placement. |\n| <a id=\"property-definition\"></a> `definition` | [`PropertyDefinitionWithOptions`](PropertyDefinitionWithOptions.md) | The bound definition (name, type, options). |\n| <a id=\"property-shared_outside_database\"></a> `shared_outside_database` | `boolean` | Whether the definition belongs to something beyond this database (a person's, a team's or a system property), so changing its options changes them everywhere that property is used. |\n| <a id=\"property-sql_name\"></a> `sql_name` | `string` | The name SQL refers to the column by: its display name, quoted. |\n| <a id=\"property-writable\"></a> `writable` | `boolean` | Whether SQL may write this column. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ColumnKind.md -->\n# Type Alias: ColumnKind\n\n> **ColumnKind** = \\{ `type`: `\"text\"`; \\} \\| \\{ `type`: `\"number\"`; \\} \\| \\{ `type`: `\"boolean\"`; \\} \\| \\{ `type`: `\"date\"`; \\} \\| \\{ `type`: `\"link\"`; \\} \\| \\{ `multi`: `boolean`; `type`: `\"select\"`; \\} \\| \\{ `multi`: `boolean`; `type`: `\"select_number\"`; \\} \\| \\{ `type`: `\"tag\"`; \\} \\| \\{ `multi`: `boolean`; `target`: [`EntityKind`](EntityKind.md); `type`: `\"entity\"`; \\} \\| \\{ `database`: `string`; `table`: `string`; `type`: `\"relation\"`; \\}\n\nA type a column can have.\n\n## Union Members\n\n### Type Literal\n\n\\{ `type`: `\"text\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"number\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"boolean\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"date\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"link\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `multi`: `boolean`; `type`: `\"select\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `multi` | `boolean` | Whether a cell holds several options. |\n| `type` | `\"select\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `multi`: `boolean`; `type`: `\"select_number\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `multi` | `boolean` | Whether a cell holds several options. |\n| `type` | `\"select_number\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"tag\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `multi`: `boolean`; `target`: [`EntityKind`](EntityKind.md); `type`: `\"entity\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `multi` | `boolean` | Whether a cell holds several references. |\n| `target` | [`EntityKind`](EntityKind.md) | What the references point at. |\n| `type` | `\"entity\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `database`: `string`; `table`: `string`; `type`: `\"relation\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `database` | `string` | The database of the related table. |\n| `table` | `string` | The related table. |\n| `type` | `\"relation\"` | - |\n\n\n<!-- generated/storage/types.gen/type-aliases/ColumnProtection.md -->\n# Type Alias: ColumnProtection\n\n> **ColumnProtection** = `\"delete\"` \\| `\"change_type\"`\n\nA schema operation reserved by a feature using a column.\n\n\n<!-- generated/storage/types.gen/type-aliases/ColumnResult.md -->\n# Type Alias: ColumnResult\n\n> **ColumnResult** = \\{ `kind`: `\"created\"`; \\} \\| \\{ `kind`: `\"renamed\"`; \\} \\| \\{ `kind`: `\"type_changed\"`; \\} \\| \\{ `kind`: `\"deleted\"`; \\} \\| \\{ `added`: `string`[]; `kind`: `\"options_added\"`; \\} \\| \\{ `kind`: `\"option_updated\"`; \\} \\| \\{ `kind`: `\"option_deleted\"`; \\} \\| \\{ `kind`: `\"formula_set\"`; \\}\n\nWhat happened to a column.\n\n## Union Members\n\n### Type Literal\n\n\\{ `kind`: `\"created\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"renamed\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"type_changed\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"deleted\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `added`: `string`[]; `kind`: `\"options_added\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `added` | `string`[] | The options created, in order: those sent, less any whose label the column already had. |\n| `kind` | `\"options_added\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"option_updated\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"option_deleted\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"formula_set\"`; \\}\n\n\n<!-- generated/storage/types.gen/type-aliases/Conjunction.md -->\n# Type Alias: Conjunction\n\n> **Conjunction** = `\"and\"` \\| `\"or\"`\n\nHow a group's conditions combine.\n\n\n<!-- generated/storage/types.gen/type-aliases/ConvertedCell.md -->\n# Type Alias: ConvertedCell\n\n> **ConvertedCell** = \\{ `row`: `string`; `value`: [`CellValue`](CellValue.md); \\}\n\nOne row's converted value.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-row\"></a> `row` | `string` | The row. |\n| <a id=\"property-value\"></a> `value` | [`CellValue`](CellValue.md) | Its value under the new type. |\n\n\n<!-- generated/storage/types.gen/type-aliases/DataType.md -->\n# Type Alias: DataType\n\n> **DataType** = `\"BOOLEAN\"` \\| `\"DATE\"` \\| `\"NUMBER\"` \\| `\"STRING\"` \\| `\"SELECT_NUMBER\"` \\| `\"SELECT_STRING\"` \\| `\"TAG\"` \\| `\"ENTITY\"` \\| `\"LINK\"`\n\nData type for property values, determining storage and validation.\n\n\n<!-- generated/storage/types.gen/type-aliases/Database.md -->\n# Type Alias: Database\n\n> **Database** = \\{ `created_at`: `string`; `id`: `string`; `name`: `string`; `owner_id`: `string`; `trashed_at`: `string` \\| `null`; \\}\n\nA database: a named collection of tables, owned and shared as one entity.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | Creation time. |\n| <a id=\"property-id\"></a> `id` | `string` | Identifier. |\n| <a id=\"property-name\"></a> `name` | `string` | Display name. |\n| <a id=\"property-owner_id\"></a> `owner_id` | `string` | Owning user. |\n| <a id=\"property-trashed_at\"></a> `trashed_at` | `string` \\| `null` | Set when trashed. |\n\n\n<!-- generated/storage/types.gen/type-aliases/DatabaseDetail.md -->\n# Type Alias: DatabaseDetail\n\n> **DatabaseDetail** = \\{ `database`: [`Database`](Database.md); `grant`: [`AccessLevel`](AccessLevel.md); `tables`: [`TableDetail`](TableDetail.md)[]; \\}\n\nEverything a client needs to render and edit one database: tables,\ncolumn placements with their definitions, and the SQL names the query\nsurface exposes them under.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-database\"></a> `database` | [`Database`](Database.md) | The database. |\n| <a id=\"property-grant\"></a> `grant` | [`AccessLevel`](AccessLevel.md) | The viewer's access. |\n| <a id=\"property-tables\"></a> `tables` | [`TableDetail`](TableDetail.md)[] | Tables in tab order. |\n\n\n<!-- generated/storage/types.gen/type-aliases/DatabaseOp.md -->\n# Type Alias: DatabaseOp\n\n> **DatabaseOp** = \\{ `change`: [`TableChange`](TableChange.md); `kind`: `\"table\"`; `table`: `string`; \\} \\| \\{ `change`: [`ColumnChange`](ColumnChange.md); `column`: `string`; `kind`: `\"column\"`; `table`: `string`; \\} \\| \\{ `change`: [`RowsChange`](RowsChange.md); `kind`: `\"rows\"`; `table`: `string`; \\} \\| \\{ `change`: [`ViewChange`](ViewChange.md); `kind`: `\"view\"`; `table`: `string`; `view`: `string`; \\} \\| \\{ `kind`: `\"reorder_tables\"`; `order`: `string`[]; \\}\n\nOne write to a database: its tables, columns, options, rows or views,\ngrouped by the resource it changes. A request's ops apply in order and\ntogether, or not at all, and every op names a table of the database the\nrequest is for (or, creating one, adds it there).\n\n## Union Members\n\n### Type Literal\n\n\\{ `change`: [`TableChange`](TableChange.md); `kind`: `\"table\"`; `table`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `change` | [`TableChange`](TableChange.md) | What changes. |\n| `kind` | `\"table\"` | - |\n| `table` | `string` | The table; for a creation, its new id, minted by the client, which later ops of the request may name. |\n\n***\n\n### Type Literal\n\n\\{ `change`: [`ColumnChange`](ColumnChange.md); `column`: `string`; `kind`: `\"column\"`; `table`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `change` | [`ColumnChange`](ColumnChange.md) | What changes. |\n| `column` | `string` | The column; for a creation, its new id, minted by the client, which later ops of the request may name. |\n| `kind` | `\"column\"` | - |\n| `table` | `string` | The table. |\n\n***\n\n### Type Literal\n\n\\{ `change`: [`RowsChange`](RowsChange.md); `kind`: `\"rows\"`; `table`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `change` | [`RowsChange`](RowsChange.md) | What changes. |\n| `kind` | `\"rows\"` | - |\n| `table` | `string` | The table the rows belong to. |\n\n***\n\n### Type Literal\n\n\\{ `change`: [`ViewChange`](ViewChange.md); `kind`: `\"view\"`; `table`: `string`; `view`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `change` | [`ViewChange`](ViewChange.md) | What changes. |\n| `kind` | `\"view\"` | - |\n| `table` | `string` | The view's table. |\n| `view` | `string` | The view; for a creation, its new id, minted by the client. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"reorder_tables\"`; `order`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"reorder_tables\"` | - |\n| `order` | `string`[] | Every table, in its new order. |\n\n\n<!-- generated/storage/types.gen/type-aliases/DatabaseView.md -->\n# Type Alias: DatabaseView\n\n> **DatabaseView** = \\{ `createdAt`: `string`; `databaseId`: `string`; `id`: `string`; `layout`: [`ViewLayout`](ViewLayout.md); `name`: `string`; `position`: `string`; `query`: [`ViewQuery`](ViewQuery.md); `tableId`: `string`; `updatedAt`: `string`; \\}\n\nA view of one table, as stored.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-createdat\"></a> `createdAt` | `string` | When it was created. |\n| <a id=\"property-databaseid\"></a> `databaseId` | `string` | The database the table belongs to. |\n| <a id=\"property-id\"></a> `id` | `string` | The view. |\n| <a id=\"property-layout\"></a> `layout` | [`ViewLayout`](ViewLayout.md) | How it draws them. |\n| <a id=\"property-name\"></a> `name` | `string` | Its name, unique among the table's views ignoring case. |\n| <a id=\"property-position\"></a> `position` | `string` | Where it sorts among the table's views: a fractional key. |\n| <a id=\"property-query\"></a> `query` | [`ViewQuery`](ViewQuery.md) | Which rows it shows, in what order. |\n| <a id=\"property-tableid\"></a> `tableId` | `string` | The table it shows. |\n| <a id=\"property-updatedat\"></a> `updatedAt` | `string` | When it last changed. |\n\n\n<!-- generated/storage/types.gen/type-aliases/DatabaseWebhookResponse.md -->\n# Type Alias: DatabaseWebhookResponse\n\n> **DatabaseWebhookResponse** = \\{ `createdAt`: `string`; `createdBy`: `string`; `databaseId`: `string`; `id`: `string`; `tableId`: `string`; `tokenPrefix`: `string`; \\}\n\nA webhook of a database. Its token is never shown again after creation.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-createdat\"></a> `createdAt` | `string` | Creation time. |\n| <a id=\"property-createdby\"></a> `createdBy` | `string` | Who created it; its calls write with their access. |\n| <a id=\"property-databaseid\"></a> `databaseId` | `string` | The database. |\n| <a id=\"property-id\"></a> `id` | `string` | Identifier. |\n| <a id=\"property-tableid\"></a> `tableId` | `string` | The table its calls insert rows into. |\n| <a id=\"property-tokenprefix\"></a> `tokenPrefix` | `string` | The token's first characters, to tell webhooks apart. |\n\n\n<!-- generated/storage/types.gen/type-aliases/DateOperator.md -->\n# Type Alias: DateOperator\n\n> **DateOperator** = `\"before\"` \\| `\"after\"` \\| `\"onOrBefore\"` \\| `\"onOrAfter\"`\n\nHow a date cell compares to a date-time.\n\n\n<!-- generated/storage/types.gen/type-aliases/EntityKind.md -->\n# Type Alias: EntityKind\n\n> **EntityKind** = `\"USER\"` \\| `\"DOCUMENT\"` \\| `\"TASK\"` \\| `\"COMPANY\"` \\| `\"CONTACT\"` \\| `\"CALL_RECORD\"` \\| `\"CHANNEL\"` \\| `\"CHAT\"` \\| `\"PROJECT\"` \\| `\"THREAD\"` \\| `\"CALENDAR_EVENT\"` \\| `\"INITIATIVE\"`\n\nA kind of Macro entity a reference column can point at.\n\n\n<!-- generated/storage/types.gen/type-aliases/EntityRef.md -->\n# Type Alias: EntityRef\n\n> **EntityRef** = \\{ `entityId`: `string`; `entityType`: [`EntityKind`](EntityKind.md); \\}\n\nA reference to one Macro entity.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entityid\"></a> `entityId` | `string` | The entity's id. |\n| <a id=\"property-entitytype\"></a> `entityType` | [`EntityKind`](EntityKind.md) | What kind of entity it is; it must be the kind the column points at. |\n\n\n<!-- generated/storage/types.gen/type-aliases/EntityType.md -->\n# Type Alias: EntityType\n\n> **EntityType** = `\"CALENDAR_EVENT\"` \\| `\"CALL_RECORD\"` \\| `\"CHANNEL\"` \\| `\"CHAT\"` \\| `\"COMPANY\"` \\| `\"DATABASE_ROW\"` \\| `\"CONTACT\"` \\| `\"DOCUMENT\"` \\| `\"INITIATIVE\"` \\| `\"PROJECT\"` \\| `\"TASK\"` \\| `\"THREAD\"` \\| `\"USER\"`\n\nType of entity that can be referenced by entity properties.\n\n\n<!-- generated/storage/types.gen/type-aliases/FilterCondition.md -->\n# Type Alias: FilterCondition\n\n> **FilterCondition** = \\{ `column`: `string`; `test`: [`FilterTest`](FilterTest.md); \\}\n\nA test of one column's cells.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-column\"></a> `column` | `string` | The column tested. |\n| <a id=\"property-test\"></a> `test` | [`FilterTest`](FilterTest.md) | What its cell must be. The test's kind must fit the column's type. |\n\n\n<!-- generated/storage/types.gen/type-aliases/FilterGroup.md -->\n# Type Alias: FilterGroup\n\n> **FilterGroup** = \\{ `conditions`: [`FilterNode`](FilterNode.md)[]; `conjunction`: [`Conjunction`](Conjunction.md); \\}\n\nConditions joined by one conjunction.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-conditions\"></a> `conditions` | [`FilterNode`](FilterNode.md)[] | The conditions and nested groups. A group without any keeps every row. |\n| <a id=\"property-conjunction\"></a> `conjunction` | [`Conjunction`](Conjunction.md) | Whether every condition must hold, or any one. |\n\n\n<!-- generated/storage/types.gen/type-aliases/FilterNode.md -->\n# Type Alias: FilterNode\n\n> **FilterNode** = [`FilterCondition`](FilterCondition.md) & \\{ `kind`: `\"condition\"`; \\} \\| [`FilterGroup`](FilterGroup.md) & \\{ `kind`: `\"group\"`; \\}\n\nOne entry of a group: a condition, or a group of its own.\n\n\n<!-- generated/storage/types.gen/type-aliases/FilterTest.md -->\n# Type Alias: FilterTest\n\n> **FilterTest** = \\{ `kind`: `\"presence\"`; `operator`: [`PresenceOperator`](PresenceOperator.md); \\} \\| \\{ `kind`: `\"text\"`; `operator`: [`TextOperator`](TextOperator.md); `value`: `string`; \\} \\| \\{ `kind`: `\"number\"`; `operator`: [`NumberOperator`](NumberOperator.md); `value`: `number`; \\} \\| \\{ `kind`: `\"date\"`; `operator`: [`DateOperator`](DateOperator.md); `value`: `string`; \\} \\| \\{ `checked`: `boolean`; `kind`: `\"checkbox\"`; \\} \\| \\{ `kind`: `\"options\"`; `operator`: [`SetOperator`](SetOperator.md); `options`: `string`[]; \\} \\| \\{ `entities`: `string`[]; `kind`: `\"entities\"`; `operator`: [`SetOperator`](SetOperator.md); \\}\n\nWhat a column's cell must be, by the kind of value the column holds.\n\n## Union Members\n\n### Type Literal\n\n\\{ `kind`: `\"presence\"`; `operator`: [`PresenceOperator`](PresenceOperator.md); \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"presence\"` | - |\n| `operator` | [`PresenceOperator`](PresenceOperator.md) | Empty, or not. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"text\"`; `operator`: [`TextOperator`](TextOperator.md); `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"text\"` | - |\n| `operator` | [`TextOperator`](TextOperator.md) | How the cell compares. |\n| `value` | `string` | The text compared against, ignoring case for the containment tests. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"number\"`; `operator`: [`NumberOperator`](NumberOperator.md); `value`: `number`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"number\"` | - |\n| `operator` | [`NumberOperator`](NumberOperator.md) | How the cell compares. |\n| `value` | `number` | The number compared against; finite. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"date\"`; `operator`: [`DateOperator`](DateOperator.md); `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"date\"` | - |\n| `operator` | [`DateOperator`](DateOperator.md) | How the cell compares. |\n| `value` | `string` | The date-time compared against. |\n\n***\n\n### Type Literal\n\n\\{ `checked`: `boolean`; `kind`: `\"checkbox\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `checked` | `boolean` | Whether the box is checked. |\n| `kind` | `\"checkbox\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"options\"`; `operator`: [`SetOperator`](SetOperator.md); `options`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"options\"` | - |\n| `operator` | [`SetOperator`](SetOperator.md) | How the cell's options relate to these. |\n| `options` | `string`[] | Options of the column; at least one. |\n\n***\n\n### Type Literal\n\n\\{ `entities`: `string`[]; `kind`: `\"entities\"`; `operator`: [`SetOperator`](SetOperator.md); \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `entities` | `string`[] | Entity ids, or for a relation the related rows' ids; at least one. |\n| `kind` | `\"entities\"` | - |\n| `operator` | [`SetOperator`](SetOperator.md) | How the cell's references relate to these. |\n\n\n<!-- generated/storage/types.gen/type-aliases/Formula.md -->\n# Type Alias: Formula\n\n> **Formula** = \\{ `column`: `string`; `kind`: `\"column\"`; \\} \\| \\{ `kind`: `\"number\"`; `value`: `number`; \\} \\| \\{ `kind`: `\"binary\"`; `left`: `Formula`; `operator`: [`Operator`](Operator.md); `right`: `Formula`; \\} \\| \\{ `kind`: `\"negate\"`; `operand`: `Formula`; \\}\n\nAn expression over one row's cells.\n\n## Union Members\n\n### Type Literal\n\n\\{ `column`: `string`; `kind`: `\"column\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `column` | `string` | The column placement. |\n| `kind` | `\"column\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"number\"`; `value`: `number`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"number\"` | - |\n| `value` | `number` | The value; finite. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"binary\"`; `left`: `Formula`; `operator`: [`Operator`](Operator.md); `right`: `Formula`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"binary\"` | - |\n| `left` | `Formula` | The left operand. |\n| `operator` | [`Operator`](Operator.md) | How. |\n| `right` | `Formula` | The right operand. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"negate\"`; `operand`: `Formula`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"negate\"` | - |\n| `operand` | `Formula` | The expression negated; a number. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ImportTable.md -->\n# Type Alias: ImportTable\n\n> **ImportTable** = \\{ `columns`: `string`[]; `name`: `string`; `requestId`: `string`; `rows`: `string`[][]; \\}\n\nAn import is identified once, before sending, so retries cannot duplicate rows.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-columns\"></a> `columns` | `string`[] | Header names, in order. All imported values remain text. |\n| <a id=\"property-name\"></a> `name` | `string` | New table's display name. |\n| <a id=\"property-requestid\"></a> `requestId` | `string` | Stable key for this import, retained through retries. |\n| <a id=\"property-rows\"></a> `rows` | `string`[][] | Rectangular text rows. Empty fields are preserved. |\n\n\n<!-- generated/storage/types.gen/type-aliases/InferColumnTypeOutcome.md -->\n# Type Alias: InferColumnTypeOutcome\n\n> **InferColumnTypeOutcome** = \\{ `column`: [`ColumnDetail`](ColumnDetail.md); `table_version`: [`TableVersion`](TableVersion.md); \\}\n\nSettled schema and the version against which its first value can be written.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-column\"></a> `column` | [`ColumnDetail`](ColumnDetail.md) | Updated placement, property definition, and SQL name. |\n| <a id=\"property-table_version\"></a> `table_version` | [`TableVersion`](TableVersion.md) | Version after settling the column. |\n\n\n<!-- generated/storage/types.gen/type-aliases/InferColumnTypeRequest.md -->\n# Type Alias: InferColumnTypeRequest\n\n> **InferColumnTypeRequest** = \\{ `baseVersion`: [`TableVersion`](TableVersion.md); `dataType`: [`DataType`](DataType.md); `specificEntityType?`: `null` \\| [`EntityType`](EntityType.md); \\}\n\nRequest to settle an empty column's first-value type.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-baseversion\"></a> `baseVersion` | [`TableVersion`](TableVersion.md) | Table version used when interpreting the first value. |\n| <a id=\"property-datatype\"></a> `dataType` | [`DataType`](DataType.md) | First-value type: STRING, NUMBER, or ENTITY. |\n| <a id=\"property-specificentitytype\"></a> `specificEntityType?` | `null` \\| [`EntityType`](EntityType.md) | - |\n\n\n<!-- generated/storage/types.gen/type-aliases/Lane.md -->\n# Type Alias: Lane\n\n> **Lane** = \\{ `hidden?`: `boolean`; `key`: [`LaneKey`](LaneKey.md); \\}\n\nHow one lane shows in a board layout.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-hidden\"></a> `hidden?` | `boolean` | Whether it is hidden. |\n| <a id=\"property-key\"></a> `key` | [`LaneKey`](LaneKey.md) | The lane. |\n\n\n<!-- generated/storage/types.gen/type-aliases/LaneKey.md -->\n# Type Alias: LaneKey\n\n> **LaneKey** = \\{ `id`: `string`; `kind`: `\"option\"`; \\} \\| \\{ `id`: `string`; `kind`: `\"user\"`; \\} \\| \\{ `kind`: `\"none\"`; \\}\n\nA lane of a board, named by what its cards' grouping cells hold: one\noption of a select, one person, or nothing.\n\n## Union Members\n\n### Type Literal\n\n\\{ `id`: `string`; `kind`: `\"option\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | The cards holding this option of the board's select column. |\n| `kind` | `\"option\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: `string`; `kind`: `\"user\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | The cards naming this person in the board's person column. |\n| `kind` | `\"user\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"none\"`; \\}\n\n\n<!-- generated/storage/types.gen/type-aliases/LinkShare.md -->\n# Type Alias: LinkShare\n\n> **LinkShare** = `\"PUBLIC\"` \\| `\"TEAM\"`\n\nDefines who can access an item through its share link.\n\n\n<!-- generated/storage/types.gen/type-aliases/NewColumn.md -->\n# Type Alias: NewColumn\n\n> **NewColumn** = \\{ `inferType?`: `boolean`; `name`: `string`; `options?`: [`NewOption`](NewOption.md)[]; `source`: `\"new\"`; `type`: [`ColumnKind`](ColumnKind.md); \\} \\| \\{ `formula`: [`Formula`](Formula.md); `name`: `string`; `source`: `\"derived\"`; \\} \\| \\{ `property`: `string`; `source`: `\"existing\"`; \\}\n\nWhat a new column holds.\n\n## Union Members\n\n### Type Literal\n\n\\{ `inferType?`: `boolean`; `name`: `string`; `options?`: [`NewOption`](NewOption.md)[]; `source`: `\"new\"`; `type`: [`ColumnKind`](ColumnKind.md); \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `inferType?` | `boolean` | Let the column's first value settle its type: only for a plain text column. |\n| `name` | `string` | The column's name, unique within the table ignoring case. |\n| `options?` | [`NewOption`](NewOption.md)[] | For a select or tag column, the options it starts with, in order, each under an id the client mints. A select column with none accepts nothing until options are added. |\n| `source` | `\"new\"` | - |\n| `type` | [`ColumnKind`](ColumnKind.md) | Its type. A relation names the table whose rows it holds, one the caller can see. |\n\n***\n\n### Type Literal\n\n\\{ `formula`: [`Formula`](Formula.md); `name`: `string`; `source`: `\"derived\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `formula` | [`Formula`](Formula.md) | How its cells are computed: arithmetic over the table's number, date and other derived columns. |\n| `name` | `string` | The column's name, unique within the table ignoring case. |\n| `source` | `\"derived\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `property`: `string`; `source`: `\"existing\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `property` | `string` | The property's definition. |\n| `source` | `\"existing\"` | - |\n\n\n<!-- generated/storage/types.gen/type-aliases/NewOption.md -->\n# Type Alias: NewOption\n\n> **NewOption** = \\{ `id`: `string`; `label`: `string`; \\}\n\nA select or tag option to create.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-id\"></a> `id` | `string` | Its id, minted by the client; later ops of the request may name it. |\n| <a id=\"property-label\"></a> `label` | `string` | Its label, unique within the column ignoring case. A numeric select's labels are numbers. |\n\n\n<!-- generated/storage/types.gen/type-aliases/NewView.md -->\n# Type Alias: NewView\n\n> **NewView** = \\{ `layout`: [`RequestedLayout`](RequestedLayout.md); `name`: `string`; `query?`: [`ViewQuery`](ViewQuery.md); \\}\n\nA view's contents as an op creates it; the server gives it its id,\nposition and times.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-layout\"></a> `layout` | [`RequestedLayout`](RequestedLayout.md) | How it draws them; a board left without a card title gets the table's first column. |\n| <a id=\"property-name\"></a> `name` | `string` | Its name. |\n| <a id=\"property-query\"></a> `query?` | [`ViewQuery`](ViewQuery.md) | Which rows it shows, in what order. |\n\n\n<!-- generated/storage/types.gen/type-aliases/NumberOperator.md -->\n# Type Alias: NumberOperator\n\n> **NumberOperator** = `\"is\"` \\| `\"isNot\"` \\| `\"greaterThan\"` \\| `\"greaterThanOrEqual\"` \\| `\"lessThan\"` \\| `\"lessThanOrEqual\"`\n\nHow a number cell compares to a number.\n\n\n<!-- generated/storage/types.gen/type-aliases/OpRefusalResponse.md -->\n# Type Alias: OpRefusalResponse\n\n> **OpRefusalResponse** = \\{ `column`: `string` \\| `null`; `message`: `string`; `op`: `number`; `row`: `number` \\| `null`; `taken`: `null` \\| [`TakenId`](TakenId.md); \\}\n\nWhy an op of a batch was refused. Nothing in the batch was written.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-column\"></a> `column` | `string` \\| `null` | The column placement at fault, when one is. |\n| <a id=\"property-message\"></a> `message` | `string` | What is wrong. |\n| <a id=\"property-op\"></a> `op` | `number` | The refused op's index in the request. |\n| <a id=\"property-row\"></a> `row` | `number` \\| `null` | The row's index within the op, when one row is at fault. |\n| <a id=\"property-taken\"></a> `taken` | `null` \\| [`TakenId`](TakenId.md) | - |\n\n\n<!-- generated/storage/types.gen/type-aliases/OpResult.md -->\n# Type Alias: OpResult\n\n> **OpResult** = \\{ `change`: [`TableResult`](TableResult.md); `kind`: `\"table\"`; `table`: `string`; `tableVersion?`: [`TableVersion`](TableVersion.md); \\} \\| \\{ `change`: [`ColumnResult`](ColumnResult.md); `column`: `string`; `kind`: `\"column\"`; `table`: `string`; `tableVersion`: [`TableVersion`](TableVersion.md); \\} \\| \\{ `change`: [`RowsResult`](RowsResult.md); `kind`: `\"rows\"`; `table`: `string`; `tableVersion`: [`TableVersion`](TableVersion.md); \\} \\| \\{ `change`: [`ViewResult`](ViewResult.md); `kind`: `\"view\"`; `table`: `string`; `tableVersion`: [`TableVersion`](TableVersion.md); `view`: `string`; \\} \\| \\{ `kind`: `\"reorder_tables\"`; `tables`: [`VersionedTable`](VersionedTable.md)[]; \\}\n\nWhat one op did, in the order the ops were sent, grouped as the ops are:\na result's `kind` is its op's, naming the same resource, and its\n`change` says what happened to it.\n\n## Union Members\n\n### Type Literal\n\n\\{ `change`: [`TableResult`](TableResult.md); `kind`: `\"table\"`; `table`: `string`; `tableVersion?`: [`TableVersion`](TableVersion.md); \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `change` | [`TableResult`](TableResult.md) | What happened to it. |\n| `kind` | `\"table\"` | - |\n| `table` | `string` | The table. |\n| `tableVersion?` | [`TableVersion`](TableVersion.md) | Its version once the request committed; left out when the op removed it. |\n\n***\n\n### Type Literal\n\n\\{ `change`: [`ColumnResult`](ColumnResult.md); `column`: `string`; `kind`: `\"column\"`; `table`: `string`; `tableVersion`: [`TableVersion`](TableVersion.md); \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `change` | [`ColumnResult`](ColumnResult.md) | What happened to it. |\n| `column` | `string` | The column. |\n| `kind` | `\"column\"` | - |\n| `table` | `string` | The table. |\n| `tableVersion` | [`TableVersion`](TableVersion.md) | The table's version once the request committed. |\n\n***\n\n### Type Literal\n\n\\{ `change`: [`RowsResult`](RowsResult.md); `kind`: `\"rows\"`; `table`: `string`; `tableVersion`: [`TableVersion`](TableVersion.md); \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `change` | [`RowsResult`](RowsResult.md) | What happened to them. |\n| `kind` | `\"rows\"` | - |\n| `table` | `string` | The table. |\n| `tableVersion` | [`TableVersion`](TableVersion.md) | The table's version once the request committed. |\n\n***\n\n### Type Literal\n\n\\{ `change`: [`ViewResult`](ViewResult.md); `kind`: `\"view\"`; `table`: `string`; `tableVersion`: [`TableVersion`](TableVersion.md); `view`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `change` | [`ViewResult`](ViewResult.md) | What happened to it. |\n| `kind` | `\"view\"` | - |\n| `table` | `string` | The view's table. |\n| `tableVersion` | [`TableVersion`](TableVersion.md) | The table's version once the request committed. |\n| `view` | `string` | The view. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"reorder_tables\"`; `tables`: [`VersionedTable`](VersionedTable.md)[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"reorder_tables\"` | - |\n| `tables` | [`VersionedTable`](VersionedTable.md)[] | Every table, in its new order, with its version once the request committed. |\n\n\n<!-- generated/storage/types.gen/type-aliases/Operator.md -->\n# Type Alias: Operator\n\n> **Operator** = `\"add\"` \\| `\"subtract\"` \\| `\"multiply\"` \\| `\"divide\"`\n\nAn arithmetic operator.\n\n\n<!-- generated/storage/types.gen/type-aliases/OptionRef.md -->\n# Type Alias: OptionRef\n\n> **OptionRef** = \\{ `id`: `string`; \\} \\| \\{ `label`: `string`; \\}\n\nA select option, by its id or by its label.\n\n## Union Members\n\n### Type Literal\n\n\\{ `id`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | An option the column has. |\n\n***\n\n### Type Literal\n\n\\{ `label`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `label` | `string` | An option's label, matched without regard to case. An unknown label is refused. |\n\n\n<!-- generated/storage/types.gen/type-aliases/PresenceOperator.md -->\n# Type Alias: PresenceOperator\n\n> **PresenceOperator** = `\"isEmpty\"` \\| `\"isNotEmpty\"`\n\nWhether a cell is empty.\n\n\n<!-- generated/storage/types.gen/type-aliases/PropertyDefinition.md -->\n# Type Alias: PropertyDefinition\n\n> **PropertyDefinition** = \\{ `created_at`: `string`; `data_type`: [`DataType`](DataType.md); `display_name`: `string`; `id`: `string`; `is_metadata`: `boolean`; `is_multi_select`: `boolean`; `is_system`: `boolean`; `owner`: [`PropertyOwner`](PropertyOwner.md); `specific_entity_type`: `null` \\| [`EntityType`](EntityType.md); `updated_at`: `string`; \\}\n\nProperty definition model (service representation).\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | - |\n| <a id=\"property-data_type\"></a> `data_type` | [`DataType`](DataType.md) | - |\n| <a id=\"property-display_name\"></a> `display_name` | `string` | - |\n| <a id=\"property-id\"></a> `id` | `string` | - |\n| <a id=\"property-is_metadata\"></a> `is_metadata` | `boolean` | Flag to indicate if this is a system-generated metadata property. Not stored in database - computed at service layer. |\n| <a id=\"property-is_multi_select\"></a> `is_multi_select` | `boolean` | - |\n| <a id=\"property-is_system\"></a> `is_system` | `boolean` | Flag to indicate if this is a system property (stored in DB). |\n| <a id=\"property-owner\"></a> `owner` | [`PropertyOwner`](PropertyOwner.md) | - |\n| <a id=\"property-specific_entity_type\"></a> `specific_entity_type` | `null` \\| [`EntityType`](EntityType.md) | - |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` | - |\n\n\n<!-- generated/storage/types.gen/type-aliases/PropertyDefinitionWithOptions.md -->\n# Type Alias: PropertyDefinitionWithOptions\n\n> **PropertyDefinitionWithOptions** = \\{ `definition`: [`PropertyDefinition`](PropertyDefinition.md); `property_options`: [`PropertyOption`](PropertyOption.md)[]; \\}\n\nProperty definition with its associated options (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-definition\"></a> `definition` | [`PropertyDefinition`](PropertyDefinition.md) |\n| <a id=\"property-property_options\"></a> `property_options` | [`PropertyOption`](PropertyOption.md)[] |\n\n\n<!-- generated/storage/types.gen/type-aliases/PropertyOption.md -->\n# Type Alias: PropertyOption\n\n> **PropertyOption** = \\{ `color`: `string` \\| `null`; `created_at`: `string`; `display_order`: `number`; `id`: `string`; `property_definition_id`: `string`; `updated_at`: `string`; `value`: [`PropertyOptionValue`](PropertyOptionValue.md); \\}\n\nA selectable option for select-type properties (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-color\"></a> `color` | `string` \\| `null` |\n| <a id=\"property-created_at\"></a> `created_at` | `string` |\n| <a id=\"property-display_order\"></a> `display_order` | `number` |\n| <a id=\"property-id\"></a> `id` | `string` |\n| <a id=\"property-property_definition_id\"></a> `property_definition_id` | `string` |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` |\n| <a id=\"property-value\"></a> `value` | [`PropertyOptionValue`](PropertyOptionValue.md) |\n\n\n<!-- generated/storage/types.gen/type-aliases/PropertyOptionValue.md -->\n# Type Alias: PropertyOptionValue\n\n> **PropertyOptionValue** = \\{ `type`: `\"string\"`; `value`: `string`; \\} \\| \\{ `type`: `\"number\"`; `value`: `number`; \\}\n\nThe value of a property option - either a string or a number.\n\n## Union Members\n\n### Type Literal\n\n\\{ `type`: `\"string\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"string\"` | - |\n| `value` | `string` | String value for SelectString properties |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"number\"`; `value`: `number`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"number\"` | - |\n| `value` | `number` | Number value for SelectNumber properties |\n\n\n<!-- generated/storage/types.gen/type-aliases/PropertyOwner.md -->\n# Type Alias: PropertyOwner\n\n> **PropertyOwner** = \\{ `scope`: `\"user\"`; `user_id`: `string`; \\} \\| \\{ `scope`: `\"team\"`; `team_id`: `string`; \\} \\| \\{ `database_id`: `string`; `scope`: `\"database\"`; \\} \\| \\{ `scope`: `\"system\"`; \\}\n\nDefines who owns a property - user-scoped, team-scoped, database-scoped, or system.\n\n\n<!-- generated/storage/types.gen/type-aliases/RequestedLayout.md -->\n# Type Alias: RequestedLayout\n\n> **RequestedLayout** = \\{ `columns`: [`ViewColumn`](ViewColumn.md)[]; `kind`: `\"table\"`; \\} \\| \\{ `cardFields`: `string`[]; `groupBy`: `string`; `hideEmptyLanes`: `boolean`; `kind`: `\"board\"`; `lanes`: [`Lane`](Lane.md)[]; `title?`: `string`; \\}\n\nA layout as an op asks for it: a board may leave its card title out.\n\n## Union Members\n\n### Type Literal\n\n\\{ `columns`: [`ViewColumn`](ViewColumn.md)[]; `kind`: `\"table\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `columns` | [`ViewColumn`](ViewColumn.md)[] | How columns show, in display order. A column left out shows after the listed ones, in the table's order. |\n| `kind` | `\"table\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `cardFields`: `string`[]; `groupBy`: `string`; `hideEmptyLanes`: `boolean`; `kind`: `\"board\"`; `lanes`: [`Lane`](Lane.md)[]; `title?`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `cardFields` | `string`[] | The columns a card shows under its title, in order. |\n| `groupBy` | `string` | The single-select or single-person column whose values are the lanes. |\n| `hideEmptyLanes` | `boolean` | Whether a lane with no cards is hidden. |\n| `kind` | `\"board\"` | - |\n| `lanes` | [`Lane`](Lane.md)[] | How lanes show, in display order. |\n| `title?` | `string` | The column a card is titled by. Left out, a board keeps the title it has, and a new board takes the table's first column. |\n\n\n<!-- generated/storage/types.gen/type-aliases/RowChange.md -->\n# Type Alias: RowChange\n\n> **RowChange** = \\{ `cells`: [`CellWrite`](CellWrite.md)[]; `row`: `string`; \\}\n\nOne row's cells in a [`RowChanges::PerRow`] update.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-cells\"></a> `cells` | [`CellWrite`](CellWrite.md)[] | Its new cells. |\n| <a id=\"property-row\"></a> `row` | `string` | The row. |\n\n\n<!-- generated/storage/types.gen/type-aliases/RowChangeKind.md -->\n# Type Alias: RowChangeKind\n\n> **RowChangeKind** = `\"insert\"` \\| `\"update\"` \\| `\"delete\"`\n\nHow a change touched a row.\n\n\n<!-- generated/storage/types.gen/type-aliases/RowChanges.md -->\n# Type Alias: RowChanges\n\n> **RowChanges** = \\{ `cells`: [`CellWrite`](CellWrite.md)[]; `kind`: `\"uniform\"`; `rows`: `string`[]; \\} \\| \\{ `kind`: `\"per_row\"`; `rows`: [`RowChange`](RowChange.md)[]; \\}\n\nWhich rows an update writes, and with what.\n\n## Union Members\n\n### Type Literal\n\n\\{ `cells`: [`CellWrite`](CellWrite.md)[]; `kind`: `\"uniform\"`; `rows`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `cells` | [`CellWrite`](CellWrite.md)[] | The cells each of them gets. |\n| `kind` | `\"uniform\"` | - |\n| `rows` | `string`[] | The rows. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"per_row\"`; `rows`: [`RowChange`](RowChange.md)[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"per_row\"` | - |\n| `rows` | [`RowChange`](RowChange.md)[] | The rows and their cells, in order. |\n\n\n<!-- generated/storage/types.gen/type-aliases/RowHistoryEntry.md -->\n# Type Alias: RowHistoryEntry\n\n> **RowHistoryEntry** = \\{ `actingBot`: `string` \\| `null`; `actor`: `string` \\| `null`; `after`: \\{\\[`key`: `string`\\]: [`CellValue`](CellValue.md); \\}; `at`: `string`; `before`: \\{\\[`key`: `string`\\]: [`CellValue`](CellValue.md); \\}; `change`: `number`; `columns`: `string`[]; `kind`: [`RowChangeKind`](RowChangeKind.md); `version`: `number`; \\}\n\nOne change of a row, as its history shows it.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-actingbot\"></a> `actingBot` | `string` \\| `null` | The agent acting for them, if one was. |\n| <a id=\"property-actor\"></a> `actor` | `string` \\| `null` | Who made it; `null` for an internal caller, or a removed user. |\n| <a id=\"property-after\"></a> `after` | \\{\\[`key`: `string`\\]: [`CellValue`](CellValue.md); \\} | Those columns' values it wrote, by column id; a cell it emptied is left out. |\n| <a id=\"property-at\"></a> `at` | `string` | When it committed. |\n| <a id=\"property-before\"></a> `before` | \\{\\[`key`: `string`\\]: [`CellValue`](CellValue.md); \\} | Those columns' values before it, by column id; an empty cell is left out. |\n| <a id=\"property-change\"></a> `change` | `number` | The change's id in the journal. |\n| <a id=\"property-columns\"></a> `columns` | `string`[] | The columns it wrote; for a removal, those the row had values in. |\n| <a id=\"property-kind\"></a> `kind` | [`RowChangeKind`](RowChangeKind.md) | How it touched the row. |\n| <a id=\"property-version\"></a> `version` | `number` | The table version it produced. |\n\n\n<!-- generated/storage/types.gen/type-aliases/RowsChange.md -->\n# Type Alias: RowsChange\n\n> **RowsChange** = \\{ `kind`: `\"insert\"`; `rows`: [`CellWrite`](CellWrite.md)[][]; \\} \\| \\{ `changes`: [`RowChanges`](RowChanges.md); `kind`: `\"update\"`; \\} \\| \\{ `kind`: `\"delete\"`; `rows`: `string`[]; \\}\n\nA write to a table's rows.\n\n## Union Members\n\n### Type Literal\n\n\\{ `kind`: `\"insert\"`; `rows`: [`CellWrite`](CellWrite.md)[][]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"insert\"` | - |\n| `rows` | [`CellWrite`](CellWrite.md)[][] | One entry per new row: the cells it starts with. Columns left out start empty. |\n\n***\n\n### Type Literal\n\n\\{ `changes`: [`RowChanges`](RowChanges.md); `kind`: `\"update\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `changes` | [`RowChanges`](RowChanges.md) | Which rows get which cells. |\n| `kind` | `\"update\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"delete\"`; `rows`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"delete\"` | - |\n| `rows` | `string`[] | The rows, each named once. |\n\n\n<!-- generated/storage/types.gen/type-aliases/RowsResult.md -->\n# Type Alias: RowsResult\n\n> **RowsResult** = \\{ `kind`: `\"inserted\"`; `rows`: `string`[]; \\} \\| \\{ `affected`: `number`; `kind`: `\"updated\"`; \\} \\| \\{ `affected`: `number`; `kind`: `\"deleted\"`; \\}\n\nWhat happened to a table's rows.\n\n## Union Members\n\n### Type Literal\n\n\\{ `kind`: `\"inserted\"`; `rows`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"inserted\"` | - |\n| `rows` | `string`[] | The new rows, in the order they were sent. |\n\n***\n\n### Type Literal\n\n\\{ `affected`: `number`; `kind`: `\"updated\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `affected` | `number` | How many rows the op updated. |\n| `kind` | `\"updated\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `affected`: `number`; `kind`: `\"deleted\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `affected` | `number` | How many rows the op deleted. |\n| `kind` | `\"deleted\"` | - |\n\n\n<!-- generated/storage/types.gen/type-aliases/SetOperator.md -->\n# Type Alias: SetOperator\n\n> **SetOperator** = `\"isAnyOf\"` \\| `\"isNoneOf\"` \\| `\"hasAny\"` \\| `\"hasAll\"` \\| `\"hasNone\"`\n\nHow a cell's options or references relate to a set of them. The first\ntwo fit a column holding one value, the last three one holding several.\n\n\n<!-- generated/storage/types.gen/type-aliases/SharePermissionV2.md -->\n# Type Alias: SharePermissionV2\n\n> **SharePermissionV2** = \\{ `channelSharePermissions?`: [`ChannelSharePermission`](ChannelSharePermission.md)[] \\| `null`; `id`: `string`; `linkShare?`: `null` \\| [`LinkShare`](LinkShare.md); `linkShareAccessLevel?`: `null` \\| [`AccessLevel`](AccessLevel.md); `owner`: `string`; `teamShareAccessLevel?`: `null` \\| [`AccessLevel`](AccessLevel.md); \\}\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-channelsharepermissions\"></a> `channelSharePermissions?` | [`ChannelSharePermission`](ChannelSharePermission.md)[] \\| `null` | The channel share permissions for the item |\n| <a id=\"property-id\"></a> `id` | `string` | The share permission id |\n| <a id=\"property-linkshare\"></a> `linkShare?` | `null` \\| [`LinkShare`](LinkShare.md) | - |\n| <a id=\"property-linkshareaccesslevel\"></a> `linkShareAccessLevel?` | `null` \\| [`AccessLevel`](AccessLevel.md) | - |\n| <a id=\"property-owner\"></a> `owner` | `string` | The owner of the item |\n| <a id=\"property-teamshareaccesslevel\"></a> `teamShareAccessLevel?` | `null` \\| [`AccessLevel`](AccessLevel.md) | - |\n\n\n<!-- generated/storage/types.gen/type-aliases/SortDirection.md -->\n# Type Alias: SortDirection\n\n> **SortDirection** = `\"ascending\"` \\| `\"descending\"`\n\nA sort direction. Empty cells sort last either way.\n\n\n<!-- generated/storage/types.gen/type-aliases/SortKey.md -->\n# Type Alias: SortKey\n\n> **SortKey** = \\{ `column`: `string`; `direction`: [`SortDirection`](SortDirection.md); \\}\n\nOne sort key.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-column\"></a> `column` | `string` | The column sorted on. |\n| <a id=\"property-direction\"></a> `direction` | [`SortDirection`](SortDirection.md) | Which way. |\n\n\n<!-- generated/storage/types.gen/type-aliases/Table.md -->\n# Type Alias: Table\n\n> **Table** = \\{ `database_id`: `string`; `id`: `string`; `name`: `string`; `position`: `string`; `version`: [`TableVersion`](TableVersion.md); \\}\n\nOne table (tab) of a database.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-database_id\"></a> `database_id` | `string` | Owning database. |\n| <a id=\"property-id\"></a> `id` | `string` | Identifier. |\n| <a id=\"property-name\"></a> `name` | `string` | Display name; also the basis of the table's SQL name. |\n| <a id=\"property-position\"></a> `position` | `string` | Fractional index for tab ordering. |\n| <a id=\"property-version\"></a> `version` | [`TableVersion`](TableVersion.md) | Current version. |\n\n\n<!-- generated/storage/types.gen/type-aliases/TableChange.md -->\n# Type Alias: TableChange\n\n> **TableChange** = \\{ `kind`: `\"create\"`; `name`: `string`; \\} \\| \\{ `kind`: `\"rename\"`; `name`: `string`; `previousName?`: `string`; \\} \\| \\{ `kind`: `\"delete\"`; \\} \\| \\{ `kind`: `\"reorder_columns\"`; `order`: `string`[]; \\} \\| \\{ `kind`: `\"reorder_views\"`; `order`: `string`[]; \\}\n\nA change to a table itself.\n\n## Union Members\n\n### Type Literal\n\n\\{ `kind`: `\"create\"`; `name`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"create\"` | - |\n| `name` | `string` | Its name, unique within the database ignoring case. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"rename\"`; `name`: `string`; `previousName?`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"rename\"` | - |\n| `name` | `string` | Its new name, unique within the database ignoring case. |\n| `previousName?` | `string` | The name the caller saw. Given, the rename is refused if the table goes by another one now, so a concurrent rename is not overwritten. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"delete\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"reorder_columns\"`; `order`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"reorder_columns\"` | - |\n| `order` | `string`[] | Its columns, in their new order. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"reorder_views\"`; `order`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"reorder_views\"` | - |\n| `order` | `string`[] | Its views, in their new order. |\n\n\n<!-- generated/storage/types.gen/type-aliases/TableDetail.md -->\n# Type Alias: TableDetail\n\n> **TableDetail** = \\{ `columns`: [`ColumnDetail`](ColumnDetail.md)[]; `sql_name`: `string`; `table`: [`Table`](Table.md); `views`: [`DatabaseView`](DatabaseView.md)[]; \\}\n\nOne table with its columns and SQL name.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-columns\"></a> `columns` | [`ColumnDetail`](ColumnDetail.md)[] | Columns in display order. |\n| <a id=\"property-sql_name\"></a> `sql_name` | `string` | The name SQL refers to the table by: its display name quoted and qualified by the database's (`FROM \"Plans\".\"Table 1\"`). |\n| <a id=\"property-table\"></a> `table` | [`Table`](Table.md) | The table. |\n| <a id=\"property-views\"></a> `views` | [`DatabaseView`](DatabaseView.md)[] | The table's views, in their order. |\n\n\n<!-- generated/storage/types.gen/type-aliases/TableResult.md -->\n# Type Alias: TableResult\n\n> **TableResult** = \\{ `kind`: `\"created\"`; \\} \\| \\{ `kind`: `\"renamed\"`; \\} \\| \\{ `kind`: `\"deleted\"`; \\} \\| \\{ `kind`: `\"columns_reordered\"`; \\} \\| \\{ `kind`: `\"views_reordered\"`; `positions`: [`ViewPosition`](ViewPosition.md)[]; \\}\n\nWhat happened to a table.\n\n## Union Members\n\n### Type Literal\n\n\\{ `kind`: `\"created\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"renamed\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"deleted\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"columns_reordered\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"views_reordered\"`; `positions`: [`ViewPosition`](ViewPosition.md)[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"views_reordered\"` | - |\n| `positions` | [`ViewPosition`](ViewPosition.md)[] | Every view's key, in their new order. |\n\n\n<!-- generated/storage/types.gen/type-aliases/TableVersion.md -->\n# Type Alias: TableVersion\n\n> **TableVersion** = `number`\n\nMonotonic per-table version, bumped once by every committed change to a\ntable's schema or rows. Schema edits name the version they were made\nagainst, and change events carry the new one.\n\n\n<!-- generated/storage/types.gen/type-aliases/TakenId.md -->\n# Type Alias: TakenId\n\n> **TakenId** = \\{ `id`: `string`; `kind`: `\"table\"`; \\} \\| \\{ `id`: `string`; `kind`: `\"column\"`; \\} \\| \\{ `id`: `string`; `kind`: `\"option\"`; \\} \\| \\{ `id`: `string`; `kind`: `\"view\"`; \\}\n\nAn id a request minted for something new that already names something,\nwhich refuses the request: a retried request whose first attempt\ncommitted, or an id minted twice.\n\n## Union Members\n\n### Type Literal\n\n\\{ `id`: `string`; `kind`: `\"table\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | A table's. |\n| `kind` | `\"table\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: `string`; `kind`: `\"column\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | A column's. |\n| `kind` | `\"column\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: `string`; `kind`: `\"option\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | An option's. |\n| `kind` | `\"option\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: `string`; `kind`: `\"view\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | A view's. |\n| `kind` | `\"view\"` | - |\n\n\n<!-- generated/storage/types.gen/type-aliases/TextOperator.md -->\n# Type Alias: TextOperator\n\n> **TextOperator** = `\"is\"` \\| `\"isNot\"` \\| `\"contains\"` \\| `\"doesNotContain\"` \\| `\"startsWith\"` \\| `\"endsWith\"`\n\nHow a text cell compares to a text.\n\n\n<!-- generated/storage/types.gen/type-aliases/UpdateChannelSharePermission.md -->\n# Type Alias: UpdateChannelSharePermission\n\n> **UpdateChannelSharePermission** = \\{ `accessLevel?`: `null` \\| [`AccessLevel`](AccessLevel.md); `channelId`: `string`; `operation`: [`UpdateOperation`](UpdateOperation.md); \\}\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-accesslevel\"></a> `accessLevel?` | `null` \\| [`AccessLevel`](AccessLevel.md) | - |\n| <a id=\"property-channelid\"></a> `channelId` | `string` | The channel id |\n| <a id=\"property-operation\"></a> `operation` | [`UpdateOperation`](UpdateOperation.md) | The type of operation to be performed on the chanel share permission You can add, remove or replace and existing permission |\n\n\n<!-- generated/storage/types.gen/type-aliases/UpdateOperation.md -->\n# Type Alias: UpdateOperation\n\n> **UpdateOperation** = `\"add\"` \\| `\"remove\"` \\| `\"replace\"`\n\n\n<!-- generated/storage/types.gen/type-aliases/UpdateSharePermissionRequestV2.md -->\n# Type Alias: UpdateSharePermissionRequestV2\n\n> **UpdateSharePermissionRequestV2** = \\{ `channelSharePermissions?`: [`UpdateChannelSharePermission`](UpdateChannelSharePermission.md)[] \\| `null`; `linkShare?`: `null` \\| [`LinkShare`](LinkShare.md); `linkShareAccessLevel?`: `null` \\| [`AccessLevel`](AccessLevel.md); `teamShareAccessLevel?`: `null` \\| [`AccessLevel`](AccessLevel.md); \\}\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-channelsharepermissions\"></a> `channelSharePermissions?` | [`UpdateChannelSharePermission`](UpdateChannelSharePermission.md)[] \\| `null` | Any channel share permissions to be created/updated/removed |\n| <a id=\"property-linkshare\"></a> `linkShare?` | `null` \\| [`LinkShare`](LinkShare.md) | - |\n| <a id=\"property-linkshareaccesslevel\"></a> `linkShareAccessLevel?` | `null` \\| [`AccessLevel`](AccessLevel.md) | - |\n| <a id=\"property-teamshareaccesslevel\"></a> `teamShareAccessLevel?` | `null` \\| [`AccessLevel`](AccessLevel.md) | - |\n\n\n<!-- generated/storage/types.gen/type-aliases/VersionedTable.md -->\n# Type Alias: VersionedTable\n\n> **VersionedTable** = \\{ `table`: `string`; `version`: [`TableVersion`](TableVersion.md); \\}\n\nA table and its version.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-table\"></a> `table` | `string` | The table. |\n| <a id=\"property-version\"></a> `version` | [`TableVersion`](TableVersion.md) | Its version. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ViewChange.md -->\n# Type Alias: ViewChange\n\n> **ViewChange** = \\{ `kind`: `\"create\"`; `view`: [`NewView`](NewView.md); \\} \\| \\{ `kind`: `\"update\"`; `layout?`: [`RequestedLayout`](RequestedLayout.md); `name?`: `string`; `query?`: [`ViewQuery`](ViewQuery.md); \\} \\| \\{ `kind`: `\"delete\"`; \\} \\| \\{ `after?`: `string` \\| `null`; `before?`: `string` \\| `null`; `kind`: `\"move_card\"`; `lane`: [`LaneKey`](LaneKey.md); `row`: `string`; \\}\n\nA change to one view.\n\n## Union Members\n\n### Type Literal\n\n\\{ `kind`: `\"create\"`; `view`: [`NewView`](NewView.md); \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"create\"` | - |\n| `view` | [`NewView`](NewView.md) | What it shows and how. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"update\"`; `layout?`: [`RequestedLayout`](RequestedLayout.md); `name?`: `string`; `query?`: [`ViewQuery`](ViewQuery.md); \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"update\"` | - |\n| `layout?` | [`RequestedLayout`](RequestedLayout.md) | Its new layout. A board grouped by another column forgets where its cards were; a board left without a card title keeps the one it has, or takes the table's first column. |\n| `name?` | `string` | Its new name. |\n| `query?` | [`ViewQuery`](ViewQuery.md) | Its new query. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"delete\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `after?`: `string` \\| `null`; `before?`: `string` \\| `null`; `kind`: `\"move_card\"`; `lane`: [`LaneKey`](LaneKey.md); `row`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `after?` | `string` \\| `null` | The card that ends up just after it, if any. Given with `before`, it must be the card right after `before`; with neither, the card goes to the end of the lane. |\n| `before?` | `string` \\| `null` | The card that ends up just before it (it lands right after this one), if any. |\n| `kind` | `\"move_card\"` | - |\n| `lane` | [`LaneKey`](LaneKey.md) | The lane it goes to: an option of a select board's column, a person for a board grouped by people, or the lane of empty cells. |\n| `row` | `string` | The card's row. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ViewColumn.md -->\n# Type Alias: ViewColumn\n\n> **ViewColumn** = \\{ `column`: `string`; `width`: `number` \\| `null`; \\}\n\nHow one column shows in a table layout.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-column\"></a> `column` | `string` | The column. |\n| <a id=\"property-width\"></a> `width` | `number` \\| `null` | Its width in pixels; the default when unset. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ViewLayout.md -->\n# Type Alias: ViewLayout\n\n> **ViewLayout** = \\{ `columns`: [`ViewColumn`](ViewColumn.md)[]; `kind`: `\"table\"`; \\} \\| \\{ `cardFields`: `string`[]; `groupBy`: `string`; `hideEmptyLanes`: `boolean`; `kind`: `\"board\"`; `lanes`: [`Lane`](Lane.md)[]; `title`: `string`; \\}\n\nHow a view draws its rows.\n\n## Union Members\n\n### Type Literal\n\n\\{ `columns`: [`ViewColumn`](ViewColumn.md)[]; `kind`: `\"table\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `columns` | [`ViewColumn`](ViewColumn.md)[] | How columns show, in display order. A column left out shows after the listed ones, in the table's order. |\n| `kind` | `\"table\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `cardFields`: `string`[]; `groupBy`: `string`; `hideEmptyLanes`: `boolean`; `kind`: `\"board\"`; `lanes`: [`Lane`](Lane.md)[]; `title`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `cardFields` | `string`[] | The columns a card shows under its title, in order. |\n| `groupBy` | `string` | The single-select or single-person column whose values are the lanes; moving a card to another lane sets this column. |\n| `hideEmptyLanes` | `boolean` | Whether a lane with no cards is hidden. |\n| `kind` | `\"board\"` | - |\n| `lanes` | [`Lane`](Lane.md)[] | How lanes show, in display order. A lane left out shows after the listed ones: the lane of empty cells first, then options in the column's order, or people by id. |\n| `title` | `string` | The column a card is titled by, of any type. Removing it titles the cards by the table's first remaining column. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ViewPosition.md -->\n# Type Alias: ViewPosition\n\n> **ViewPosition** = \\{ `position`: `string`; `view`: `string`; \\}\n\nA view's place among its table's views.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-position\"></a> `position` | `string` | Its key. |\n| <a id=\"property-view\"></a> `view` | `string` | The view. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ViewQuery.md -->\n# Type Alias: ViewQuery\n\n> **ViewQuery** = \\{ `filter`: `null` \\| [`FilterGroup`](FilterGroup.md); `sort?`: [`SortKey`](SortKey.md)[]; \\}\n\nWhich rows of the table a view shows, and in what order: a filter and a\nsort, nothing that joins, groups or reshapes rows.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-filter\"></a> `filter` | `null` \\| [`FilterGroup`](FilterGroup.md) | - |\n| <a id=\"property-sort\"></a> `sort?` | [`SortKey`](SortKey.md)[] | The sort keys, first key first. Rows the keys leave tied keep the table's own order; with no keys, the table's order is the view's. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ViewResult.md -->\n# Type Alias: ViewResult\n\n> **ViewResult** = \\{ `kind`: `\"created\"`; `view`: [`DatabaseView`](DatabaseView.md); \\} \\| \\{ `kind`: `\"updated\"`; `view`: [`DatabaseView`](DatabaseView.md); \\} \\| \\{ `kind`: `\"deleted\"`; \\} \\| \\{ `kind`: `\"card_moved\"`; `positions`: [`CardPosition`](CardPosition.md)[]; \\}\n\nWhat happened to a view.\n\n## Union Members\n\n### Type Literal\n\n\\{ `kind`: `\"created\"`; `view`: [`DatabaseView`](DatabaseView.md); \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"created\"` | - |\n| `view` | [`DatabaseView`](DatabaseView.md) | The view as stored. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"updated\"`; `view`: [`DatabaseView`](DatabaseView.md); \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"updated\"` | - |\n| `view` | [`DatabaseView`](DatabaseView.md) | The view as stored. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"deleted\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"card_moved\"`; `positions`: [`CardPosition`](CardPosition.md)[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"card_moved\"` | - |\n| `positions` | [`CardPosition`](CardPosition.md)[] | The positions written, the moved card's last. |\n\n\n<!-- src/entities/databases/column/classes/DatabaseColumn.md -->\n# Class: DatabaseColumn\n\nOne column of a [DatabaseTable](../../table/classes/DatabaseTable.md): the placement of a property\ndefinition on the table.\n\nA column is not an entity of its own — it has no permissions and no\nendpoint to read it directly. The handle resolves through the owning\ndatabase's schema, so a fresh read after a write sees the new value.\n\n## Properties\n\n| Property | Modifier | Type | Description |\n| ------ | ------ | ------ | ------ |\n| <a id=\"property-id\"></a> `id` | `readonly` | `string` | Identifier of the column placement. |\n| <a id=\"property-table\"></a> `table` | `readonly` | [`DatabaseTable`](../../table/classes/DatabaseTable.md) | The table this column belongs to. |\n\n## Methods\n\n### addOptions()\n\n> **addOptions**(`labels`): `Promise`\\<`DatabaseColumn`\\>\n\nAdd select options to the column. Labels it already has are skipped, so\nthe call is safe to repeat. Only select and tag columns accept options.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `labels` | `string`[] |\n\n#### Returns\n\n`Promise`\\<`DatabaseColumn`\\>\n\n***\n\n### casts()\n\n> **casts**(): `Promise`\\<[`ColumnCast`](../../../../../generated/storage/types.gen/type-aliases/ColumnCast.md)[]\\>\n\nWhat changing this column to each type would do to its values: `safe`,\n`checked` (with how many would not convert, and a few of them), or\n`never` (with why). Changes nothing.\n\n#### Returns\n\n`Promise`\\<[`ColumnCast`](../../../../../generated/storage/types.gen/type-aliases/ColumnCast.md)[]\\>\n\n***\n\n### changeType()\n\n> **changeType**(`options`): `Promise`\\<[`OpResultOf`](../../database/type-aliases/OpResultOf.md)\\<`\"column\"`, `\"type_changed\"`\\>\\>\n\nChange this column's type. See Database.changeColumnType.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | [`ChangeColumnTypeOptions`](../../database/type-aliases/ChangeColumnTypeOptions.md) |\n\n#### Returns\n\n`Promise`\\<[`OpResultOf`](../../database/type-aliases/OpResultOf.md)\\<`\"column\"`, `\"type_changed\"`\\>\\>\n\n***\n\n### config()\n\n> **config**(): `Promise`\\<[`ColumnConfig`](../../../../../generated/storage/types.gen/type-aliases/ColumnConfig.md) \\| `undefined`\\>\n\nColumn-kind configuration (a link), or `undefined` for a plain\nvalue column.\n\n#### Returns\n\n`Promise`\\<[`ColumnConfig`](../../../../../generated/storage/types.gen/type-aliases/ColumnConfig.md) \\| `undefined`\\>\n\n***\n\n### convertIntoNewColumn()\n\n> **convertIntoNewColumn**(`options`): `Promise`\\<`DatabaseColumn`\\>\n\nAdd a column of another type right after this one, filled with the\nvalues that convert, leaving this one as it is. See\nDatabase.convertColumnIntoNewColumn.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | [`ConvertIntoNewColumnOptions`](../../database/type-aliases/ConvertIntoNewColumnOptions.md) |\n\n#### Returns\n\n`Promise`\\<`DatabaseColumn`\\>\n\n***\n\n### dataType()\n\n> **dataType**(): `Promise`\\<[`DataType`](../../../../../generated/storage/types.gen/type-aliases/DataType.md)\\>\n\nThe value type the column holds.\n\n#### Returns\n\n`Promise`\\<[`DataType`](../../../../../generated/storage/types.gen/type-aliases/DataType.md)\\>\n\n***\n\n### definition()\n\n> **definition**(): `Promise`\\<[`PropertyDefinitionWithOptions`](../../../../../generated/storage/types.gen/type-aliases/PropertyDefinitionWithOptions.md)\\>\n\nThe bound property definition together with its select options — the\nsource of the column's name, type, and allowed values.\n\n#### Returns\n\n`Promise`\\<[`PropertyDefinitionWithOptions`](../../../../../generated/storage/types.gen/type-aliases/PropertyDefinitionWithOptions.md)\\>\n\n***\n\n### delete()\n\n> **delete**(): `Promise`\\<`void`\\>\n\nDelete this placement and its cells at the table version last read.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### detail()\n\n> **detail**(): `Promise`\\<[`ColumnDetail`](../../../../../generated/storage/types.gen/type-aliases/ColumnDetail.md)\\>\n\nThe column's record as the API returns it: the placement and the bound\nproperty definition.\n\n#### Returns\n\n`Promise`\\<[`ColumnDetail`](../../../../../generated/storage/types.gen/type-aliases/ColumnDetail.md)\\>\n\n***\n\n### inferType()\n\n> **inferType**(`options`): `Promise`\\<`DatabaseColumn`\\>\n\nSettle the type of an empty column created with inferType enabled.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | [`InferColumnTypeOptions`](../../database/type-aliases/InferColumnTypeOptions.md) |\n\n#### Returns\n\n`Promise`\\<`DatabaseColumn`\\>\n\n***\n\n### isMultiSelect()\n\n> **isMultiSelect**(): `Promise`\\<`boolean`\\>\n\nWhether the column holds multiple values.\n\n#### Returns\n\n`Promise`\\<`boolean`\\>\n\n***\n\n### name()\n\n> **name**(): `Promise`\\<`string`\\>\n\nThe placement's display name, falling back to its property definition.\n\n#### Returns\n\n`Promise`\\<`string`\\>\n\n***\n\n### position()\n\n> **position**(): `Promise`\\<`string`\\>\n\nThe column's fractional index within the table's column order.\n\n#### Returns\n\n`Promise`\\<`string`\\>\n\n***\n\n### rename()\n\n> **rename**(`name`): `Promise`\\<`DatabaseColumn`\\>\n\nRename this placement, only if its last-read name is still current,\nwithout changing its shared property definition.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `name` | `string` |\n\n#### Returns\n\n`Promise`\\<`DatabaseColumn`\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `id`: `string`; `tableId`: `string`; \\}\n\n#### Returns\n\n\\{ `id`: `string`; `tableId`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `id` | `string` |\n| `tableId` | `string` |\n\n***\n\n### byId()\n\n> `static` **byId**(`table`, `id`): `DatabaseColumn`\n\nA handle to a column by id, within a table. Details load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `table` | [`DatabaseTable`](../../table/classes/DatabaseTable.md) |\n| `id` | `string` |\n\n#### Returns\n\n`DatabaseColumn`\n\n\n<!-- src/entities/databases/database/classes/Database.md -->\n# Class: Database\n\nA Macro database: a named collection of tables, owned and shared as one\nentity.\n\nA free-to-construct `(client, id)` handle like any other entity — the schema\nloads lazily on first field access and is dropped after any mutation.\n\n## Extends\n\n- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\\<[`DatabaseDetail`](../../../../../generated/storage/types.gen/type-aliases/DatabaseDetail.md)\\>\n\n## Properties\n\n| Property | Modifier | Type | Description | Inherited from |\n| ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-createdat\"></a> `createdAt` | `readonly` | () => `Promise`\\<`string`\\> | When the database was created. | - |\n| <a id=\"property-grant\"></a> `grant` | `readonly` | () => `Promise`\\<[`AccessLevel`](../../../../../generated/storage/types.gen/type-aliases/AccessLevel.md)\\> | The caller's access on the database. | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |\n| <a id=\"property-name\"></a> `name` | `readonly` | () => `Promise`\\<`string`\\> | The database's display name. | - |\n| <a id=\"property-owner\"></a> `owner` | `readonly` | () => `Promise`\\<[`User`](../../../users/user/classes/User.md)\\> | The user who owns the database. | - |\n| <a id=\"property-tables\"></a> `tables` | `readonly` | () => `Promise`\\<[`DatabaseTable`](../../table/classes/DatabaseTable.md)[]\\> | The database's tables, in tab order. | - |\n| <a id=\"property-trashedat\"></a> `trashedAt` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | When the database was trashed, if it has been. | - |\n\n## Methods\n\n### addColumn()\n\n> **addColumn**(`table`, `options`): `Promise`\\<[`DatabaseColumn`](../../column/classes/DatabaseColumn.md)\\>\n\nAdd a column to one of the database's tables, under an id minted here,\neither creating a property definition for it or binding an existing one.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `table` | [`DatabaseTable`](../../table/classes/DatabaseTable.md) |\n| `options` | [`AddColumnOptions`](../type-aliases/AddColumnOptions.md) |\n\n#### Returns\n\n`Promise`\\<[`DatabaseColumn`](../../column/classes/DatabaseColumn.md)\\>\n\n***\n\n### addColumnOptions()\n\n> **addColumnOptions**(`column`, `labels`): `Promise`\\<[`OpResultOf`](../type-aliases/OpResultOf.md)\\<`\"column\"`, `\"options_added\"`\\>\\>\n\nAdd select options to one of the database's columns, each under an id\nminted here. Labels the column already has are skipped, so the call is\nsafe to repeat; the result lists the options it did create. Only select\nand tag columns accept options.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `column` | [`DatabaseColumn`](../../column/classes/DatabaseColumn.md) |\n| `labels` | `string`[] |\n\n#### Returns\n\n`Promise`\\<[`OpResultOf`](../type-aliases/OpResultOf.md)\\<`\"column\"`, `\"options_added\"`\\>\\>\n\n***\n\n### applyOps()\n\n> **applyOps**(`ops`, `options?`): `Promise`\\<[`OpResult`](../../../../../generated/storage/types.gen/type-aliases/OpResult.md)[]\\>\n\nApply ops to the database in one transaction: create, rename, reorder,\nor delete tables and columns; change a column's type; add, edit, or\ndelete select options; insert, update, or delete rows; create, change,\nreorder, or delete views; move board cards. Later ops see what earlier\nones did, so a table or column created by one op (under an id the caller\nmints, as a UUIDv7) can be named by the next. A refused op leaves the\nwhole batch unwritten and throws [MacroOpRefusedError](MacroOpRefusedError.md). Returns one\nresult per op, in the order sent.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `ops` | [`DatabaseOp`](../../../../../generated/storage/types.gen/type-aliases/DatabaseOp.md)[] |\n| `options?` | [`ApplyOpsOptions`](../type-aliases/ApplyOpsOptions.md) |\n\n#### Returns\n\n`Promise`\\<[`OpResult`](../../../../../generated/storage/types.gen/type-aliases/OpResult.md)[]\\>\n\n***\n\n### changeColumnType()\n\n> **changeColumnType**(`column`, `options`): `Promise`\\<[`OpResultOf`](../type-aliases/OpResultOf.md)\\<`\"column\"`, `\"type_changed\"`\\>\\>\n\nChange a column's type at the table version last read. Every value must\nconvert: one that does not refuses the change, naming how many and a few\nof them, and nothing is written. To keep the original column, see\n[Database.convertColumnIntoNewColumn](#convertcolumnintonewcolumn).\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `column` | [`DatabaseColumn`](../../column/classes/DatabaseColumn.md) |\n| `options` | [`ChangeColumnTypeOptions`](../type-aliases/ChangeColumnTypeOptions.md) |\n\n#### Returns\n\n`Promise`\\<[`OpResultOf`](../type-aliases/OpResultOf.md)\\<`\"column\"`, `\"type_changed\"`\\>\\>\n\n***\n\n### columnCasts()\n\n> **columnCasts**(`column`): `Promise`\\<[`ColumnCast`](../../../../../generated/storage/types.gen/type-aliases/ColumnCast.md)[]\\>\n\nWhat changing a column to each type would do to its values. Changes\nnothing.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `column` | [`DatabaseColumn`](../../column/classes/DatabaseColumn.md) |\n\n#### Returns\n\n`Promise`\\<[`ColumnCast`](../../../../../generated/storage/types.gen/type-aliases/ColumnCast.md)[]\\>\n\n***\n\n### columnConversion()\n\n> **columnConversion**(`column`, `to`): `Promise`\\<[`ColumnConversion`](../../../../../generated/storage/types.gen/type-aliases/ColumnConversion.md)\\>\n\nWhat a column's values become under another type: the values that\nconvert, the option labels a new select or tag column of that type needs,\nand how many values do not convert. Changes nothing.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `column` | [`DatabaseColumn`](../../column/classes/DatabaseColumn.md) |\n| `to` | [`ColumnType`](../type-aliases/ColumnType.md) |\n\n#### Returns\n\n`Promise`\\<[`ColumnConversion`](../../../../../generated/storage/types.gen/type-aliases/ColumnConversion.md)\\>\n\n***\n\n### convertColumnIntoNewColumn()\n\n> **convertColumnIntoNewColumn**(`column`, `options`): `Promise`\\<[`DatabaseColumn`](../../column/classes/DatabaseColumn.md)\\>\n\nAdd a column of another type right after this one, filled with the\nvalues that convert, in one batch at the table version the conversion\nwas read at. The original column is left as it is; values that do not\nconvert stay only there.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `column` | [`DatabaseColumn`](../../column/classes/DatabaseColumn.md) |\n| `options` | [`ConvertIntoNewColumnOptions`](../type-aliases/ConvertIntoNewColumnOptions.md) |\n\n#### Returns\n\n`Promise`\\<[`DatabaseColumn`](../../column/classes/DatabaseColumn.md)\\>\n\n***\n\n### createTable()\n\n> **createTable**(`options`): `Promise`\\<[`DatabaseTable`](../../table/classes/DatabaseTable.md)\\>\n\nCreate a table in the database, under an id minted here.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | \\{ `name`: `string`; \\} |\n| `options.name` | `string` |\n\n#### Returns\n\n`Promise`\\<[`DatabaseTable`](../../table/classes/DatabaseTable.md)\\>\n\n***\n\n### createWebhook()\n\n> **createWebhook**(`table`): `Promise`\\<\\{ `token`: `string`; `webhook`: [`DatabaseWebhook`](../../webhook/classes/DatabaseWebhook.md); \\}\\>\n\nCreate a webhook that inserts rows into `table`, writing with the\ncaller's access. POST a JSON object (one row) or an array of objects to\n`/databases/webhooks/{token}` on the storage service; keys name columns.\nThe token is the whole credential and is answered only here.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `table` | [`DatabaseTable`](../../table/classes/DatabaseTable.md) |\n\n#### Returns\n\n`Promise`\\<\\{ `token`: `string`; `webhook`: [`DatabaseWebhook`](../../webhook/classes/DatabaseWebhook.md); \\}\\>\n\n***\n\n### deleteColumn()\n\n> **deleteColumn**(`column`): `Promise`\\<`number`\\>\n\nRemove a column and its cells at the table version last read. Returns\nthe table's new version.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `column` | [`DatabaseColumn`](../../column/classes/DatabaseColumn.md) |\n\n#### Returns\n\n`Promise`\\<`number`\\>\n\n***\n\n### deleteTable()\n\n> **deleteTable**(`table`): `Promise`\\<`void`\\>\n\nDelete one of the database's tables with its columns, rows, and views.\nA database keeps at least one table, and a table another table's\nrelation column points at cannot be deleted.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `table` | [`DatabaseTable`](../../table/classes/DatabaseTable.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### deleteWebhook()\n\n> **deleteWebhook**(`webhook`): `Promise`\\<`void`\\>\n\nDelete one of the database's webhooks; its URL stops working.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `webhook` | [`DatabaseWebhook`](../../webhook/classes/DatabaseWebhook.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### importTable()\n\n> **importTable**(`request`): `Promise`\\<[`DatabaseTable`](../../table/classes/DatabaseTable.md)\\>\n\nImport text rows atomically. Keep requestId unchanged when retrying.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `request` | [`ImportTable`](../../../../../generated/storage/types.gen/type-aliases/ImportTable.md) |\n\n#### Returns\n\n`Promise`\\<[`DatabaseTable`](../../table/classes/DatabaseTable.md)\\>\n\n***\n\n### inferColumnType()\n\n> **inferColumnType**(`column`, `options`): `Promise`\\<[`InferColumnTypeOutcome`](../../../../../generated/storage/types.gen/type-aliases/InferColumnTypeOutcome.md)\\>\n\nAdopt a first-value type only while the owned column is empty and inferable.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `column` | [`DatabaseColumn`](../../column/classes/DatabaseColumn.md) |\n| `options` | [`InferColumnTypeOptions`](../type-aliases/InferColumnTypeOptions.md) |\n\n#### Returns\n\n`Promise`\\<[`InferColumnTypeOutcome`](../../../../../generated/storage/types.gen/type-aliases/InferColumnTypeOutcome.md)\\>\n\n***\n\n### renameColumn()\n\n> **renameColumn**(`column`, `name`): `Promise`\\<`number`\\>\n\nRename this column placement, only if its last-read name is still\ncurrent, without changing its shared property definition. Returns the\ntable's new version.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `column` | [`DatabaseColumn`](../../column/classes/DatabaseColumn.md) |\n| `name` | `string` |\n\n#### Returns\n\n`Promise`\\<`number`\\>\n\n***\n\n### renameTable()\n\n> **renameTable**(`table`, `name`): `Promise`\\<`number`\\>\n\nRename a table only if its last-read name is still current. Returns the\ntable's new version.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `table` | [`DatabaseTable`](../../table/classes/DatabaseTable.md) |\n| `name` | `string` |\n\n#### Returns\n\n`Promise`\\<`number`\\>\n\n***\n\n### reorderColumns()\n\n> **reorderColumns**(`table`, `columns`): `Promise`\\<`number`\\>\n\nPersist a complete column order at the table version last read. Pass\nevery column of the table exactly once.\nReturns the table's new version.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `table` | [`DatabaseTable`](../../table/classes/DatabaseTable.md) |\n| `columns` | [`DatabaseColumn`](../../column/classes/DatabaseColumn.md)[] |\n\n#### Returns\n\n`Promise`\\<`number`\\>\n\n***\n\n### reorderTables()\n\n> **reorderTables**(`tables`): `Promise`\\<[`DatabaseTable`](../../table/classes/DatabaseTable.md)[]\\>\n\nPersist a new tab order. Pass every table of the database exactly once.\nReturns the tables in their new order.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `tables` | [`DatabaseTable`](../../table/classes/DatabaseTable.md)[] |\n\n#### Returns\n\n`Promise`\\<[`DatabaseTable`](../../table/classes/DatabaseTable.md)[]\\>\n\n***\n\n### rowHistory()\n\n> **rowHistory**(`row`): `Promise`\\<[`RowHistoryEntry`](../../../../../generated/storage/types.gen/type-aliases/RowHistoryEntry.md)[]\\>\n\nA row's history: every committed change that touched it, newest first.\nSee [DatabaseRow.history](../../row/classes/DatabaseRow.md#history).\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `row` | [`DatabaseRow`](../../row/classes/DatabaseRow.md) |\n\n#### Returns\n\n`Promise`\\<[`RowHistoryEntry`](../../../../../generated/storage/types.gen/type-aliases/RowHistoryEntry.md)[]\\>\n\n***\n\n### schema()\n\n> **schema**(): `Promise`\\<[`DatabaseDetail`](../../../../../generated/storage/types.gen/type-aliases/DatabaseDetail.md)\\>\n\nThe full schema: the database record, the caller's access, and every\ntable with its columns and views. Cached until the next write.\n\n#### Returns\n\n`Promise`\\<[`DatabaseDetail`](../../../../../generated/storage/types.gen/type-aliases/DatabaseDetail.md)\\>\n\n***\n\n### sharePermissions()\n\n> **sharePermissions**(): `Promise`\\<[`SharePermissionV2`](../../../../../generated/storage/types.gen/type-aliases/SharePermissionV2.md)\\>\n\nRead direct recipients. Only the database owner can manage sharing.\n\n#### Returns\n\n`Promise`\\<[`SharePermissionV2`](../../../../../generated/storage/types.gen/type-aliases/SharePermissionV2.md)\\>\n\n***\n\n### table()\n\n> **table**(`name`): `Promise`\\<[`DatabaseTable`](../../table/classes/DatabaseTable.md) \\| `undefined`\\>\n\nThe table with the given display name, or `undefined` if there is none.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `name` | `string` |\n\n#### Returns\n\n`Promise`\\<[`DatabaseTable`](../../table/classes/DatabaseTable.md) \\| `undefined`\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`DatabaseDetail`](../../../../../generated/storage/types.gen/type-aliases/DatabaseDetail.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`DatabaseDetail`](../../../../../generated/storage/types.gen/type-aliases/DatabaseDetail.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`DatabaseDetail`](../../../../../generated/storage/types.gen/type-aliases/DatabaseDetail.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)\n\n***\n\n### updateSharePermissions()\n\n> **updateSharePermissions**(`request`): `Promise`\\<[`SharePermissionV2`](../../../../../generated/storage/types.gen/type-aliases/SharePermissionV2.md)\\>\n\nAdd, replace, or remove recipient grants without transferring ownership.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `request` | [`UpdateSharePermissionRequestV2`](../../../../../generated/storage/types.gen/type-aliases/UpdateSharePermissionRequestV2.md) |\n\n#### Returns\n\n`Promise`\\<[`SharePermissionV2`](../../../../../generated/storage/types.gen/type-aliases/SharePermissionV2.md)\\>\n\n***\n\n### viewPositions()\n\n> **viewPositions**(`view`): `Promise`\\<[`CardPosition`](../../../../../generated/storage/types.gen/type-aliases/CardPosition.md)[]\\>\n\nWhere a board view's cards sit: each placed card's lane and key.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `view` | [`DatabaseView`](../../view/classes/DatabaseView.md) |\n\n#### Returns\n\n`Promise`\\<[`CardPosition`](../../../../../generated/storage/types.gen/type-aliases/CardPosition.md)[]\\>\n\n***\n\n### webhooks()\n\n> **webhooks**(): `Promise`\\<[`DatabaseWebhook`](../../webhook/classes/DatabaseWebhook.md)[]\\>\n\nThe database's webhooks, oldest first. Takes edit access.\n\n#### Returns\n\n`Promise`\\<[`DatabaseWebhook`](../../webhook/classes/DatabaseWebhook.md)[]\\>\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `id`): `Database`\n\nA handle to a database by id. Details load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `id` | `string` |\n\n#### Returns\n\n`Database`\n\n***\n\n### create()\n\n> `static` **create**(`client`, `options`): `Promise`\\<`Database`\\>\n\nCreate a database owned by the caller.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `options` | \\{ `name`: `string`; \\} |\n| `options.name` | `string` |\n\n#### Returns\n\n`Promise`\\<`Database`\\>\n\n***\n\n### list()\n\n> `static` **list**(`client`): `Promise`\\<`Database`[]\\>\n\nThe databases the caller can see, each with the caller's access level.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`Promise`\\<`Database`[]\\>\n\n\n<!-- src/entities/databases/database/classes/MacroOpRefusedError.md -->\n# Class: MacroOpRefusedError\n\nA batch of ops was refused (HTTP 400): nothing in it was written. Names the\nop at fault and, when the batch minted an id that already names something\n(a retry of a batch that committed, or an id minted twice), that id.\n\n## Extends\n\n- [`MacroApiError`](../../../../utils/unwrap/classes/MacroApiError.md)\n\n## Constructors\n\n### Constructor\n\n> **new MacroOpRefusedError**(`status`, `refusal`): `MacroOpRefusedError`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `status` | `number` |\n| `refusal` | [`OpRefusalResponse`](../../../../../generated/storage/types.gen/type-aliases/OpRefusalResponse.md) |\n\n#### Returns\n\n`MacroOpRefusedError`\n\n#### Overrides\n\n[`MacroApiError`](../../../../utils/unwrap/classes/MacroApiError.md).[`constructor`](../../../../utils/unwrap/classes/MacroApiError.md#constructor)\n\n## Properties\n\n| Property | Modifier | Type | Description | Inherited from |\n| ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-column\"></a> `column` | `readonly` | `string` \\| `null` | The column placement at fault, when one is. | - |\n| <a id=\"property-data\"></a> `data` | `readonly` | `unknown` | - | [`MacroApiError`](../../../../utils/unwrap/classes/MacroApiError.md).[`data`](../../../../utils/unwrap/classes/MacroApiError.md#property-data) |\n| <a id=\"property-op\"></a> `op` | `readonly` | `number` | The refused op's index in the batch. | - |\n| <a id=\"property-row\"></a> `row` | `readonly` | `number` \\| `null` | The row's index within the op, when one row is at fault. | - |\n| <a id=\"property-status\"></a> `status` | `readonly` | `number` | - | [`MacroApiError`](../../../../utils/unwrap/classes/MacroApiError.md).[`status`](../../../../utils/unwrap/classes/MacroApiError.md#property-status) |\n| <a id=\"property-taken\"></a> `taken` | `readonly` | [`TakenId`](../../../../../generated/storage/types.gen/type-aliases/TakenId.md) \\| `null` | The minted id that is already taken, when that is the reason. | - |\n\n\n<!-- src/entities/databases/database/type-aliases/AddColumnOptions.md -->\n# Type Alias: AddColumnOptions\n\n> **AddColumnOptions** = \\{ `inferType?`: `boolean`; `name`: `string`; `options?`: `string`[]; `type`: [`ColumnType`](ColumnType.md); \\} \\| \\{ `property`: [`PropertyDefinition`](../../../properties/property-definition/classes/PropertyDefinition.md); \\} & \\{ `after?`: [`DatabaseColumn`](../../column/classes/DatabaseColumn.md); \\}\n\nOptions for [Database.addColumn](../classes/Database.md#addcolumn).\n\n## Type Declaration\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `after?` | [`DatabaseColumn`](../../column/classes/DatabaseColumn.md) | The column the new one goes right after; by default, the last one. |\n\n\n<!-- src/entities/databases/database/type-aliases/ApplyOpsOptions.md -->\n# Type Alias: ApplyOpsOptions\n\n> **ApplyOpsOptions** = \\{ `baseVersions?`: \\{ `table`: [`DatabaseTable`](../../table/classes/DatabaseTable.md); `version`: [`TableVersion`](../../../../../generated/storage/types.gen/type-aliases/TableVersion.md); \\}[]; \\}\n\nOptions for [Database.applyOps](../classes/Database.md#applyops).\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-baseversions\"></a> `baseVersions?` | \\{ `table`: [`DatabaseTable`](../../table/classes/DatabaseTable.md); `version`: [`TableVersion`](../../../../../generated/storage/types.gen/type-aliases/TableVersion.md); \\}[] | The version each table must still be at, as the caller read it. A table that moved refuses the whole batch with a 409, so an edit made against what the caller saw does not overwrite another's. |\n\n\n<!-- src/entities/databases/database/type-aliases/ChangeColumnTypeOptions.md -->\n# Type Alias: ChangeColumnTypeOptions\n\n> **ChangeColumnTypeOptions** = \\{ `to`: [`ColumnType`](ColumnType.md); \\}\n\nOptions for [Database.changeColumnType](../classes/Database.md#changecolumntype).\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-to\"></a> `to` | [`ColumnType`](ColumnType.md) | The type to change the column to. |\n\n\n<!-- src/entities/databases/database/type-aliases/ColumnType.md -->\n# Type Alias: ColumnType\n\n> **ColumnType** = `Exclude`\\<[`ColumnKind`](../../../../../generated/storage/types.gen/type-aliases/ColumnKind.md), \\{ `type`: `\"relation\"`; \\}\\> \\| \\{ `table`: [`DatabaseTable`](../../table/classes/DatabaseTable.md); `type`: `\"relation\"`; \\}\n\nA type a column can have. A relation names the related table by handle;\nthe table may live in any database the caller can reach.\n\n\n<!-- src/entities/databases/database/type-aliases/ConvertIntoNewColumnOptions.md -->\n# Type Alias: ConvertIntoNewColumnOptions\n\n> **ConvertIntoNewColumnOptions** = \\{ `name?`: `string`; `to`: [`ColumnType`](ColumnType.md); \\}\n\nOptions for [Database.convertColumnIntoNewColumn](../classes/Database.md#convertcolumnintonewcolumn).\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-name\"></a> `name?` | `string` | Display name of the new column; by default the original's name followed by the type, as in `Due (Date)`. |\n| <a id=\"property-to\"></a> `to` | [`ColumnType`](ColumnType.md) | The type of the new column. |\n\n\n<!-- src/entities/databases/database/type-aliases/InferColumnTypeOptions.md -->\n# Type Alias: InferColumnTypeOptions\n\n> **InferColumnTypeOptions** = \\{ `baseVersion`: [`TableVersion`](../../../../../generated/storage/types.gen/type-aliases/TableVersion.md); `dataType`: `\"STRING\"` \\| `\"NUMBER\"` \\| `\"ENTITY\"`; `specificEntityType?`: [`InferColumnTypeRequest`](../../../../../generated/storage/types.gen/type-aliases/InferColumnTypeRequest.md)\\[`\"specificEntityType\"`\\]; \\}\n\nSettle an empty inferred column using the table version the caller read.\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-baseversion\"></a> `baseVersion` | [`TableVersion`](../../../../../generated/storage/types.gen/type-aliases/TableVersion.md) |\n| <a id=\"property-datatype\"></a> `dataType` | `\"STRING\"` \\| `\"NUMBER\"` \\| `\"ENTITY\"` |\n| <a id=\"property-specificentitytype\"></a> `specificEntityType?` | [`InferColumnTypeRequest`](../../../../../generated/storage/types.gen/type-aliases/InferColumnTypeRequest.md)\\[`\"specificEntityType\"`\\] |\n\n\n<!-- src/entities/databases/database/type-aliases/OpResultOf.md -->\n# Type Alias: OpResultOf\\<Kind, Change\\>\n\n> **OpResultOf**\\<`Kind`, `Change`\\> = `Extract`\\<`ChangedResult`, \\{ `kind`: `Kind`; \\}\\> & \\{ `change`: `Extract`\\<`Extract`\\<`ChangedResult`, \\{ `kind`: `Kind`; \\}\\>\\[`\"change\"`\\], \\{ `kind`: `Change`; \\}\\>; \\}\n\nThe result of a `Kind` op whose change answered `Change`.\n\n## Type Parameters\n\n| Type Parameter |\n| ------ |\n| <a id=\"type-parameter-kind\"></a> `Kind` *extends* keyof `ResultChanges` |\n| <a id=\"type-parameter-change\"></a> `Change` *extends* `ResultChanges`\\[`Kind`\\] |\n\n## Type Declaration\n\n| Name | Type |\n| ------ | ------ |\n| `change` | `Extract`\\<`Extract`\\<`ChangedResult`, \\{ `kind`: `Kind`; \\}\\>\\[`\"change\"`\\], \\{ `kind`: `Change`; \\}\\> |\n\n\n<!-- src/entities/databases/namespace/classes/DatabaseNamespace.md -->\n# Class: DatabaseNamespace\n\nMacro databases: named collections of tables, owned and shared as one\nentity.\n\n## Constructors\n\n### Constructor\n\n> **new DatabaseNamespace**(`client`): `DatabaseNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`DatabaseNamespace`\n\n## Methods\n\n### byId()\n\n> **byId**(`id`): [`Database`](../../database/classes/Database.md)\n\nA handle to a database by id. Details load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`Database`](../../database/classes/Database.md)\n\n***\n\n### create()\n\n> **create**(`options`): `Promise`\\<[`Database`](../../database/classes/Database.md)\\>\n\nCreate a database owned by the caller.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | \\{ `name`: `string`; \\} |\n| `options.name` | `string` |\n\n#### Returns\n\n`Promise`\\<[`Database`](../../database/classes/Database.md)\\>\n\n***\n\n### list()\n\n> **list**(): `Promise`\\<[`Database`](../../database/classes/Database.md)[]\\>\n\nThe databases the caller can see.\n\n#### Returns\n\n`Promise`\\<[`Database`](../../database/classes/Database.md)[]\\>\n\n\n<!-- src/entities/databases/row/classes/DatabaseRow.md -->\n# Class: DatabaseRow\n\nOne row of a [DatabaseTable](../../table/classes/DatabaseTable.md).\n\nA row is not an entity of its own — it is owned and shared as part of its\ndatabase. Its cells are written with ops; see Database.applyOps.\n\n## Properties\n\n| Property | Modifier | Type | Description |\n| ------ | ------ | ------ | ------ |\n| <a id=\"property-id\"></a> `id` | `readonly` | `string` | Identifier of the row. |\n| <a id=\"property-table\"></a> `table` | `readonly` | [`DatabaseTable`](../../table/classes/DatabaseTable.md) | The table this row belongs to. |\n\n## Methods\n\n### history()\n\n> **history**(): `Promise`\\<[`RowHistoryEntry`](../../../../../generated/storage/types.gen/type-aliases/RowHistoryEntry.md)[]\\>\n\nEvery committed change that touched the row, newest first: who made it,\nwhen, how, and the values of the columns it touched before and after.\nA removed row's history still reads.\n\n#### Returns\n\n`Promise`\\<[`RowHistoryEntry`](../../../../../generated/storage/types.gen/type-aliases/RowHistoryEntry.md)[]\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `id`: `string`; `tableId`: `string`; \\}\n\n#### Returns\n\n\\{ `id`: `string`; `tableId`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `id` | `string` |\n| `tableId` | `string` |\n\n***\n\n### byId()\n\n> `static` **byId**(`table`, `id`): `DatabaseRow`\n\nA handle to a row by id, within a table.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `table` | [`DatabaseTable`](../../table/classes/DatabaseTable.md) |\n| `id` | `string` |\n\n#### Returns\n\n`DatabaseRow`\n\n\n<!-- src/entities/databases/table/classes/DatabaseTable.md -->\n# Class: DatabaseTable\n\nOne table (tab) of a [Database](../../database/classes/Database.md).\n\nA table is not an entity of its own — it is owned and shared as part of its\ndatabase, and has no endpoint to read it directly. The handle resolves\nthrough [Database.schema](../../database/classes/Database.md#schema), so reads after a write see the new state.\n\n## Properties\n\n| Property | Modifier | Type | Description |\n| ------ | ------ | ------ | ------ |\n| <a id=\"property-database\"></a> `database` | `readonly` | [`Database`](../../database/classes/Database.md) | The database this table belongs to. |\n| <a id=\"property-id\"></a> `id` | `readonly` | `string` | Identifier of the table. |\n\n## Methods\n\n### addColumn()\n\n> **addColumn**(`options`): `Promise`\\<[`DatabaseColumn`](../../column/classes/DatabaseColumn.md)\\>\n\nAdd a column to this table. See [Database.addColumn](../../database/classes/Database.md#addcolumn).\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | [`AddColumnOptions`](../../database/type-aliases/AddColumnOptions.md) |\n\n#### Returns\n\n`Promise`\\<[`DatabaseColumn`](../../column/classes/DatabaseColumn.md)\\>\n\n***\n\n### columns()\n\n> **columns**(): `Promise`\\<[`DatabaseColumn`](../../column/classes/DatabaseColumn.md)[]\\>\n\nThe table's columns, in display order.\n\n#### Returns\n\n`Promise`\\<[`DatabaseColumn`](../../column/classes/DatabaseColumn.md)[]\\>\n\n***\n\n### createWebhook()\n\n> **createWebhook**(): `Promise`\\<\\{ `token`: `string`; `webhook`: [`DatabaseWebhook`](../../webhook/classes/DatabaseWebhook.md); \\}\\>\n\nCreate a webhook that inserts rows here. See [Database.createWebhook](../../database/classes/Database.md#createwebhook).\n\n#### Returns\n\n`Promise`\\<\\{ `token`: `string`; `webhook`: [`DatabaseWebhook`](../../webhook/classes/DatabaseWebhook.md); \\}\\>\n\n***\n\n### delete()\n\n> **delete**(): `Promise`\\<`void`\\>\n\nDelete this table. See [Database.deleteTable](../../database/classes/Database.md#deletetable).\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### detail()\n\n> **detail**(): `Promise`\\<[`TableDetail`](../../../../../generated/storage/types.gen/type-aliases/TableDetail.md)\\>\n\nThe table's record as the API returns it: the table, its columns, and\nits views.\n\n#### Returns\n\n`Promise`\\<[`TableDetail`](../../../../../generated/storage/types.gen/type-aliases/TableDetail.md)\\>\n\n***\n\n### name()\n\n> **name**(): `Promise`\\<`string`\\>\n\nThe table's display name.\n\n#### Returns\n\n`Promise`\\<`string`\\>\n\n***\n\n### position()\n\n> **position**(): `Promise`\\<`string`\\>\n\nThe table's fractional index within the database's tab order.\n\n#### Returns\n\n`Promise`\\<`string`\\>\n\n***\n\n### rename()\n\n> **rename**(`name`): `Promise`\\<`DatabaseTable`\\>\n\nRename only if the last-read display name is still current.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `name` | `string` |\n\n#### Returns\n\n`Promise`\\<`DatabaseTable`\\>\n\n***\n\n### reorderColumns()\n\n> **reorderColumns**(`columns`): `Promise`\\<`DatabaseTable`\\>\n\nPersist a new column order. See [Database.reorderColumns](../../database/classes/Database.md#reordercolumns).\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `columns` | [`DatabaseColumn`](../../column/classes/DatabaseColumn.md)[] |\n\n#### Returns\n\n`Promise`\\<`DatabaseTable`\\>\n\n***\n\n### row()\n\n> **row**(`id`): [`DatabaseRow`](../../row/classes/DatabaseRow.md)\n\nA handle to one of the table's rows, by the id an insert answered.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`DatabaseRow`](../../row/classes/DatabaseRow.md)\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `databaseId`: `string`; `id`: `string`; \\}\n\n#### Returns\n\n\\{ `databaseId`: `string`; `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `databaseId` | `string` |\n| `id` | `string` |\n\n***\n\n### version()\n\n> **version**(): `Promise`\\<`number`\\>\n\nThe table's current version, bumped by every committed change to its\nschema or rows. Schema edits such as [reorderColumns](#reordercolumns) send it as\nthe base version they were made against, so a table that moved since\nrefuses the edit with a 409.\n\n#### Returns\n\n`Promise`\\<`number`\\>\n\n***\n\n### views()\n\n> **views**(): `Promise`\\<[`DatabaseView`](../../view/classes/DatabaseView.md)[]\\>\n\nThe table's views, in their order.\n\n#### Returns\n\n`Promise`\\<[`DatabaseView`](../../view/classes/DatabaseView.md)[]\\>\n\n***\n\n### byId()\n\n> `static` **byId**(`database`, `id`): `DatabaseTable`\n\nA handle to a table by id, within a database. Details load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `database` | [`Database`](../../database/classes/Database.md) |\n| `id` | `string` |\n\n#### Returns\n\n`DatabaseTable`\n\n\n<!-- src/entities/databases/view/classes/DatabaseView.md -->\n# Class: DatabaseView\n\nOne view of a [DatabaseTable](../../table/classes/DatabaseTable.md): which of its rows to show, in what\norder, drawn as a table or a board.\n\nA view is not an entity of its own — it is owned and shared as part of its\ndatabase. The handle resolves through the database's schema, so a fresh\nread after a write sees the new value. Views are created, changed, and\nreordered with ops; see Database.applyOps.\n\n## Properties\n\n| Property | Modifier | Type | Description |\n| ------ | ------ | ------ | ------ |\n| <a id=\"property-id\"></a> `id` | `readonly` | `string` | Identifier of the view. |\n| <a id=\"property-table\"></a> `table` | `readonly` | [`DatabaseTable`](../../table/classes/DatabaseTable.md) | The table this view shows. |\n\n## Methods\n\n### detail()\n\n> **detail**(): `Promise`\\<[`DatabaseView`](../../../../../generated/storage/types.gen/type-aliases/DatabaseView.md)\\>\n\nThe view's record as the API returns it.\n\n#### Returns\n\n`Promise`\\<[`DatabaseView`](../../../../../generated/storage/types.gen/type-aliases/DatabaseView.md)\\>\n\n***\n\n### layout()\n\n> **layout**(): `Promise`\\<[`ViewLayout`](../../../../../generated/storage/types.gen/type-aliases/ViewLayout.md)\\>\n\nHow the view draws its rows: a table, or a board grouped by a column.\n\n#### Returns\n\n`Promise`\\<[`ViewLayout`](../../../../../generated/storage/types.gen/type-aliases/ViewLayout.md)\\>\n\n***\n\n### name()\n\n> **name**(): `Promise`\\<`string`\\>\n\nThe view's name, unique among its table's views ignoring case.\n\n#### Returns\n\n`Promise`\\<`string`\\>\n\n***\n\n### position()\n\n> **position**(): `Promise`\\<`string`\\>\n\nThe view's fractional index within its table's views.\n\n#### Returns\n\n`Promise`\\<`string`\\>\n\n***\n\n### positions()\n\n> **positions**(): `Promise`\\<[`CardPosition`](../../../../../generated/storage/types.gen/type-aliases/CardPosition.md)[]\\>\n\nWhere a board's cards sit: each placed card's lane and its key there.\nCards without a place show after the placed ones of their lane, oldest\nfirst.\n\n#### Returns\n\n`Promise`\\<[`CardPosition`](../../../../../generated/storage/types.gen/type-aliases/CardPosition.md)[]\\>\n\n***\n\n### query()\n\n> **query**(): `Promise`\\<[`ViewQuery`](../../../../../generated/storage/types.gen/type-aliases/ViewQuery.md)\\>\n\nWhich rows the view shows, and in what order.\n\n#### Returns\n\n`Promise`\\<[`ViewQuery`](../../../../../generated/storage/types.gen/type-aliases/ViewQuery.md)\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `id`: `string`; `tableId`: `string`; \\}\n\n#### Returns\n\n\\{ `id`: `string`; `tableId`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `id` | `string` |\n| `tableId` | `string` |\n\n***\n\n### byId()\n\n> `static` **byId**(`table`, `id`): `DatabaseView`\n\nA handle to a view by id, within a table. Details load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `table` | [`DatabaseTable`](../../table/classes/DatabaseTable.md) |\n| `id` | `string` |\n\n#### Returns\n\n`DatabaseView`\n\n\n<!-- src/entities/databases/webhook/classes/DatabaseWebhook.md -->\n# Class: DatabaseWebhook\n\nA webhook of a [DatabaseTable](../../table/classes/DatabaseTable.md): a secret URL that anyone holding it\ncan POST JSON to, each object becoming a row, written with the access of\nthe user who created it. Its token is shown only when it is created; see\nDatabase.createWebhook.\n\n## Properties\n\n| Property | Modifier | Type | Description |\n| ------ | ------ | ------ | ------ |\n| <a id=\"property-createdby\"></a> `createdBy` | `readonly` | [`User`](../../../users/user/classes/User.md) | Who created it; its calls write with their access. |\n| <a id=\"property-id\"></a> `id` | `readonly` | `string` | Identifier of the webhook. |\n| <a id=\"property-table\"></a> `table` | `readonly` | [`DatabaseTable`](../../table/classes/DatabaseTable.md) | The table its calls insert rows into. |\n\n## Accessors\n\n### createdAt\n\n#### Get Signature\n\n> **get** **createdAt**(): `string`\n\nWhen it was created.\n\n##### Returns\n\n`string`\n\n***\n\n### tokenPrefix\n\n#### Get Signature\n\n> **get** **tokenPrefix**(): `string`\n\nThe token's first characters, to tell webhooks apart without the secret.\n\n##### Returns\n\n`string`\n\n## Methods\n\n### delete()\n\n> **delete**(): `Promise`\\<`void`\\>\n\nDelete the webhook; its URL stops working.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `id`: `string`; `tableId`: `string`; `tokenPrefix`: `string`; \\}\n\n#### Returns\n\n\\{ `id`: `string`; `tableId`: `string`; `tokenPrefix`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `id` | `string` |\n| `tableId` | `string` |\n| `tokenPrefix` | `string` |\n\n***\n\n### fromRecord()\n\n> `static` **fromRecord**(`table`, `createdBy`, `record`): `DatabaseWebhook`\n\nA handle from the record the API answered.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `table` | [`DatabaseTable`](../../table/classes/DatabaseTable.md) |\n| `createdBy` | [`User`](../../../users/user/classes/User.md) |\n| `record` | [`DatabaseWebhookResponse`](../../../../../generated/storage/types.gen/type-aliases/DatabaseWebhookResponse.md) |\n\n#### Returns\n\n`DatabaseWebhook`\n"+ "overview": "<!-- src/entities/databases/namespace/classes/DatabaseNamespace.md -->\n# Class: DatabaseNamespace\n\nMacro databases: named collections of tables, owned and shared as one\nentity.\n\n## Constructors\n\n### Constructor\n\n> **new DatabaseNamespace**(`client`): `DatabaseNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`DatabaseNamespace`\n\n## Methods\n\n### byId()\n\n> **byId**(`id`): [`Database`](../../database/classes/Database.md)\n\nA handle to a database by id. Details load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`Database`](../../database/classes/Database.md)\n\n***\n\n### create()\n\n> **create**(`options`): `Promise`\\<[`Database`](../../database/classes/Database.md)\\>\n\nCreate a database owned by the caller.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | \\{ `name`: `string`; \\} |\n| `options.name` | `string` |\n\n#### Returns\n\n`Promise`\\<[`Database`](../../database/classes/Database.md)\\>\n\n***\n\n### list()\n\n> **list**(): `Promise`\\<[`Database`](../../database/classes/Database.md)[]\\>\n\nThe databases the caller can see.\n\n#### Returns\n\n`Promise`\\<[`Database`](../../database/classes/Database.md)[]\\>\n\n***\n\n### query()\n\n> **query**(`sql`, `options?`): `Promise`\\<[`DatabaseQueryResult`](../../query/interfaces/DatabaseQueryResult.md)\\>\n\nRun one SQL statement over the caller's visible databases. Writes execute once.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `sql` | `string` |\n| `options?` | [`DatabaseQueryOptions`](../../query/interfaces/DatabaseQueryOptions.md) |\n\n#### Returns\n\n`Promise`\\<[`DatabaseQueryResult`](../../query/interfaces/DatabaseQueryResult.md)\\>\n\n\n<!-- src/entities/databases/query/interfaces/DatabaseQueryOptions.md -->\n# Interface: DatabaseQueryOptions\n\nScope and optimistic concurrency for one SQL statement.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-baseversions\"></a> `baseVersions?` | [`QueryTableVersion`](QueryTableVersion.md)[] | Refuse writes if these tables changed since they were read. |\n| <a id=\"property-database\"></a> `database?` | [`Database`](../../database/classes/Database.md) | Default database for unqualified table names; visible databases remain joinable. |\n\n\n<!-- src/entities/databases/query/interfaces/DatabaseQueryResult.md -->\n# Interface: DatabaseQueryResult\n\nThe committed outcome of one statement; write calls are never automatically retried.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-changesapplied\"></a> `changesApplied` | `number` | Number of changes committed by the statement. |\n| <a id=\"property-insertedrows\"></a> `insertedRows` | [`DatabaseRow`](../../row/classes/DatabaseRow.md)[] | Handles for newly inserted rows, in insertion order. |\n| <a id=\"property-newversions\"></a> `newVersions` | [`QueryTableVersion`](QueryTableVersion.md)[] | Versions of tables after committed writes. |\n| <a id=\"property-readversions\"></a> `readVersions` | [`QueryTableVersion`](QueryTableVersion.md)[] | Observed table versions, reusable as guards for a later write. |\n| <a id=\"property-result\"></a> `result?` | [`QueryResultSet`](QueryResultSet.md) | Returned result set, when the statement produces one. |\n| <a id=\"property-statement\"></a> `statement` | [`QueryStatement`](../type-aliases/QueryStatement.md) | Statement classification with typed handles for its targets. |\n| <a id=\"property-truncatedtables\"></a> `truncatedTables` | `string`[] | SQL table names whose input hit the server row cap; aggregates may be partial. |\n\n\n<!-- src/entities/databases/query/interfaces/QueryResultSet.md -->\n# Interface: QueryResultSet\n\nSQL returns dynamically shaped, discriminated cells and optional source row handles.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-columns\"></a> `columns` | [`QueryColumn`](../type-aliases/QueryColumn.md)[] | Ordered metadata corresponding to each cell in a result row. |\n| <a id=\"property-rowhandles\"></a> `rowHandles` | [`DatabaseRow`](../../row/classes/DatabaseRow.md)[] | Source row handles in result order; empty for aggregates and virtual tables. |\n| <a id=\"property-rows\"></a> `rows` | ([`SqlCell`](../../../../../generated/storage/types.gen/type-aliases/SqlCell.md) \\| `null`)[][] | Dynamic tagged cells in column order; empty cells are null. |\n| <a id=\"property-sourcetable\"></a> `sourceTable?` | [`DatabaseTable`](../../table/classes/DatabaseTable.md) | Persisted source table when results correspond to individual rows. |\n\n\n<!-- src/entities/databases/query/interfaces/QueryTableVersion.md -->\n# Interface: QueryTableVersion\n\nA version observed on a typed table handle, reusable as a write guard.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-table\"></a> `table` | [`DatabaseTable`](../../table/classes/DatabaseTable.md) | Table whose version was observed. |\n| <a id=\"property-version\"></a> `version` | `number` | Opaque version to pass back as an optimistic write guard. |\n\n\n<!-- src/entities/databases/query/type-aliases/QueryColumn.md -->\n# Type Alias: QueryColumn\n\n> **QueryColumn** = `Omit`\\<[`ResultColumn`](../../../../../generated/storage/types.gen/type-aliases/ResultColumn.md), `\"relatedTable\"`\\> & \\{ `relatedTable?`: [`DatabaseTable`](../../table/classes/DatabaseTable.md); \\}\n\nResult column metadata, including a typed relation target when visible.\n\n## Type Declaration\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `relatedTable?` | [`DatabaseTable`](../../table/classes/DatabaseTable.md) | Visible target table for a relation column. |\n\n\n<!-- src/entities/databases/query/type-aliases/QueryStatement.md -->\n# Type Alias: QueryStatement\n\n> **QueryStatement** = `Extract`\\<[`SqlStatement`](../../../../../generated/storage/types.gen/type-aliases/SqlStatement.md), \\{ `kind`: `\"select\"`; \\}\\> \\| \\{ `database`: [`Database`](../../database/classes/Database.md); `kind`: `\"schema\"`; `summary`: `string`; \\} \\| \\{ `kind`: `\"insert\"` \\| `\"update\"` \\| `\"delete\"`; `table`: [`DatabaseTable`](../../table/classes/DatabaseTable.md); `tableName`: `string`; \\} \\| \\{ `column`: [`DatabaseColumn`](../../column/classes/DatabaseColumn.md); `columnName`: `string`; `kind`: `\"alterColumnType\"`; `table`: [`DatabaseTable`](../../table/classes/DatabaseTable.md); `tableName`: `string`; `to`: `string`; \\}\n\nWhat ran, with typed handles for resources written by the statement.\n\n## Union Members\n\n`Extract`\\<[`SqlStatement`](../../../../../generated/storage/types.gen/type-aliases/SqlStatement.md), \\{ `kind`: `\"select\"`; \\}\\>\n\n***\n\n### Type Literal\n\n\\{ `database`: [`Database`](../../database/classes/Database.md); `kind`: `\"schema\"`; `summary`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `database` | [`Database`](../../database/classes/Database.md) | Database whose schema changed. |\n| `kind` | `\"schema\"` | Schema change discriminator. |\n| `summary` | `string` | Human-readable description of the schema change. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"insert\"` \\| `\"update\"` \\| `\"delete\"`; `table`: [`DatabaseTable`](../../table/classes/DatabaseTable.md); `tableName`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"insert\"` \\| `\"update\"` \\| `\"delete\"` | Row mutation discriminator. |\n| `table` | [`DatabaseTable`](../../table/classes/DatabaseTable.md) | Table targeted by the mutation, including zero-match writes. |\n| `tableName` | `string` | SQL name of the target table. |\n\n***\n\n### Type Literal\n\n\\{ `column`: [`DatabaseColumn`](../../column/classes/DatabaseColumn.md); `columnName`: `string`; `kind`: `\"alterColumnType\"`; `table`: [`DatabaseTable`](../../table/classes/DatabaseTable.md); `tableName`: `string`; `to`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `column` | [`DatabaseColumn`](../../column/classes/DatabaseColumn.md) | Column whose type changed. |\n| `columnName` | `string` | SQL name of the changed column. |\n| `kind` | `\"alterColumnType\"` | Column type change discriminator. |\n| `table` | [`DatabaseTable`](../../table/classes/DatabaseTable.md) | Table containing the changed column. |\n| `tableName` | `string` | SQL name of the target table. |\n| `to` | `string` | SQL type requested by the statement. |\n",+ "documentation": "# Macro SDK: databases\n\nGenerated by TypeDoc. Paths below refer to the canonical Markdown hierarchy. Other entity handles are documented in their named section; request core for shared SDK helpers.\n\n<!-- generated/storage/types.gen/type-aliases/AccessLevel.md -->\n# Type Alias: AccessLevel\n\n> **AccessLevel** = `\"view\"` \\| `\"comment\"` \\| `\"edit\"` \\| `\"owner\"`\n\nOrdered from least to most access top -> bottom\n\n\n<!-- generated/storage/types.gen/type-aliases/CardPosition.md -->\n# Type Alias: CardPosition\n\n> **CardPosition** = \\{ `lane`: [`LaneKey`](LaneKey.md); `position`: `string`; `row`: `string`; \\}\n\nWhere one card sits on a board: its lane, and its fractional key there.\nA card whose row has since moved to another lane has no place until it is\nmoved again.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-lane\"></a> `lane` | [`LaneKey`](LaneKey.md) | The lane. |\n| <a id=\"property-position\"></a> `position` | `string` | The card's key in that lane. |\n| <a id=\"property-row\"></a> `row` | `string` | The card's row. |\n\n\n<!-- generated/storage/types.gen/type-aliases/CastVerdict.md -->\n# Type Alias: CastVerdict\n\n> **CastVerdict** = `\"safe\"` \\| `\"checked\"` \\| `\"never\"`\n\nWhether a column's values convert to a type.\n\n\n<!-- generated/storage/types.gen/type-aliases/CellValue.md -->\n# Type Alias: CellValue\n\n> **CellValue** = \\{ `type`: `\"text\"`; `value`: `string`; \\} \\| \\{ `type`: `\"number\"`; `value`: `number`; \\} \\| \\{ `type`: `\"boolean\"`; `value`: `boolean`; \\} \\| \\{ `type`: `\"date\"`; `value`: `string`; \\} \\| \\{ `type`: `\"link\"`; `value`: `string`[]; \\} \\| \\{ `type`: `\"options\"`; `value`: [`OptionRef`](OptionRef.md)[]; \\} \\| \\{ `type`: `\"entities\"`; `value`: [`EntityRef`](EntityRef.md)[]; \\} \\| \\{ `type`: `\"rows\"`; `value`: `string`[]; \\} \\| \\{ `type`: `\"clear\"`; \\}\n\nA cell's value. It must fit the column's type: text for a text column,\noptions of the column for a select, and so on.\n\n## Union Members\n\n### Type Literal\n\n\\{ `type`: `\"text\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"text\"` | - |\n| `value` | `string` | Free text. |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"number\"`; `value`: `number`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"number\"` | - |\n| `value` | `number` | A finite number. |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"boolean\"`; `value`: `boolean`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"boolean\"` | - |\n| `value` | `boolean` | A checkbox. |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"date\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"date\"` | - |\n| `value` | `string` | A date-time. |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"link\"`; `value`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"link\"` | - |\n| `value` | `string`[] | Complete http or https URLs; at most one for a single-valued column. |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"options\"`; `value`: [`OptionRef`](OptionRef.md)[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"options\"` | - |\n| `value` | [`OptionRef`](OptionRef.md)[] | Options of a select or tag column; at most one for a single-valued column. |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"entities\"`; `value`: [`EntityRef`](EntityRef.md)[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"entities\"` | - |\n| `value` | [`EntityRef`](EntityRef.md)[] | References to Macro entities of the kind the column points at; at most one for a single-valued column. |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"rows\"`; `value`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"rows\"` | - |\n| `value` | `string`[] | Rows of the table a relation column points at. |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"clear\"`; \\}\n\n\n<!-- generated/storage/types.gen/type-aliases/CellWrite.md -->\n# Type Alias: CellWrite\n\n> **CellWrite** = \\{ `column`: `string`; `value`: [`CellValue`](CellValue.md); \\}\n\nOne cell of a row: which column, and its new value.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-column\"></a> `column` | `string` | The column placement. |\n| <a id=\"property-value\"></a> `value` | [`CellValue`](CellValue.md) | The value, or [`CellValue::Clear`] to empty the cell. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ChannelSharePermission.md -->\n# Type Alias: ChannelSharePermission\n\n> **ChannelSharePermission** = \\{ `access_level`: [`AccessLevel`](AccessLevel.md); `channel_id`: `string`; \\}\n\nThe channel share permission\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-access_level\"></a> `access_level` | [`AccessLevel`](AccessLevel.md) | The access level for the channel |\n| <a id=\"property-channel_id\"></a> `channel_id` | `string` | The channel id |\n\n\n<!-- generated/storage/types.gen/type-aliases/Column.md -->\n# Type Alias: Column\n\n> **Column** = \\{ `config`: `null` \\| [`ColumnConfig`](ColumnConfig.md); `display_name`: `string` \\| `null`; `id`: `string`; `infer_type`: `boolean`; `nullable?`: `boolean`; `position`: `string`; `property_definition_id`: `string`; `protections?`: [`ColumnProtection`](ColumnProtection.md)[]; `table_id`: `string`; \\}\n\nA column: the placement of a property definition on a table.\n\nThe definition carries name, [`DataType`], multi-select flag, and options;\nthis carries only where it appears and column-kind configuration.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-config\"></a> `config` | `null` \\| [`ColumnConfig`](ColumnConfig.md) | - |\n| <a id=\"property-display_name\"></a> `display_name` | `string` \\| `null` | The placement's own label, which also names it in SQL; `None` shows the definition's name. |\n| <a id=\"property-id\"></a> `id` | `string` | Identifier of the placement. |\n| <a id=\"property-infer_type\"></a> `infer_type` | `boolean` | Whether the first nonempty value may settle this new text column's type. |\n| <a id=\"property-nullable\"></a> `nullable?` | `boolean` | Whether a row may omit this cell; empty collections also count as absent. |\n| <a id=\"property-position\"></a> `position` | `string` | Fractional index for column ordering. |\n| <a id=\"property-property_definition_id\"></a> `property_definition_id` | `string` | The bound property definition. |\n| <a id=\"property-protections\"></a> `protections?` | [`ColumnProtection`](ColumnProtection.md)[] | Schema operations reserved by a feature; ordinary edits cannot clear them. |\n| <a id=\"property-table_id\"></a> `table_id` | `string` | Table the column appears on. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ColumnCast.md -->\n# Type Alias: ColumnCast\n\n> **ColumnCast** = \\{ `cast`: [`CastVerdict`](CastVerdict.md); `data_type`: [`DataType`](DataType.md); `examples`: `string`[]; `failures`: `number`; `is_multi_select`: `boolean`; `reason`: `string` \\| `null`; `relation`: `boolean`; `specific_entity_type`: `null` \\| [`EntityType`](EntityType.md); `summary`: `string` \\| `null`; \\}\n\nWhat changing a column to one type would do to its values: the dry run\nof a type change, for one target.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-cast\"></a> `cast` | [`CastVerdict`](CastVerdict.md) | Whether the values convert. |\n| <a id=\"property-data_type\"></a> `data_type` | [`DataType`](DataType.md) | The target property type. |\n| <a id=\"property-examples\"></a> `examples` | `string`[] | Up to three of the values that would not convert. |\n| <a id=\"property-failures\"></a> `failures` | `number` | For a `checked` cast, how many cells would not convert. |\n| <a id=\"property-is_multi_select\"></a> `is_multi_select` | `boolean` | Whether the target holds several values. |\n| <a id=\"property-reason\"></a> `reason` | `string` \\| `null` | Why nothing converts, for a `never` cast. |\n| <a id=\"property-relation\"></a> `relation` | `boolean` | Whether the target is a relation to another table's rows. |\n| <a id=\"property-specific_entity_type\"></a> `specific_entity_type` | `null` \\| [`EntityType`](EntityType.md) | - |\n| <a id=\"property-summary\"></a> `summary` | `string` \\| `null` | For a `checked` cast with failures, what is wrong with them, as in `3 values aren't numbers`. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ColumnChange.md -->\n# Type Alias: ColumnChange\n\n> **ColumnChange** = \\{ `after?`: `string`; `definition`: [`NewColumn`](NewColumn.md); `kind`: `\"create\"`; \\} \\| \\{ `kind`: `\"rename\"`; `name`: `string`; `previousName?`: `string`; \\} \\| \\{ `kind`: `\"change_type\"`; `to`: [`ColumnKind`](ColumnKind.md); \\} \\| \\{ `kind`: `\"delete\"`; \\} \\| \\{ `kind`: `\"add_options\"`; `options`: [`NewOption`](NewOption.md)[]; \\} \\| \\{ `color?`: `string` \\| `null`; `kind`: `\"update_option\"`; `label?`: `string`; `option`: `string`; \\} \\| \\{ `formula`: [`Formula`](Formula.md); `kind`: `\"set_formula\"`; \\} \\| \\{ `kind`: `\"delete_option\"`; `option`: `string`; \\}\n\nA change to one column.\n\n## Union Members\n\n### Type Literal\n\n\\{ `after?`: `string`; `definition`: [`NewColumn`](NewColumn.md); `kind`: `\"create\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `after?` | `string` | The column it goes right after; left out, it goes after the table's last column. |\n| `definition` | [`NewColumn`](NewColumn.md) | What the column holds. |\n| `kind` | `\"create\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"rename\"`; `name`: `string`; `previousName?`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"rename\"` | - |\n| `name` | `string` | Its new name, unique within the table ignoring case. |\n| `previousName?` | `string` | The name the caller saw. Given, the rename is refused if the column goes by another one now. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"change_type\"`; `to`: [`ColumnKind`](ColumnKind.md); \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"change_type\"` | - |\n| `to` | [`ColumnKind`](ColumnKind.md) | The type it becomes. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"delete\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"add_options\"`; `options`: [`NewOption`](NewOption.md)[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"add_options\"` | - |\n| `options` | [`NewOption`](NewOption.md)[] | The options, each under an id the client mints. |\n\n***\n\n### Type Literal\n\n\\{ `color?`: `string` \\| `null`; `kind`: `\"update_option\"`; `label?`: `string`; `option`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `color?` | `string` \\| `null` | Its new colour, a hex string like `#RRGGBB`, or `null` to clear it; left out, it keeps its own. A tag option always has one. |\n| `kind` | `\"update_option\"` | - |\n| `label?` | `string` | Its new label; left out, it keeps its own. Labels are unique within a column, ignoring case. |\n| `option` | `string` | The option. |\n\n***\n\n### Type Literal\n\n\\{ `formula`: [`Formula`](Formula.md); `kind`: `\"set_formula\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `formula` | [`Formula`](Formula.md) | The formula, over the table's other columns. |\n| `kind` | `\"set_formula\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"delete_option\"`; `option`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"delete_option\"` | - |\n| `option` | `string` | The option. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ColumnConfig.md -->\n# Type Alias: ColumnConfig\n\n> **ColumnConfig** = \\{ `database_id`: `string`; `kind`: `\"link\"`; `table_id`: `string`; \\} \\| \\{ `formula`: [`Formula`](Formula.md); `kind`: `\"derived\"`; \\}\n\nColumn-kind specific configuration stored on the placement.\n\n## Union Members\n\n### Type Literal\n\n\\{ `database_id`: `string`; `kind`: `\"link\"`; `table_id`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `database_id` | `string` | Target database. |\n| `kind` | `\"link\"` | - |\n| `table_id` | `string` | Target table. |\n\n***\n\n### Type Literal\n\n\\{ `formula`: [`Formula`](Formula.md); `kind`: `\"derived\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `formula` | [`Formula`](Formula.md) | How its cells are computed. |\n| `kind` | `\"derived\"` | - |\n\n\n<!-- generated/storage/types.gen/type-aliases/ColumnConversion.md -->\n# Type Alias: ColumnConversion\n\n> **ColumnConversion** = \\{ `cells`: [`ConvertedCell`](ConvertedCell.md)[]; `misfits`: `number`; `options`: `string`[]; `tableVersion`: [`TableVersion`](TableVersion.md); \\}\n\nWhat a column's values become under another type, for a new column of\nthat type beside it: the values that convert, the options they need,\nand how many do not convert. Nothing is changed by reading it.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-cells\"></a> `cells` | [`ConvertedCell`](ConvertedCell.md)[] | Each row whose value converts, with that value, options named by label. |\n| <a id=\"property-misfits\"></a> `misfits` | `number` | How many values do not convert, and are left out. |\n| <a id=\"property-options\"></a> `options` | `string`[] | The option labels a new select or tag column needs, in order. |\n| <a id=\"property-tableversion\"></a> `tableVersion` | [`TableVersion`](TableVersion.md) | The table's version the cells were read at; a batch writing the new column sends it as its base version. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ColumnDetail.md -->\n# Type Alias: ColumnDetail\n\n> **ColumnDetail** = \\{ `column`: [`Column`](Column.md); `definition`: [`PropertyDefinitionWithOptions`](PropertyDefinitionWithOptions.md); `shared_outside_database`: `boolean`; `sql_name`: `string`; `writable`: `boolean`; \\}\n\nOne column placement with the definition behind it.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-column\"></a> `column` | [`Column`](Column.md) | The placement. |\n| <a id=\"property-definition\"></a> `definition` | [`PropertyDefinitionWithOptions`](PropertyDefinitionWithOptions.md) | The bound definition (name, type, options). |\n| <a id=\"property-shared_outside_database\"></a> `shared_outside_database` | `boolean` | Whether the definition belongs to something beyond this database (a person's, a team's or a system property), so changing its options changes them everywhere that property is used. |\n| <a id=\"property-sql_name\"></a> `sql_name` | `string` | The name SQL refers to the column by: its display name, quoted. |\n| <a id=\"property-writable\"></a> `writable` | `boolean` | Whether SQL may write this column. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ColumnId.md -->\n# Type Alias: ColumnId\n\n> **ColumnId** = `string`\n\nIdentifier of a column placement within a table.\n\n\n<!-- generated/storage/types.gen/type-aliases/ColumnKind.md -->\n# Type Alias: ColumnKind\n\n> **ColumnKind** = \\{ `type`: `\"text\"`; \\} \\| \\{ `type`: `\"number\"`; \\} \\| \\{ `type`: `\"boolean\"`; \\} \\| \\{ `type`: `\"date\"`; \\} \\| \\{ `type`: `\"link\"`; \\} \\| \\{ `multi`: `boolean`; `type`: `\"select\"`; \\} \\| \\{ `multi`: `boolean`; `type`: `\"select_number\"`; \\} \\| \\{ `type`: `\"tag\"`; \\} \\| \\{ `multi`: `boolean`; `target`: [`EntityKind`](EntityKind.md); `type`: `\"entity\"`; \\} \\| \\{ `database`: `string`; `table`: `string`; `type`: `\"relation\"`; \\}\n\nA type a column can have.\n\n## Union Members\n\n### Type Literal\n\n\\{ `type`: `\"text\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"number\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"boolean\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"date\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"link\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `multi`: `boolean`; `type`: `\"select\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `multi` | `boolean` | Whether a cell holds several options. |\n| `type` | `\"select\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `multi`: `boolean`; `type`: `\"select_number\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `multi` | `boolean` | Whether a cell holds several options. |\n| `type` | `\"select_number\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"tag\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `multi`: `boolean`; `target`: [`EntityKind`](EntityKind.md); `type`: `\"entity\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `multi` | `boolean` | Whether a cell holds several references. |\n| `target` | [`EntityKind`](EntityKind.md) | What the references point at. |\n| `type` | `\"entity\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `database`: `string`; `table`: `string`; `type`: `\"relation\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `database` | `string` | The database of the related table. |\n| `table` | `string` | The related table. |\n| `type` | `\"relation\"` | - |\n\n\n<!-- generated/storage/types.gen/type-aliases/ColumnProtection.md -->\n# Type Alias: ColumnProtection\n\n> **ColumnProtection** = `\"delete\"` \\| `\"change_type\"`\n\nA schema operation reserved by a feature using a column.\n\n\n<!-- generated/storage/types.gen/type-aliases/ColumnResult.md -->\n# Type Alias: ColumnResult\n\n> **ColumnResult** = \\{ `kind`: `\"created\"`; \\} \\| \\{ `kind`: `\"renamed\"`; \\} \\| \\{ `kind`: `\"type_changed\"`; \\} \\| \\{ `kind`: `\"deleted\"`; \\} \\| \\{ `added`: `string`[]; `kind`: `\"options_added\"`; \\} \\| \\{ `kind`: `\"option_updated\"`; \\} \\| \\{ `kind`: `\"option_deleted\"`; \\} \\| \\{ `kind`: `\"formula_set\"`; \\}\n\nWhat happened to a column.\n\n## Union Members\n\n### Type Literal\n\n\\{ `kind`: `\"created\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"renamed\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"type_changed\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"deleted\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `added`: `string`[]; `kind`: `\"options_added\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `added` | `string`[] | The options created, in order: those sent, less any whose label the column already had. |\n| `kind` | `\"options_added\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"option_updated\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"option_deleted\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"formula_set\"`; \\}\n\n\n<!-- generated/storage/types.gen/type-aliases/Conjunction.md -->\n# Type Alias: Conjunction\n\n> **Conjunction** = `\"and\"` \\| `\"or\"`\n\nHow a group's conditions combine.\n\n\n<!-- generated/storage/types.gen/type-aliases/ConvertedCell.md -->\n# Type Alias: ConvertedCell\n\n> **ConvertedCell** = \\{ `row`: `string`; `value`: [`CellValue`](CellValue.md); \\}\n\nOne row's converted value.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-row\"></a> `row` | `string` | The row. |\n| <a id=\"property-value\"></a> `value` | [`CellValue`](CellValue.md) | Its value under the new type. |\n\n\n<!-- generated/storage/types.gen/type-aliases/DataType.md -->\n# Type Alias: DataType\n\n> **DataType** = `\"BOOLEAN\"` \\| `\"DATE\"` \\| `\"NUMBER\"` \\| `\"STRING\"` \\| `\"SELECT_NUMBER\"` \\| `\"SELECT_STRING\"` \\| `\"TAG\"` \\| `\"ENTITY\"` \\| `\"LINK\"`\n\nData type for property values, determining storage and validation.\n\n\n<!-- generated/storage/types.gen/type-aliases/Database.md -->\n# Type Alias: Database\n\n> **Database** = \\{ `created_at`: `string`; `id`: `string`; `name`: `string`; `owner_id`: `string`; `trashed_at`: `string` \\| `null`; \\}\n\nA database: a named collection of tables, owned and shared as one entity.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | Creation time. |\n| <a id=\"property-id\"></a> `id` | `string` | Identifier. |\n| <a id=\"property-name\"></a> `name` | `string` | Display name. |\n| <a id=\"property-owner_id\"></a> `owner_id` | `string` | Owning user. |\n| <a id=\"property-trashed_at\"></a> `trashed_at` | `string` \\| `null` | Set when trashed. |\n\n\n<!-- generated/storage/types.gen/type-aliases/DatabaseDetail.md -->\n# Type Alias: DatabaseDetail\n\n> **DatabaseDetail** = \\{ `database`: [`Database`](Database.md); `grant`: [`AccessLevel`](AccessLevel.md); `tables`: [`TableDetail`](TableDetail.md)[]; \\}\n\nEverything a client needs to render and edit one database: tables,\ncolumn placements with their definitions, and the SQL names the query\nsurface exposes them under.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-database\"></a> `database` | [`Database`](Database.md) | The database. |\n| <a id=\"property-grant\"></a> `grant` | [`AccessLevel`](AccessLevel.md) | The viewer's access. |\n| <a id=\"property-tables\"></a> `tables` | [`TableDetail`](TableDetail.md)[] | Tables in tab order. |\n\n\n<!-- generated/storage/types.gen/type-aliases/DatabaseId.md -->\n# Type Alias: DatabaseId\n\n> **DatabaseId** = `string`\n\nIdentifier of reusable database storage. Its optional Macro entity uses\nthe same identity, so existing routes and grants keep their IDs.\n\n\n<!-- generated/storage/types.gen/type-aliases/DatabaseOp.md -->\n# Type Alias: DatabaseOp\n\n> **DatabaseOp** = \\{ `change`: [`TableChange`](TableChange.md); `kind`: `\"table\"`; `table`: `string`; \\} \\| \\{ `change`: [`ColumnChange`](ColumnChange.md); `column`: `string`; `kind`: `\"column\"`; `table`: `string`; \\} \\| \\{ `change`: [`RowsChange`](RowsChange.md); `kind`: `\"rows\"`; `table`: `string`; \\} \\| \\{ `change`: [`ViewChange`](ViewChange.md); `kind`: `\"view\"`; `table`: `string`; `view`: `string`; \\} \\| \\{ `kind`: `\"reorder_tables\"`; `order`: `string`[]; \\}\n\nOne write to a database: its tables, columns, options, rows or views,\ngrouped by the resource it changes. A request's ops apply in order and\ntogether, or not at all, and every op names a table of the database the\nrequest is for (or, creating one, adds it there).\n\n## Union Members\n\n### Type Literal\n\n\\{ `change`: [`TableChange`](TableChange.md); `kind`: `\"table\"`; `table`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `change` | [`TableChange`](TableChange.md) | What changes. |\n| `kind` | `\"table\"` | - |\n| `table` | `string` | The table; for a creation, its new id, minted by the client, which later ops of the request may name. |\n\n***\n\n### Type Literal\n\n\\{ `change`: [`ColumnChange`](ColumnChange.md); `column`: `string`; `kind`: `\"column\"`; `table`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `change` | [`ColumnChange`](ColumnChange.md) | What changes. |\n| `column` | `string` | The column; for a creation, its new id, minted by the client, which later ops of the request may name. |\n| `kind` | `\"column\"` | - |\n| `table` | `string` | The table. |\n\n***\n\n### Type Literal\n\n\\{ `change`: [`RowsChange`](RowsChange.md); `kind`: `\"rows\"`; `table`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `change` | [`RowsChange`](RowsChange.md) | What changes. |\n| `kind` | `\"rows\"` | - |\n| `table` | `string` | The table the rows belong to. |\n\n***\n\n### Type Literal\n\n\\{ `change`: [`ViewChange`](ViewChange.md); `kind`: `\"view\"`; `table`: `string`; `view`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `change` | [`ViewChange`](ViewChange.md) | What changes. |\n| `kind` | `\"view\"` | - |\n| `table` | `string` | The view's table. |\n| `view` | `string` | The view; for a creation, its new id, minted by the client. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"reorder_tables\"`; `order`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"reorder_tables\"` | - |\n| `order` | `string`[] | Every table, in its new order. |\n\n\n<!-- generated/storage/types.gen/type-aliases/DatabaseView.md -->\n# Type Alias: DatabaseView\n\n> **DatabaseView** = \\{ `createdAt`: `string`; `databaseId`: `string`; `id`: `string`; `layout`: [`ViewLayout`](ViewLayout.md); `name`: `string`; `position`: `string`; `query`: [`ViewQuery`](ViewQuery.md); `tableId`: `string`; `updatedAt`: `string`; \\}\n\nA view of one table, as stored.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-createdat\"></a> `createdAt` | `string` | When it was created. |\n| <a id=\"property-databaseid\"></a> `databaseId` | `string` | The database the table belongs to. |\n| <a id=\"property-id\"></a> `id` | `string` | The view. |\n| <a id=\"property-layout\"></a> `layout` | [`ViewLayout`](ViewLayout.md) | How it draws them. |\n| <a id=\"property-name\"></a> `name` | `string` | Its name, unique among the table's views ignoring case. |\n| <a id=\"property-position\"></a> `position` | `string` | Where it sorts among the table's views: a fractional key. |\n| <a id=\"property-query\"></a> `query` | [`ViewQuery`](ViewQuery.md) | Which rows it shows, in what order. |\n| <a id=\"property-tableid\"></a> `tableId` | `string` | The table it shows. |\n| <a id=\"property-updatedat\"></a> `updatedAt` | `string` | When it last changed. |\n\n\n<!-- generated/storage/types.gen/type-aliases/DatabaseWebhookResponse.md -->\n# Type Alias: DatabaseWebhookResponse\n\n> **DatabaseWebhookResponse** = \\{ `createdAt`: `string`; `createdBy`: `string`; `databaseId`: `string`; `id`: `string`; `tableId`: `string`; `tokenPrefix`: `string`; \\}\n\nA webhook of a database. Its token is never shown again after creation.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-createdat\"></a> `createdAt` | `string` | Creation time. |\n| <a id=\"property-createdby\"></a> `createdBy` | `string` | Who created it; its calls write with their access. |\n| <a id=\"property-databaseid\"></a> `databaseId` | `string` | The database. |\n| <a id=\"property-id\"></a> `id` | `string` | Identifier. |\n| <a id=\"property-tableid\"></a> `tableId` | `string` | The table its calls insert rows into. |\n| <a id=\"property-tokenprefix\"></a> `tokenPrefix` | `string` | The token's first characters, to tell webhooks apart. |\n\n\n<!-- generated/storage/types.gen/type-aliases/DateOperator.md -->\n# Type Alias: DateOperator\n\n> **DateOperator** = `\"before\"` \\| `\"after\"` \\| `\"onOrBefore\"` \\| `\"onOrAfter\"`\n\nHow a date cell compares to a date-time.\n\n\n<!-- generated/storage/types.gen/type-aliases/EntityKind.md -->\n# Type Alias: EntityKind\n\n> **EntityKind** = `\"USER\"` \\| `\"DOCUMENT\"` \\| `\"TASK\"` \\| `\"COMPANY\"` \\| `\"CONTACT\"` \\| `\"CALL_RECORD\"` \\| `\"CHANNEL\"` \\| `\"CHAT\"` \\| `\"PROJECT\"` \\| `\"THREAD\"` \\| `\"CALENDAR_EVENT\"` \\| `\"INITIATIVE\"`\n\nA kind of Macro entity a reference column can point at.\n\n\n<!-- generated/storage/types.gen/type-aliases/EntityRef.md -->\n# Type Alias: EntityRef\n\n> **EntityRef** = \\{ `entityId`: `string`; `entityType`: [`EntityKind`](EntityKind.md); \\}\n\nA reference to one Macro entity.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entityid\"></a> `entityId` | `string` | The entity's id. |\n| <a id=\"property-entitytype\"></a> `entityType` | [`EntityKind`](EntityKind.md) | What kind of entity it is; it must be the kind the column points at. |\n\n\n<!-- generated/storage/types.gen/type-aliases/EntityType.md -->\n# Type Alias: EntityType\n\n> **EntityType** = `\"CALENDAR_EVENT\"` \\| `\"CALL_RECORD\"` \\| `\"CHANNEL\"` \\| `\"CHAT\"` \\| `\"COMPANY\"` \\| `\"DATABASE_ROW\"` \\| `\"CONTACT\"` \\| `\"DOCUMENT\"` \\| `\"INITIATIVE\"` \\| `\"PROJECT\"` \\| `\"TASK\"` \\| `\"THREAD\"` \\| `\"USER\"`\n\nType of entity that can be referenced by entity properties.\n\n\n<!-- generated/storage/types.gen/type-aliases/FilterCondition.md -->\n# Type Alias: FilterCondition\n\n> **FilterCondition** = \\{ `column`: `string`; `test`: [`FilterTest`](FilterTest.md); \\}\n\nA test of one column's cells.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-column\"></a> `column` | `string` | The column tested. |\n| <a id=\"property-test\"></a> `test` | [`FilterTest`](FilterTest.md) | What its cell must be. The test's kind must fit the column's type. |\n\n\n<!-- generated/storage/types.gen/type-aliases/FilterGroup.md -->\n# Type Alias: FilterGroup\n\n> **FilterGroup** = \\{ `conditions`: [`FilterNode`](FilterNode.md)[]; `conjunction`: [`Conjunction`](Conjunction.md); \\}\n\nConditions joined by one conjunction.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-conditions\"></a> `conditions` | [`FilterNode`](FilterNode.md)[] | The conditions and nested groups. A group without any keeps every row. |\n| <a id=\"property-conjunction\"></a> `conjunction` | [`Conjunction`](Conjunction.md) | Whether every condition must hold, or any one. |\n\n\n<!-- generated/storage/types.gen/type-aliases/FilterNode.md -->\n# Type Alias: FilterNode\n\n> **FilterNode** = [`FilterCondition`](FilterCondition.md) & \\{ `kind`: `\"condition\"`; \\} \\| [`FilterGroup`](FilterGroup.md) & \\{ `kind`: `\"group\"`; \\}\n\nOne entry of a group: a condition, or a group of its own.\n\n\n<!-- generated/storage/types.gen/type-aliases/FilterTest.md -->\n# Type Alias: FilterTest\n\n> **FilterTest** = \\{ `kind`: `\"presence\"`; `operator`: [`PresenceOperator`](PresenceOperator.md); \\} \\| \\{ `kind`: `\"text\"`; `operator`: [`TextOperator`](TextOperator.md); `value`: `string`; \\} \\| \\{ `kind`: `\"number\"`; `operator`: [`NumberOperator`](NumberOperator.md); `value`: `number`; \\} \\| \\{ `kind`: `\"date\"`; `operator`: [`DateOperator`](DateOperator.md); `value`: `string`; \\} \\| \\{ `checked`: `boolean`; `kind`: `\"checkbox\"`; \\} \\| \\{ `kind`: `\"options\"`; `operator`: [`SetOperator`](SetOperator.md); `options`: `string`[]; \\} \\| \\{ `entities`: `string`[]; `kind`: `\"entities\"`; `operator`: [`SetOperator`](SetOperator.md); \\}\n\nWhat a column's cell must be, by the kind of value the column holds.\n\n## Union Members\n\n### Type Literal\n\n\\{ `kind`: `\"presence\"`; `operator`: [`PresenceOperator`](PresenceOperator.md); \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"presence\"` | - |\n| `operator` | [`PresenceOperator`](PresenceOperator.md) | Empty, or not. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"text\"`; `operator`: [`TextOperator`](TextOperator.md); `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"text\"` | - |\n| `operator` | [`TextOperator`](TextOperator.md) | How the cell compares. |\n| `value` | `string` | The text compared against, ignoring case for the containment tests. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"number\"`; `operator`: [`NumberOperator`](NumberOperator.md); `value`: `number`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"number\"` | - |\n| `operator` | [`NumberOperator`](NumberOperator.md) | How the cell compares. |\n| `value` | `number` | The number compared against; finite. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"date\"`; `operator`: [`DateOperator`](DateOperator.md); `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"date\"` | - |\n| `operator` | [`DateOperator`](DateOperator.md) | How the cell compares. |\n| `value` | `string` | The date-time compared against. |\n\n***\n\n### Type Literal\n\n\\{ `checked`: `boolean`; `kind`: `\"checkbox\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `checked` | `boolean` | Whether the box is checked. |\n| `kind` | `\"checkbox\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"options\"`; `operator`: [`SetOperator`](SetOperator.md); `options`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"options\"` | - |\n| `operator` | [`SetOperator`](SetOperator.md) | How the cell's options relate to these. |\n| `options` | `string`[] | Options of the column; at least one. |\n\n***\n\n### Type Literal\n\n\\{ `entities`: `string`[]; `kind`: `\"entities\"`; `operator`: [`SetOperator`](SetOperator.md); \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `entities` | `string`[] | Entity ids, or for a relation the related rows' ids; at least one. |\n| `kind` | `\"entities\"` | - |\n| `operator` | [`SetOperator`](SetOperator.md) | How the cell's references relate to these. |\n\n\n<!-- generated/storage/types.gen/type-aliases/Formula.md -->\n# Type Alias: Formula\n\n> **Formula** = \\{ `column`: `string`; `kind`: `\"column\"`; \\} \\| \\{ `kind`: `\"number\"`; `value`: `number`; \\} \\| \\{ `kind`: `\"binary\"`; `left`: `Formula`; `operator`: [`Operator`](Operator.md); `right`: `Formula`; \\} \\| \\{ `kind`: `\"negate\"`; `operand`: `Formula`; \\}\n\nAn expression over one row's cells.\n\n## Union Members\n\n### Type Literal\n\n\\{ `column`: `string`; `kind`: `\"column\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `column` | `string` | The column placement. |\n| `kind` | `\"column\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"number\"`; `value`: `number`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"number\"` | - |\n| `value` | `number` | The value; finite. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"binary\"`; `left`: `Formula`; `operator`: [`Operator`](Operator.md); `right`: `Formula`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"binary\"` | - |\n| `left` | `Formula` | The left operand. |\n| `operator` | [`Operator`](Operator.md) | How. |\n| `right` | `Formula` | The right operand. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"negate\"`; `operand`: `Formula`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"negate\"` | - |\n| `operand` | `Formula` | The expression negated; a number. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ImportTable.md -->\n# Type Alias: ImportTable\n\n> **ImportTable** = \\{ `columns`: `string`[]; `name`: `string`; `requestId`: `string`; `rows`: `string`[][]; \\}\n\nAn import is identified once, before sending, so retries cannot duplicate rows.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-columns\"></a> `columns` | `string`[] | Header names, in order. All imported values remain text. |\n| <a id=\"property-name\"></a> `name` | `string` | New table's display name. |\n| <a id=\"property-requestid\"></a> `requestId` | `string` | Stable key for this import, retained through retries. |\n| <a id=\"property-rows\"></a> `rows` | `string`[][] | Rectangular text rows. Empty fields are preserved. |\n\n\n<!-- generated/storage/types.gen/type-aliases/InferColumnTypeOutcome.md -->\n# Type Alias: InferColumnTypeOutcome\n\n> **InferColumnTypeOutcome** = \\{ `column`: [`ColumnDetail`](ColumnDetail.md); `table_version`: [`TableVersion`](TableVersion.md); \\}\n\nSettled schema and the version against which its first value can be written.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-column\"></a> `column` | [`ColumnDetail`](ColumnDetail.md) | Updated placement, property definition, and SQL name. |\n| <a id=\"property-table_version\"></a> `table_version` | [`TableVersion`](TableVersion.md) | Version after settling the column. |\n\n\n<!-- generated/storage/types.gen/type-aliases/InferColumnTypeRequest.md -->\n# Type Alias: InferColumnTypeRequest\n\n> **InferColumnTypeRequest** = \\{ `baseVersion`: [`TableVersion`](TableVersion.md); `dataType`: [`DataType`](DataType.md); `specificEntityType?`: `null` \\| [`EntityType`](EntityType.md); \\}\n\nRequest to settle an empty column's first-value type.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-baseversion\"></a> `baseVersion` | [`TableVersion`](TableVersion.md) | Table version used when interpreting the first value. |\n| <a id=\"property-datatype\"></a> `dataType` | [`DataType`](DataType.md) | First-value type: STRING, NUMBER, or ENTITY. |\n| <a id=\"property-specificentitytype\"></a> `specificEntityType?` | `null` \\| [`EntityType`](EntityType.md) | - |\n\n\n<!-- generated/storage/types.gen/type-aliases/Lane.md -->\n# Type Alias: Lane\n\n> **Lane** = \\{ `hidden?`: `boolean`; `key`: [`LaneKey`](LaneKey.md); \\}\n\nHow one lane shows in a board layout.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-hidden\"></a> `hidden?` | `boolean` | Whether it is hidden. |\n| <a id=\"property-key\"></a> `key` | [`LaneKey`](LaneKey.md) | The lane. |\n\n\n<!-- generated/storage/types.gen/type-aliases/LaneKey.md -->\n# Type Alias: LaneKey\n\n> **LaneKey** = \\{ `id`: `string`; `kind`: `\"option\"`; \\} \\| \\{ `id`: `string`; `kind`: `\"user\"`; \\} \\| \\{ `kind`: `\"none\"`; \\}\n\nA lane of a board, named by what its cards' grouping cells hold: one\noption of a select, one person, or nothing.\n\n## Union Members\n\n### Type Literal\n\n\\{ `id`: `string`; `kind`: `\"option\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | The cards holding this option of the board's select column. |\n| `kind` | `\"option\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: `string`; `kind`: `\"user\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | The cards naming this person in the board's person column. |\n| `kind` | `\"user\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"none\"`; \\}\n\n\n<!-- generated/storage/types.gen/type-aliases/LinkShare.md -->\n# Type Alias: LinkShare\n\n> **LinkShare** = `\"PUBLIC\"` \\| `\"TEAM\"`\n\nDefines who can access an item through its share link.\n\n\n<!-- generated/storage/types.gen/type-aliases/NewColumn.md -->\n# Type Alias: NewColumn\n\n> **NewColumn** = \\{ `inferType?`: `boolean`; `name`: `string`; `options?`: [`NewOption`](NewOption.md)[]; `source`: `\"new\"`; `type`: [`ColumnKind`](ColumnKind.md); \\} \\| \\{ `formula`: [`Formula`](Formula.md); `name`: `string`; `source`: `\"derived\"`; \\} \\| \\{ `property`: `string`; `source`: `\"existing\"`; \\}\n\nWhat a new column holds.\n\n## Union Members\n\n### Type Literal\n\n\\{ `inferType?`: `boolean`; `name`: `string`; `options?`: [`NewOption`](NewOption.md)[]; `source`: `\"new\"`; `type`: [`ColumnKind`](ColumnKind.md); \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `inferType?` | `boolean` | Let the column's first value settle its type: only for a plain text column. |\n| `name` | `string` | The column's name, unique within the table ignoring case. |\n| `options?` | [`NewOption`](NewOption.md)[] | For a select or tag column, the options it starts with, in order, each under an id the client mints. A select column with none accepts nothing until options are added. |\n| `source` | `\"new\"` | - |\n| `type` | [`ColumnKind`](ColumnKind.md) | Its type. A relation names the table whose rows it holds, one the caller can see. |\n\n***\n\n### Type Literal\n\n\\{ `formula`: [`Formula`](Formula.md); `name`: `string`; `source`: `\"derived\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `formula` | [`Formula`](Formula.md) | How its cells are computed: arithmetic over the table's number, date and other derived columns. |\n| `name` | `string` | The column's name, unique within the table ignoring case. |\n| `source` | `\"derived\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `property`: `string`; `source`: `\"existing\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `property` | `string` | The property's definition. |\n| `source` | `\"existing\"` | - |\n\n\n<!-- generated/storage/types.gen/type-aliases/NewOption.md -->\n# Type Alias: NewOption\n\n> **NewOption** = \\{ `id`: `string`; `label`: `string`; \\}\n\nA select or tag option to create.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-id\"></a> `id` | `string` | Its id, minted by the client; later ops of the request may name it. |\n| <a id=\"property-label\"></a> `label` | `string` | Its label, unique within the column ignoring case. A numeric select's labels are numbers. |\n\n\n<!-- generated/storage/types.gen/type-aliases/NewView.md -->\n# Type Alias: NewView\n\n> **NewView** = \\{ `layout`: [`RequestedLayout`](RequestedLayout.md); `name`: `string`; `query?`: [`ViewQuery`](ViewQuery.md); \\}\n\nA view's contents as an op creates it; the server gives it its id,\nposition and times.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-layout\"></a> `layout` | [`RequestedLayout`](RequestedLayout.md) | How it draws them; a board left without a card title gets the table's first column. |\n| <a id=\"property-name\"></a> `name` | `string` | Its name. |\n| <a id=\"property-query\"></a> `query?` | [`ViewQuery`](ViewQuery.md) | Which rows it shows, in what order. |\n\n\n<!-- generated/storage/types.gen/type-aliases/NumberOperator.md -->\n# Type Alias: NumberOperator\n\n> **NumberOperator** = `\"is\"` \\| `\"isNot\"` \\| `\"greaterThan\"` \\| `\"greaterThanOrEqual\"` \\| `\"lessThan\"` \\| `\"lessThanOrEqual\"`\n\nHow a number cell compares to a number.\n\n\n<!-- generated/storage/types.gen/type-aliases/OpRefusalResponse.md -->\n# Type Alias: OpRefusalResponse\n\n> **OpRefusalResponse** = \\{ `column`: `string` \\| `null`; `message`: `string`; `op`: `number`; `row`: `number` \\| `null`; `taken`: `null` \\| [`TakenId`](TakenId.md); \\}\n\nWhy an op of a batch was refused. Nothing in the batch was written.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-column\"></a> `column` | `string` \\| `null` | The column placement at fault, when one is. |\n| <a id=\"property-message\"></a> `message` | `string` | What is wrong. |\n| <a id=\"property-op\"></a> `op` | `number` | The refused op's index in the request. |\n| <a id=\"property-row\"></a> `row` | `number` \\| `null` | The row's index within the op, when one row is at fault. |\n| <a id=\"property-taken\"></a> `taken` | `null` \\| [`TakenId`](TakenId.md) | - |\n\n\n<!-- generated/storage/types.gen/type-aliases/OpResult.md -->\n# Type Alias: OpResult\n\n> **OpResult** = \\{ `change`: [`TableResult`](TableResult.md); `kind`: `\"table\"`; `table`: `string`; `tableVersion?`: [`TableVersion`](TableVersion.md); \\} \\| \\{ `change`: [`ColumnResult`](ColumnResult.md); `column`: `string`; `kind`: `\"column\"`; `table`: `string`; `tableVersion`: [`TableVersion`](TableVersion.md); \\} \\| \\{ `change`: [`RowsResult`](RowsResult.md); `kind`: `\"rows\"`; `table`: `string`; `tableVersion`: [`TableVersion`](TableVersion.md); \\} \\| \\{ `change`: [`ViewResult`](ViewResult.md); `kind`: `\"view\"`; `table`: `string`; `tableVersion`: [`TableVersion`](TableVersion.md); `view`: `string`; \\} \\| \\{ `kind`: `\"reorder_tables\"`; `tables`: [`VersionedTable`](VersionedTable.md)[]; \\}\n\nWhat one op did, in the order the ops were sent, grouped as the ops are:\na result's `kind` is its op's, naming the same resource, and its\n`change` says what happened to it.\n\n## Union Members\n\n### Type Literal\n\n\\{ `change`: [`TableResult`](TableResult.md); `kind`: `\"table\"`; `table`: `string`; `tableVersion?`: [`TableVersion`](TableVersion.md); \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `change` | [`TableResult`](TableResult.md) | What happened to it. |\n| `kind` | `\"table\"` | - |\n| `table` | `string` | The table. |\n| `tableVersion?` | [`TableVersion`](TableVersion.md) | Its version once the request committed; left out when the op removed it. |\n\n***\n\n### Type Literal\n\n\\{ `change`: [`ColumnResult`](ColumnResult.md); `column`: `string`; `kind`: `\"column\"`; `table`: `string`; `tableVersion`: [`TableVersion`](TableVersion.md); \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `change` | [`ColumnResult`](ColumnResult.md) | What happened to it. |\n| `column` | `string` | The column. |\n| `kind` | `\"column\"` | - |\n| `table` | `string` | The table. |\n| `tableVersion` | [`TableVersion`](TableVersion.md) | The table's version once the request committed. |\n\n***\n\n### Type Literal\n\n\\{ `change`: [`RowsResult`](RowsResult.md); `kind`: `\"rows\"`; `table`: `string`; `tableVersion`: [`TableVersion`](TableVersion.md); \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `change` | [`RowsResult`](RowsResult.md) | What happened to them. |\n| `kind` | `\"rows\"` | - |\n| `table` | `string` | The table. |\n| `tableVersion` | [`TableVersion`](TableVersion.md) | The table's version once the request committed. |\n\n***\n\n### Type Literal\n\n\\{ `change`: [`ViewResult`](ViewResult.md); `kind`: `\"view\"`; `table`: `string`; `tableVersion`: [`TableVersion`](TableVersion.md); `view`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `change` | [`ViewResult`](ViewResult.md) | What happened to it. |\n| `kind` | `\"view\"` | - |\n| `table` | `string` | The view's table. |\n| `tableVersion` | [`TableVersion`](TableVersion.md) | The table's version once the request committed. |\n| `view` | `string` | The view. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"reorder_tables\"`; `tables`: [`VersionedTable`](VersionedTable.md)[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"reorder_tables\"` | - |\n| `tables` | [`VersionedTable`](VersionedTable.md)[] | Every table, in its new order, with its version once the request committed. |\n\n\n<!-- generated/storage/types.gen/type-aliases/Operator.md -->\n# Type Alias: Operator\n\n> **Operator** = `\"add\"` \\| `\"subtract\"` \\| `\"multiply\"` \\| `\"divide\"`\n\nAn arithmetic operator.\n\n\n<!-- generated/storage/types.gen/type-aliases/OptionId.md -->\n# Type Alias: OptionId\n\n> **OptionId** = `string`\n\nIdentifier of an option of a select or tag column.\n\n\n<!-- generated/storage/types.gen/type-aliases/OptionRef.md -->\n# Type Alias: OptionRef\n\n> **OptionRef** = \\{ `id`: `string`; \\} \\| \\{ `label`: `string`; \\}\n\nA select option, by its id or by its label.\n\n## Union Members\n\n### Type Literal\n\n\\{ `id`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | An option the column has. |\n\n***\n\n### Type Literal\n\n\\{ `label`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `label` | `string` | An option's label, matched without regard to case. An unknown label is refused. |\n\n\n<!-- generated/storage/types.gen/type-aliases/PresenceOperator.md -->\n# Type Alias: PresenceOperator\n\n> **PresenceOperator** = `\"isEmpty\"` \\| `\"isNotEmpty\"`\n\nWhether a cell is empty.\n\n\n<!-- generated/storage/types.gen/type-aliases/PropertyDefinition.md -->\n# Type Alias: PropertyDefinition\n\n> **PropertyDefinition** = \\{ `created_at`: `string`; `data_type`: [`DataType`](DataType.md); `display_name`: `string`; `id`: `string`; `is_metadata`: `boolean`; `is_multi_select`: `boolean`; `is_system`: `boolean`; `owner`: [`PropertyOwner`](PropertyOwner.md); `specific_entity_type`: `null` \\| [`EntityType`](EntityType.md); `updated_at`: `string`; \\}\n\nProperty definition model (service representation).\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | - |\n| <a id=\"property-data_type\"></a> `data_type` | [`DataType`](DataType.md) | - |\n| <a id=\"property-display_name\"></a> `display_name` | `string` | - |\n| <a id=\"property-id\"></a> `id` | `string` | - |\n| <a id=\"property-is_metadata\"></a> `is_metadata` | `boolean` | Flag to indicate if this is a system-generated metadata property. Not stored in database - computed at service layer. |\n| <a id=\"property-is_multi_select\"></a> `is_multi_select` | `boolean` | - |\n| <a id=\"property-is_system\"></a> `is_system` | `boolean` | Flag to indicate if this is a system property (stored in DB). |\n| <a id=\"property-owner\"></a> `owner` | [`PropertyOwner`](PropertyOwner.md) | - |\n| <a id=\"property-specific_entity_type\"></a> `specific_entity_type` | `null` \\| [`EntityType`](EntityType.md) | - |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` | - |\n\n\n<!-- generated/storage/types.gen/type-aliases/PropertyDefinitionWithOptions.md -->\n# Type Alias: PropertyDefinitionWithOptions\n\n> **PropertyDefinitionWithOptions** = \\{ `definition`: [`PropertyDefinition`](PropertyDefinition.md); `property_options`: [`PropertyOption`](PropertyOption.md)[]; \\}\n\nProperty definition with its associated options (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-definition\"></a> `definition` | [`PropertyDefinition`](PropertyDefinition.md) |\n| <a id=\"property-property_options\"></a> `property_options` | [`PropertyOption`](PropertyOption.md)[] |\n\n\n<!-- generated/storage/types.gen/type-aliases/PropertyOption.md -->\n# Type Alias: PropertyOption\n\n> **PropertyOption** = \\{ `color`: `string` \\| `null`; `created_at`: `string`; `display_order`: `number`; `id`: `string`; `property_definition_id`: `string`; `updated_at`: `string`; `value`: [`PropertyOptionValue`](PropertyOptionValue.md); \\}\n\nA selectable option for select-type properties (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-color\"></a> `color` | `string` \\| `null` |\n| <a id=\"property-created_at\"></a> `created_at` | `string` |\n| <a id=\"property-display_order\"></a> `display_order` | `number` |\n| <a id=\"property-id\"></a> `id` | `string` |\n| <a id=\"property-property_definition_id\"></a> `property_definition_id` | `string` |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` |\n| <a id=\"property-value\"></a> `value` | [`PropertyOptionValue`](PropertyOptionValue.md) |\n\n\n<!-- generated/storage/types.gen/type-aliases/PropertyOptionValue.md -->\n# Type Alias: PropertyOptionValue\n\n> **PropertyOptionValue** = \\{ `type`: `\"string\"`; `value`: `string`; \\} \\| \\{ `type`: `\"number\"`; `value`: `number`; \\}\n\nThe value of a property option - either a string or a number.\n\n## Union Members\n\n### Type Literal\n\n\\{ `type`: `\"string\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"string\"` | - |\n| `value` | `string` | String value for SelectString properties |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"number\"`; `value`: `number`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"number\"` | - |\n| `value` | `number` | Number value for SelectNumber properties |\n\n\n<!-- generated/storage/types.gen/type-aliases/PropertyOwner.md -->\n# Type Alias: PropertyOwner\n\n> **PropertyOwner** = \\{ `scope`: `\"user\"`; `user_id`: `string`; \\} \\| \\{ `scope`: `\"team\"`; `team_id`: `string`; \\} \\| \\{ `database_id`: `string`; `scope`: `\"database\"`; \\} \\| \\{ `scope`: `\"system\"`; \\}\n\nDefines who owns a property - user-scoped, team-scoped, database-scoped, or system.\n\n\n<!-- generated/storage/types.gen/type-aliases/RequestedLayout.md -->\n# Type Alias: RequestedLayout\n\n> **RequestedLayout** = \\{ `columns`: [`ViewColumn`](ViewColumn.md)[]; `kind`: `\"table\"`; \\} \\| \\{ `cardFields`: `string`[]; `groupBy`: `string`; `hideEmptyLanes`: `boolean`; `kind`: `\"board\"`; `lanes`: [`Lane`](Lane.md)[]; `title?`: `string`; \\}\n\nA layout as an op asks for it: a board may leave its card title out.\n\n## Union Members\n\n### Type Literal\n\n\\{ `columns`: [`ViewColumn`](ViewColumn.md)[]; `kind`: `\"table\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `columns` | [`ViewColumn`](ViewColumn.md)[] | How columns show, in display order. A column left out shows after the listed ones, in the table's order. |\n| `kind` | `\"table\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `cardFields`: `string`[]; `groupBy`: `string`; `hideEmptyLanes`: `boolean`; `kind`: `\"board\"`; `lanes`: [`Lane`](Lane.md)[]; `title?`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `cardFields` | `string`[] | The columns a card shows under its title, in order. |\n| `groupBy` | `string` | The single-select or single-person column whose values are the lanes. |\n| `hideEmptyLanes` | `boolean` | Whether a lane with no cards is hidden. |\n| `kind` | `\"board\"` | - |\n| `lanes` | [`Lane`](Lane.md)[] | How lanes show, in display order. |\n| `title?` | `string` | The column a card is titled by. Left out, a board keeps the title it has, and a new board takes the table's first column. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ResultColumn.md -->\n# Type Alias: ResultColumn\n\n> **ResultColumn** = \\{ `kind`: [`SqlOutcomeKind`](SqlOutcomeKind.md); `name`: `string`; `options?`: [`SqlSelectOption`](SqlSelectOption.md)[]; `relatedTable?`: `null` \\| [`TableId`](TableId.md); `target?`: `null` \\| [`SqlEntityKind`](SqlEntityKind.md); \\}\n\nOne result column, with what its cells mean.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-kind\"></a> `kind` | [`SqlOutcomeKind`](SqlOutcomeKind.md) | What its cells hold. |\n| <a id=\"property-name\"></a> `name` | `string` | The name or alias the statement gave it. |\n| <a id=\"property-options\"></a> `options?` | [`SqlSelectOption`](SqlSelectOption.md)[] | For a select column, its options: its cells hold their ids. |\n| <a id=\"property-relatedtable\"></a> `relatedTable?` | `null` \\| [`TableId`](TableId.md) | - |\n| <a id=\"property-target\"></a> `target?` | `null` \\| [`SqlEntityKind`](SqlEntityKind.md) | - |\n\n\n<!-- generated/storage/types.gen/type-aliases/RowChange.md -->\n# Type Alias: RowChange\n\n> **RowChange** = \\{ `cells`: [`CellWrite`](CellWrite.md)[]; `row`: `string`; \\}\n\nOne row's cells in a [`RowChanges::PerRow`] update.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-cells\"></a> `cells` | [`CellWrite`](CellWrite.md)[] | Its new cells. |\n| <a id=\"property-row\"></a> `row` | `string` | The row. |\n\n\n<!-- generated/storage/types.gen/type-aliases/RowChangeKind.md -->\n# Type Alias: RowChangeKind\n\n> **RowChangeKind** = `\"insert\"` \\| `\"update\"` \\| `\"delete\"`\n\nHow a change touched a row.\n\n\n<!-- generated/storage/types.gen/type-aliases/RowChanges.md -->\n# Type Alias: RowChanges\n\n> **RowChanges** = \\{ `cells`: [`CellWrite`](CellWrite.md)[]; `kind`: `\"uniform\"`; `rows`: `string`[]; \\} \\| \\{ `kind`: `\"per_row\"`; `rows`: [`RowChange`](RowChange.md)[]; \\}\n\nWhich rows an update writes, and with what.\n\n## Union Members\n\n### Type Literal\n\n\\{ `cells`: [`CellWrite`](CellWrite.md)[]; `kind`: `\"uniform\"`; `rows`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `cells` | [`CellWrite`](CellWrite.md)[] | The cells each of them gets. |\n| `kind` | `\"uniform\"` | - |\n| `rows` | `string`[] | The rows. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"per_row\"`; `rows`: [`RowChange`](RowChange.md)[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"per_row\"` | - |\n| `rows` | [`RowChange`](RowChange.md)[] | The rows and their cells, in order. |\n\n\n<!-- generated/storage/types.gen/type-aliases/RowHistoryEntry.md -->\n# Type Alias: RowHistoryEntry\n\n> **RowHistoryEntry** = \\{ `actingBot`: `string` \\| `null`; `actor`: `string` \\| `null`; `after`: \\{\\[`key`: `string`\\]: [`CellValue`](CellValue.md); \\}; `at`: `string`; `before`: \\{\\[`key`: `string`\\]: [`CellValue`](CellValue.md); \\}; `change`: `number`; `columns`: `string`[]; `kind`: [`RowChangeKind`](RowChangeKind.md); `version`: `number`; \\}\n\nOne change of a row, as its history shows it.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-actingbot\"></a> `actingBot` | `string` \\| `null` | The agent acting for them, if one was. |\n| <a id=\"property-actor\"></a> `actor` | `string` \\| `null` | Who made it; `null` for an internal caller, or a removed user. |\n| <a id=\"property-after\"></a> `after` | \\{\\[`key`: `string`\\]: [`CellValue`](CellValue.md); \\} | Those columns' values it wrote, by column id; a cell it emptied is left out. |\n| <a id=\"property-at\"></a> `at` | `string` | When it committed. |\n| <a id=\"property-before\"></a> `before` | \\{\\[`key`: `string`\\]: [`CellValue`](CellValue.md); \\} | Those columns' values before it, by column id; an empty cell is left out. |\n| <a id=\"property-change\"></a> `change` | `number` | The change's id in the journal. |\n| <a id=\"property-columns\"></a> `columns` | `string`[] | The columns it wrote; for a removal, those the row had values in. |\n| <a id=\"property-kind\"></a> `kind` | [`RowChangeKind`](RowChangeKind.md) | How it touched the row. |\n| <a id=\"property-version\"></a> `version` | `number` | The table version it produced. |\n\n\n<!-- generated/storage/types.gen/type-aliases/RowId.md -->\n# Type Alias: RowId\n\n> **RowId** = `string`\n\nIdentifier of a row.\n\n\n<!-- generated/storage/types.gen/type-aliases/RowsChange.md -->\n# Type Alias: RowsChange\n\n> **RowsChange** = \\{ `kind`: `\"insert\"`; `rows`: [`CellWrite`](CellWrite.md)[][]; \\} \\| \\{ `changes`: [`RowChanges`](RowChanges.md); `kind`: `\"update\"`; \\} \\| \\{ `kind`: `\"delete\"`; `rows`: `string`[]; \\}\n\nA write to a table's rows.\n\n## Union Members\n\n### Type Literal\n\n\\{ `kind`: `\"insert\"`; `rows`: [`CellWrite`](CellWrite.md)[][]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"insert\"` | - |\n| `rows` | [`CellWrite`](CellWrite.md)[][] | One entry per new row: the cells it starts with. Columns left out start empty. |\n\n***\n\n### Type Literal\n\n\\{ `changes`: [`RowChanges`](RowChanges.md); `kind`: `\"update\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `changes` | [`RowChanges`](RowChanges.md) | Which rows get which cells. |\n| `kind` | `\"update\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"delete\"`; `rows`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"delete\"` | - |\n| `rows` | `string`[] | The rows, each named once. |\n\n\n<!-- generated/storage/types.gen/type-aliases/RowsResult.md -->\n# Type Alias: RowsResult\n\n> **RowsResult** = \\{ `kind`: `\"inserted\"`; `rows`: `string`[]; \\} \\| \\{ `affected`: `number`; `kind`: `\"updated\"`; \\} \\| \\{ `affected`: `number`; `kind`: `\"deleted\"`; \\}\n\nWhat happened to a table's rows.\n\n## Union Members\n\n### Type Literal\n\n\\{ `kind`: `\"inserted\"`; `rows`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"inserted\"` | - |\n| `rows` | `string`[] | The new rows, in the order they were sent. |\n\n***\n\n### Type Literal\n\n\\{ `affected`: `number`; `kind`: `\"updated\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `affected` | `number` | How many rows the op updated. |\n| `kind` | `\"updated\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `affected`: `number`; `kind`: `\"deleted\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `affected` | `number` | How many rows the op deleted. |\n| `kind` | `\"deleted\"` | - |\n\n\n<!-- generated/storage/types.gen/type-aliases/SetOperator.md -->\n# Type Alias: SetOperator\n\n> **SetOperator** = `\"isAnyOf\"` \\| `\"isNoneOf\"` \\| `\"hasAny\"` \\| `\"hasAll\"` \\| `\"hasNone\"`\n\nHow a cell's options or references relate to a set of them. The first\ntwo fit a column holding one value, the last three one holding several.\n\n\n<!-- generated/storage/types.gen/type-aliases/SharePermissionV2.md -->\n# Type Alias: SharePermissionV2\n\n> **SharePermissionV2** = \\{ `channelSharePermissions?`: [`ChannelSharePermission`](ChannelSharePermission.md)[] \\| `null`; `id`: `string`; `linkShare?`: `null` \\| [`LinkShare`](LinkShare.md); `linkShareAccessLevel?`: `null` \\| [`AccessLevel`](AccessLevel.md); `owner`: `string`; `teamShareAccessLevel?`: `null` \\| [`AccessLevel`](AccessLevel.md); \\}\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-channelsharepermissions\"></a> `channelSharePermissions?` | [`ChannelSharePermission`](ChannelSharePermission.md)[] \\| `null` | The channel share permissions for the item |\n| <a id=\"property-id\"></a> `id` | `string` | The share permission id |\n| <a id=\"property-linkshare\"></a> `linkShare?` | `null` \\| [`LinkShare`](LinkShare.md) | - |\n| <a id=\"property-linkshareaccesslevel\"></a> `linkShareAccessLevel?` | `null` \\| [`AccessLevel`](AccessLevel.md) | - |\n| <a id=\"property-owner\"></a> `owner` | `string` | The owner of the item |\n| <a id=\"property-teamshareaccesslevel\"></a> `teamShareAccessLevel?` | `null` \\| [`AccessLevel`](AccessLevel.md) | - |\n\n\n<!-- generated/storage/types.gen/type-aliases/SortDirection.md -->\n# Type Alias: SortDirection\n\n> **SortDirection** = `\"ascending\"` \\| `\"descending\"`\n\nA sort direction. Empty cells sort last either way.\n\n\n<!-- generated/storage/types.gen/type-aliases/SortKey.md -->\n# Type Alias: SortKey\n\n> **SortKey** = \\{ `column`: `string`; `direction`: [`SortDirection`](SortDirection.md); \\}\n\nOne sort key.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-column\"></a> `column` | `string` | The column sorted on. |\n| <a id=\"property-direction\"></a> `direction` | [`SortDirection`](SortDirection.md) | Which way. |\n\n\n<!-- generated/storage/types.gen/type-aliases/SqlCell.md -->\n# Type Alias: SqlCell\n\n> **SqlCell** = \\{ `type`: `\"text\"`; `value`: `string`; \\} \\| \\{ `type`: `\"number\"`; `value`: `number`; \\} \\| \\{ `type`: `\"bool\"`; `value`: `boolean`; \\} \\| \\{ `type`: `\"date\"`; `value`: `string`; \\} \\| \\{ `type`: `\"options\"`; `value`: [`OptionId`](OptionId.md)[]; \\} \\| \\{ `type`: `\"entities\"`; `value`: `string`[]; \\} \\| \\{ `type`: `\"row\"`; `value`: [`RowId`](RowId.md); \\}\n\nA cell as fetched. An absent cell is `NULL`; an absent multi-valued cell\nis the empty set.\n\n## Union Members\n\n### Type Literal\n\n\\{ `type`: `\"text\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"text\"` | - |\n| `value` | `string` | Text or link. |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"number\"`; `value`: `number`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"number\"` | - |\n| `value` | `number` | A number. |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"bool\"`; `value`: `boolean`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"bool\"` | - |\n| `value` | `boolean` | A checkbox. |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"date\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"date\"` | - |\n| `value` | `string` | A date-time. |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"options\"`; `value`: [`OptionId`](OptionId.md)[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"options\"` | - |\n| `value` | [`OptionId`](OptionId.md)[] | The selected option ids; one for single-select columns. |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"entities\"`; `value`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"entities\"` | - |\n| `value` | `string`[] | The referenced entity ids; one for single-valued columns. |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"row\"`; `value`: [`RowId`](RowId.md); \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"row\"` | - |\n| `value` | [`RowId`](RowId.md) | A table row's own id, the `row_id` column. |\n\n\n<!-- generated/storage/types.gen/type-aliases/SqlEntityKind.md -->\n# Type Alias: SqlEntityKind\n\n> **SqlEntityKind** = `\"USER\"` \\| `\"DOCUMENT\"` \\| `\"TASK\"` \\| `\"COMPANY\"` \\| `\"CONTACT\"` \\| `\"CALL_RECORD\"` \\| `\"CHANNEL\"` \\| `\"CHAT\"` \\| `\"PROJECT\"` \\| `\"THREAD\"` \\| `\"CALENDAR_EVENT\"` \\| `\"INITIATIVE\"` \\| `\"DATABASE_ROW\"`\n\nWhat an entity column's references point at: a kind of Macro entity, or\nthe rows of another table for a relation.\n\nSpelled as the properties system spells entity types (`USER`,\n`DATABASE_ROW`), on the wire and in SQL, where it parses\ncase-insensitively.\n\n\n<!-- generated/storage/types.gen/type-aliases/SqlOutcomeKind.md -->\n# Type Alias: SqlOutcomeKind\n\n> **SqlOutcomeKind** = `\"text\"` \\| `\"number\"` \\| `\"boolean\"` \\| `\"date\"` \\| `\"select\"` \\| `\"entity\"` \\| `\"row\"`\n\nThe value kind of a result column.\n\n\n<!-- generated/storage/types.gen/type-aliases/SqlSelectOption.md -->\n# Type Alias: SqlSelectOption\n\n> **SqlSelectOption** = \\{ `id`: [`OptionId`](OptionId.md); `label`: `string`; \\}\n\nOne option of a select column.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-id\"></a> `id` | [`OptionId`](OptionId.md) | The option id. |\n| <a id=\"property-label\"></a> `label` | `string` | The label users type in SQL. |\n\n\n<!-- generated/storage/types.gen/type-aliases/SqlStatement.md -->\n# Type Alias: SqlStatement\n\n> **SqlStatement** = \\{ `databaseId`: [`DatabaseId`](DatabaseId.md); `kind`: `\"schema\"`; `summary`: `string`; \\} \\| \\{ `kind`: `\"select\"`; \\} \\| \\{ `kind`: `\"insert\"`; `tableId`: [`TableId`](TableId.md); `tableName`: `string`; \\} \\| \\{ `kind`: `\"update\"`; `tableId`: [`TableId`](TableId.md); `tableName`: `string`; \\} \\| \\{ `kind`: `\"delete\"`; `tableId`: [`TableId`](TableId.md); `tableName`: `string`; \\} \\| \\{ `columnId`: [`ColumnId`](ColumnId.md); `columnName`: `string`; `kind`: `\"alterColumnType\"`; `tableId`: [`TableId`](TableId.md); `tableName`: `string`; `to`: `string`; \\}\n\nThe statement that ran: a read, or the table (and for a type change, the\ncolumn) it wrote.\n\n## Union Members\n\n### Type Literal\n\n\\{ `databaseId`: [`DatabaseId`](DatabaseId.md); `kind`: `\"schema\"`; `summary`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `databaseId` | [`DatabaseId`](DatabaseId.md) | Owning database. |\n| `kind` | `\"schema\"` | - |\n| `summary` | `string` | What changed and how to read the resulting schema. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"select\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"insert\"`; `tableId`: [`TableId`](TableId.md); `tableName`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"insert\"` | - |\n| `tableId` | [`TableId`](TableId.md) | The table written. |\n| `tableName` | `string` | Its name. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"update\"`; `tableId`: [`TableId`](TableId.md); `tableName`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"update\"` | - |\n| `tableId` | [`TableId`](TableId.md) | The table written. |\n| `tableName` | `string` | Its name. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"delete\"`; `tableId`: [`TableId`](TableId.md); `tableName`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"delete\"` | - |\n| `tableId` | [`TableId`](TableId.md) | The table written. |\n| `tableName` | `string` | Its name. |\n\n***\n\n### Type Literal\n\n\\{ `columnId`: [`ColumnId`](ColumnId.md); `columnName`: `string`; `kind`: `\"alterColumnType\"`; `tableId`: [`TableId`](TableId.md); `tableName`: `string`; `to`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `columnId` | [`ColumnId`](ColumnId.md) | The column placement; its id survives the change. |\n| `columnName` | `string` | The column's name. |\n| `kind` | `\"alterColumnType\"` | - |\n| `tableId` | [`TableId`](TableId.md) | The table. |\n| `tableName` | `string` | Its name. |\n| `to` | `string` | The type it became, as SQL spells it, e.g. `select[]`. |\n\n\n<!-- generated/storage/types.gen/type-aliases/Table.md -->\n# Type Alias: Table\n\n> **Table** = \\{ `database_id`: `string`; `id`: `string`; `name`: `string`; `position`: `string`; `version`: [`TableVersion`](TableVersion.md); \\}\n\nOne table (tab) of a database.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-database_id\"></a> `database_id` | `string` | Owning database. |\n| <a id=\"property-id\"></a> `id` | `string` | Identifier. |\n| <a id=\"property-name\"></a> `name` | `string` | Display name; also the basis of the table's SQL name. |\n| <a id=\"property-position\"></a> `position` | `string` | Fractional index for tab ordering. |\n| <a id=\"property-version\"></a> `version` | [`TableVersion`](TableVersion.md) | Current version. |\n\n\n<!-- generated/storage/types.gen/type-aliases/TableChange.md -->\n# Type Alias: TableChange\n\n> **TableChange** = \\{ `kind`: `\"create\"`; `name`: `string`; \\} \\| \\{ `kind`: `\"rename\"`; `name`: `string`; `previousName?`: `string`; \\} \\| \\{ `kind`: `\"delete\"`; \\} \\| \\{ `kind`: `\"reorder_columns\"`; `order`: `string`[]; \\} \\| \\{ `kind`: `\"reorder_views\"`; `order`: `string`[]; \\}\n\nA change to a table itself.\n\n## Union Members\n\n### Type Literal\n\n\\{ `kind`: `\"create\"`; `name`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"create\"` | - |\n| `name` | `string` | Its name, unique within the database ignoring case. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"rename\"`; `name`: `string`; `previousName?`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"rename\"` | - |\n| `name` | `string` | Its new name, unique within the database ignoring case. |\n| `previousName?` | `string` | The name the caller saw. Given, the rename is refused if the table goes by another one now, so a concurrent rename is not overwritten. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"delete\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"reorder_columns\"`; `order`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"reorder_columns\"` | - |\n| `order` | `string`[] | Its columns, in their new order. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"reorder_views\"`; `order`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"reorder_views\"` | - |\n| `order` | `string`[] | Its views, in their new order. |\n\n\n<!-- generated/storage/types.gen/type-aliases/TableDetail.md -->\n# Type Alias: TableDetail\n\n> **TableDetail** = \\{ `columns`: [`ColumnDetail`](ColumnDetail.md)[]; `sql_name`: `string`; `table`: [`Table`](Table.md); `views`: [`DatabaseView`](DatabaseView.md)[]; \\}\n\nOne table with its columns and SQL name.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-columns\"></a> `columns` | [`ColumnDetail`](ColumnDetail.md)[] | Columns in display order. |\n| <a id=\"property-sql_name\"></a> `sql_name` | `string` | The name SQL refers to the table by: its display name quoted and qualified by the database's (`FROM \"Plans\".\"Table 1\"`). |\n| <a id=\"property-table\"></a> `table` | [`Table`](Table.md) | The table. |\n| <a id=\"property-views\"></a> `views` | [`DatabaseView`](DatabaseView.md)[] | The table's views, in their order. |\n\n\n<!-- generated/storage/types.gen/type-aliases/TableId.md -->\n# Type Alias: TableId\n\n> **TableId** = `string`\n\nIdentifier of one table (tab) within a database.\n\n\n<!-- generated/storage/types.gen/type-aliases/TableResult.md -->\n# Type Alias: TableResult\n\n> **TableResult** = \\{ `kind`: `\"created\"`; \\} \\| \\{ `kind`: `\"renamed\"`; \\} \\| \\{ `kind`: `\"deleted\"`; \\} \\| \\{ `kind`: `\"columns_reordered\"`; \\} \\| \\{ `kind`: `\"views_reordered\"`; `positions`: [`ViewPosition`](ViewPosition.md)[]; \\}\n\nWhat happened to a table.\n\n## Union Members\n\n### Type Literal\n\n\\{ `kind`: `\"created\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"renamed\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"deleted\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"columns_reordered\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"views_reordered\"`; `positions`: [`ViewPosition`](ViewPosition.md)[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"views_reordered\"` | - |\n| `positions` | [`ViewPosition`](ViewPosition.md)[] | Every view's key, in their new order. |\n\n\n<!-- generated/storage/types.gen/type-aliases/TableVersion.md -->\n# Type Alias: TableVersion\n\n> **TableVersion** = `number`\n\nMonotonic per-table version, bumped once by every committed change to a\ntable's schema or rows. Schema edits name the version they were made\nagainst, and change events carry the new one.\n\n\n<!-- generated/storage/types.gen/type-aliases/TakenId.md -->\n# Type Alias: TakenId\n\n> **TakenId** = \\{ `id`: `string`; `kind`: `\"table\"`; \\} \\| \\{ `id`: `string`; `kind`: `\"column\"`; \\} \\| \\{ `id`: `string`; `kind`: `\"option\"`; \\} \\| \\{ `id`: `string`; `kind`: `\"view\"`; \\}\n\nAn id a request minted for something new that already names something,\nwhich refuses the request: a retried request whose first attempt\ncommitted, or an id minted twice.\n\n## Union Members\n\n### Type Literal\n\n\\{ `id`: `string`; `kind`: `\"table\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | A table's. |\n| `kind` | `\"table\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: `string`; `kind`: `\"column\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | A column's. |\n| `kind` | `\"column\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: `string`; `kind`: `\"option\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | An option's. |\n| `kind` | `\"option\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: `string`; `kind`: `\"view\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | A view's. |\n| `kind` | `\"view\"` | - |\n\n\n<!-- generated/storage/types.gen/type-aliases/TextOperator.md -->\n# Type Alias: TextOperator\n\n> **TextOperator** = `\"is\"` \\| `\"isNot\"` \\| `\"contains\"` \\| `\"doesNotContain\"` \\| `\"startsWith\"` \\| `\"endsWith\"`\n\nHow a text cell compares to a text.\n\n\n<!-- generated/storage/types.gen/type-aliases/UpdateChannelSharePermission.md -->\n# Type Alias: UpdateChannelSharePermission\n\n> **UpdateChannelSharePermission** = \\{ `accessLevel?`: `null` \\| [`AccessLevel`](AccessLevel.md); `channelId`: `string`; `operation`: [`UpdateOperation`](UpdateOperation.md); \\}\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-accesslevel\"></a> `accessLevel?` | `null` \\| [`AccessLevel`](AccessLevel.md) | - |\n| <a id=\"property-channelid\"></a> `channelId` | `string` | The channel id |\n| <a id=\"property-operation\"></a> `operation` | [`UpdateOperation`](UpdateOperation.md) | The type of operation to be performed on the chanel share permission You can add, remove or replace and existing permission |\n\n\n<!-- generated/storage/types.gen/type-aliases/UpdateOperation.md -->\n# Type Alias: UpdateOperation\n\n> **UpdateOperation** = `\"add\"` \\| `\"remove\"` \\| `\"replace\"`\n\n\n<!-- generated/storage/types.gen/type-aliases/UpdateSharePermissionRequestV2.md -->\n# Type Alias: UpdateSharePermissionRequestV2\n\n> **UpdateSharePermissionRequestV2** = \\{ `channelSharePermissions?`: [`UpdateChannelSharePermission`](UpdateChannelSharePermission.md)[] \\| `null`; `linkShare?`: `null` \\| [`LinkShare`](LinkShare.md); `linkShareAccessLevel?`: `null` \\| [`AccessLevel`](AccessLevel.md); `teamShareAccessLevel?`: `null` \\| [`AccessLevel`](AccessLevel.md); \\}\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-channelsharepermissions\"></a> `channelSharePermissions?` | [`UpdateChannelSharePermission`](UpdateChannelSharePermission.md)[] \\| `null` | Any channel share permissions to be created/updated/removed |\n| <a id=\"property-linkshare\"></a> `linkShare?` | `null` \\| [`LinkShare`](LinkShare.md) | - |\n| <a id=\"property-linkshareaccesslevel\"></a> `linkShareAccessLevel?` | `null` \\| [`AccessLevel`](AccessLevel.md) | - |\n| <a id=\"property-teamshareaccesslevel\"></a> `teamShareAccessLevel?` | `null` \\| [`AccessLevel`](AccessLevel.md) | - |\n\n\n<!-- generated/storage/types.gen/type-aliases/VersionedTable.md -->\n# Type Alias: VersionedTable\n\n> **VersionedTable** = \\{ `table`: `string`; `version`: [`TableVersion`](TableVersion.md); \\}\n\nA table and its version.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-table\"></a> `table` | `string` | The table. |\n| <a id=\"property-version\"></a> `version` | [`TableVersion`](TableVersion.md) | Its version. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ViewChange.md -->\n# Type Alias: ViewChange\n\n> **ViewChange** = \\{ `kind`: `\"create\"`; `view`: [`NewView`](NewView.md); \\} \\| \\{ `kind`: `\"update\"`; `layout?`: [`RequestedLayout`](RequestedLayout.md); `name?`: `string`; `query?`: [`ViewQuery`](ViewQuery.md); \\} \\| \\{ `kind`: `\"delete\"`; \\} \\| \\{ `after?`: `string` \\| `null`; `before?`: `string` \\| `null`; `kind`: `\"move_card\"`; `lane`: [`LaneKey`](LaneKey.md); `row`: `string`; \\}\n\nA change to one view.\n\n## Union Members\n\n### Type Literal\n\n\\{ `kind`: `\"create\"`; `view`: [`NewView`](NewView.md); \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"create\"` | - |\n| `view` | [`NewView`](NewView.md) | What it shows and how. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"update\"`; `layout?`: [`RequestedLayout`](RequestedLayout.md); `name?`: `string`; `query?`: [`ViewQuery`](ViewQuery.md); \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"update\"` | - |\n| `layout?` | [`RequestedLayout`](RequestedLayout.md) | Its new layout. A board grouped by another column forgets where its cards were; a board left without a card title keeps the one it has, or takes the table's first column. |\n| `name?` | `string` | Its new name. |\n| `query?` | [`ViewQuery`](ViewQuery.md) | Its new query. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"delete\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `after?`: `string` \\| `null`; `before?`: `string` \\| `null`; `kind`: `\"move_card\"`; `lane`: [`LaneKey`](LaneKey.md); `row`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `after?` | `string` \\| `null` | The card that ends up just after it, if any. Given with `before`, it must be the card right after `before`; with neither, the card goes to the end of the lane. |\n| `before?` | `string` \\| `null` | The card that ends up just before it (it lands right after this one), if any. |\n| `kind` | `\"move_card\"` | - |\n| `lane` | [`LaneKey`](LaneKey.md) | The lane it goes to: an option of a select board's column, a person for a board grouped by people, or the lane of empty cells. |\n| `row` | `string` | The card's row. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ViewColumn.md -->\n# Type Alias: ViewColumn\n\n> **ViewColumn** = \\{ `column`: `string`; `width`: `number` \\| `null`; \\}\n\nHow one column shows in a table layout.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-column\"></a> `column` | `string` | The column. |\n| <a id=\"property-width\"></a> `width` | `number` \\| `null` | Its width in pixels; the default when unset. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ViewLayout.md -->\n# Type Alias: ViewLayout\n\n> **ViewLayout** = \\{ `columns`: [`ViewColumn`](ViewColumn.md)[]; `kind`: `\"table\"`; \\} \\| \\{ `cardFields`: `string`[]; `groupBy`: `string`; `hideEmptyLanes`: `boolean`; `kind`: `\"board\"`; `lanes`: [`Lane`](Lane.md)[]; `title`: `string`; \\}\n\nHow a view draws its rows.\n\n## Union Members\n\n### Type Literal\n\n\\{ `columns`: [`ViewColumn`](ViewColumn.md)[]; `kind`: `\"table\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `columns` | [`ViewColumn`](ViewColumn.md)[] | How columns show, in display order. A column left out shows after the listed ones, in the table's order. |\n| `kind` | `\"table\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `cardFields`: `string`[]; `groupBy`: `string`; `hideEmptyLanes`: `boolean`; `kind`: `\"board\"`; `lanes`: [`Lane`](Lane.md)[]; `title`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `cardFields` | `string`[] | The columns a card shows under its title, in order. |\n| `groupBy` | `string` | The single-select or single-person column whose values are the lanes; moving a card to another lane sets this column. |\n| `hideEmptyLanes` | `boolean` | Whether a lane with no cards is hidden. |\n| `kind` | `\"board\"` | - |\n| `lanes` | [`Lane`](Lane.md)[] | How lanes show, in display order. A lane left out shows after the listed ones: the lane of empty cells first, then options in the column's order, or people by id. |\n| `title` | `string` | The column a card is titled by, of any type. Removing it titles the cards by the table's first remaining column. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ViewPosition.md -->\n# Type Alias: ViewPosition\n\n> **ViewPosition** = \\{ `position`: `string`; `view`: `string`; \\}\n\nA view's place among its table's views.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-position\"></a> `position` | `string` | Its key. |\n| <a id=\"property-view\"></a> `view` | `string` | The view. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ViewQuery.md -->\n# Type Alias: ViewQuery\n\n> **ViewQuery** = \\{ `filter`: `null` \\| [`FilterGroup`](FilterGroup.md); `sort?`: [`SortKey`](SortKey.md)[]; \\}\n\nWhich rows of the table a view shows, and in what order: a filter and a\nsort, nothing that joins, groups or reshapes rows.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-filter\"></a> `filter` | `null` \\| [`FilterGroup`](FilterGroup.md) | - |\n| <a id=\"property-sort\"></a> `sort?` | [`SortKey`](SortKey.md)[] | The sort keys, first key first. Rows the keys leave tied keep the table's own order; with no keys, the table's order is the view's. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ViewResult.md -->\n# Type Alias: ViewResult\n\n> **ViewResult** = \\{ `kind`: `\"created\"`; `view`: [`DatabaseView`](DatabaseView.md); \\} \\| \\{ `kind`: `\"updated\"`; `view`: [`DatabaseView`](DatabaseView.md); \\} \\| \\{ `kind`: `\"deleted\"`; \\} \\| \\{ `kind`: `\"card_moved\"`; `positions`: [`CardPosition`](CardPosition.md)[]; \\}\n\nWhat happened to a view.\n\n## Union Members\n\n### Type Literal\n\n\\{ `kind`: `\"created\"`; `view`: [`DatabaseView`](DatabaseView.md); \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"created\"` | - |\n| `view` | [`DatabaseView`](DatabaseView.md) | The view as stored. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"updated\"`; `view`: [`DatabaseView`](DatabaseView.md); \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"updated\"` | - |\n| `view` | [`DatabaseView`](DatabaseView.md) | The view as stored. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"deleted\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"card_moved\"`; `positions`: [`CardPosition`](CardPosition.md)[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"card_moved\"` | - |\n| `positions` | [`CardPosition`](CardPosition.md)[] | The positions written, the moved card's last. |\n\n\n<!-- src/entities/databases/column/classes/DatabaseColumn.md -->\n# Class: DatabaseColumn\n\nOne column of a [DatabaseTable](../../table/classes/DatabaseTable.md): the placement of a property\ndefinition on the table.\n\nA column is not an entity of its own — it has no permissions and no\nendpoint to read it directly. The handle resolves through the owning\ndatabase's schema, so a fresh read after a write sees the new value.\n\n## Properties\n\n| Property | Modifier | Type | Description |\n| ------ | ------ | ------ | ------ |\n| <a id=\"property-id\"></a> `id` | `readonly` | `string` | Identifier of the column placement. |\n| <a id=\"property-table\"></a> `table` | `readonly` | [`DatabaseTable`](../../table/classes/DatabaseTable.md) | The table this column belongs to. |\n\n## Methods\n\n### addOptions()\n\n> **addOptions**(`labels`): `Promise`\\<`DatabaseColumn`\\>\n\nAdd select options to the column. Labels it already has are skipped, so\nthe call is safe to repeat. Only select and tag columns accept options.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `labels` | `string`[] |\n\n#### Returns\n\n`Promise`\\<`DatabaseColumn`\\>\n\n***\n\n### casts()\n\n> **casts**(): `Promise`\\<[`ColumnCast`](../../../../../generated/storage/types.gen/type-aliases/ColumnCast.md)[]\\>\n\nWhat changing this column to each type would do to its values: `safe`,\n`checked` (with how many would not convert, and a few of them), or\n`never` (with why). Changes nothing.\n\n#### Returns\n\n`Promise`\\<[`ColumnCast`](../../../../../generated/storage/types.gen/type-aliases/ColumnCast.md)[]\\>\n\n***\n\n### changeType()\n\n> **changeType**(`options`): `Promise`\\<[`OpResultOf`](../../database/type-aliases/OpResultOf.md)\\<`\"column\"`, `\"type_changed\"`\\>\\>\n\nChange this column's type. See Database.changeColumnType.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | [`ChangeColumnTypeOptions`](../../database/type-aliases/ChangeColumnTypeOptions.md) |\n\n#### Returns\n\n`Promise`\\<[`OpResultOf`](../../database/type-aliases/OpResultOf.md)\\<`\"column\"`, `\"type_changed\"`\\>\\>\n\n***\n\n### config()\n\n> **config**(): `Promise`\\<[`ColumnConfig`](../../../../../generated/storage/types.gen/type-aliases/ColumnConfig.md) \\| `undefined`\\>\n\nColumn-kind configuration (a link), or `undefined` for a plain\nvalue column.\n\n#### Returns\n\n`Promise`\\<[`ColumnConfig`](../../../../../generated/storage/types.gen/type-aliases/ColumnConfig.md) \\| `undefined`\\>\n\n***\n\n### convertIntoNewColumn()\n\n> **convertIntoNewColumn**(`options`): `Promise`\\<`DatabaseColumn`\\>\n\nAdd a column of another type right after this one, filled with the\nvalues that convert, leaving this one as it is. See\nDatabase.convertColumnIntoNewColumn.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | [`ConvertIntoNewColumnOptions`](../../database/type-aliases/ConvertIntoNewColumnOptions.md) |\n\n#### Returns\n\n`Promise`\\<`DatabaseColumn`\\>\n\n***\n\n### dataType()\n\n> **dataType**(): `Promise`\\<[`DataType`](../../../../../generated/storage/types.gen/type-aliases/DataType.md)\\>\n\nThe value type the column holds.\n\n#### Returns\n\n`Promise`\\<[`DataType`](../../../../../generated/storage/types.gen/type-aliases/DataType.md)\\>\n\n***\n\n### definition()\n\n> **definition**(): `Promise`\\<[`PropertyDefinitionWithOptions`](../../../../../generated/storage/types.gen/type-aliases/PropertyDefinitionWithOptions.md)\\>\n\nThe bound property definition together with its select options — the\nsource of the column's name, type, and allowed values.\n\n#### Returns\n\n`Promise`\\<[`PropertyDefinitionWithOptions`](../../../../../generated/storage/types.gen/type-aliases/PropertyDefinitionWithOptions.md)\\>\n\n***\n\n### delete()\n\n> **delete**(): `Promise`\\<`void`\\>\n\nDelete this placement and its cells at the table version last read.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### detail()\n\n> **detail**(): `Promise`\\<[`ColumnDetail`](../../../../../generated/storage/types.gen/type-aliases/ColumnDetail.md)\\>\n\nThe column's record as the API returns it: the placement and the bound\nproperty definition.\n\n#### Returns\n\n`Promise`\\<[`ColumnDetail`](../../../../../generated/storage/types.gen/type-aliases/ColumnDetail.md)\\>\n\n***\n\n### inferType()\n\n> **inferType**(`options`): `Promise`\\<`DatabaseColumn`\\>\n\nSettle the type of an empty column created with inferType enabled.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | [`InferColumnTypeOptions`](../../database/type-aliases/InferColumnTypeOptions.md) |\n\n#### Returns\n\n`Promise`\\<`DatabaseColumn`\\>\n\n***\n\n### isMultiSelect()\n\n> **isMultiSelect**(): `Promise`\\<`boolean`\\>\n\nWhether the column holds multiple values.\n\n#### Returns\n\n`Promise`\\<`boolean`\\>\n\n***\n\n### name()\n\n> **name**(): `Promise`\\<`string`\\>\n\nThe placement's display name, falling back to its property definition.\n\n#### Returns\n\n`Promise`\\<`string`\\>\n\n***\n\n### position()\n\n> **position**(): `Promise`\\<`string`\\>\n\nThe column's fractional index within the table's column order.\n\n#### Returns\n\n`Promise`\\<`string`\\>\n\n***\n\n### rename()\n\n> **rename**(`name`): `Promise`\\<`DatabaseColumn`\\>\n\nRename this placement, only if its last-read name is still current,\nwithout changing its shared property definition.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `name` | `string` |\n\n#### Returns\n\n`Promise`\\<`DatabaseColumn`\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `id`: `string`; `tableId`: `string`; \\}\n\n#### Returns\n\n\\{ `id`: `string`; `tableId`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `id` | `string` |\n| `tableId` | `string` |\n\n***\n\n### byId()\n\n> `static` **byId**(`table`, `id`): `DatabaseColumn`\n\nA handle to a column by id, within a table. Details load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `table` | [`DatabaseTable`](../../table/classes/DatabaseTable.md) |\n| `id` | `string` |\n\n#### Returns\n\n`DatabaseColumn`\n\n\n<!-- src/entities/databases/database/classes/Database.md -->\n# Class: Database\n\nA Macro database: a named collection of tables, owned and shared as one\nentity.\n\nA free-to-construct `(client, id)` handle like any other entity — the schema\nloads lazily on first field access and is dropped after any mutation.\n\n## Extends\n\n- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\\<[`DatabaseDetail`](../../../../../generated/storage/types.gen/type-aliases/DatabaseDetail.md)\\>\n\n## Properties\n\n| Property | Modifier | Type | Description | Inherited from |\n| ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-access\"></a> `access` | `readonly` | [`EntityAccess`](../../../sharing/access/classes/EntityAccess.md) | Access requests and direct user grants. | - |\n| <a id=\"property-createdat\"></a> `createdAt` | `readonly` | () => `Promise`\\<`string`\\> | When the database was created. | - |\n| <a id=\"property-grant\"></a> `grant` | `readonly` | () => `Promise`\\<[`AccessLevel`](../../../../../generated/storage/types.gen/type-aliases/AccessLevel.md)\\> | The caller's access on the database. | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |\n| <a id=\"property-name\"></a> `name` | `readonly` | () => `Promise`\\<`string`\\> | The database's display name. | - |\n| <a id=\"property-owner\"></a> `owner` | `readonly` | () => `Promise`\\<[`User`](../../../users/user/classes/User.md)\\> | The user who owns the database. | - |\n| <a id=\"property-tables\"></a> `tables` | `readonly` | () => `Promise`\\<[`DatabaseTable`](../../table/classes/DatabaseTable.md)[]\\> | The database's tables, in tab order. | - |\n| <a id=\"property-trashedat\"></a> `trashedAt` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | When the database was trashed, if it has been. | - |\n\n## Methods\n\n### addColumn()\n\n> **addColumn**(`table`, `options`): `Promise`\\<[`DatabaseColumn`](../../column/classes/DatabaseColumn.md)\\>\n\nAdd a column to one of the database's tables, under an id minted here,\neither creating a property definition for it or binding an existing one.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `table` | [`DatabaseTable`](../../table/classes/DatabaseTable.md) |\n| `options` | [`AddColumnOptions`](../type-aliases/AddColumnOptions.md) |\n\n#### Returns\n\n`Promise`\\<[`DatabaseColumn`](../../column/classes/DatabaseColumn.md)\\>\n\n***\n\n### addColumnOptions()\n\n> **addColumnOptions**(`column`, `labels`): `Promise`\\<[`OpResultOf`](../type-aliases/OpResultOf.md)\\<`\"column\"`, `\"options_added\"`\\>\\>\n\nAdd select options to one of the database's columns, each under an id\nminted here. Labels the column already has are skipped, so the call is\nsafe to repeat; the result lists the options it did create. Only select\nand tag columns accept options.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `column` | [`DatabaseColumn`](../../column/classes/DatabaseColumn.md) |\n| `labels` | `string`[] |\n\n#### Returns\n\n`Promise`\\<[`OpResultOf`](../type-aliases/OpResultOf.md)\\<`\"column\"`, `\"options_added\"`\\>\\>\n\n***\n\n### applyOps()\n\n> **applyOps**(`ops`, `options?`): `Promise`\\<[`OpResult`](../../../../../generated/storage/types.gen/type-aliases/OpResult.md)[]\\>\n\nApply ops to the database in one transaction: create, rename, reorder,\nor delete tables and columns; change a column's type; add, edit, or\ndelete select options; insert, update, or delete rows; create, change,\nreorder, or delete views; move board cards. Later ops see what earlier\nones did, so a table or column created by one op (under an id the caller\nmints, as a UUIDv7) can be named by the next. A refused op leaves the\nwhole batch unwritten and throws [MacroOpRefusedError](MacroOpRefusedError.md). Returns one\nresult per op, in the order sent.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `ops` | [`DatabaseOp`](../../../../../generated/storage/types.gen/type-aliases/DatabaseOp.md)[] |\n| `options?` | [`ApplyOpsOptions`](../type-aliases/ApplyOpsOptions.md) |\n\n#### Returns\n\n`Promise`\\<[`OpResult`](../../../../../generated/storage/types.gen/type-aliases/OpResult.md)[]\\>\n\n***\n\n### changeColumnType()\n\n> **changeColumnType**(`column`, `options`): `Promise`\\<[`OpResultOf`](../type-aliases/OpResultOf.md)\\<`\"column\"`, `\"type_changed\"`\\>\\>\n\nChange a column's type at the table version last read. Every value must\nconvert: one that does not refuses the change, naming how many and a few\nof them, and nothing is written. To keep the original column, see\n[Database.convertColumnIntoNewColumn](#convertcolumnintonewcolumn).\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `column` | [`DatabaseColumn`](../../column/classes/DatabaseColumn.md) |\n| `options` | [`ChangeColumnTypeOptions`](../type-aliases/ChangeColumnTypeOptions.md) |\n\n#### Returns\n\n`Promise`\\<[`OpResultOf`](../type-aliases/OpResultOf.md)\\<`\"column\"`, `\"type_changed\"`\\>\\>\n\n***\n\n### columnCasts()\n\n> **columnCasts**(`column`): `Promise`\\<[`ColumnCast`](../../../../../generated/storage/types.gen/type-aliases/ColumnCast.md)[]\\>\n\nWhat changing a column to each type would do to its values. Changes\nnothing.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `column` | [`DatabaseColumn`](../../column/classes/DatabaseColumn.md) |\n\n#### Returns\n\n`Promise`\\<[`ColumnCast`](../../../../../generated/storage/types.gen/type-aliases/ColumnCast.md)[]\\>\n\n***\n\n### columnConversion()\n\n> **columnConversion**(`column`, `to`): `Promise`\\<[`ColumnConversion`](../../../../../generated/storage/types.gen/type-aliases/ColumnConversion.md)\\>\n\nWhat a column's values become under another type: the values that\nconvert, the option labels a new select or tag column of that type needs,\nand how many values do not convert. Changes nothing.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `column` | [`DatabaseColumn`](../../column/classes/DatabaseColumn.md) |\n| `to` | [`ColumnType`](../type-aliases/ColumnType.md) |\n\n#### Returns\n\n`Promise`\\<[`ColumnConversion`](../../../../../generated/storage/types.gen/type-aliases/ColumnConversion.md)\\>\n\n***\n\n### convertColumnIntoNewColumn()\n\n> **convertColumnIntoNewColumn**(`column`, `options`): `Promise`\\<[`DatabaseColumn`](../../column/classes/DatabaseColumn.md)\\>\n\nAdd a column of another type right after this one, filled with the\nvalues that convert, in one batch at the table version the conversion\nwas read at. The original column is left as it is; values that do not\nconvert stay only there.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `column` | [`DatabaseColumn`](../../column/classes/DatabaseColumn.md) |\n| `options` | [`ConvertIntoNewColumnOptions`](../type-aliases/ConvertIntoNewColumnOptions.md) |\n\n#### Returns\n\n`Promise`\\<[`DatabaseColumn`](../../column/classes/DatabaseColumn.md)\\>\n\n***\n\n### createTable()\n\n> **createTable**(`options`): `Promise`\\<[`DatabaseTable`](../../table/classes/DatabaseTable.md)\\>\n\nCreate a table in the database, under an id minted here.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | \\{ `name`: `string`; \\} |\n| `options.name` | `string` |\n\n#### Returns\n\n`Promise`\\<[`DatabaseTable`](../../table/classes/DatabaseTable.md)\\>\n\n***\n\n### createWebhook()\n\n> **createWebhook**(`table`): `Promise`\\<\\{ `token`: `string`; `webhook`: [`DatabaseWebhook`](../../webhook/classes/DatabaseWebhook.md); \\}\\>\n\nCreate a webhook that inserts rows into `table`, writing with the\ncaller's access. POST a JSON object (one row) or an array of objects to\n`/databases/webhooks/{token}` on the storage service; keys name columns.\nThe token is the whole credential and is answered only here.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `table` | [`DatabaseTable`](../../table/classes/DatabaseTable.md) |\n\n#### Returns\n\n`Promise`\\<\\{ `token`: `string`; `webhook`: [`DatabaseWebhook`](../../webhook/classes/DatabaseWebhook.md); \\}\\>\n\n***\n\n### deleteColumn()\n\n> **deleteColumn**(`column`): `Promise`\\<`number`\\>\n\nRemove a column and its cells at the table version last read. Returns\nthe table's new version.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `column` | [`DatabaseColumn`](../../column/classes/DatabaseColumn.md) |\n\n#### Returns\n\n`Promise`\\<`number`\\>\n\n***\n\n### deleteTable()\n\n> **deleteTable**(`table`): `Promise`\\<`void`\\>\n\nDelete one of the database's tables with its columns, rows, and views.\nA database keeps at least one table, and a table another table's\nrelation column points at cannot be deleted.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `table` | [`DatabaseTable`](../../table/classes/DatabaseTable.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### deleteWebhook()\n\n> **deleteWebhook**(`webhook`): `Promise`\\<`void`\\>\n\nDelete one of the database's webhooks; its URL stops working.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `webhook` | [`DatabaseWebhook`](../../webhook/classes/DatabaseWebhook.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### importTable()\n\n> **importTable**(`request`): `Promise`\\<[`DatabaseTable`](../../table/classes/DatabaseTable.md)\\>\n\nImport text rows atomically. Keep requestId unchanged when retrying.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `request` | [`ImportTable`](../../../../../generated/storage/types.gen/type-aliases/ImportTable.md) |\n\n#### Returns\n\n`Promise`\\<[`DatabaseTable`](../../table/classes/DatabaseTable.md)\\>\n\n***\n\n### inferColumnType()\n\n> **inferColumnType**(`column`, `options`): `Promise`\\<[`InferColumnTypeOutcome`](../../../../../generated/storage/types.gen/type-aliases/InferColumnTypeOutcome.md)\\>\n\nAdopt a first-value type only while the owned column is empty and inferable.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `column` | [`DatabaseColumn`](../../column/classes/DatabaseColumn.md) |\n| `options` | [`InferColumnTypeOptions`](../type-aliases/InferColumnTypeOptions.md) |\n\n#### Returns\n\n`Promise`\\<[`InferColumnTypeOutcome`](../../../../../generated/storage/types.gen/type-aliases/InferColumnTypeOutcome.md)\\>\n\n***\n\n### query()\n\n> **query**(`sql`, `options?`): `Promise`\\<[`DatabaseQueryResult`](../../query/interfaces/DatabaseQueryResult.md)\\>\n\nRun one SQL statement with this database as the default name scope.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `sql` | `string` |\n| `options?` | `Omit`\\<[`DatabaseQueryOptions`](../../query/interfaces/DatabaseQueryOptions.md), `\"database\"`\\> |\n\n#### Returns\n\n`Promise`\\<[`DatabaseQueryResult`](../../query/interfaces/DatabaseQueryResult.md)\\>\n\n***\n\n### renameColumn()\n\n> **renameColumn**(`column`, `name`): `Promise`\\<`number`\\>\n\nRename this column placement, only if its last-read name is still\ncurrent, without changing its shared property definition. Returns the\ntable's new version.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `column` | [`DatabaseColumn`](../../column/classes/DatabaseColumn.md) |\n| `name` | `string` |\n\n#### Returns\n\n`Promise`\\<`number`\\>\n\n***\n\n### renameTable()\n\n> **renameTable**(`table`, `name`): `Promise`\\<`number`\\>\n\nRename a table only if its last-read name is still current. Returns the\ntable's new version.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `table` | [`DatabaseTable`](../../table/classes/DatabaseTable.md) |\n| `name` | `string` |\n\n#### Returns\n\n`Promise`\\<`number`\\>\n\n***\n\n### reorderColumns()\n\n> **reorderColumns**(`table`, `columns`): `Promise`\\<`number`\\>\n\nPersist a complete column order at the table version last read. Pass\nevery column of the table exactly once.\nReturns the table's new version.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `table` | [`DatabaseTable`](../../table/classes/DatabaseTable.md) |\n| `columns` | [`DatabaseColumn`](../../column/classes/DatabaseColumn.md)[] |\n\n#### Returns\n\n`Promise`\\<`number`\\>\n\n***\n\n### reorderTables()\n\n> **reorderTables**(`tables`): `Promise`\\<[`DatabaseTable`](../../table/classes/DatabaseTable.md)[]\\>\n\nPersist a new tab order. Pass every table of the database exactly once.\nReturns the tables in their new order.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `tables` | [`DatabaseTable`](../../table/classes/DatabaseTable.md)[] |\n\n#### Returns\n\n`Promise`\\<[`DatabaseTable`](../../table/classes/DatabaseTable.md)[]\\>\n\n***\n\n### rowHistory()\n\n> **rowHistory**(`row`): `Promise`\\<[`RowHistoryEntry`](../../../../../generated/storage/types.gen/type-aliases/RowHistoryEntry.md)[]\\>\n\nA row's history: every committed change that touched it, newest first.\nSee [DatabaseRow.history](../../row/classes/DatabaseRow.md#history).\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `row` | [`DatabaseRow`](../../row/classes/DatabaseRow.md) |\n\n#### Returns\n\n`Promise`\\<[`RowHistoryEntry`](../../../../../generated/storage/types.gen/type-aliases/RowHistoryEntry.md)[]\\>\n\n***\n\n### schema()\n\n> **schema**(): `Promise`\\<[`DatabaseDetail`](../../../../../generated/storage/types.gen/type-aliases/DatabaseDetail.md)\\>\n\nThe full schema: the database record, the caller's access, and every\ntable with its columns and views. Cached until the next write.\n\n#### Returns\n\n`Promise`\\<[`DatabaseDetail`](../../../../../generated/storage/types.gen/type-aliases/DatabaseDetail.md)\\>\n\n***\n\n### sharePermissions()\n\n> **sharePermissions**(): `Promise`\\<[`SharePermissionV2`](../../../../../generated/storage/types.gen/type-aliases/SharePermissionV2.md)\\>\n\nRead direct recipients. Only the database owner can manage sharing.\n\n#### Returns\n\n`Promise`\\<[`SharePermissionV2`](../../../../../generated/storage/types.gen/type-aliases/SharePermissionV2.md)\\>\n\n***\n\n### table()\n\n> **table**(`name`): `Promise`\\<[`DatabaseTable`](../../table/classes/DatabaseTable.md) \\| `undefined`\\>\n\nThe table with the given display name, or `undefined` if there is none.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `name` | `string` |\n\n#### Returns\n\n`Promise`\\<[`DatabaseTable`](../../table/classes/DatabaseTable.md) \\| `undefined`\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`DatabaseDetail`](../../../../../generated/storage/types.gen/type-aliases/DatabaseDetail.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`DatabaseDetail`](../../../../../generated/storage/types.gen/type-aliases/DatabaseDetail.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`DatabaseDetail`](../../../../../generated/storage/types.gen/type-aliases/DatabaseDetail.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)\n\n***\n\n### updateSharePermissions()\n\n> **updateSharePermissions**(`request`): `Promise`\\<[`SharePermissionV2`](../../../../../generated/storage/types.gen/type-aliases/SharePermissionV2.md)\\>\n\nAdd, replace, or remove recipient grants without transferring ownership.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `request` | [`UpdateSharePermissionRequestV2`](../../../../../generated/storage/types.gen/type-aliases/UpdateSharePermissionRequestV2.md) |\n\n#### Returns\n\n`Promise`\\<[`SharePermissionV2`](../../../../../generated/storage/types.gen/type-aliases/SharePermissionV2.md)\\>\n\n***\n\n### viewPositions()\n\n> **viewPositions**(`view`): `Promise`\\<[`CardPosition`](../../../../../generated/storage/types.gen/type-aliases/CardPosition.md)[]\\>\n\nWhere a board view's cards sit: each placed card's lane and key.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `view` | [`DatabaseView`](../../view/classes/DatabaseView.md) |\n\n#### Returns\n\n`Promise`\\<[`CardPosition`](../../../../../generated/storage/types.gen/type-aliases/CardPosition.md)[]\\>\n\n***\n\n### webhooks()\n\n> **webhooks**(): `Promise`\\<[`DatabaseWebhook`](../../webhook/classes/DatabaseWebhook.md)[]\\>\n\nThe database's webhooks, oldest first. Takes edit access.\n\n#### Returns\n\n`Promise`\\<[`DatabaseWebhook`](../../webhook/classes/DatabaseWebhook.md)[]\\>\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `id`): `Database`\n\nA handle to a database by id. Details load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `id` | `string` |\n\n#### Returns\n\n`Database`\n\n***\n\n### create()\n\n> `static` **create**(`client`, `options`): `Promise`\\<`Database`\\>\n\nCreate a database owned by the caller.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `options` | \\{ `name`: `string`; \\} |\n| `options.name` | `string` |\n\n#### Returns\n\n`Promise`\\<`Database`\\>\n\n***\n\n### list()\n\n> `static` **list**(`client`): `Promise`\\<`Database`[]\\>\n\nThe databases the caller can see, each with the caller's access level.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`Promise`\\<`Database`[]\\>\n\n\n<!-- src/entities/databases/database/classes/MacroOpRefusedError.md -->\n# Class: MacroOpRefusedError\n\nA batch of ops was refused (HTTP 400): nothing in it was written. Names the\nop at fault and, when the batch minted an id that already names something\n(a retry of a batch that committed, or an id minted twice), that id.\n\n## Extends\n\n- [`MacroApiError`](../../../../utils/unwrap/classes/MacroApiError.md)\n\n## Constructors\n\n### Constructor\n\n> **new MacroOpRefusedError**(`status`, `refusal`): `MacroOpRefusedError`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `status` | `number` |\n| `refusal` | [`OpRefusalResponse`](../../../../../generated/storage/types.gen/type-aliases/OpRefusalResponse.md) |\n\n#### Returns\n\n`MacroOpRefusedError`\n\n#### Overrides\n\n[`MacroApiError`](../../../../utils/unwrap/classes/MacroApiError.md).[`constructor`](../../../../utils/unwrap/classes/MacroApiError.md#constructor)\n\n## Properties\n\n| Property | Modifier | Type | Description | Inherited from |\n| ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-column\"></a> `column` | `readonly` | `string` \\| `null` | The column placement at fault, when one is. | - |\n| <a id=\"property-data\"></a> `data` | `readonly` | `unknown` | - | [`MacroApiError`](../../../../utils/unwrap/classes/MacroApiError.md).[`data`](../../../../utils/unwrap/classes/MacroApiError.md#property-data) |\n| <a id=\"property-op\"></a> `op` | `readonly` | `number` | The refused op's index in the batch. | - |\n| <a id=\"property-row\"></a> `row` | `readonly` | `number` \\| `null` | The row's index within the op, when one row is at fault. | - |\n| <a id=\"property-status\"></a> `status` | `readonly` | `number` | - | [`MacroApiError`](../../../../utils/unwrap/classes/MacroApiError.md).[`status`](../../../../utils/unwrap/classes/MacroApiError.md#property-status) |\n| <a id=\"property-taken\"></a> `taken` | `readonly` | [`TakenId`](../../../../../generated/storage/types.gen/type-aliases/TakenId.md) \\| `null` | The minted id that is already taken, when that is the reason. | - |\n\n\n<!-- src/entities/databases/database/type-aliases/AddColumnOptions.md -->\n# Type Alias: AddColumnOptions\n\n> **AddColumnOptions** = \\{ `inferType?`: `boolean`; `name`: `string`; `options?`: `string`[]; `type`: [`ColumnType`](ColumnType.md); \\} \\| \\{ `property`: [`PropertyDefinition`](../../../properties/property-definition/classes/PropertyDefinition.md); \\} & \\{ `after?`: [`DatabaseColumn`](../../column/classes/DatabaseColumn.md); \\}\n\nOptions for [Database.addColumn](../classes/Database.md#addcolumn).\n\n## Type Declaration\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `after?` | [`DatabaseColumn`](../../column/classes/DatabaseColumn.md) | The column the new one goes right after; by default, the last one. |\n\n\n<!-- src/entities/databases/database/type-aliases/ApplyOpsOptions.md -->\n# Type Alias: ApplyOpsOptions\n\n> **ApplyOpsOptions** = \\{ `baseVersions?`: \\{ `table`: [`DatabaseTable`](../../table/classes/DatabaseTable.md); `version`: [`TableVersion`](../../../../../generated/storage/types.gen/type-aliases/TableVersion.md); \\}[]; \\}\n\nOptions for [Database.applyOps](../classes/Database.md#applyops).\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-baseversions\"></a> `baseVersions?` | \\{ `table`: [`DatabaseTable`](../../table/classes/DatabaseTable.md); `version`: [`TableVersion`](../../../../../generated/storage/types.gen/type-aliases/TableVersion.md); \\}[] | The version each table must still be at, as the caller read it. A table that moved refuses the whole batch with a 409, so an edit made against what the caller saw does not overwrite another's. |\n\n\n<!-- src/entities/databases/database/type-aliases/ChangeColumnTypeOptions.md -->\n# Type Alias: ChangeColumnTypeOptions\n\n> **ChangeColumnTypeOptions** = \\{ `to`: [`ColumnType`](ColumnType.md); \\}\n\nOptions for [Database.changeColumnType](../classes/Database.md#changecolumntype).\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-to\"></a> `to` | [`ColumnType`](ColumnType.md) | The type to change the column to. |\n\n\n<!-- src/entities/databases/database/type-aliases/ColumnType.md -->\n# Type Alias: ColumnType\n\n> **ColumnType** = `Exclude`\\<[`ColumnKind`](../../../../../generated/storage/types.gen/type-aliases/ColumnKind.md), \\{ `type`: `\"relation\"`; \\}\\> \\| \\{ `table`: [`DatabaseTable`](../../table/classes/DatabaseTable.md); `type`: `\"relation\"`; \\}\n\nA type a column can have. A relation names the related table by handle;\nthe table may live in any database the caller can reach.\n\n\n<!-- src/entities/databases/database/type-aliases/ConvertIntoNewColumnOptions.md -->\n# Type Alias: ConvertIntoNewColumnOptions\n\n> **ConvertIntoNewColumnOptions** = \\{ `name?`: `string`; `to`: [`ColumnType`](ColumnType.md); \\}\n\nOptions for [Database.convertColumnIntoNewColumn](../classes/Database.md#convertcolumnintonewcolumn).\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-name\"></a> `name?` | `string` | Display name of the new column; by default the original's name followed by the type, as in `Due (Date)`. |\n| <a id=\"property-to\"></a> `to` | [`ColumnType`](ColumnType.md) | The type of the new column. |\n\n\n<!-- src/entities/databases/database/type-aliases/InferColumnTypeOptions.md -->\n# Type Alias: InferColumnTypeOptions\n\n> **InferColumnTypeOptions** = \\{ `baseVersion`: [`TableVersion`](../../../../../generated/storage/types.gen/type-aliases/TableVersion.md); `dataType`: `\"STRING\"` \\| `\"NUMBER\"` \\| `\"ENTITY\"`; `specificEntityType?`: [`InferColumnTypeRequest`](../../../../../generated/storage/types.gen/type-aliases/InferColumnTypeRequest.md)\\[`\"specificEntityType\"`\\]; \\}\n\nSettle an empty inferred column using the table version the caller read.\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-baseversion\"></a> `baseVersion` | [`TableVersion`](../../../../../generated/storage/types.gen/type-aliases/TableVersion.md) |\n| <a id=\"property-datatype\"></a> `dataType` | `\"STRING\"` \\| `\"NUMBER\"` \\| `\"ENTITY\"` |\n| <a id=\"property-specificentitytype\"></a> `specificEntityType?` | [`InferColumnTypeRequest`](../../../../../generated/storage/types.gen/type-aliases/InferColumnTypeRequest.md)\\[`\"specificEntityType\"`\\] |\n\n\n<!-- src/entities/databases/database/type-aliases/OpResultOf.md -->\n# Type Alias: OpResultOf\\<Kind, Change\\>\n\n> **OpResultOf**\\<`Kind`, `Change`\\> = `Extract`\\<`ChangedResult`, \\{ `kind`: `Kind`; \\}\\> & \\{ `change`: `Extract`\\<`Extract`\\<`ChangedResult`, \\{ `kind`: `Kind`; \\}\\>\\[`\"change\"`\\], \\{ `kind`: `Change`; \\}\\>; \\}\n\nThe result of a `Kind` op whose change answered `Change`.\n\n## Type Parameters\n\n| Type Parameter |\n| ------ |\n| <a id=\"type-parameter-kind\"></a> `Kind` *extends* keyof `ResultChanges` |\n| <a id=\"type-parameter-change\"></a> `Change` *extends* `ResultChanges`\\[`Kind`\\] |\n\n## Type Declaration\n\n| Name | Type |\n| ------ | ------ |\n| `change` | `Extract`\\<`Extract`\\<`ChangedResult`, \\{ `kind`: `Kind`; \\}\\>\\[`\"change\"`\\], \\{ `kind`: `Change`; \\}\\> |\n\n\n<!-- src/entities/databases/namespace/classes/DatabaseNamespace.md -->\n# Class: DatabaseNamespace\n\nMacro databases: named collections of tables, owned and shared as one\nentity.\n\n## Constructors\n\n### Constructor\n\n> **new DatabaseNamespace**(`client`): `DatabaseNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`DatabaseNamespace`\n\n## Methods\n\n### byId()\n\n> **byId**(`id`): [`Database`](../../database/classes/Database.md)\n\nA handle to a database by id. Details load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`Database`](../../database/classes/Database.md)\n\n***\n\n### create()\n\n> **create**(`options`): `Promise`\\<[`Database`](../../database/classes/Database.md)\\>\n\nCreate a database owned by the caller.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | \\{ `name`: `string`; \\} |\n| `options.name` | `string` |\n\n#### Returns\n\n`Promise`\\<[`Database`](../../database/classes/Database.md)\\>\n\n***\n\n### list()\n\n> **list**(): `Promise`\\<[`Database`](../../database/classes/Database.md)[]\\>\n\nThe databases the caller can see.\n\n#### Returns\n\n`Promise`\\<[`Database`](../../database/classes/Database.md)[]\\>\n\n***\n\n### query()\n\n> **query**(`sql`, `options?`): `Promise`\\<[`DatabaseQueryResult`](../../query/interfaces/DatabaseQueryResult.md)\\>\n\nRun one SQL statement over the caller's visible databases. Writes execute once.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `sql` | `string` |\n| `options?` | [`DatabaseQueryOptions`](../../query/interfaces/DatabaseQueryOptions.md) |\n\n#### Returns\n\n`Promise`\\<[`DatabaseQueryResult`](../../query/interfaces/DatabaseQueryResult.md)\\>\n\n\n<!-- src/entities/databases/query/interfaces/DatabaseQueryOptions.md -->\n# Interface: DatabaseQueryOptions\n\nScope and optimistic concurrency for one SQL statement.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-baseversions\"></a> `baseVersions?` | [`QueryTableVersion`](QueryTableVersion.md)[] | Refuse writes if these tables changed since they were read. |\n| <a id=\"property-database\"></a> `database?` | [`Database`](../../database/classes/Database.md) | Default database for unqualified table names; visible databases remain joinable. |\n\n\n<!-- src/entities/databases/query/interfaces/DatabaseQueryResult.md -->\n# Interface: DatabaseQueryResult\n\nThe committed outcome of one statement; write calls are never automatically retried.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-changesapplied\"></a> `changesApplied` | `number` | Number of changes committed by the statement. |\n| <a id=\"property-insertedrows\"></a> `insertedRows` | [`DatabaseRow`](../../row/classes/DatabaseRow.md)[] | Handles for newly inserted rows, in insertion order. |\n| <a id=\"property-newversions\"></a> `newVersions` | [`QueryTableVersion`](QueryTableVersion.md)[] | Versions of tables after committed writes. |\n| <a id=\"property-readversions\"></a> `readVersions` | [`QueryTableVersion`](QueryTableVersion.md)[] | Observed table versions, reusable as guards for a later write. |\n| <a id=\"property-result\"></a> `result?` | [`QueryResultSet`](QueryResultSet.md) | Returned result set, when the statement produces one. |\n| <a id=\"property-statement\"></a> `statement` | [`QueryStatement`](../type-aliases/QueryStatement.md) | Statement classification with typed handles for its targets. |\n| <a id=\"property-truncatedtables\"></a> `truncatedTables` | `string`[] | SQL table names whose input hit the server row cap; aggregates may be partial. |\n\n\n<!-- src/entities/databases/query/interfaces/QueryResultSet.md -->\n# Interface: QueryResultSet\n\nSQL returns dynamically shaped, discriminated cells and optional source row handles.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-columns\"></a> `columns` | [`QueryColumn`](../type-aliases/QueryColumn.md)[] | Ordered metadata corresponding to each cell in a result row. |\n| <a id=\"property-rowhandles\"></a> `rowHandles` | [`DatabaseRow`](../../row/classes/DatabaseRow.md)[] | Source row handles in result order; empty for aggregates and virtual tables. |\n| <a id=\"property-rows\"></a> `rows` | ([`SqlCell`](../../../../../generated/storage/types.gen/type-aliases/SqlCell.md) \\| `null`)[][] | Dynamic tagged cells in column order; empty cells are null. |\n| <a id=\"property-sourcetable\"></a> `sourceTable?` | [`DatabaseTable`](../../table/classes/DatabaseTable.md) | Persisted source table when results correspond to individual rows. |\n\n\n<!-- src/entities/databases/query/interfaces/QueryTableVersion.md -->\n# Interface: QueryTableVersion\n\nA version observed on a typed table handle, reusable as a write guard.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-table\"></a> `table` | [`DatabaseTable`](../../table/classes/DatabaseTable.md) | Table whose version was observed. |\n| <a id=\"property-version\"></a> `version` | `number` | Opaque version to pass back as an optimistic write guard. |\n\n\n<!-- src/entities/databases/query/type-aliases/QueryColumn.md -->\n# Type Alias: QueryColumn\n\n> **QueryColumn** = `Omit`\\<[`ResultColumn`](../../../../../generated/storage/types.gen/type-aliases/ResultColumn.md), `\"relatedTable\"`\\> & \\{ `relatedTable?`: [`DatabaseTable`](../../table/classes/DatabaseTable.md); \\}\n\nResult column metadata, including a typed relation target when visible.\n\n## Type Declaration\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `relatedTable?` | [`DatabaseTable`](../../table/classes/DatabaseTable.md) | Visible target table for a relation column. |\n\n\n<!-- src/entities/databases/query/type-aliases/QueryStatement.md -->\n# Type Alias: QueryStatement\n\n> **QueryStatement** = `Extract`\\<[`SqlStatement`](../../../../../generated/storage/types.gen/type-aliases/SqlStatement.md), \\{ `kind`: `\"select\"`; \\}\\> \\| \\{ `database`: [`Database`](../../database/classes/Database.md); `kind`: `\"schema\"`; `summary`: `string`; \\} \\| \\{ `kind`: `\"insert\"` \\| `\"update\"` \\| `\"delete\"`; `table`: [`DatabaseTable`](../../table/classes/DatabaseTable.md); `tableName`: `string`; \\} \\| \\{ `column`: [`DatabaseColumn`](../../column/classes/DatabaseColumn.md); `columnName`: `string`; `kind`: `\"alterColumnType\"`; `table`: [`DatabaseTable`](../../table/classes/DatabaseTable.md); `tableName`: `string`; `to`: `string`; \\}\n\nWhat ran, with typed handles for resources written by the statement.\n\n## Union Members\n\n`Extract`\\<[`SqlStatement`](../../../../../generated/storage/types.gen/type-aliases/SqlStatement.md), \\{ `kind`: `\"select\"`; \\}\\>\n\n***\n\n### Type Literal\n\n\\{ `database`: [`Database`](../../database/classes/Database.md); `kind`: `\"schema\"`; `summary`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `database` | [`Database`](../../database/classes/Database.md) | Database whose schema changed. |\n| `kind` | `\"schema\"` | Schema change discriminator. |\n| `summary` | `string` | Human-readable description of the schema change. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"insert\"` \\| `\"update\"` \\| `\"delete\"`; `table`: [`DatabaseTable`](../../table/classes/DatabaseTable.md); `tableName`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"insert\"` \\| `\"update\"` \\| `\"delete\"` | Row mutation discriminator. |\n| `table` | [`DatabaseTable`](../../table/classes/DatabaseTable.md) | Table targeted by the mutation, including zero-match writes. |\n| `tableName` | `string` | SQL name of the target table. |\n\n***\n\n### Type Literal\n\n\\{ `column`: [`DatabaseColumn`](../../column/classes/DatabaseColumn.md); `columnName`: `string`; `kind`: `\"alterColumnType\"`; `table`: [`DatabaseTable`](../../table/classes/DatabaseTable.md); `tableName`: `string`; `to`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `column` | [`DatabaseColumn`](../../column/classes/DatabaseColumn.md) | Column whose type changed. |\n| `columnName` | `string` | SQL name of the changed column. |\n| `kind` | `\"alterColumnType\"` | Column type change discriminator. |\n| `table` | [`DatabaseTable`](../../table/classes/DatabaseTable.md) | Table containing the changed column. |\n| `tableName` | `string` | SQL name of the target table. |\n| `to` | `string` | SQL type requested by the statement. |\n\n\n<!-- src/entities/databases/row/classes/DatabaseRow.md -->\n# Class: DatabaseRow\n\nOne row of a [DatabaseTable](../../table/classes/DatabaseTable.md).\n\nA row is not an entity of its own — it is owned and shared as part of its\ndatabase. Its cells are written with ops; see Database.applyOps.\n\n## Properties\n\n| Property | Modifier | Type | Description |\n| ------ | ------ | ------ | ------ |\n| <a id=\"property-id\"></a> `id` | `readonly` | `string` | Identifier of the row. |\n| <a id=\"property-table\"></a> `table` | `readonly` | [`DatabaseTable`](../../table/classes/DatabaseTable.md) | The table this row belongs to. |\n\n## Methods\n\n### history()\n\n> **history**(): `Promise`\\<[`RowHistoryEntry`](../../../../../generated/storage/types.gen/type-aliases/RowHistoryEntry.md)[]\\>\n\nEvery committed change that touched the row, newest first: who made it,\nwhen, how, and the values of the columns it touched before and after.\nA removed row's history still reads.\n\n#### Returns\n\n`Promise`\\<[`RowHistoryEntry`](../../../../../generated/storage/types.gen/type-aliases/RowHistoryEntry.md)[]\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `id`: `string`; `tableId`: `string`; \\}\n\n#### Returns\n\n\\{ `id`: `string`; `tableId`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `id` | `string` |\n| `tableId` | `string` |\n\n***\n\n### byId()\n\n> `static` **byId**(`table`, `id`): `DatabaseRow`\n\nA handle to a row by id, within a table.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `table` | [`DatabaseTable`](../../table/classes/DatabaseTable.md) |\n| `id` | `string` |\n\n#### Returns\n\n`DatabaseRow`\n\n\n<!-- src/entities/databases/table/classes/DatabaseTable.md -->\n# Class: DatabaseTable\n\nOne table (tab) of a [Database](../../database/classes/Database.md).\n\nA table is not an entity of its own — it is owned and shared as part of its\ndatabase, and has no endpoint to read it directly. The handle resolves\nthrough [Database.schema](../../database/classes/Database.md#schema), so reads after a write see the new state.\n\n## Properties\n\n| Property | Modifier | Type | Description |\n| ------ | ------ | ------ | ------ |\n| <a id=\"property-database\"></a> `database` | `readonly` | [`Database`](../../database/classes/Database.md) | The database this table belongs to. |\n| <a id=\"property-id\"></a> `id` | `readonly` | `string` | Identifier of the table. |\n\n## Methods\n\n### addColumn()\n\n> **addColumn**(`options`): `Promise`\\<[`DatabaseColumn`](../../column/classes/DatabaseColumn.md)\\>\n\nAdd a column to this table. See [Database.addColumn](../../database/classes/Database.md#addcolumn).\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | [`AddColumnOptions`](../../database/type-aliases/AddColumnOptions.md) |\n\n#### Returns\n\n`Promise`\\<[`DatabaseColumn`](../../column/classes/DatabaseColumn.md)\\>\n\n***\n\n### columns()\n\n> **columns**(): `Promise`\\<[`DatabaseColumn`](../../column/classes/DatabaseColumn.md)[]\\>\n\nThe table's columns, in display order.\n\n#### Returns\n\n`Promise`\\<[`DatabaseColumn`](../../column/classes/DatabaseColumn.md)[]\\>\n\n***\n\n### createWebhook()\n\n> **createWebhook**(): `Promise`\\<\\{ `token`: `string`; `webhook`: [`DatabaseWebhook`](../../webhook/classes/DatabaseWebhook.md); \\}\\>\n\nCreate a webhook that inserts rows here. See [Database.createWebhook](../../database/classes/Database.md#createwebhook).\n\n#### Returns\n\n`Promise`\\<\\{ `token`: `string`; `webhook`: [`DatabaseWebhook`](../../webhook/classes/DatabaseWebhook.md); \\}\\>\n\n***\n\n### delete()\n\n> **delete**(): `Promise`\\<`void`\\>\n\nDelete this table. See [Database.deleteTable](../../database/classes/Database.md#deletetable).\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### detail()\n\n> **detail**(): `Promise`\\<[`TableDetail`](../../../../../generated/storage/types.gen/type-aliases/TableDetail.md)\\>\n\nThe table's record as the API returns it: the table, its columns, and\nits views.\n\n#### Returns\n\n`Promise`\\<[`TableDetail`](../../../../../generated/storage/types.gen/type-aliases/TableDetail.md)\\>\n\n***\n\n### name()\n\n> **name**(): `Promise`\\<`string`\\>\n\nThe table's display name.\n\n#### Returns\n\n`Promise`\\<`string`\\>\n\n***\n\n### position()\n\n> **position**(): `Promise`\\<`string`\\>\n\nThe table's fractional index within the database's tab order.\n\n#### Returns\n\n`Promise`\\<`string`\\>\n\n***\n\n### rename()\n\n> **rename**(`name`): `Promise`\\<`DatabaseTable`\\>\n\nRename only if the last-read display name is still current.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `name` | `string` |\n\n#### Returns\n\n`Promise`\\<`DatabaseTable`\\>\n\n***\n\n### reorderColumns()\n\n> **reorderColumns**(`columns`): `Promise`\\<`DatabaseTable`\\>\n\nPersist a new column order. See [Database.reorderColumns](../../database/classes/Database.md#reordercolumns).\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `columns` | [`DatabaseColumn`](../../column/classes/DatabaseColumn.md)[] |\n\n#### Returns\n\n`Promise`\\<`DatabaseTable`\\>\n\n***\n\n### row()\n\n> **row**(`id`): [`DatabaseRow`](../../row/classes/DatabaseRow.md)\n\nA handle to one of the table's rows, by the id an insert answered.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`DatabaseRow`](../../row/classes/DatabaseRow.md)\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `databaseId`: `string`; `id`: `string`; \\}\n\n#### Returns\n\n\\{ `databaseId`: `string`; `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `databaseId` | `string` |\n| `id` | `string` |\n\n***\n\n### version()\n\n> **version**(): `Promise`\\<`number`\\>\n\nThe table's current version, bumped by every committed change to its\nschema or rows. Schema edits such as [reorderColumns](#reordercolumns) send it as\nthe base version they were made against, so a table that moved since\nrefuses the edit with a 409.\n\n#### Returns\n\n`Promise`\\<`number`\\>\n\n***\n\n### views()\n\n> **views**(): `Promise`\\<[`DatabaseView`](../../view/classes/DatabaseView.md)[]\\>\n\nThe table's views, in their order.\n\n#### Returns\n\n`Promise`\\<[`DatabaseView`](../../view/classes/DatabaseView.md)[]\\>\n\n***\n\n### byId()\n\n> `static` **byId**(`database`, `id`): `DatabaseTable`\n\nA handle to a table by id, within a database. Details load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `database` | [`Database`](../../database/classes/Database.md) |\n| `id` | `string` |\n\n#### Returns\n\n`DatabaseTable`\n\n\n<!-- src/entities/databases/view/classes/DatabaseView.md -->\n# Class: DatabaseView\n\nOne view of a [DatabaseTable](../../table/classes/DatabaseTable.md): which of its rows to show, in what\norder, drawn as a table or a board.\n\nA view is not an entity of its own — it is owned and shared as part of its\ndatabase. The handle resolves through the database's schema, so a fresh\nread after a write sees the new value. Views are created, changed, and\nreordered with ops; see Database.applyOps.\n\n## Properties\n\n| Property | Modifier | Type | Description |\n| ------ | ------ | ------ | ------ |\n| <a id=\"property-id\"></a> `id` | `readonly` | `string` | Identifier of the view. |\n| <a id=\"property-table\"></a> `table` | `readonly` | [`DatabaseTable`](../../table/classes/DatabaseTable.md) | The table this view shows. |\n\n## Methods\n\n### detail()\n\n> **detail**(): `Promise`\\<[`DatabaseView`](../../../../../generated/storage/types.gen/type-aliases/DatabaseView.md)\\>\n\nThe view's record as the API returns it.\n\n#### Returns\n\n`Promise`\\<[`DatabaseView`](../../../../../generated/storage/types.gen/type-aliases/DatabaseView.md)\\>\n\n***\n\n### layout()\n\n> **layout**(): `Promise`\\<[`ViewLayout`](../../../../../generated/storage/types.gen/type-aliases/ViewLayout.md)\\>\n\nHow the view draws its rows: a table, or a board grouped by a column.\n\n#### Returns\n\n`Promise`\\<[`ViewLayout`](../../../../../generated/storage/types.gen/type-aliases/ViewLayout.md)\\>\n\n***\n\n### name()\n\n> **name**(): `Promise`\\<`string`\\>\n\nThe view's name, unique among its table's views ignoring case.\n\n#### Returns\n\n`Promise`\\<`string`\\>\n\n***\n\n### position()\n\n> **position**(): `Promise`\\<`string`\\>\n\nThe view's fractional index within its table's views.\n\n#### Returns\n\n`Promise`\\<`string`\\>\n\n***\n\n### positions()\n\n> **positions**(): `Promise`\\<[`CardPosition`](../../../../../generated/storage/types.gen/type-aliases/CardPosition.md)[]\\>\n\nWhere a board's cards sit: each placed card's lane and its key there.\nCards without a place show after the placed ones of their lane, oldest\nfirst.\n\n#### Returns\n\n`Promise`\\<[`CardPosition`](../../../../../generated/storage/types.gen/type-aliases/CardPosition.md)[]\\>\n\n***\n\n### query()\n\n> **query**(): `Promise`\\<[`ViewQuery`](../../../../../generated/storage/types.gen/type-aliases/ViewQuery.md)\\>\n\nWhich rows the view shows, and in what order.\n\n#### Returns\n\n`Promise`\\<[`ViewQuery`](../../../../../generated/storage/types.gen/type-aliases/ViewQuery.md)\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `id`: `string`; `tableId`: `string`; \\}\n\n#### Returns\n\n\\{ `id`: `string`; `tableId`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `id` | `string` |\n| `tableId` | `string` |\n\n***\n\n### byId()\n\n> `static` **byId**(`table`, `id`): `DatabaseView`\n\nA handle to a view by id, within a table. Details load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `table` | [`DatabaseTable`](../../table/classes/DatabaseTable.md) |\n| `id` | `string` |\n\n#### Returns\n\n`DatabaseView`\n\n\n<!-- src/entities/databases/webhook/classes/DatabaseWebhook.md -->\n# Class: DatabaseWebhook\n\nA webhook of a [DatabaseTable](../../table/classes/DatabaseTable.md): a secret URL that anyone holding it\ncan POST JSON to, each object becoming a row, written with the access of\nthe user who created it. Its token is shown only when it is created; see\nDatabase.createWebhook.\n\n## Properties\n\n| Property | Modifier | Type | Description |\n| ------ | ------ | ------ | ------ |\n| <a id=\"property-createdby\"></a> `createdBy` | `readonly` | [`User`](../../../users/user/classes/User.md) | Who created it; its calls write with their access. |\n| <a id=\"property-id\"></a> `id` | `readonly` | `string` | Identifier of the webhook. |\n| <a id=\"property-table\"></a> `table` | `readonly` | [`DatabaseTable`](../../table/classes/DatabaseTable.md) | The table its calls insert rows into. |\n\n## Accessors\n\n### createdAt\n\n#### Get Signature\n\n> **get** **createdAt**(): `string`\n\nWhen it was created.\n\n##### Returns\n\n`string`\n\n***\n\n### tokenPrefix\n\n#### Get Signature\n\n> **get** **tokenPrefix**(): `string`\n\nThe token's first characters, to tell webhooks apart without the secret.\n\n##### Returns\n\n`string`\n\n## Methods\n\n### delete()\n\n> **delete**(): `Promise`\\<`void`\\>\n\nDelete the webhook; its URL stops working.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `id`: `string`; `tableId`: `string`; `tokenPrefix`: `string`; \\}\n\n#### Returns\n\n\\{ `id`: `string`; `tableId`: `string`; `tokenPrefix`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `id` | `string` |\n| `tableId` | `string` |\n| `tokenPrefix` | `string` |\n\n***\n\n### fromRecord()\n\n> `static` **fromRecord**(`table`, `createdBy`, `record`): `DatabaseWebhook`\n\nA handle from the record the API answered.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `table` | [`DatabaseTable`](../../table/classes/DatabaseTable.md) |\n| `createdBy` | [`User`](../../../users/user/classes/User.md) |\n| `record` | [`DatabaseWebhookResponse`](../../../../../generated/storage/types.gen/type-aliases/DatabaseWebhookResponse.md) |\n\n#### Returns\n\n`DatabaseWebhook`\n"},{"name": "documents","description": "Search, read, create, and manage documents and tasks.",- "overview": "<!-- src/entities/documents/namespace/classes/DocumentNamespace.md -->\n# Class: DocumentNamespace\n\n## Constructors\n\n### Constructor\n\n> **new DocumentNamespace**(`client`): `DocumentNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`DocumentNamespace`\n\n## Methods\n\n### byId()\n\n> **byId**(`id`): [`Document`](../../document/classes/Document.md)\n\nA handle to a document by id. Details load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`Document`](../../document/classes/Document.md)\n\n***\n\n### create()\n\n> **create**(`opts`): `Promise`\\<[`Document`](../../document/classes/Document.md)\\>\n\nCreate a markdown document.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts` | \\{ `markdown?`: `string`; `name`: `string`; `project?`: [`Project`](../../../projects/project/classes/Project.md); \\} |\n| `opts.markdown?` | `string` |\n| `opts.name` | `string` |\n| `opts.project?` | [`Project`](../../../projects/project/classes/Project.md) |\n\n#### Returns\n\n`Promise`\\<[`Document`](../../document/classes/Document.md)\\>\n\n***\n\n### createSkill()\n\n> **createSkill**(`opts`): `Promise`\\<[`Document`](../../document/classes/Document.md)\\>\n\nCreate a skill: markdown instructions that AI reads and follows.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts` | \\{ `markdown?`: `string`; `name`: `string`; `project?`: [`Project`](../../../projects/project/classes/Project.md); \\} |\n| `opts.markdown?` | `string` |\n| `opts.name` | `string` |\n| `opts.project?` | [`Project`](../../../projects/project/classes/Project.md) |\n\n#### Returns\n\n`Promise`\\<[`Document`](../../document/classes/Document.md)\\>\n\n***\n\n### createSnippet()\n\n> **createSnippet**(`opts`): `Promise`\\<[`Document`](../../document/classes/Document.md)\\>\n\nCreate a snippet: a reusable markdown document.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts` | \\{ `markdown?`: `string`; `name`: `string`; `project?`: [`Project`](../../../projects/project/classes/Project.md); \\} |\n| `opts.markdown?` | `string` |\n| `opts.name` | `string` |\n| `opts.project?` | [`Project`](../../../projects/project/classes/Project.md) |\n\n#### Returns\n\n`Promise`\\<[`Document`](../../document/classes/Document.md)\\>\n\n***\n\n### recent()\n\n> **recent**(`opts?`): `AsyncGenerator`\\<[`Document`](../../document/classes/Document.md)\\>\n\nThe user's recent documents, most recent first, auto-paginated.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts?` | \\{ `fileType?`: `string`; `pageSize?`: `number`; \\} |\n| `opts.fileType?` | `string` |\n| `opts.pageSize?` | `number` |\n\n#### Returns\n\n`AsyncGenerator`\\<[`Document`](../../document/classes/Document.md)\\>\n\n***\n\n### recentlyDeleted()\n\n> **recentlyDeleted**(): `Promise`\\<[`Document`](../../document/classes/Document.md)[]\\>\n\nThe user's recently soft-deleted documents.\n\n#### Returns\n\n`Promise`\\<[`Document`](../../document/classes/Document.md)[]\\>\n\n***\n\n### search()\n\n> **search**(`query`, `opts?`): `AsyncGenerator`\\<[`Document`](../../document/classes/Document.md)\\>\n\nSearch documents by name and content, most relevant first, auto-paginated.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `query` | `string` |\n| `opts?` | [`SearchOpts`](../../../search/interfaces/SearchOpts.md) |\n\n#### Returns\n\n`AsyncGenerator`\\<[`Document`](../../document/classes/Document.md)\\>\n\n***\n\n### systemSkills()\n\n> **systemSkills**(): `Promise`\\<[`SystemSkill`](../../system-skill/classes/SystemSkill.md)[]\\>\n\nThe built-in system skills: static AI instructions with no document\nbehind them. Unlike user skills they cannot be opened or edited.\n\n#### Returns\n\n`Promise`\\<[`SystemSkill`](../../system-skill/classes/SystemSkill.md)[]\\>\n",- "documentation": "# Macro SDK: documents\n\nGenerated by TypeDoc. Paths below refer to the canonical Markdown hierarchy. Other entity handles are documented in their named section; request core for shared SDK helpers.\n\n<!-- generated/properties/types.gen/type-aliases/BulkUpdateEntityPropertyOptionsResponse.md -->\n# Type Alias: BulkUpdateEntityPropertyOptionsResponse\n\n> **BulkUpdateEntityPropertyOptionsResponse** = \\{ `properties`: [`EntityPropertyOptionSelectionResponse`](EntityPropertyOptionSelectionResponse.md)[]; \\}\n\nResponse for a bulk option update: each property's reconciled final ids.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-properties\"></a> `properties` | [`EntityPropertyOptionSelectionResponse`](EntityPropertyOptionSelectionResponse.md)[] | The final option ids per updated property. |\n\n\n<!-- generated/properties/types.gen/type-aliases/DataType.md -->\n# Type Alias: DataType\n\n> **DataType** = `\"BOOLEAN\"` \\| `\"DATE\"` \\| `\"NUMBER\"` \\| `\"STRING\"` \\| `\"SELECT_NUMBER\"` \\| `\"SELECT_STRING\"` \\| `\"TAG\"` \\| `\"ENTITY\"` \\| `\"LINK\"`\n\nData type for property values, determining storage and validation.\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityProperty.md -->\n# Type Alias: EntityProperty\n\n> **EntityProperty** = \\{ `created_at`: `string`; `entity_id`: `string`; `entity_type`: [`EntityType`](EntityType.md); `id`: `string`; `property_definition_id`: `string`; `updated_at`: `string`; \\}\n\nAssignment of a property definition to a specific entity (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-created_at\"></a> `created_at` | `string` |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` |\n| <a id=\"property-entity_type\"></a> `entity_type` | [`EntityType`](EntityType.md) |\n| <a id=\"property-id\"></a> `id` | `string` |\n| <a id=\"property-property_definition_id\"></a> `property_definition_id` | `string` |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityPropertyOptionSelectionResponse.md -->\n# Type Alias: EntityPropertyOptionSelectionResponse\n\n> **EntityPropertyOptionSelectionResponse** = \\{ `option_ids`: `string`[]; `property_id`: `string`; \\}\n\nThe reconciled final option ids stored for one property after a bulk update.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-option_ids\"></a> `option_ids` | `string`[] | The final option ids the server persisted, in stored order. |\n| <a id=\"property-property_id\"></a> `property_id` | `string` | The property definition the options belong to. |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md -->\n# Type Alias: EntityPropertyWithDefinition\n\n> **EntityPropertyWithDefinition** = \\{ `definition`: [`PropertyDefinition`](PropertyDefinition.md); `options?`: [`PropertyOption`](PropertyOption.md)[] \\| `null`; `property`: [`EntityProperty`](EntityProperty.md); `value?`: `null` \\| [`PropertyValue`](PropertyValue.md); \\}\n\nEntity property with its definition, value, and options (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-definition\"></a> `definition` | [`PropertyDefinition`](PropertyDefinition.md) |\n| <a id=\"property-options\"></a> `options?` | [`PropertyOption`](PropertyOption.md)[] \\| `null` |\n| <a id=\"property-property\"></a> `property` | [`EntityProperty`](EntityProperty.md) |\n| <a id=\"property-value\"></a> `value?` | `null` \\| [`PropertyValue`](PropertyValue.md) |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityReference.md -->\n# Type Alias: EntityReference\n\n> **EntityReference** = \\{ `entity_id`: `string`; `entity_type`: [`EntityType`](EntityType.md); `specific_message_id?`: `string` \\| `null`; \\}\n\nEntity reference for entity-type property values.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | - |\n| <a id=\"property-entity_type\"></a> `entity_type` | [`EntityType`](EntityType.md) | - |\n| <a id=\"property-specific_message_id\"></a> `specific_message_id?` | `string` \\| `null` | For CHANNEL, CHAT, THREAD entity types - optional specific message ID. This allows referencing a specific message within a thread/channel/chat. |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityType.md -->\n# Type Alias: EntityType\n\n> **EntityType** = `\"CALENDAR_EVENT\"` \\| `\"CALL_RECORD\"` \\| `\"CHANNEL\"` \\| `\"CHAT\"` \\| `\"COMPANY\"` \\| `\"DATABASE_ROW\"` \\| `\"CONTACT\"` \\| `\"DOCUMENT\"` \\| `\"INITIATIVE\"` \\| `\"PROJECT\"` \\| `\"TASK\"` \\| `\"THREAD\"` \\| `\"USER\"`\n\nType of entity that can be referenced by entity properties.\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyDefinition.md -->\n# Type Alias: PropertyDefinition\n\n> **PropertyDefinition** = \\{ `created_at`: `string`; `data_type`: [`DataType`](DataType.md); `display_name`: `string`; `id`: `string`; `is_metadata`: `boolean`; `is_multi_select`: `boolean`; `is_system`: `boolean`; `owner`: [`PropertyOwner`](PropertyOwner.md); `specific_entity_type`: `null` \\| [`EntityType`](EntityType.md); `updated_at`: `string`; \\}\n\nProperty definition model (service representation).\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | - |\n| <a id=\"property-data_type\"></a> `data_type` | [`DataType`](DataType.md) | - |\n| <a id=\"property-display_name\"></a> `display_name` | `string` | - |\n| <a id=\"property-id\"></a> `id` | `string` | - |\n| <a id=\"property-is_metadata\"></a> `is_metadata` | `boolean` | Flag to indicate if this is a system-generated metadata property. Not stored in database - computed at service layer. |\n| <a id=\"property-is_multi_select\"></a> `is_multi_select` | `boolean` | - |\n| <a id=\"property-is_system\"></a> `is_system` | `boolean` | Flag to indicate if this is a system property (stored in DB). |\n| <a id=\"property-owner\"></a> `owner` | [`PropertyOwner`](PropertyOwner.md) | - |\n| <a id=\"property-specific_entity_type\"></a> `specific_entity_type` | `null` \\| [`EntityType`](EntityType.md) | - |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` | - |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyOption.md -->\n# Type Alias: PropertyOption\n\n> **PropertyOption** = \\{ `color`: `string` \\| `null`; `created_at`: `string`; `display_order`: `number`; `id`: `string`; `property_definition_id`: `string`; `updated_at`: `string`; `value`: [`PropertyOptionValue`](PropertyOptionValue.md); \\}\n\nA selectable option for select-type properties (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-color\"></a> `color` | `string` \\| `null` |\n| <a id=\"property-created_at\"></a> `created_at` | `string` |\n| <a id=\"property-display_order\"></a> `display_order` | `number` |\n| <a id=\"property-id\"></a> `id` | `string` |\n| <a id=\"property-property_definition_id\"></a> `property_definition_id` | `string` |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` |\n| <a id=\"property-value\"></a> `value` | [`PropertyOptionValue`](PropertyOptionValue.md) |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyOptionValue.md -->\n# Type Alias: PropertyOptionValue\n\n> **PropertyOptionValue** = \\{ `type`: `\"string\"`; `value`: `string`; \\} \\| \\{ `type`: `\"number\"`; `value`: `number`; \\}\n\nThe value of a property option - either a string or a number.\n\n## Union Members\n\n### Type Literal\n\n\\{ `type`: `\"string\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"string\"` | - |\n| `value` | `string` | String value for SelectString properties |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"number\"`; `value`: `number`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"number\"` | - |\n| `value` | `number` | Number value for SelectNumber properties |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyOwner.md -->\n# Type Alias: PropertyOwner\n\n> **PropertyOwner** = \\{ `scope`: `\"user\"`; `user_id`: `string`; \\} \\| \\{ `scope`: `\"team\"`; `team_id`: `string`; \\} \\| \\{ `database_id`: `string`; `scope`: `\"database\"`; \\} \\| \\{ `scope`: `\"system\"`; \\}\n\nDefines who owns a property - user-scoped, team-scoped, database-scoped, or system.\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyTargetEntityType.md -->\n# Type Alias: PropertyTargetEntityType\n\n> **PropertyTargetEntityType** = `\"CALL_RECORD\"` \\| `\"CHANNEL\"` \\| `\"CHAT\"` \\| `\"COMPANY\"` \\| `\"DATABASE_ROW\"` \\| `\"DOCUMENT\"` \\| `\"INITIATIVE\"` \\| `\"PROJECT\"` \\| `\"THREAD\"` \\| `\"USER\"`\n\nCanonical type of an entity receiving properties.\n\nTasks are documents at API boundaries. `Task` intentionally does not exist\nhere; task classification is resolved by the properties domain from the\ndocument subtype.\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyTargetReference.md -->\n# Type Alias: PropertyTargetReference\n\n> **PropertyTargetReference** = \\{ `entity_id`: `string`; `entity_type`: [`PropertyTargetEntityType`](PropertyTargetEntityType.md); \\}\n\nCanonical reference to an entity receiving properties.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | Entity identifier. |\n| <a id=\"property-entity_type\"></a> `entity_type` | [`PropertyTargetEntityType`](PropertyTargetEntityType.md) | Canonical entity type. |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyValue.md -->\n# Type Alias: PropertyValue\n\n> **PropertyValue** = \\{ `type`: `\"Boolean\"`; `value`: `boolean`; \\} \\| \\{ `type`: `\"Number\"`; `value`: `number`; \\} \\| \\{ `type`: `\"String\"`; `value`: `string`; \\} \\| \\{ `type`: `\"Date\"`; `value`: `string`; \\} \\| \\{ `type`: `\"SelectOption\"`; `value`: `string`[]; \\} \\| \\{ `type`: `\"EntityReference\"`; `value`: [`EntityReference`](EntityReference.md)[]; \\} \\| \\{ `type`: `\"Link\"`; `value`: `string`[]; \\}\n\nProperty value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to/from JSONB in the database.\n\n## Union Members\n\n### Type Literal\n\n\\{ `type`: `\"Boolean\"`; `value`: `boolean`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Boolean\"` | - |\n| `value` | `boolean` | Boolean value Serializes as: {\"type\": \"Boolean\", \"value\": true} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"Number\"`; `value`: `number`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Number\"` | - |\n| `value` | `number` | Numeric value Serializes as: {\"type\": \"Number\", \"value\": 42.5} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"String\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"String\"` | - |\n| `value` | `string` | String value Serializes as: {\"type\": \"String\", \"value\": \"text\"} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"Date\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Date\"` | - |\n| `value` | `string` | Date/timestamp value Serializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"SelectOption\"`; `value`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"SelectOption\"` | - |\n| `value` | `string`[] | Select option(s) - always an array (check is_multi_select to determine if single or multi) Single-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1) Multi-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+) |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"EntityReference\"`; `value`: [`EntityReference`](EntityReference.md)[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"EntityReference\"` | - |\n| `value` | [`EntityReference`](EntityReference.md)[] | Entity reference(s) - always an array (check is_multi_select to determine if single or multi) Single-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1) Multi-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+) |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"Link\"`; `value`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Link\"` | - |\n| `value` | `string`[] | Link value(s) - always an array (check is_multi_select to determine if single or multi) Single-select: {\"type\": \"Link\", \"value\": [\"https://example.com\"]} (length 0 or 1) Multi-select: {\"type\": \"Link\", \"value\": [\"https://example.com\", \"https://other.com\"]} (length 0+) |\n\n\n<!-- generated/properties/types.gen/type-aliases/SetPropertyValue.md -->\n# Type Alias: SetPropertyValue\n\n> **SetPropertyValue** = \\{ `type`: `\"boolean\"`; `value`: `boolean`; \\} \\| \\{ `type`: `\"date\"`; `value`: `string`; \\} \\| \\{ `type`: `\"number\"`; `value`: `number`; \\} \\| \\{ `type`: `\"string\"`; `value`: `string`; \\} \\| \\{ `option_id`: `string`; `type`: `\"select_option\"`; \\} \\| \\{ `option_ids`: `string`[]; `type`: `\"multi_select_option\"`; \\} \\| \\{ `reference`: [`EntityReference`](EntityReference.md); `type`: `\"entity_reference\"`; \\} \\| \\{ `references`: [`EntityReference`](EntityReference.md)[]; `type`: `\"multi_entity_reference\"`; \\} \\| \\{ `type`: `\"link\"`; `url`: `string`; \\} \\| \\{ `type`: `\"multi_link\"`; `urls`: `string`[]; \\}\n\nType-safe enum for setting entity property values - provides compile-time validation.\n\n\n<!-- generated/storage/types.gen/type-aliases/BomPart.md -->\n# Type Alias: BomPart\n\n> **BomPart** = \\{ `id`: `string`; `path`: `string`; `sha`: `string`; \\}\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-id\"></a> `id` | `string` | The uuid of the bom part |\n| <a id=\"property-path\"></a> `path` | `string` | The file path of the bom part content |\n| <a id=\"property-sha\"></a> `sha` | `string` | The sha of the bom part content There is an index on sha for more performant queries based on it. |\n\n\n<!-- generated/storage/types.gen/type-aliases/BotSenderProfile.md -->\n# Type Alias: BotSenderProfile\n\n> **BotSenderProfile** = \\{ `avatar_url?`: `string` \\| `null`; `name`: `string`; \\}\n\nPublic bot profile attached to bot-authored messages.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-avatar_url\"></a> `avatar_url?` | `string` \\| `null` | Bot avatar URL. |\n| <a id=\"property-name\"></a> `name` | `string` | Bot display name. |\n\n\n<!-- generated/storage/types.gen/type-aliases/CountedReaction.md -->\n# Type Alias: CountedReaction\n\n> **CountedReaction** = \\{ `emoji`: `string`; `users`: `string`[]; \\}\n\nReaction emoji and the users who added it.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-emoji\"></a> `emoji` | `string` | Emoji being reacted with. |\n| <a id=\"property-users\"></a> `users` | `string`[] | User identifiers. |\n\n\n<!-- generated/storage/types.gen/type-aliases/DocumentContent.md -->\n# Type Alias: DocumentContent\n\n> **DocumentContent** = \\{ `location?`: `null` \\| [`DocumentContentLocation`](DocumentContentLocation.md); `state`: [`DocumentContentState`](DocumentContentState.md); \\}\n\nAPI-visible content lifecycle and location metadata.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-location\"></a> `location?` | `null` \\| [`DocumentContentLocation`](DocumentContentLocation.md) | - |\n| <a id=\"property-state\"></a> `state` | [`DocumentContentState`](DocumentContentState.md) | The current lifecycle state of the content. |\n\n\n<!-- generated/storage/types.gen/type-aliases/DocumentContentLocation.md -->\n# Type Alias: DocumentContentLocation\n\n> **DocumentContentLocation** = `\"object_storage\"` \\| `\"sync_service\"` \\| `\"docx_bom_parts\"` \\| `\"converted_pdf\"` \\| `\"unknown\"`\n\nWhere document content is, or is expected to be, read from.\n\n\n<!-- generated/storage/types.gen/type-aliases/DocumentContentState.md -->\n# Type Alias: DocumentContentState\n\n> **DocumentContentState** = `\"unknown\"` \\| `\"pending\"` \\| `\"ready\"`\n\nAPI-visible content lifecycle state derived from current document metadata.\n\n\n<!-- generated/storage/types.gen/type-aliases/DocumentId.md -->\n# Type Alias: DocumentId\n\n> **DocumentId** = `string`\n\nA validated document identifier. Historical document ids need not be UUIDs.\n\n\n<!-- generated/storage/types.gen/type-aliases/DocumentMetadata.md -->\n# Type Alias: DocumentMetadata\n\n> **DocumentMetadata** = \\{ `branchedFromId?`: `string` \\| `null`; `branchedFromVersionId?`: `number` \\| `null`; `createdAt?`: `string` \\| `null`; `deletedAt?`: `string` \\| `null`; `documentBom?`: [`BomPart`](BomPart.md)[] \\| `null`; `documentFamilyId?`: `number` \\| `null`; `documentId`: `string`; `documentName`: `string`; `documentVersionId`: `number`; `fileType?`: `string` \\| `null`; `modificationData?`: `unknown`; `owner`: `string`; `projectId?`: `string` \\| `null`; `projectName?`: `string` \\| `null`; `sha?`: `string` \\| `null`; `subType?`: `null` \\| [`DocumentSubType`](DocumentSubType.md); `updatedAt?`: `string` \\| `null`; \\}\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-branchedfromid\"></a> `branchedFromId?` | `string` \\| `null` | The id of the document this document branched from |\n| <a id=\"property-branchedfromversionid\"></a> `branchedFromVersionId?` | `number` \\| `null` | The id of the version this document branched from This could be either DocumentInstance or DocumentBom id depending on the file type |\n| <a id=\"property-createdat\"></a> `createdAt?` | `string` \\| `null` | The time the document was created |\n| <a id=\"property-deletedat\"></a> `deletedAt?` | `string` \\| `null` | The time the document was deleted |\n| <a id=\"property-documentbom\"></a> `documentBom?` | [`BomPart`](BomPart.md)[] \\| `null` | If the document is a DOCX document and unzipped, the document_bom will be present |\n| <a id=\"property-documentfamilyid\"></a> `documentFamilyId?` | `number` \\| `null` | The id of the document family this document belongs to |\n| <a id=\"property-documentid\"></a> `documentId` | `string` | The document id |\n| <a id=\"property-documentname\"></a> `documentName` | `string` | The name of the document |\n| <a id=\"property-documentversionid\"></a> `documentVersionId` | `number` | The version of the document This could be the document_instance_id or document_bom_id depending on the file type |\n| <a id=\"property-filetype\"></a> `fileType?` | `string` \\| `null` | The file type of the document (file extension) |\n| <a id=\"property-modificationdata\"></a> `modificationData?` | `unknown` | The modification data for the document instance. This is only used for PDF documents. |\n| <a id=\"property-owner\"></a> `owner` | `string` | The owner of the document |\n| <a id=\"property-projectid\"></a> `projectId?` | `string` \\| `null` | The id of the project that this document belongs to |\n| <a id=\"property-projectname\"></a> `projectName?` | `string` \\| `null` | The name of the project that this document belongs to |\n| <a id=\"property-sha\"></a> `sha?` | `string` \\| `null` | If the document is a PDF, this is the SHA of the pdf If the document is a DOCX, this will not be present |\n| <a id=\"property-subtype\"></a> `subType?` | `null` \\| [`DocumentSubType`](DocumentSubType.md) | - |\n| <a id=\"property-updatedat\"></a> `updatedAt?` | `string` \\| `null` | The time the document instance / document BOM was updated |\n\n\n<!-- generated/storage/types.gen/type-aliases/DocumentMetadataWithContent.md -->\n# Type Alias: DocumentMetadataWithContent\n\n> **DocumentMetadataWithContent** = [`DocumentMetadata`](DocumentMetadata.md) & \\{ `content`: [`DocumentContent`](DocumentContent.md); `teamId?`: `string` \\| `null`; `teamTaskId?`: `number` \\| `null`; \\}\n\nFull document metadata plus content lifecycle metadata.\n\n## Type Declaration\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `content` | [`DocumentContent`](DocumentContent.md) | Content lifecycle and location metadata. |\n| `teamId?` | `string` \\| `null` | The team this task number is scoped to, for task documents. |\n| `teamTaskId?` | `number` \\| `null` | The task number assigned within the team, for task documents. |\n\n\n<!-- generated/storage/types.gen/type-aliases/DocumentSubType.md -->\n# Type Alias: DocumentSubType\n\n> **DocumentSubType** = `\"task\"` \\| `\"snippet\"` \\| `\"skill\"` \\| `\"initiative_description\"`\n\nThe document sub type enum represents all values of document sub types.\nThese values should match the `document_sub_type_value` table in macrodb.\n\nWire, database, and `Display` spellings are all `snake_case` so a\nmulti-word variant serializes identically in every system.\n\n\n<!-- generated/storage/types.gen/type-aliases/DocumentTeamShareResponse.md -->\n# Type Alias: DocumentTeamShareResponse\n\n> **DocumentTeamShareResponse** = \\{ `sharedWithTeam`: `boolean`; `teamId?`: `string` \\| `null`; \\}\n\nThe team-share state of a document. The team is resolved from the document\nowner's team membership.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-sharedwithteam\"></a> `sharedWithTeam` | `boolean` | Whether explicit team sharing is enabled; inherited team access does not count. |\n| <a id=\"property-teamid\"></a> `teamId?` | `string` \\| `null` | The owner's team the document is (or would be) shared with. `None` when the owner does not belong to a team. |\n\n\n<!-- generated/storage/types.gen/type-aliases/GithubPullRequest.md -->\n# Type Alias: GithubPullRequest\n\n> **GithubPullRequest** = \\{ `additions?`: `number` \\| `null`; `checks?`: [`GithubPullRequestCheckRun`](GithubPullRequestCheckRun.md)[] \\| `null`; `comments?`: [`GithubPullRequestComment`](GithubPullRequestComment.md)[] \\| `null`; `deletions?`: `number` \\| `null`; `displayName`: `string`; `foreignEntityId?`: `string` \\| `null`; `githubKey`: `string`; `name?`: `string` \\| `null`; `number`: `number`; `owner`: `string`; `repo`: `string`; `status?`: `string` \\| `null`; `url`: `string`; \\}\n\nDisplay-ready data for a GitHub pull request associated with a task.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-additions\"></a> `additions?` | `number` \\| `null` | The number of added lines in the pull request, when enrichment data is available. |\n| <a id=\"property-checks\"></a> `checks?` | [`GithubPullRequestCheckRun`](GithubPullRequestCheckRun.md)[] \\| `null` | Check runs collected from the pull request head commit, when enrichment data is available. |\n| <a id=\"property-comments\"></a> `comments?` | [`GithubPullRequestComment`](GithubPullRequestComment.md)[] \\| `null` | Comments collected from the pull request, when enrichment data is available. |\n| <a id=\"property-deletions\"></a> `deletions?` | `number` \\| `null` | The number of deleted lines in the pull request, when enrichment data is available. |\n| <a id=\"property-displayname\"></a> `displayName` | `string` | A compact label suitable for display in the UI. |\n| <a id=\"property-foreignentityid\"></a> `foreignEntityId?` | `string` \\| `null` | The internal `foreign_entity.id` UUID for the GitHub pull request row. |\n| <a id=\"property-githubkey\"></a> `githubKey` | `string` | The stored GitHub association key, in `owner/repo/pull/number` format. |\n| <a id=\"property-name\"></a> `name?` | `string` \\| `null` | The GitHub pull request title, when enrichment data is available. |\n| <a id=\"property-number\"></a> `number` | `number` | The GitHub pull request number. |\n| <a id=\"property-owner\"></a> `owner` | `string` | The GitHub repository owner or organization. |\n| <a id=\"property-repo\"></a> `repo` | `string` | The GitHub repository name. |\n| <a id=\"property-status\"></a> `status?` | `string` \\| `null` | The GitHub pull request status, when enrichment data is available. |\n| <a id=\"property-url\"></a> `url` | `string` | The public GitHub URL for the pull request. |\n\n\n<!-- generated/storage/types.gen/type-aliases/GithubPullRequestCheckRun.md -->\n# Type Alias: GithubPullRequestCheckRun\n\n> **GithubPullRequestCheckRun** = \\{ `completedAt?`: `string` \\| `null`; `conclusion?`: `string` \\| `null`; `id`: `number`; `name`: `string`; `startedAt?`: `string` \\| `null`; `status`: `string`; `url?`: `string` \\| `null`; \\}\n\nA check run associated with a GitHub pull request.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-completedat\"></a> `completedAt?` | `string` \\| `null` | When the check run completed, when available. |\n| <a id=\"property-conclusion\"></a> `conclusion?` | `string` \\| `null` | The raw GitHub check run conclusion, when the run has completed. |\n| <a id=\"property-id\"></a> `id` | `number` | The unique GitHub identifier for the check run. |\n| <a id=\"property-name\"></a> `name` | `string` | The check run name. |\n| <a id=\"property-startedat\"></a> `startedAt?` | `string` \\| `null` | When the check run started, when available. |\n| <a id=\"property-status\"></a> `status` | `string` | The raw GitHub check run status. |\n| <a id=\"property-url\"></a> `url?` | `string` \\| `null` | The public GitHub URL for the check run, when available. |\n\n\n<!-- generated/storage/types.gen/type-aliases/GithubPullRequestComment.md -->\n# Type Alias: GithubPullRequestComment\n\n> **GithubPullRequestComment** = \\{ `authorAssociation?`: `string` \\| `null`; `authorId?`: `number` \\| `null`; `authorLogin?`: `string` \\| `null`; `body`: `string`; `createdAt?`: `string` \\| `null`; `id`: `number`; `inReplyToId?`: `number` \\| `null`; `line?`: `number` \\| `null`; `originalLine?`: `number` \\| `null`; `path?`: `string` \\| `null`; `pullRequestReviewId?`: `number` \\| `null`; `source`: `string`; `updatedAt?`: `string` \\| `null`; `url?`: `string` \\| `null`; \\}\n\nA comment associated with a GitHub pull request.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-authorassociation\"></a> `authorAssociation?` | `string` \\| `null` | GitHub's relationship label for the author, when available. |\n| <a id=\"property-authorid\"></a> `authorId?` | `number` \\| `null` | The stable numeric GitHub user id for the comment author, when available. |\n| <a id=\"property-authorlogin\"></a> `authorLogin?` | `string` \\| `null` | The GitHub login for the comment author, when available. |\n| <a id=\"property-body\"></a> `body` | `string` | The comment or review body text. |\n| <a id=\"property-createdat\"></a> `createdAt?` | `string` \\| `null` | When the comment was created or the review was submitted. |\n| <a id=\"property-id\"></a> `id` | `number` | The unique GitHub identifier for the comment or review. |\n| <a id=\"property-inreplytoid\"></a> `inReplyToId?` | `number` \\| `null` | The id of the comment this one replies to, when it is part of a review thread. Only ever present on `review_comment` sources. |\n| <a id=\"property-line\"></a> `line?` | `number` \\| `null` | The line in the current diff the comment is anchored to. Cleared by GitHub when later commits outdate the comment's diff. |\n| <a id=\"property-originalline\"></a> `originalLine?` | `number` \\| `null` | The line the comment was originally anchored to, kept even when the diff has since changed. |\n| <a id=\"property-path\"></a> `path?` | `string` \\| `null` | The repository-relative file path the review comment is anchored to. Only ever present on `review_comment` sources. |\n| <a id=\"property-pullrequestreviewid\"></a> `pullRequestReviewId?` | `number` \\| `null` | The id of the pull request review this comment was submitted with. Only ever present on `review_comment` sources. |\n| <a id=\"property-source\"></a> `source` | `string` | The GitHub source for the comment, such as `issue_comment` or `review_comment`. |\n| <a id=\"property-updatedat\"></a> `updatedAt?` | `string` \\| `null` | When the comment or review was last updated. |\n| <a id=\"property-url\"></a> `url?` | `string` \\| `null` | The public GitHub URL for the comment or review, when available. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ImportedAuthor.md -->\n# Type Alias: ImportedAuthor\n\n> **ImportedAuthor** = \\{ `name`: `string`; \\}\n\nDisplay attribution for a comment imported from an external document.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-name\"></a> `name` | `string` | Original author text; never interpreted as an authenticated principal. |\n\n\n<!-- generated/storage/types.gen/type-aliases/Message.md -->\n# Type Alias: Message\n\n> **Message** = \\{ `attachments`: [`MessageAttachment`](MessageAttachment.md)[]; `bot_profile?`: `null` \\| [`BotSenderProfile`](BotSenderProfile.md); `content`: `string`; `created_at`: `string`; `deleted_at?`: `string` \\| `null`; `edited_at?`: `string` \\| `null`; `guest_name?`: `string` \\| `null`; `id`: `string`; `imported_author?`: `null` \\| [`ImportedAuthor`](ImportedAuthor.md); `mentions`: [`SimpleMention`](SimpleMention.md)[]; `parent`: [`MessageParent`](MessageParent.md); `reactions`: [`CountedReaction`](CountedReaction.md)[]; `sender_id`: `string`; `thread_id?`: `string` \\| `null`; `triggered_by?`: `string` \\| `null`; `updated_at`: `string`; \\}\n\nShared message representation for channel timelines and entity discussions.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-attachments\"></a> `attachments` | [`MessageAttachment`](MessageAttachment.md)[] | Attached entities. |\n| <a id=\"property-bot_profile\"></a> `bot_profile?` | `null` \\| [`BotSenderProfile`](BotSenderProfile.md) | - |\n| <a id=\"property-content\"></a> `content` | `string` | Macro Markdown body. |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | Creation time. |\n| <a id=\"property-deleted_at\"></a> `deleted_at?` | `string` \\| `null` | Message tombstone, independent of thread deletion. |\n| <a id=\"property-edited_at\"></a> `edited_at?` | `string` \\| `null` | Last content edit, if any. |\n| <a id=\"property-guest_name\"></a> `guest_name?` | `string` \\| `null` | Display name of a verified call guest, retained after the call ends. |\n| <a id=\"property-id\"></a> `id` | `string` | Message UUID. |\n| <a id=\"property-imported_author\"></a> `imported_author?` | `null` \\| [`ImportedAuthor`](ImportedAuthor.md) | - |\n| <a id=\"property-mentions\"></a> `mentions` | [`SimpleMention`](SimpleMention.md)[] | Tracked mentions, retained when a caller changes attachments only. |\n| <a id=\"property-parent\"></a> `parent` | [`MessageParent`](MessageParent.md) | Entity that owns this conversation. |\n| <a id=\"property-reactions\"></a> `reactions` | [`CountedReaction`](CountedReaction.md)[] | Aggregated reactions. |\n| <a id=\"property-sender_id\"></a> `sender_id` | `string` | Authenticated actor or owner of imported content. |\n| <a id=\"property-thread_id\"></a> `thread_id?` | `string` \\| `null` | Root message UUID for replies; absent on roots. |\n| <a id=\"property-triggered_by\"></a> `triggered_by?` | `string` \\| `null` | User who triggered a bot-authored message. |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` | Last persisted update. |\n\n\n<!-- generated/storage/types.gen/type-aliases/MessageAttachment.md -->\n# Type Alias: MessageAttachment\n\n> **MessageAttachment** = \\{ `created_at`: `string`; `entity_id`: `string`; `entity_type`: `string`; `height?`: `number` \\| `null`; `id`: `string`; `width?`: `number` \\| `null`; \\}\n\nAn entity attached to a message.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | When the attachment was added. |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | Attached entity identifier. |\n| <a id=\"property-entity_type\"></a> `entity_type` | `string` | Attached entity type. |\n| <a id=\"property-height\"></a> `height?` | `number` \\| `null` | Optional media height. |\n| <a id=\"property-id\"></a> `id` | `string` | Attachment UUID. |\n| <a id=\"property-width\"></a> `width?` | `number` \\| `null` | Optional media width. |\n\n\n<!-- generated/storage/types.gen/type-aliases/MessageParent.md -->\n# Type Alias: MessageParent\n\n> **MessageParent** = \\{ `id`: `string`; `type`: `\"channel\"`; \\} \\| \\{ `id`: [`DocumentId`](DocumentId.md); `type`: `\"document\"`; \\} \\| \\{ `id`: `string`; `type`: `\"initiative\"`; \\} \\| \\{ `id`: `string`; `type`: `\"crm_company\"`; \\} \\| \\{ `id`: `string`; `type`: `\"crm_contact\"`; \\} \\| \\{ `id`: `string`; `type`: `\"call\"`; \\}\n\nThe entity whose permissions and lifecycle govern a message.\n\n## Union Members\n\n### Type Literal\n\n\\{ `id`: `string`; `type`: `\"channel\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | A channel, including direct messages. |\n| `type` | `\"channel\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: [`DocumentId`](DocumentId.md); `type`: `\"document\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | [`DocumentId`](DocumentId.md) | A document, including tasks and PDFs. |\n| `type` | `\"document\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: `string`; `type`: `\"initiative\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | An initiative, presented as a project in the application. |\n| `type` | `\"initiative\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: `string`; `type`: `\"crm_company\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | A CRM company. |\n| `type` | `\"crm_company\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: `string`; `type`: `\"crm_contact\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | A CRM contact. |\n| `type` | `\"crm_contact\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: `string`; `type`: `\"call\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | A video call and its persistent chat thread. |\n| `type` | `\"call\"` | - |\n\n\n<!-- generated/storage/types.gen/type-aliases/SimpleMention.md -->\n# Type Alias: SimpleMention\n\n> **SimpleMention** = \\{ `entity_id`: `string`; `entity_type`: `string`; \\}\n\nA mention tracked in a message body.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | Mentioned entity identifier. |\n| <a id=\"property-entity_type\"></a> `entity_type` | `string` | Mentioned entity type. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ThreadAnchor.md -->\n# Type Alias: ThreadAnchor\n\n> **ThreadAnchor** = \\{ `mark_id`: `string`; `marked_text?`: `string` \\| `null`; `type`: `\"markdown\"`; \\} \\| \\{ `anchor_id`: `string`; `marked_text?`: `string` \\| `null`; `type`: `\"pdf_highlight\"`; \\} \\| \\{ `anchor_id`: `string`; `type`: `\"pdf_placeable\"`; \\} \\| \\{ `range`: `string`; `sheetId`: `string`; `sheetName`: `string`; `type`: `\"spreadsheet\"`; \\} \\| \\{ `nodeId?`: `string` \\| `null`; `pageId`: `string`; `type`: `\"fig\"`; `x`: `number`; `y`: `number`; \\}\n\nA thread's location within its document. PDF geometry remains annotation-owned.\n\n## Union Members\n\n### Type Literal\n\n\\{ `mark_id`: `string`; `marked_text?`: `string` \\| `null`; `type`: `\"markdown\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `mark_id` | `string` | Mark UUID serialized in the document. |\n| `marked_text?` | `string` \\| `null` | The marked text as it read when the discussion was created, already trimmed and bounded. Absent on threads created or imported before snapshots were captured: the text a mark covers cannot be recovered from the mark id alone. |\n| `type` | `\"markdown\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `anchor_id`: `string`; `marked_text?`: `string` \\| `null`; `type`: `\"pdf_highlight\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `anchor_id` | `string` | Highlight annotation UUID. |\n| `marked_text?` | `string` \\| `null` | The text the highlight covers, trimmed and bounded like a markdown snapshot. The highlight owns it and it can be edited there, so it is read from the highlight whenever the thread is, never stored on the thread. Absent when the highlight carries no text. |\n| `type` | `\"pdf_highlight\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `anchor_id`: `string`; `type`: `\"pdf_placeable\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `anchor_id` | `string` | Placeable annotation UUID. |\n| `type` | `\"pdf_placeable\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `range`: `string`; `sheetId`: `string`; `sheetName`: `string`; `type`: `\"spreadsheet\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `range` | `string` | A1 cell or range, such as B4 or B4:C9. |\n| `sheetId` | `string` | Stable sheet identity within the workbook. |\n| `sheetName` | `string` | Sheet name when the discussion was created. |\n| `type` | `\"spreadsheet\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `nodeId?`: `string` \\| `null`; `pageId`: `string`; `type`: `\"fig\"`; `x`: `number`; `y`: `number`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `nodeId?` | `string` \\| `null` | Layer the pin follows; absent for a pin on the bare canvas. |\n| `pageId` | `string` | Page (canvas) the pin is on. |\n| `type` | `\"fig\"` | - |\n| `x` | `number` | Horizontal offset from the layer's origin, or the page's when the pin is on no layer, in design units. |\n| `y` | `number` | Vertical offset, measured like `x`. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ThreadState.md -->\n# Type Alias: ThreadState\n\n> **ThreadState** = \\{ `anchor?`: `null` \\| [`ThreadAnchor`](ThreadAnchor.md); `created_at`: `string`; `deleted_at?`: `string` \\| `null`; `resolved`: `boolean`; `root_id`: `string`; `updated_at`: `string`; `user_id`: `string`; \\}\n\nState belonging to a whole thread, keyed by its root message.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-anchor\"></a> `anchor?` | `null` \\| [`ThreadAnchor`](ThreadAnchor.md) | - |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | Creation time of the discussion. |\n| <a id=\"property-deleted_at\"></a> `deleted_at?` | `string` \\| `null` | Explicit deletion of the entire thread, distinct from root deletion. |\n| <a id=\"property-resolved\"></a> `resolved` | `boolean` | Whether this discussion has been resolved. |\n| <a id=\"property-root_id\"></a> `root_id` | `string` | Root message UUID; there is no separate thread identity. |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` | Last state change. |\n| <a id=\"property-user_id\"></a> `user_id` | `string` | User who owns this discussion, including imported discussions. |\n\n\n<!-- src/entities/documents/comment/classes/Comment.md -->\n# Class: Comment\n\nA comment on a document: a document-parent message, addressed by its\ndocument and message UUID. Its record and mutations are the ones channel\nmessages use.\n\n## Extends\n\n- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\\<[`Message`](../../../../../generated/storage/types.gen/type-aliases/Message.md)\\>\n\n## Properties\n\n| Property | Modifier | Type | Description | Inherited from |\n| ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-createdat\"></a> `createdAt` | `readonly` | () => `Promise`\\<`string`\\> | When the comment was created. | - |\n| <a id=\"property-documentid\"></a> `documentId` | `readonly` | `string` | The document this comment belongs to. | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |\n| <a id=\"property-text\"></a> `text` | `readonly` | () => `Promise`\\<`string`\\> | The comment's text. | - |\n| <a id=\"property-updatedat\"></a> `updatedAt` | `readonly` | () => `Promise`\\<`string`\\> | When the comment was last updated. | - |\n\n## Methods\n\n### author()\n\n> **author**(): `Promise`\\<[`User`](../../../users/user/classes/User.md)\\>\n\nThe user who wrote this comment.\n\n#### Returns\n\n`Promise`\\<[`User`](../../../users/user/classes/User.md)\\>\n\n***\n\n### delete()\n\n> **delete**(): `Promise`\\<`void`\\>\n\nDelete this comment.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### document()\n\n> **document**(): [`Document`](../../document/classes/Document.md)\n\nThe document this comment is on.\n\n#### Returns\n\n[`Document`](../../document/classes/Document.md)\n\n***\n\n### edit()\n\n> **edit**(`body`): `Promise`\\<`Comment`\\>\n\nReplace the comment's text.\n\n#### Parameters\n\n| Parameter | Type | Description |\n| ------ | ------ | ------ |\n| `body` | `string` \\| [`RichMessage`](../../../../mentions/interfaces/RichMessage.md) | Plain text, or a rich body composed with msg. |\n\n#### Returns\n\n`Promise`\\<`Comment`\\>\n\n***\n\n### reply()\n\n> **reply**(`body`): `Promise`\\<`Comment`\\>\n\nReply in this comment's thread.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `body` | `string` \\| [`RichMessage`](../../../../mentions/interfaces/RichMessage.md) |\n\n#### Returns\n\n`Promise`\\<`Comment`\\>\n\n***\n\n### threadId()\n\n> **threadId**(): `Promise`\\<`string`\\>\n\nThe id of the thread this comment belongs to: its root, or itself for a root.\n\n#### Returns\n\n`Promise`\\<`string`\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`Message`](../../../../../generated/storage/types.gen/type-aliases/Message.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`Message`](../../../../../generated/storage/types.gen/type-aliases/Message.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`Message`](../../../../../generated/storage/types.gen/type-aliases/Message.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `documentId`, `id`): `Comment`\n\nA handle to a comment by id. Fields load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `documentId` | `string` |\n| `id` | `string` |\n\n#### Returns\n\n`Comment`\n\n***\n\n### from()\n\n> `static` **from**(`client`, `documentId`, `record`): `Comment`\n\nBuild a comment from a message record (pre-seeded, no fetch).\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `documentId` | `string` |\n| `record` | [`Message`](../../../../../generated/storage/types.gen/type-aliases/Message.md) |\n\n#### Returns\n\n`Comment`\n\n\n<!-- src/entities/documents/document/classes/Document.md -->\n# Class: Document\n\nA Macro document. Can be dropped into a msg template to render an\ninline link to the document.\n\n## Extends\n\n- [`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md)\\<`DocumentDetail`\\>\n\n## Extended by\n\n- [`Task`](../../../tasks/task/classes/Task.md)\n\n## Implements\n\n- [`Mentionable`](../../../../mentions/interfaces/Mentionable.md)\n\n## Properties\n\n| Property | Modifier | Type | Default value | Description | Overrides | Inherited from |\n| ------ | ------ | ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-branchedfrom\"></a> `branchedFrom` | `readonly` | () => `Promise`\\<`Document` \\| `undefined`\\> | `...` | The document this one was branched from, if any. | - | - |\n| <a id=\"property-createdat\"></a> `createdAt` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | `...` | When the document was created. | - | - |\n| <a id=\"property-deletedat\"></a> `deletedAt` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | `...` | When the document was deleted, if it has been. | - | - |\n| <a id=\"property-entitytype\"></a> `entityType` | `readonly` | `\"document\"` | `'document'` | Favorites identify documents as `document`. | [`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`entityType`](../../../entity/classes/PropertiedEntity.md#property-entitytype) | - |\n| <a id=\"property-filetype\"></a> `fileType` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | `...` | The document's file type (e.g. `md`, `pdf`, `docx`). | - | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | `undefined` | - | - | [`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`id`](../../../entity/classes/PropertiedEntity.md#property-id) |\n| <a id=\"property-name\"></a> `name` | `readonly` | () => `Promise`\\<`string`\\> | `...` | The document's display name. | - | - |\n| <a id=\"property-owner\"></a> `owner` | `readonly` | () => `Promise`\\<[`User`](../../../users/user/classes/User.md)\\> | `...` | The user who owns the document. | - | - |\n| <a id=\"property-project\"></a> `project` | `readonly` | () => `Promise`\\<[`Project`](../../../projects/project/classes/Project.md) \\| `undefined`\\> | `...` | The project this document belongs to, if any. | - | - |\n| <a id=\"property-updatedat\"></a> `updatedAt` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | `...` | When the document was last updated. | - | - |\n| <a id=\"property-search\"></a> `search` | `static` | (`client`, `query`, `searchOpts?`) => `AsyncGenerator`\\<`Document`\\> | `...` | Search documents by name and content, most relevant first, auto-paginated. | - | - |\n\n## Methods\n\n### branchName()\n\n> **branchName**(): `Promise`\\<`string`\\>\n\nThe git branch name derived for the document (task documents).\n\n#### Returns\n\n`Promise`\\<`string`\\>\n\n***\n\n### comment()\n\n> **comment**(`body`, `opts?`): `Promise`\\<[`Comment`](../../comment/classes/Comment.md)\\>\n\nAdd a comment. Starts a new unanchored thread, or replies to an existing\none when `threadId` (the thread's root comment id) is given.\n\n#### Parameters\n\n| Parameter | Type | Description |\n| ------ | ------ | ------ |\n| `body` | `string` \\| [`RichMessage`](../../../../mentions/interfaces/RichMessage.md) | Plain text, or a rich body composed with msg. |\n| `opts?` | \\{ `threadId?`: `string`; \\} | - |\n| `opts.threadId?` | `string` | - |\n\n#### Returns\n\n`Promise`\\<[`Comment`](../../comment/classes/Comment.md)\\>\n\nThe created comment.\n\n***\n\n### comments()\n\n> **comments**(): `Promise`\\<[`CommentThread`](../interfaces/CommentThread.md)[]\\>\n\nThe document's live comment threads, each with its comments, newest thread first.\n\n#### Returns\n\n`Promise`\\<[`CommentThread`](../interfaces/CommentThread.md)[]\\>\n\n***\n\n### content()\n\n> **content**(): `Promise`\\<`string`\\>\n\nCurrent Markdown for native documents, extracted text for PDF/Word,\nor raw file content for other formats. Native reads include live edits.\n\n#### Returns\n\n`Promise`\\<`string`\\>\n\n***\n\n### copy()\n\n> **copy**(`opts`): `Promise`\\<`Document`\\>\n\nCopy the document under a new name, optionally from a specific version.\nReturns a handle to the new document.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts` | \\{ `name`: `string`; `versionId?`: `number`; \\} |\n| `opts.name` | `string` |\n| `opts.versionId?` | `number` |\n\n#### Returns\n\n`Promise`\\<`Document`\\>\n\n***\n\n### delete()\n\n> **delete**(`opts?`): `Promise`\\<`void`\\>\n\nDelete the document. Soft by default (reversible with [restore](#restore));\npass `permanent: true` to delete irreversibly.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts?` | \\{ `permanent?`: `boolean`; \\} |\n| `opts.permanent?` | `boolean` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### deleteProperty()\n\n> **deleteProperty**(`assignment`): `Promise`\\<`void`\\>\n\nRemove a property from this entity, given its [properties](#properties) entry.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `assignment` | [`EntityPropertyWithDefinition`](../../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`deleteProperty`](../../../entity/classes/PropertiedEntity.md#deleteproperty)\n\n***\n\n### favorite()\n\n> **favorite**(): `Promise`\\<`Document`\\>\n\nAdd this entity to the user's favorites. Returns this handle for chaining.\nPlain unwrap: favoriting alters the user's favorites collection, not this\nentity's own detail, so there's nothing cached to invalidate.\n\n#### Returns\n\n`Promise`\\<`Document`\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`favorite`](../../../entity/classes/PropertiedEntity.md#favorite)\n\n***\n\n### githubPullRequests()\n\n> **githubPullRequests**(): `Promise`\\<[`GithubPullRequest`](../../../../../generated/storage/types.gen/type-aliases/GithubPullRequest.md)[]\\>\n\nGitHub pull requests associated with the document.\n\n#### Returns\n\n`Promise`\\<[`GithubPullRequest`](../../../../../generated/storage/types.gen/type-aliases/GithubPullRequest.md)[]\\>\n\n***\n\n### move()\n\n> **move**(`project`): `Promise`\\<`void`\\>\n\nMove the document into a project (or out of one, with `null`).\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `project` | [`Project`](../../../projects/project/classes/Project.md) \\| `null` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### properties()\n\n> **properties**(`opts?`): `Promise`\\<[`EntityPropertyWithDefinition`](../../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md)[]\\>\n\nThe properties set on this entity, each with its definition, value, and options.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts?` | \\{ `includeMetadata?`: `boolean`; \\} |\n| `opts.includeMetadata?` | `boolean` |\n\n#### Returns\n\n`Promise`\\<[`EntityPropertyWithDefinition`](../../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md)[]\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`properties`](../../../entity/classes/PropertiedEntity.md#properties)\n\n***\n\n### propertyReference()\n\n> **propertyReference**(): [`PropertyTargetReference`](../../../../../generated/properties/types.gen/type-aliases/PropertyTargetReference.md)\n\nThis entity's reference for bulk property operations.\n\n#### Returns\n\n[`PropertyTargetReference`](../../../../../generated/properties/types.gen/type-aliases/PropertyTargetReference.md)\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`propertyReference`](../../../entity/classes/PropertiedEntity.md#propertyreference)\n\n***\n\n### rename()\n\n> **rename**(`name`): `Promise`\\<`void`\\>\n\nRename the document.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `name` | `string` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### restore()\n\n> **restore**(): `Promise`\\<`void`\\>\n\nRestore a soft-deleted document.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### setProperty()\n\n> **setProperty**(`property`, `value?`): `Promise`\\<`void`\\>\n\nSet a property value on this entity, or attach the property without a\nvalue when `value` is omitted.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `property` | [`PropertyDefinition`](../../../properties/property-definition/classes/PropertyDefinition.md) |\n| `value?` | [`SetPropertyValue`](../../../../../generated/properties/types.gen/type-aliases/SetPropertyValue.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`setProperty`](../../../entity/classes/PropertiedEntity.md#setproperty)\n\n***\n\n### setTeamShare()\n\n> **setTeamShare**(`shared`): `Promise`\\<`void`\\>\n\nShare the document with the owner's team, or unshare it.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `shared` | `boolean` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### shortId()\n\n> **shortId**(): `Promise`\\<`string`\\>\n\nThe document's short id (used in compact links and branch names).\n\n#### Returns\n\n`Promise`\\<`string`\\>\n\n***\n\n### teamShare()\n\n> **teamShare**(): `Promise`\\<[`DocumentTeamShareResponse`](../../../../../generated/storage/types.gen/type-aliases/DocumentTeamShareResponse.md)\\>\n\nWhether the document is shared with the owner's team, and which team.\n\n#### Returns\n\n`Promise`\\<[`DocumentTeamShareResponse`](../../../../../generated/storage/types.gen/type-aliases/DocumentTeamShareResponse.md)\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`DocumentMetadataWithContent`](../../../../../generated/storage/types.gen/type-aliases/DocumentMetadataWithContent.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`DocumentMetadataWithContent`](../../../../../generated/storage/types.gen/type-aliases/DocumentMetadataWithContent.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`DocumentMetadataWithContent`](../../../../../generated/storage/types.gen/type-aliases/DocumentMetadataWithContent.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`toJSON`](../../../entity/classes/PropertiedEntity.md#tojson)\n\n***\n\n### toMention()\n\n> **toMention**(): [`MentionPart`](../../../../mentions/interfaces/MentionPart.md)\n\n#### Returns\n\n[`MentionPart`](../../../../mentions/interfaces/MentionPart.md)\n\n#### Implementation of\n\n[`Mentionable`](../../../../mentions/interfaces/Mentionable.md).[`toMention`](../../../../mentions/interfaces/Mentionable.md#tomention)\n\n***\n\n### unfavorite()\n\n> **unfavorite**(): `Promise`\\<`Document`\\>\n\nRemove this entity from the user's favorites. Returns this handle for chaining.\n\n#### Returns\n\n`Promise`\\<`Document`\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`unfavorite`](../../../entity/classes/PropertiedEntity.md#unfavorite)\n\n***\n\n### updatePropertyOptions()\n\n> **updatePropertyOptions**(`changes`): `Promise`\\<[`BulkUpdateEntityPropertyOptionsResponse`](../../../../../generated/properties/types.gen/type-aliases/BulkUpdateEntityPropertyOptionsResponse.md)\\>\n\nApply multi-select option deltas atomically across this entity's properties.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `changes` | [`PropertyOptionDelta`](../../../entity/interfaces/PropertyOptionDelta.md)[] |\n\n#### Returns\n\n`Promise`\\<[`BulkUpdateEntityPropertyOptionsResponse`](../../../../../generated/properties/types.gen/type-aliases/BulkUpdateEntityPropertyOptionsResponse.md)\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`updatePropertyOptions`](../../../entity/classes/PropertiedEntity.md#updatepropertyoptions)\n\n***\n\n### webUrl()\n\n> **webUrl**(): `string`\n\nThe document's URL in the Macro web app.\n\n#### Returns\n\n`string`\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `id`): `Document`\n\nA handle to a document by id. Details load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `id` | `string` |\n\n#### Returns\n\n`Document`\n\n***\n\n### create()\n\n> `static` **create**(`client`, `opts`): `Promise`\\<`Document`\\>\n\nCreate a markdown document.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `opts` | \\{ `markdown?`: `string`; `name`: `string`; `project?`: [`Project`](../../../projects/project/classes/Project.md); \\} |\n| `opts.markdown?` | `string` |\n| `opts.name` | `string` |\n| `opts.project?` | [`Project`](../../../projects/project/classes/Project.md) |\n\n#### Returns\n\n`Promise`\\<`Document`\\>\n\n***\n\n### createSkill()\n\n> `static` **createSkill**(`client`, `opts`): `Promise`\\<`Document`\\>\n\nCreate a skill: a markdown document containing instructions that AI reads\nand follows when the skill is referenced in an AI input.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `opts` | \\{ `markdown?`: `string`; `name`: `string`; `project?`: [`Project`](../../../projects/project/classes/Project.md); \\} |\n| `opts.markdown?` | `string` |\n| `opts.name` | `string` |\n| `opts.project?` | [`Project`](../../../projects/project/classes/Project.md) |\n\n#### Returns\n\n`Promise`\\<`Document`\\>\n\n***\n\n### createSnippet()\n\n> `static` **createSnippet**(`client`, `opts`): `Promise`\\<`Document`\\>\n\nCreate a snippet: a reusable markdown document that can be inserted into\nany markdown area.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `opts` | \\{ `markdown?`: `string`; `name`: `string`; `project?`: [`Project`](../../../projects/project/classes/Project.md); \\} |\n| `opts.markdown?` | `string` |\n| `opts.name` | `string` |\n| `opts.project?` | [`Project`](../../../projects/project/classes/Project.md) |\n\n#### Returns\n\n`Promise`\\<`Document`\\>\n\n***\n\n### recent()\n\n> `static` **recent**(`client`, `opts?`): `AsyncGenerator`\\<`Document`\\>\n\nThe user's recent documents, most recent first, auto-paginated.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `opts?` | \\{ `fileType?`: `string`; `pageSize?`: `number`; \\} |\n| `opts.fileType?` | `string` |\n| `opts.pageSize?` | `number` |\n\n#### Returns\n\n`AsyncGenerator`\\<`Document`\\>\n\n***\n\n### recentlyDeleted()\n\n> `static` **recentlyDeleted**(`client`): `Promise`\\<`Document`[]\\>\n\nThe user's recently soft-deleted documents. The underlying endpoint also\nreturns deleted chats and projects; those are filtered out here.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`Promise`\\<`Document`[]\\>\n\n\n<!-- src/entities/documents/document/interfaces/CommentThread.md -->\n# Interface: CommentThread\n\nOne of a document's comment threads: its state and its comments.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-comments\"></a> `comments` | [`Comment`](../../comment/classes/Comment.md)[] | The root comment followed by its replies, in order. |\n| <a id=\"property-thread\"></a> `thread` | [`ThreadState`](../../../../../generated/storage/types.gen/type-aliases/ThreadState.md) | The thread state: root id, resolved flag, owner, anchor, timestamps. |\n\n\n<!-- src/entities/documents/namespace/classes/DocumentNamespace.md -->\n# Class: DocumentNamespace\n\n## Constructors\n\n### Constructor\n\n> **new DocumentNamespace**(`client`): `DocumentNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`DocumentNamespace`\n\n## Methods\n\n### byId()\n\n> **byId**(`id`): [`Document`](../../document/classes/Document.md)\n\nA handle to a document by id. Details load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`Document`](../../document/classes/Document.md)\n\n***\n\n### create()\n\n> **create**(`opts`): `Promise`\\<[`Document`](../../document/classes/Document.md)\\>\n\nCreate a markdown document.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts` | \\{ `markdown?`: `string`; `name`: `string`; `project?`: [`Project`](../../../projects/project/classes/Project.md); \\} |\n| `opts.markdown?` | `string` |\n| `opts.name` | `string` |\n| `opts.project?` | [`Project`](../../../projects/project/classes/Project.md) |\n\n#### Returns\n\n`Promise`\\<[`Document`](../../document/classes/Document.md)\\>\n\n***\n\n### createSkill()\n\n> **createSkill**(`opts`): `Promise`\\<[`Document`](../../document/classes/Document.md)\\>\n\nCreate a skill: markdown instructions that AI reads and follows.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts` | \\{ `markdown?`: `string`; `name`: `string`; `project?`: [`Project`](../../../projects/project/classes/Project.md); \\} |\n| `opts.markdown?` | `string` |\n| `opts.name` | `string` |\n| `opts.project?` | [`Project`](../../../projects/project/classes/Project.md) |\n\n#### Returns\n\n`Promise`\\<[`Document`](../../document/classes/Document.md)\\>\n\n***\n\n### createSnippet()\n\n> **createSnippet**(`opts`): `Promise`\\<[`Document`](../../document/classes/Document.md)\\>\n\nCreate a snippet: a reusable markdown document.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts` | \\{ `markdown?`: `string`; `name`: `string`; `project?`: [`Project`](../../../projects/project/classes/Project.md); \\} |\n| `opts.markdown?` | `string` |\n| `opts.name` | `string` |\n| `opts.project?` | [`Project`](../../../projects/project/classes/Project.md) |\n\n#### Returns\n\n`Promise`\\<[`Document`](../../document/classes/Document.md)\\>\n\n***\n\n### recent()\n\n> **recent**(`opts?`): `AsyncGenerator`\\<[`Document`](../../document/classes/Document.md)\\>\n\nThe user's recent documents, most recent first, auto-paginated.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts?` | \\{ `fileType?`: `string`; `pageSize?`: `number`; \\} |\n| `opts.fileType?` | `string` |\n| `opts.pageSize?` | `number` |\n\n#### Returns\n\n`AsyncGenerator`\\<[`Document`](../../document/classes/Document.md)\\>\n\n***\n\n### recentlyDeleted()\n\n> **recentlyDeleted**(): `Promise`\\<[`Document`](../../document/classes/Document.md)[]\\>\n\nThe user's recently soft-deleted documents.\n\n#### Returns\n\n`Promise`\\<[`Document`](../../document/classes/Document.md)[]\\>\n\n***\n\n### search()\n\n> **search**(`query`, `opts?`): `AsyncGenerator`\\<[`Document`](../../document/classes/Document.md)\\>\n\nSearch documents by name and content, most relevant first, auto-paginated.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `query` | `string` |\n| `opts?` | [`SearchOpts`](../../../search/interfaces/SearchOpts.md) |\n\n#### Returns\n\n`AsyncGenerator`\\<[`Document`](../../document/classes/Document.md)\\>\n\n***\n\n### systemSkills()\n\n> **systemSkills**(): `Promise`\\<[`SystemSkill`](../../system-skill/classes/SystemSkill.md)[]\\>\n\nThe built-in system skills: static AI instructions with no document\nbehind them. Unlike user skills they cannot be opened or edited.\n\n#### Returns\n\n`Promise`\\<[`SystemSkill`](../../system-skill/classes/SystemSkill.md)[]\\>\n\n\n<!-- src/entities/documents/system-skill/classes/SystemSkill.md -->\n# Class: SystemSkill\n\nA built-in system skill: static, code-defined AI instructions that surface\nto AI like skill documents but have no document behind them. System skills\ncannot be opened, edited, or deleted; reference them in AI inputs by id the\nsame way as skill documents.\n\n## Properties\n\n| Property | Modifier | Type | Description |\n| ------ | ------ | ------ | ------ |\n| <a id=\"property-id\"></a> `id` | `readonly` | `string` | The well-known id the skill is referenced by in mentions and AI tools. |\n| <a id=\"property-name\"></a> `name` | `readonly` | `string` | The skill's display name. |\n\n## Methods\n\n### list()\n\n> `static` **list**(`client`): `Promise`\\<`SystemSkill`[]\\>\n\nThe built-in system skills, in display order.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`Promise`\\<`SystemSkill`[]\\>\n"+ "overview": "<!-- src/entities/documents/namespace/classes/DocumentNamespace.md -->\n# Class: DocumentNamespace\n\n## Constructors\n\n### Constructor\n\n> **new DocumentNamespace**(`client`): `DocumentNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`DocumentNamespace`\n\n## Methods\n\n### byId()\n\n> **byId**(`id`): [`Document`](../../document/classes/Document.md)\n\nA handle to a document by id. Details load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`Document`](../../document/classes/Document.md)\n\n***\n\n### byTeamSlug()\n\n> **byTeamSlug**(`slug`): `Promise`\\<[`Document`](../../document/classes/Document.md)\\>\n\nResolve a team task reference such as ENG-42.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `slug` | `string` |\n\n#### Returns\n\n`Promise`\\<[`Document`](../../document/classes/Document.md)\\>\n\n***\n\n### create()\n\n> **create**(`opts`): `Promise`\\<[`Document`](../../document/classes/Document.md)\\>\n\nCreate a markdown document.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts` | \\{ `markdown?`: `string`; `name`: `string`; `project?`: [`Project`](../../../projects/project/classes/Project.md); \\} |\n| `opts.markdown?` | `string` |\n| `opts.name` | `string` |\n| `opts.project?` | [`Project`](../../../projects/project/classes/Project.md) |\n\n#### Returns\n\n`Promise`\\<[`Document`](../../document/classes/Document.md)\\>\n\n***\n\n### createSkill()\n\n> **createSkill**(`opts`): `Promise`\\<[`Document`](../../document/classes/Document.md)\\>\n\nCreate a skill: markdown instructions that AI reads and follows.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts` | \\{ `markdown?`: `string`; `name`: `string`; `project?`: [`Project`](../../../projects/project/classes/Project.md); \\} |\n| `opts.markdown?` | `string` |\n| `opts.name` | `string` |\n| `opts.project?` | [`Project`](../../../projects/project/classes/Project.md) |\n\n#### Returns\n\n`Promise`\\<[`Document`](../../document/classes/Document.md)\\>\n\n***\n\n### createSnippet()\n\n> **createSnippet**(`opts`): `Promise`\\<[`Document`](../../document/classes/Document.md)\\>\n\nCreate a snippet: a reusable markdown document.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts` | \\{ `markdown?`: `string`; `name`: `string`; `project?`: [`Project`](../../../projects/project/classes/Project.md); \\} |\n| `opts.markdown?` | `string` |\n| `opts.name` | `string` |\n| `opts.project?` | [`Project`](../../../projects/project/classes/Project.md) |\n\n#### Returns\n\n`Promise`\\<[`Document`](../../document/classes/Document.md)\\>\n\n***\n\n### createUpload()\n\n> **createUpload**(`options`): `Promise`\\<\\{ `content`: [`DocumentContent`](../../../../../generated/storage/types.gen/type-aliases/DocumentContent.md); `contentType`: `string`; `document`: [`Document`](../../document/classes/Document.md); `uploadUrl`: `string` \\| `undefined`; \\}\\>\n\nReserve a binary document and return upload instructions. Upload content before saving.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | \\{ `attachment?`: [`EmailAttachment`](../../../email/attachment/classes/EmailAttachment.md); `branchedFrom?`: [`Document`](../../document/classes/Document.md); `fileType?`: `string`; `isTask?`: `boolean`; `mimeType?`: `string`; `name`: `string`; `project?`: [`Project`](../../../projects/project/classes/Project.md); `sha`: `string`; `team?`: [`Team`](../../../teams/team/classes/Team.md); \\} |\n| `options.attachment?` | [`EmailAttachment`](../../../email/attachment/classes/EmailAttachment.md) |\n| `options.branchedFrom?` | [`Document`](../../document/classes/Document.md) |\n| `options.fileType?` | `string` |\n| `options.isTask?` | `boolean` |\n| `options.mimeType?` | `string` |\n| `options.name` | `string` |\n| `options.project?` | [`Project`](../../../projects/project/classes/Project.md) |\n| `options.sha` | `string` |\n| `options.team?` | [`Team`](../../../teams/team/classes/Team.md) |\n\n#### Returns\n\n`Promise`\\<\\{ `content`: [`DocumentContent`](../../../../../generated/storage/types.gen/type-aliases/DocumentContent.md); `contentType`: `string`; `document`: [`Document`](../../document/classes/Document.md); `uploadUrl`: `string` \\| `undefined`; \\}\\>\n\n***\n\n### recent()\n\n> **recent**(`opts?`): `AsyncGenerator`\\<[`Document`](../../document/classes/Document.md)\\>\n\nThe user's recent documents, most recent first, auto-paginated.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts?` | \\{ `fileType?`: `string`; `pageSize?`: `number`; \\} |\n| `opts.fileType?` | `string` |\n| `opts.pageSize?` | `number` |\n\n#### Returns\n\n`AsyncGenerator`\\<[`Document`](../../document/classes/Document.md)\\>\n\n***\n\n### recentlyDeleted()\n\n> **recentlyDeleted**(): `Promise`\\<[`Document`](../../document/classes/Document.md)[]\\>\n\nThe user's recently soft-deleted documents.\n\n#### Returns\n\n`Promise`\\<[`Document`](../../document/classes/Document.md)[]\\>\n\n***\n\n### search()\n\n> **search**(`query`, `opts?`): `AsyncGenerator`\\<[`Document`](../../document/classes/Document.md)\\>\n\nSearch documents by name and content, most relevant first, auto-paginated.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `query` | `string` |\n| `opts?` | [`SearchOpts`](../../../search/interfaces/SearchOpts.md) |\n\n#### Returns\n\n`AsyncGenerator`\\<[`Document`](../../document/classes/Document.md)\\>\n\n***\n\n### systemSkills()\n\n> **systemSkills**(): `Promise`\\<[`SystemSkill`](../../system-skill/classes/SystemSkill.md)[]\\>\n\nThe built-in system skills: static AI instructions with no document\nbehind them. Unlike user skills they cannot be opened or edited.\n\n#### Returns\n\n`Promise`\\<[`SystemSkill`](../../system-skill/classes/SystemSkill.md)[]\\>\n\n***\n\n### validatePermissionsToken()\n\n> **validatePermissionsToken**(`token`): `Promise`\\<\\{ `accessLevel`: [`AccessLevel`](../../../../../generated/storage/types.gen/type-aliases/AccessLevel.md); `document`: [`Document`](../../document/classes/Document.md); `expiresAt`: `number`; `issuer`: `string`; `user`: [`User`](../../../users/user/classes/User.md) \\| `undefined`; \\}\\>\n\nValidate a permissions token, returning its document and optional user handles.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `token` | `string` |\n\n#### Returns\n\n`Promise`\\<\\{ `accessLevel`: [`AccessLevel`](../../../../../generated/storage/types.gen/type-aliases/AccessLevel.md); `document`: [`Document`](../../document/classes/Document.md); `expiresAt`: `number`; `issuer`: `string`; `user`: [`User`](../../../users/user/classes/User.md) \\| `undefined`; \\}\\>\n",+ "documentation": "# Macro SDK: documents\n\nGenerated by TypeDoc. Paths below refer to the canonical Markdown hierarchy. Other entity handles are documented in their named section; request core for shared SDK helpers.\n\n<!-- generated/properties/types.gen/type-aliases/BulkUpdateEntityPropertyOptionsResponse.md -->\n# Type Alias: BulkUpdateEntityPropertyOptionsResponse\n\n> **BulkUpdateEntityPropertyOptionsResponse** = \\{ `properties`: [`EntityPropertyOptionSelectionResponse`](EntityPropertyOptionSelectionResponse.md)[]; \\}\n\nResponse for a bulk option update: each property's reconciled final ids.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-properties\"></a> `properties` | [`EntityPropertyOptionSelectionResponse`](EntityPropertyOptionSelectionResponse.md)[] | The final option ids per updated property. |\n\n\n<!-- generated/properties/types.gen/type-aliases/DataType.md -->\n# Type Alias: DataType\n\n> **DataType** = `\"BOOLEAN\"` \\| `\"DATE\"` \\| `\"NUMBER\"` \\| `\"STRING\"` \\| `\"SELECT_NUMBER\"` \\| `\"SELECT_STRING\"` \\| `\"TAG\"` \\| `\"ENTITY\"` \\| `\"LINK\"`\n\nData type for property values, determining storage and validation.\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityProperty.md -->\n# Type Alias: EntityProperty\n\n> **EntityProperty** = \\{ `created_at`: `string`; `entity_id`: `string`; `entity_type`: [`EntityType`](EntityType.md); `id`: `string`; `property_definition_id`: `string`; `updated_at`: `string`; \\}\n\nAssignment of a property definition to a specific entity (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-created_at\"></a> `created_at` | `string` |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` |\n| <a id=\"property-entity_type\"></a> `entity_type` | [`EntityType`](EntityType.md) |\n| <a id=\"property-id\"></a> `id` | `string` |\n| <a id=\"property-property_definition_id\"></a> `property_definition_id` | `string` |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityPropertyOptionSelectionResponse.md -->\n# Type Alias: EntityPropertyOptionSelectionResponse\n\n> **EntityPropertyOptionSelectionResponse** = \\{ `option_ids`: `string`[]; `property_id`: `string`; \\}\n\nThe reconciled final option ids stored for one property after a bulk update.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-option_ids\"></a> `option_ids` | `string`[] | The final option ids the server persisted, in stored order. |\n| <a id=\"property-property_id\"></a> `property_id` | `string` | The property definition the options belong to. |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md -->\n# Type Alias: EntityPropertyWithDefinition\n\n> **EntityPropertyWithDefinition** = \\{ `definition`: [`PropertyDefinition`](PropertyDefinition.md); `options?`: [`PropertyOption`](PropertyOption.md)[] \\| `null`; `property`: [`EntityProperty`](EntityProperty.md); `value?`: `null` \\| [`PropertyValue`](PropertyValue.md); \\}\n\nEntity property with its definition, value, and options (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-definition\"></a> `definition` | [`PropertyDefinition`](PropertyDefinition.md) |\n| <a id=\"property-options\"></a> `options?` | [`PropertyOption`](PropertyOption.md)[] \\| `null` |\n| <a id=\"property-property\"></a> `property` | [`EntityProperty`](EntityProperty.md) |\n| <a id=\"property-value\"></a> `value?` | `null` \\| [`PropertyValue`](PropertyValue.md) |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityReference.md -->\n# Type Alias: EntityReference\n\n> **EntityReference** = \\{ `entity_id`: `string`; `entity_type`: [`EntityType`](EntityType.md); `specific_message_id?`: `string` \\| `null`; \\}\n\nEntity reference for entity-type property values.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | - |\n| <a id=\"property-entity_type\"></a> `entity_type` | [`EntityType`](EntityType.md) | - |\n| <a id=\"property-specific_message_id\"></a> `specific_message_id?` | `string` \\| `null` | For CHANNEL, CHAT, THREAD entity types - optional specific message ID. This allows referencing a specific message within a thread/channel/chat. |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityType.md -->\n# Type Alias: EntityType\n\n> **EntityType** = `\"CALENDAR_EVENT\"` \\| `\"CALL_RECORD\"` \\| `\"CHANNEL\"` \\| `\"CHAT\"` \\| `\"COMPANY\"` \\| `\"DATABASE_ROW\"` \\| `\"CONTACT\"` \\| `\"DOCUMENT\"` \\| `\"INITIATIVE\"` \\| `\"PROJECT\"` \\| `\"TASK\"` \\| `\"THREAD\"` \\| `\"USER\"`\n\nType of entity that can be referenced by entity properties.\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyDefinition.md -->\n# Type Alias: PropertyDefinition\n\n> **PropertyDefinition** = \\{ `created_at`: `string`; `data_type`: [`DataType`](DataType.md); `display_name`: `string`; `id`: `string`; `is_metadata`: `boolean`; `is_multi_select`: `boolean`; `is_system`: `boolean`; `owner`: [`PropertyOwner`](PropertyOwner.md); `specific_entity_type`: `null` \\| [`EntityType`](EntityType.md); `updated_at`: `string`; \\}\n\nProperty definition model (service representation).\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | - |\n| <a id=\"property-data_type\"></a> `data_type` | [`DataType`](DataType.md) | - |\n| <a id=\"property-display_name\"></a> `display_name` | `string` | - |\n| <a id=\"property-id\"></a> `id` | `string` | - |\n| <a id=\"property-is_metadata\"></a> `is_metadata` | `boolean` | Flag to indicate if this is a system-generated metadata property. Not stored in database - computed at service layer. |\n| <a id=\"property-is_multi_select\"></a> `is_multi_select` | `boolean` | - |\n| <a id=\"property-is_system\"></a> `is_system` | `boolean` | Flag to indicate if this is a system property (stored in DB). |\n| <a id=\"property-owner\"></a> `owner` | [`PropertyOwner`](PropertyOwner.md) | - |\n| <a id=\"property-specific_entity_type\"></a> `specific_entity_type` | `null` \\| [`EntityType`](EntityType.md) | - |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` | - |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyOption.md -->\n# Type Alias: PropertyOption\n\n> **PropertyOption** = \\{ `color`: `string` \\| `null`; `created_at`: `string`; `display_order`: `number`; `id`: `string`; `property_definition_id`: `string`; `updated_at`: `string`; `value`: [`PropertyOptionValue`](PropertyOptionValue.md); \\}\n\nA selectable option for select-type properties (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-color\"></a> `color` | `string` \\| `null` |\n| <a id=\"property-created_at\"></a> `created_at` | `string` |\n| <a id=\"property-display_order\"></a> `display_order` | `number` |\n| <a id=\"property-id\"></a> `id` | `string` |\n| <a id=\"property-property_definition_id\"></a> `property_definition_id` | `string` |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` |\n| <a id=\"property-value\"></a> `value` | [`PropertyOptionValue`](PropertyOptionValue.md) |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyOptionValue.md -->\n# Type Alias: PropertyOptionValue\n\n> **PropertyOptionValue** = \\{ `type`: `\"string\"`; `value`: `string`; \\} \\| \\{ `type`: `\"number\"`; `value`: `number`; \\}\n\nThe value of a property option - either a string or a number.\n\n## Union Members\n\n### Type Literal\n\n\\{ `type`: `\"string\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"string\"` | - |\n| `value` | `string` | String value for SelectString properties |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"number\"`; `value`: `number`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"number\"` | - |\n| `value` | `number` | Number value for SelectNumber properties |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyOwner.md -->\n# Type Alias: PropertyOwner\n\n> **PropertyOwner** = \\{ `scope`: `\"user\"`; `user_id`: `string`; \\} \\| \\{ `scope`: `\"team\"`; `team_id`: `string`; \\} \\| \\{ `database_id`: `string`; `scope`: `\"database\"`; \\} \\| \\{ `scope`: `\"system\"`; \\}\n\nDefines who owns a property - user-scoped, team-scoped, database-scoped, or system.\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyTargetEntityType.md -->\n# Type Alias: PropertyTargetEntityType\n\n> **PropertyTargetEntityType** = `\"CALL_RECORD\"` \\| `\"CHANNEL\"` \\| `\"CHAT\"` \\| `\"COMPANY\"` \\| `\"DATABASE_ROW\"` \\| `\"DOCUMENT\"` \\| `\"INITIATIVE\"` \\| `\"PROJECT\"` \\| `\"THREAD\"` \\| `\"USER\"`\n\nCanonical type of an entity receiving properties.\n\nTasks are documents at API boundaries. `Task` intentionally does not exist\nhere; task classification is resolved by the properties domain from the\ndocument subtype.\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyTargetReference.md -->\n# Type Alias: PropertyTargetReference\n\n> **PropertyTargetReference** = \\{ `entity_id`: `string`; `entity_type`: [`PropertyTargetEntityType`](PropertyTargetEntityType.md); \\}\n\nCanonical reference to an entity receiving properties.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | Entity identifier. |\n| <a id=\"property-entity_type\"></a> `entity_type` | [`PropertyTargetEntityType`](PropertyTargetEntityType.md) | Canonical entity type. |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyValue.md -->\n# Type Alias: PropertyValue\n\n> **PropertyValue** = \\{ `type`: `\"Boolean\"`; `value`: `boolean`; \\} \\| \\{ `type`: `\"Number\"`; `value`: `number`; \\} \\| \\{ `type`: `\"String\"`; `value`: `string`; \\} \\| \\{ `type`: `\"Date\"`; `value`: `string`; \\} \\| \\{ `type`: `\"SelectOption\"`; `value`: `string`[]; \\} \\| \\{ `type`: `\"EntityReference\"`; `value`: [`EntityReference`](EntityReference.md)[]; \\} \\| \\{ `type`: `\"Link\"`; `value`: `string`[]; \\}\n\nProperty value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to/from JSONB in the database.\n\n## Union Members\n\n### Type Literal\n\n\\{ `type`: `\"Boolean\"`; `value`: `boolean`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Boolean\"` | - |\n| `value` | `boolean` | Boolean value Serializes as: {\"type\": \"Boolean\", \"value\": true} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"Number\"`; `value`: `number`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Number\"` | - |\n| `value` | `number` | Numeric value Serializes as: {\"type\": \"Number\", \"value\": 42.5} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"String\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"String\"` | - |\n| `value` | `string` | String value Serializes as: {\"type\": \"String\", \"value\": \"text\"} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"Date\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Date\"` | - |\n| `value` | `string` | Date/timestamp value Serializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"SelectOption\"`; `value`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"SelectOption\"` | - |\n| `value` | `string`[] | Select option(s) - always an array (check is_multi_select to determine if single or multi) Single-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1) Multi-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+) |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"EntityReference\"`; `value`: [`EntityReference`](EntityReference.md)[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"EntityReference\"` | - |\n| `value` | [`EntityReference`](EntityReference.md)[] | Entity reference(s) - always an array (check is_multi_select to determine if single or multi) Single-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1) Multi-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+) |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"Link\"`; `value`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Link\"` | - |\n| `value` | `string`[] | Link value(s) - always an array (check is_multi_select to determine if single or multi) Single-select: {\"type\": \"Link\", \"value\": [\"https://example.com\"]} (length 0 or 1) Multi-select: {\"type\": \"Link\", \"value\": [\"https://example.com\", \"https://other.com\"]} (length 0+) |\n\n\n<!-- generated/properties/types.gen/type-aliases/SetPropertyValue.md -->\n# Type Alias: SetPropertyValue\n\n> **SetPropertyValue** = \\{ `type`: `\"boolean\"`; `value`: `boolean`; \\} \\| \\{ `type`: `\"date\"`; `value`: `string`; \\} \\| \\{ `type`: `\"number\"`; `value`: `number`; \\} \\| \\{ `type`: `\"string\"`; `value`: `string`; \\} \\| \\{ `option_id`: `string`; `type`: `\"select_option\"`; \\} \\| \\{ `option_ids`: `string`[]; `type`: `\"multi_select_option\"`; \\} \\| \\{ `reference`: [`EntityReference`](EntityReference.md); `type`: `\"entity_reference\"`; \\} \\| \\{ `references`: [`EntityReference`](EntityReference.md)[]; `type`: `\"multi_entity_reference\"`; \\} \\| \\{ `type`: `\"link\"`; `url`: `string`; \\} \\| \\{ `type`: `\"multi_link\"`; `urls`: `string`[]; \\}\n\nType-safe enum for setting entity property values - provides compile-time validation.\n\n\n<!-- generated/storage/types.gen/type-aliases/AccessLevel.md -->\n# Type Alias: AccessLevel\n\n> **AccessLevel** = `\"view\"` \\| `\"comment\"` \\| `\"edit\"` \\| `\"owner\"`\n\nOrdered from least to most access top -> bottom\n\n\n<!-- generated/storage/types.gen/type-aliases/Anchor.md -->\n# Type Alias: Anchor\n\n> **Anchor** = [`PdfAnchor`](PdfAnchor.md)\n\n\n<!-- generated/storage/types.gen/type-aliases/BomPart.md -->\n# Type Alias: BomPart\n\n> **BomPart** = \\{ `id`: `string`; `path`: `string`; `sha`: `string`; \\}\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-id\"></a> `id` | `string` | The uuid of the bom part |\n| <a id=\"property-path\"></a> `path` | `string` | The file path of the bom part content |\n| <a id=\"property-sha\"></a> `sha` | `string` | The sha of the bom part content There is an index on sha for more performant queries based on it. |\n\n\n<!-- generated/storage/types.gen/type-aliases/BotSenderProfile.md -->\n# Type Alias: BotSenderProfile\n\n> **BotSenderProfile** = \\{ `avatar_url?`: `string` \\| `null`; `name`: `string`; \\}\n\nPublic bot profile attached to bot-authored messages.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-avatar_url\"></a> `avatar_url?` | `string` \\| `null` | Bot avatar URL. |\n| <a id=\"property-name\"></a> `name` | `string` | Bot display name. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ChannelSharePermission.md -->\n# Type Alias: ChannelSharePermission\n\n> **ChannelSharePermission** = \\{ `access_level`: [`AccessLevel`](AccessLevel.md); `channel_id`: `string`; \\}\n\nThe channel share permission\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-access_level\"></a> `access_level` | [`AccessLevel`](AccessLevel.md) | The access level for the channel |\n| <a id=\"property-channel_id\"></a> `channel_id` | `string` | The channel id |\n\n\n<!-- generated/storage/types.gen/type-aliases/CountedReaction.md -->\n# Type Alias: CountedReaction\n\n> **CountedReaction** = \\{ `emoji`: `string`; `users`: `string`[]; \\}\n\nReaction emoji and the users who added it.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-emoji\"></a> `emoji` | `string` | Emoji being reacted with. |\n| <a id=\"property-users\"></a> `users` | `string`[] | User identifiers. |\n\n\n<!-- generated/storage/types.gen/type-aliases/DocumentContent.md -->\n# Type Alias: DocumentContent\n\n> **DocumentContent** = \\{ `location?`: `null` \\| [`DocumentContentLocation`](DocumentContentLocation.md); `state`: [`DocumentContentState`](DocumentContentState.md); \\}\n\nAPI-visible content lifecycle and location metadata.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-location\"></a> `location?` | `null` \\| [`DocumentContentLocation`](DocumentContentLocation.md) | - |\n| <a id=\"property-state\"></a> `state` | [`DocumentContentState`](DocumentContentState.md) | The current lifecycle state of the content. |\n\n\n<!-- generated/storage/types.gen/type-aliases/DocumentContentLocation.md -->\n# Type Alias: DocumentContentLocation\n\n> **DocumentContentLocation** = `\"object_storage\"` \\| `\"sync_service\"` \\| `\"docx_bom_parts\"` \\| `\"converted_pdf\"` \\| `\"unknown\"`\n\nWhere document content is, or is expected to be, read from.\n\n\n<!-- generated/storage/types.gen/type-aliases/DocumentContentState.md -->\n# Type Alias: DocumentContentState\n\n> **DocumentContentState** = `\"unknown\"` \\| `\"pending\"` \\| `\"ready\"`\n\nAPI-visible content lifecycle state derived from current document metadata.\n\n\n<!-- generated/storage/types.gen/type-aliases/DocumentId.md -->\n# Type Alias: DocumentId\n\n> **DocumentId** = `string`\n\nA validated document identifier. Historical document ids need not be UUIDs.\n\n\n<!-- generated/storage/types.gen/type-aliases/DocumentMetadata.md -->\n# Type Alias: DocumentMetadata\n\n> **DocumentMetadata** = \\{ `branchedFromId?`: `string` \\| `null`; `branchedFromVersionId?`: `number` \\| `null`; `createdAt?`: `string` \\| `null`; `deletedAt?`: `string` \\| `null`; `documentBom?`: [`BomPart`](BomPart.md)[] \\| `null`; `documentFamilyId?`: `number` \\| `null`; `documentId`: `string`; `documentName`: `string`; `documentVersionId`: `number`; `fileType?`: `string` \\| `null`; `modificationData?`: `unknown`; `owner`: `string`; `projectId?`: `string` \\| `null`; `projectName?`: `string` \\| `null`; `sha?`: `string` \\| `null`; `subType?`: `null` \\| [`DocumentSubType`](DocumentSubType.md); `updatedAt?`: `string` \\| `null`; \\}\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-branchedfromid\"></a> `branchedFromId?` | `string` \\| `null` | The id of the document this document branched from |\n| <a id=\"property-branchedfromversionid\"></a> `branchedFromVersionId?` | `number` \\| `null` | The id of the version this document branched from This could be either DocumentInstance or DocumentBom id depending on the file type |\n| <a id=\"property-createdat\"></a> `createdAt?` | `string` \\| `null` | The time the document was created |\n| <a id=\"property-deletedat\"></a> `deletedAt?` | `string` \\| `null` | The time the document was deleted |\n| <a id=\"property-documentbom\"></a> `documentBom?` | [`BomPart`](BomPart.md)[] \\| `null` | If the document is a DOCX document and unzipped, the document_bom will be present |\n| <a id=\"property-documentfamilyid\"></a> `documentFamilyId?` | `number` \\| `null` | The id of the document family this document belongs to |\n| <a id=\"property-documentid\"></a> `documentId` | `string` | The document id |\n| <a id=\"property-documentname\"></a> `documentName` | `string` | The name of the document |\n| <a id=\"property-documentversionid\"></a> `documentVersionId` | `number` | The version of the document This could be the document_instance_id or document_bom_id depending on the file type |\n| <a id=\"property-filetype\"></a> `fileType?` | `string` \\| `null` | The file type of the document (file extension) |\n| <a id=\"property-modificationdata\"></a> `modificationData?` | `unknown` | The modification data for the document instance. This is only used for PDF documents. |\n| <a id=\"property-owner\"></a> `owner` | `string` | The owner of the document |\n| <a id=\"property-projectid\"></a> `projectId?` | `string` \\| `null` | The id of the project that this document belongs to |\n| <a id=\"property-projectname\"></a> `projectName?` | `string` \\| `null` | The name of the project that this document belongs to |\n| <a id=\"property-sha\"></a> `sha?` | `string` \\| `null` | If the document is a PDF, this is the SHA of the pdf If the document is a DOCX, this will not be present |\n| <a id=\"property-subtype\"></a> `subType?` | `null` \\| [`DocumentSubType`](DocumentSubType.md) | - |\n| <a id=\"property-updatedat\"></a> `updatedAt?` | `string` \\| `null` | The time the document instance / document BOM was updated |\n\n\n<!-- generated/storage/types.gen/type-aliases/DocumentMetadataWithContent.md -->\n# Type Alias: DocumentMetadataWithContent\n\n> **DocumentMetadataWithContent** = [`DocumentMetadata`](DocumentMetadata.md) & \\{ `content`: [`DocumentContent`](DocumentContent.md); `teamId?`: `string` \\| `null`; `teamTaskId?`: `number` \\| `null`; \\}\n\nFull document metadata plus content lifecycle metadata.\n\n## Type Declaration\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `content` | [`DocumentContent`](DocumentContent.md) | Content lifecycle and location metadata. |\n| `teamId?` | `string` \\| `null` | The team this task number is scoped to, for task documents. |\n| `teamTaskId?` | `number` \\| `null` | The task number assigned within the team, for task documents. |\n\n\n<!-- generated/storage/types.gen/type-aliases/DocumentResponseMetadata.md -->\n# Type Alias: DocumentResponseMetadata\n\n> **DocumentResponseMetadata** = \\{ `branchedFromId?`: `string` \\| `null`; `branchedFromVersionId?`: `number` \\| `null`; `createdAt?`: `string` \\| `null`; `documentBom?`: [`BomPart`](BomPart.md)[] \\| `null`; `documentFamilyId?`: `number` \\| `null`; `documentId`: `string`; `documentName`: `string`; `documentVersionId`: `number`; `fileType?`: `string` \\| `null`; `modificationData?`: `unknown`; `owner`: `string`; `sha?`: `string` \\| `null`; `subType?`: `null` \\| [`DocumentSubType`](DocumentSubType.md); `updatedAt?`: `string` \\| `null`; \\}\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-branchedfromid\"></a> `branchedFromId?` | `string` \\| `null` | The id of the document this document branched from |\n| <a id=\"property-branchedfromversionid\"></a> `branchedFromVersionId?` | `number` \\| `null` | The id of the version this document branched from This could be either DocumentInstance or DocumentBom id depending on the file type |\n| <a id=\"property-createdat\"></a> `createdAt?` | `string` \\| `null` | The time the document was created |\n| <a id=\"property-documentbom\"></a> `documentBom?` | [`BomPart`](BomPart.md)[] \\| `null` | If the document is a DOCX document, the document_bom will be present |\n| <a id=\"property-documentfamilyid\"></a> `documentFamilyId?` | `number` \\| `null` | The id of the document family this document belongs to |\n| <a id=\"property-documentid\"></a> `documentId` | `string` | The document id |\n| <a id=\"property-documentname\"></a> `documentName` | `string` | The name of the document |\n| <a id=\"property-documentversionid\"></a> `documentVersionId` | `number` | The version of the document This could be the document_instance_id or document_bom_id depending on the file type |\n| <a id=\"property-filetype\"></a> `fileType?` | `string` \\| `null` | The file type of the document |\n| <a id=\"property-modificationdata\"></a> `modificationData?` | `unknown` | The modification data for the document instance. This is only used for PDF documents. |\n| <a id=\"property-owner\"></a> `owner` | `string` | The owner of the document |\n| <a id=\"property-sha\"></a> `sha?` | `string` \\| `null` | If the document is a PDF, this is the SHA of the pdf If the document is a DOCX, this will not be present |\n| <a id=\"property-subtype\"></a> `subType?` | `null` \\| [`DocumentSubType`](DocumentSubType.md) | - |\n| <a id=\"property-updatedat\"></a> `updatedAt?` | `string` \\| `null` | The time the document instance / document BOM was updated |\n\n\n<!-- generated/storage/types.gen/type-aliases/DocumentSubType.md -->\n# Type Alias: DocumentSubType\n\n> **DocumentSubType** = `\"task\"` \\| `\"snippet\"` \\| `\"skill\"` \\| `\"initiative_description\"`\n\nThe document sub type enum represents all values of document sub types.\nThese values should match the `document_sub_type_value` table in macrodb.\n\nWire, database, and `Display` spellings are all `snake_case` so a\nmulti-word variant serializes identically in every system.\n\n\n<!-- generated/storage/types.gen/type-aliases/DocumentTeamShareResponse.md -->\n# Type Alias: DocumentTeamShareResponse\n\n> **DocumentTeamShareResponse** = \\{ `sharedWithTeam`: `boolean`; `teamId?`: `string` \\| `null`; \\}\n\nThe team-share state of a document. The team is resolved from the document\nowner's team membership.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-sharedwithteam\"></a> `sharedWithTeam` | `boolean` | Whether explicit team sharing is enabled; inherited team access does not count. |\n| <a id=\"property-teamid\"></a> `teamId?` | `string` \\| `null` | The owner's team the document is (or would be) shared with. `None` when the owner does not belong to a team. |\n\n\n<!-- generated/storage/types.gen/type-aliases/EditPdfPlaceableCommentAnchorRequest.md -->\n# Type Alias: EditPdfPlaceableCommentAnchorRequest\n\n> **EditPdfPlaceableCommentAnchorRequest** = \\{ `allowableEdits?`: `unknown`; `heightPct?`: `number` \\| `null`; `originalIndex?`: `number` \\| `null`; `originalPage?`: `number` \\| `null`; `page?`: `number` \\| `null`; `rotation?`: `number` \\| `null`; `shouldLockOnSave?`: `boolean` \\| `null`; `uuid`: `string`; `wasDeleted?`: `boolean` \\| `null`; `wasEdited?`: `boolean` \\| `null`; `widthPct?`: `number` \\| `null`; `xPct?`: `number` \\| `null`; `yPct?`: `number` \\| `null`; \\}\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-allowableedits\"></a> `allowableEdits?` | `unknown` |\n| <a id=\"property-heightpct\"></a> `heightPct?` | `number` \\| `null` |\n| <a id=\"property-originalindex\"></a> `originalIndex?` | `number` \\| `null` |\n| <a id=\"property-originalpage\"></a> `originalPage?` | `number` \\| `null` |\n| <a id=\"property-page\"></a> `page?` | `number` \\| `null` |\n| <a id=\"property-rotation\"></a> `rotation?` | `number` \\| `null` |\n| <a id=\"property-shouldlockonsave\"></a> `shouldLockOnSave?` | `boolean` \\| `null` |\n| <a id=\"property-uuid\"></a> `uuid` | `string` |\n| <a id=\"property-wasdeleted\"></a> `wasDeleted?` | `boolean` \\| `null` |\n| <a id=\"property-wasedited\"></a> `wasEdited?` | `boolean` \\| `null` |\n| <a id=\"property-widthpct\"></a> `widthPct?` | `number` \\| `null` |\n| <a id=\"property-xpct\"></a> `xPct?` | `number` \\| `null` |\n| <a id=\"property-ypct\"></a> `yPct?` | `number` \\| `null` |\n\n\n<!-- generated/storage/types.gen/type-aliases/EntityPermission.md -->\n# Type Alias: EntityPermission\n\n> **EntityPermission** = \\{ `access_level`: [`AccessLevel`](AccessLevel.md); `type`: `\"access_level\"`; \\} \\| \\{ `type`: `\"channel_view_only\"`; \\} \\| \\{ `role`: [`ParticipantRole`](ParticipantRole.md); `type`: `\"channel_role\"`; \\} \\| \\{ `role`: [`TeamRole`](TeamRole.md); `type`: `\"team_role\"`; \\}\n\nA user's permission for an entity, discriminated by entity kind.\n\nItems (documents, chats, projects, threads) use access levels.\nChannels use view-only permission or participant roles.\n\n## Union Members\n\n### Type Literal\n\n\\{ `access_level`: [`AccessLevel`](AccessLevel.md); `type`: `\"access_level\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `access_level` | [`AccessLevel`](AccessLevel.md) | The access level the user has. |\n| `type` | `\"access_level\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"channel_view_only\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `role`: [`ParticipantRole`](ParticipantRole.md); `type`: `\"channel_role\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `role` | [`ParticipantRole`](ParticipantRole.md) | The role the user has in the channel. |\n| `type` | `\"channel_role\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `role`: [`TeamRole`](TeamRole.md); `type`: `\"team_role\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `role` | [`TeamRole`](TeamRole.md) | The role the user has in the team. |\n| `type` | `\"team_role\"` | - |\n\n\n<!-- generated/storage/types.gen/type-aliases/GetDocumentResponseData.md -->\n# Type Alias: GetDocumentResponseData\n\n> **GetDocumentResponseData** = \\{ `documentMetadata`: [`DocumentMetadata`](DocumentMetadata.md); `userAccessLevel`: [`AccessLevel`](AccessLevel.md); `viewLocation?`: `string` \\| `null`; \\}\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-documentmetadata\"></a> `documentMetadata` | [`DocumentMetadata`](DocumentMetadata.md) | The metadata of the document |\n| <a id=\"property-useraccesslevel\"></a> `userAccessLevel` | [`AccessLevel`](AccessLevel.md) | The users level of access to the document |\n| <a id=\"property-viewlocation\"></a> `viewLocation?` | `string` \\| `null` | The users view location if there is one |\n\n\n<!-- generated/storage/types.gen/type-aliases/GithubPullRequest.md -->\n# Type Alias: GithubPullRequest\n\n> **GithubPullRequest** = \\{ `additions?`: `number` \\| `null`; `checks?`: [`GithubPullRequestCheckRun`](GithubPullRequestCheckRun.md)[] \\| `null`; `comments?`: [`GithubPullRequestComment`](GithubPullRequestComment.md)[] \\| `null`; `deletions?`: `number` \\| `null`; `displayName`: `string`; `foreignEntityId?`: `string` \\| `null`; `githubKey`: `string`; `name?`: `string` \\| `null`; `number`: `number`; `owner`: `string`; `repo`: `string`; `status?`: `string` \\| `null`; `url`: `string`; \\}\n\nDisplay-ready data for a GitHub pull request associated with a task.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-additions\"></a> `additions?` | `number` \\| `null` | The number of added lines in the pull request, when enrichment data is available. |\n| <a id=\"property-checks\"></a> `checks?` | [`GithubPullRequestCheckRun`](GithubPullRequestCheckRun.md)[] \\| `null` | Check runs collected from the pull request head commit, when enrichment data is available. |\n| <a id=\"property-comments\"></a> `comments?` | [`GithubPullRequestComment`](GithubPullRequestComment.md)[] \\| `null` | Comments collected from the pull request, when enrichment data is available. |\n| <a id=\"property-deletions\"></a> `deletions?` | `number` \\| `null` | The number of deleted lines in the pull request, when enrichment data is available. |\n| <a id=\"property-displayname\"></a> `displayName` | `string` | A compact label suitable for display in the UI. |\n| <a id=\"property-foreignentityid\"></a> `foreignEntityId?` | `string` \\| `null` | The internal `foreign_entity.id` UUID for the GitHub pull request row. |\n| <a id=\"property-githubkey\"></a> `githubKey` | `string` | The stored GitHub association key, in `owner/repo/pull/number` format. |\n| <a id=\"property-name\"></a> `name?` | `string` \\| `null` | The GitHub pull request title, when enrichment data is available. |\n| <a id=\"property-number\"></a> `number` | `number` | The GitHub pull request number. |\n| <a id=\"property-owner\"></a> `owner` | `string` | The GitHub repository owner or organization. |\n| <a id=\"property-repo\"></a> `repo` | `string` | The GitHub repository name. |\n| <a id=\"property-status\"></a> `status?` | `string` \\| `null` | The GitHub pull request status, when enrichment data is available. |\n| <a id=\"property-url\"></a> `url` | `string` | The public GitHub URL for the pull request. |\n\n\n<!-- generated/storage/types.gen/type-aliases/GithubPullRequestCheckRun.md -->\n# Type Alias: GithubPullRequestCheckRun\n\n> **GithubPullRequestCheckRun** = \\{ `completedAt?`: `string` \\| `null`; `conclusion?`: `string` \\| `null`; `id`: `number`; `name`: `string`; `startedAt?`: `string` \\| `null`; `status`: `string`; `url?`: `string` \\| `null`; \\}\n\nA check run associated with a GitHub pull request.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-completedat\"></a> `completedAt?` | `string` \\| `null` | When the check run completed, when available. |\n| <a id=\"property-conclusion\"></a> `conclusion?` | `string` \\| `null` | The raw GitHub check run conclusion, when the run has completed. |\n| <a id=\"property-id\"></a> `id` | `number` | The unique GitHub identifier for the check run. |\n| <a id=\"property-name\"></a> `name` | `string` | The check run name. |\n| <a id=\"property-startedat\"></a> `startedAt?` | `string` \\| `null` | When the check run started, when available. |\n| <a id=\"property-status\"></a> `status` | `string` | The raw GitHub check run status. |\n| <a id=\"property-url\"></a> `url?` | `string` \\| `null` | The public GitHub URL for the check run, when available. |\n\n\n<!-- generated/storage/types.gen/type-aliases/GithubPullRequestComment.md -->\n# Type Alias: GithubPullRequestComment\n\n> **GithubPullRequestComment** = \\{ `authorAssociation?`: `string` \\| `null`; `authorId?`: `number` \\| `null`; `authorLogin?`: `string` \\| `null`; `body`: `string`; `createdAt?`: `string` \\| `null`; `id`: `number`; `inReplyToId?`: `number` \\| `null`; `line?`: `number` \\| `null`; `originalLine?`: `number` \\| `null`; `path?`: `string` \\| `null`; `pullRequestReviewId?`: `number` \\| `null`; `source`: `string`; `updatedAt?`: `string` \\| `null`; `url?`: `string` \\| `null`; \\}\n\nA comment associated with a GitHub pull request.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-authorassociation\"></a> `authorAssociation?` | `string` \\| `null` | GitHub's relationship label for the author, when available. |\n| <a id=\"property-authorid\"></a> `authorId?` | `number` \\| `null` | The stable numeric GitHub user id for the comment author, when available. |\n| <a id=\"property-authorlogin\"></a> `authorLogin?` | `string` \\| `null` | The GitHub login for the comment author, when available. |\n| <a id=\"property-body\"></a> `body` | `string` | The comment or review body text. |\n| <a id=\"property-createdat\"></a> `createdAt?` | `string` \\| `null` | When the comment was created or the review was submitted. |\n| <a id=\"property-id\"></a> `id` | `number` | The unique GitHub identifier for the comment or review. |\n| <a id=\"property-inreplytoid\"></a> `inReplyToId?` | `number` \\| `null` | The id of the comment this one replies to, when it is part of a review thread. Only ever present on `review_comment` sources. |\n| <a id=\"property-line\"></a> `line?` | `number` \\| `null` | The line in the current diff the comment is anchored to. Cleared by GitHub when later commits outdate the comment's diff. |\n| <a id=\"property-originalline\"></a> `originalLine?` | `number` \\| `null` | The line the comment was originally anchored to, kept even when the diff has since changed. |\n| <a id=\"property-path\"></a> `path?` | `string` \\| `null` | The repository-relative file path the review comment is anchored to. Only ever present on `review_comment` sources. |\n| <a id=\"property-pullrequestreviewid\"></a> `pullRequestReviewId?` | `number` \\| `null` | The id of the pull request review this comment was submitted with. Only ever present on `review_comment` sources. |\n| <a id=\"property-source\"></a> `source` | `string` | The GitHub source for the comment, such as `issue_comment` or `review_comment`. |\n| <a id=\"property-updatedat\"></a> `updatedAt?` | `string` \\| `null` | When the comment or review was last updated. |\n| <a id=\"property-url\"></a> `url?` | `string` \\| `null` | The public GitHub URL for the comment or review, when available. |\n\n\n<!-- generated/storage/types.gen/type-aliases/HighlightType.md -->\n# Type Alias: HighlightType\n\n> **HighlightType** = `1` \\| `2` \\| `3`\n\n\n<!-- generated/storage/types.gen/type-aliases/ImportedAuthor.md -->\n# Type Alias: ImportedAuthor\n\n> **ImportedAuthor** = \\{ `name`: `string`; \\}\n\nDisplay attribution for a comment imported from an external document.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-name\"></a> `name` | `string` | Original author text; never interpreted as an authenticated principal. |\n\n\n<!-- generated/storage/types.gen/type-aliases/LinkShare.md -->\n# Type Alias: LinkShare\n\n> **LinkShare** = `\"PUBLIC\"` \\| `\"TEAM\"`\n\nDefines who can access an item through its share link.\n\n\n<!-- generated/storage/types.gen/type-aliases/Message.md -->\n# Type Alias: Message\n\n> **Message** = \\{ `attachments`: [`MessageAttachment`](MessageAttachment.md)[]; `bot_profile?`: `null` \\| [`BotSenderProfile`](BotSenderProfile.md); `content`: `string`; `created_at`: `string`; `deleted_at?`: `string` \\| `null`; `edited_at?`: `string` \\| `null`; `guest_name?`: `string` \\| `null`; `id`: `string`; `imported_author?`: `null` \\| [`ImportedAuthor`](ImportedAuthor.md); `mentions`: [`SimpleMention`](SimpleMention.md)[]; `parent`: [`MessageParent`](MessageParent.md); `reactions`: [`CountedReaction`](CountedReaction.md)[]; `sender_id`: `string`; `thread_id?`: `string` \\| `null`; `triggered_by?`: `string` \\| `null`; `updated_at`: `string`; \\}\n\nShared message representation for channel timelines and entity discussions.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-attachments\"></a> `attachments` | [`MessageAttachment`](MessageAttachment.md)[] | Attached entities. |\n| <a id=\"property-bot_profile\"></a> `bot_profile?` | `null` \\| [`BotSenderProfile`](BotSenderProfile.md) | - |\n| <a id=\"property-content\"></a> `content` | `string` | Macro Markdown body. |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | Creation time. |\n| <a id=\"property-deleted_at\"></a> `deleted_at?` | `string` \\| `null` | Message tombstone, independent of thread deletion. |\n| <a id=\"property-edited_at\"></a> `edited_at?` | `string` \\| `null` | Last content edit, if any. |\n| <a id=\"property-guest_name\"></a> `guest_name?` | `string` \\| `null` | Display name of a verified call guest, retained after the call ends. |\n| <a id=\"property-id\"></a> `id` | `string` | Message UUID. |\n| <a id=\"property-imported_author\"></a> `imported_author?` | `null` \\| [`ImportedAuthor`](ImportedAuthor.md) | - |\n| <a id=\"property-mentions\"></a> `mentions` | [`SimpleMention`](SimpleMention.md)[] | Tracked mentions, retained when a caller changes attachments only. |\n| <a id=\"property-parent\"></a> `parent` | [`MessageParent`](MessageParent.md) | Entity that owns this conversation. |\n| <a id=\"property-reactions\"></a> `reactions` | [`CountedReaction`](CountedReaction.md)[] | Aggregated reactions. |\n| <a id=\"property-sender_id\"></a> `sender_id` | `string` | Authenticated actor or owner of imported content. |\n| <a id=\"property-thread_id\"></a> `thread_id?` | `string` \\| `null` | Root message UUID for replies; absent on roots. |\n| <a id=\"property-triggered_by\"></a> `triggered_by?` | `string` \\| `null` | User who triggered a bot-authored message. |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` | Last persisted update. |\n\n\n<!-- generated/storage/types.gen/type-aliases/MessageAttachment.md -->\n# Type Alias: MessageAttachment\n\n> **MessageAttachment** = \\{ `created_at`: `string`; `entity_id`: `string`; `entity_type`: `string`; `height?`: `number` \\| `null`; `id`: `string`; `width?`: `number` \\| `null`; \\}\n\nAn entity attached to a message.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | When the attachment was added. |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | Attached entity identifier. |\n| <a id=\"property-entity_type\"></a> `entity_type` | `string` | Attached entity type. |\n| <a id=\"property-height\"></a> `height?` | `number` \\| `null` | Optional media height. |\n| <a id=\"property-id\"></a> `id` | `string` | Attachment UUID. |\n| <a id=\"property-width\"></a> `width?` | `number` \\| `null` | Optional media width. |\n\n\n<!-- generated/storage/types.gen/type-aliases/MessageCursor.md -->\n# Type Alias: MessageCursor\n\n> **MessageCursor** = \\{ `created_at`: `string`; `id`: `string`; \\}\n\nCursor for a chronological parent timeline.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | Last message creation time or activity occurrence time. |\n| <a id=\"property-id\"></a> `id` | `string` | Last entry UUID, used to break timestamp ties across both sources. |\n\n\n<!-- generated/storage/types.gen/type-aliases/MessageParent.md -->\n# Type Alias: MessageParent\n\n> **MessageParent** = \\{ `id`: `string`; `type`: `\"channel\"`; \\} \\| \\{ `id`: [`DocumentId`](DocumentId.md); `type`: `\"document\"`; \\} \\| \\{ `id`: `string`; `type`: `\"initiative\"`; \\} \\| \\{ `id`: `string`; `type`: `\"crm_company\"`; \\} \\| \\{ `id`: `string`; `type`: `\"crm_contact\"`; \\} \\| \\{ `id`: `string`; `type`: `\"call\"`; \\}\n\nThe entity whose permissions and lifecycle govern a message.\n\n## Union Members\n\n### Type Literal\n\n\\{ `id`: `string`; `type`: `\"channel\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | A channel, including direct messages. |\n| `type` | `\"channel\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: [`DocumentId`](DocumentId.md); `type`: `\"document\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | [`DocumentId`](DocumentId.md) | A document, including tasks and PDFs. |\n| `type` | `\"document\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: `string`; `type`: `\"initiative\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | An initiative, presented as a project in the application. |\n| `type` | `\"initiative\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: `string`; `type`: `\"crm_company\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | A CRM company. |\n| `type` | `\"crm_company\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: `string`; `type`: `\"crm_contact\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | A CRM contact. |\n| `type` | `\"crm_contact\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `id`: `string`; `type`: `\"call\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `id` | `string` | A video call and its persistent chat thread. |\n| `type` | `\"call\"` | - |\n\n\n<!-- generated/storage/types.gen/type-aliases/ParticipantRole.md -->\n# Type Alias: ParticipantRole\n\n> **ParticipantRole** = `\"owner\"` \\| `\"admin\"` \\| `\"member\"`\n\nThe role a user has within a channel.\n\n\n<!-- generated/storage/types.gen/type-aliases/PdfAnchor.md -->\n# Type Alias: PdfAnchor\n\n> **PdfAnchor** = [`PdfPlaceableCommentAnchor`](PdfPlaceableCommentAnchor.md) & \\{ `anchorType`: `\"placeable\"`; \\} \\| [`PdfHighlightAnchor`](PdfHighlightAnchor.md) & \\{ `anchorType`: `\"highlight\"`; \\}\n\n\n<!-- generated/storage/types.gen/type-aliases/PdfHighlightAnchor.md -->\n# Type Alias: PdfHighlightAnchor\n\n> **PdfHighlightAnchor** = \\{ `alpha`: `number`; `blue`: `number`; `createdAt?`: `string` \\| `null`; `deletedAt?`: `string` \\| `null`; `documentId`: `string`; `green`: `number`; `highlightRects`: [`PdfHighlightRect`](PdfHighlightRect.md)[]; `highlightType`: [`HighlightType`](HighlightType.md); `owner`: `string`; `page`: `number`; `pageViewportHeight`: `number`; `pageViewportWidth`: `number`; `red`: `number`; `rootId?`: `string` \\| `null`; `text`: `string`; `updatedAt?`: `string` \\| `null`; `uuid`: `string`; \\}\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-alpha\"></a> `alpha` | `number` |\n| <a id=\"property-blue\"></a> `blue` | `number` |\n| <a id=\"property-createdat\"></a> `createdAt?` | `string` \\| `null` |\n| <a id=\"property-deletedat\"></a> `deletedAt?` | `string` \\| `null` |\n| <a id=\"property-documentid\"></a> `documentId` | `string` |\n| <a id=\"property-green\"></a> `green` | `number` |\n| <a id=\"property-highlightrects\"></a> `highlightRects` | [`PdfHighlightRect`](PdfHighlightRect.md)[] |\n| <a id=\"property-highlighttype\"></a> `highlightType` | [`HighlightType`](HighlightType.md) |\n| <a id=\"property-owner\"></a> `owner` | `string` |\n| <a id=\"property-page\"></a> `page` | `number` |\n| <a id=\"property-pageviewportheight\"></a> `pageViewportHeight` | `number` |\n| <a id=\"property-pageviewportwidth\"></a> `pageViewportWidth` | `number` |\n| <a id=\"property-red\"></a> `red` | `number` |\n| <a id=\"property-rootid\"></a> `rootId?` | `string` \\| `null` |\n| <a id=\"property-text\"></a> `text` | `string` |\n| <a id=\"property-updatedat\"></a> `updatedAt?` | `string` \\| `null` |\n| <a id=\"property-uuid\"></a> `uuid` | `string` |\n\n\n<!-- generated/storage/types.gen/type-aliases/PdfHighlightAnchorRequest.md -->\n# Type Alias: PdfHighlightAnchorRequest\n\n> **PdfHighlightAnchorRequest** = \\{ `alpha`: `number`; `blue`: `number`; `green`: `number`; `highlightRects`: [`PdfHighlightRectAnchorRequest`](PdfHighlightRectAnchorRequest.md)[]; `highlightType`: [`HighlightType`](HighlightType.md); `page`: `number`; `pageViewportHeight`: `number`; `pageViewportWidth`: `number`; `red`: `number`; `text`: `string`; `uuid?`: `string` \\| `null`; \\}\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-alpha\"></a> `alpha` | `number` |\n| <a id=\"property-blue\"></a> `blue` | `number` |\n| <a id=\"property-green\"></a> `green` | `number` |\n| <a id=\"property-highlightrects\"></a> `highlightRects` | [`PdfHighlightRectAnchorRequest`](PdfHighlightRectAnchorRequest.md)[] |\n| <a id=\"property-highlighttype\"></a> `highlightType` | [`HighlightType`](HighlightType.md) |\n| <a id=\"property-page\"></a> `page` | `number` |\n| <a id=\"property-pageviewportheight\"></a> `pageViewportHeight` | `number` |\n| <a id=\"property-pageviewportwidth\"></a> `pageViewportWidth` | `number` |\n| <a id=\"property-red\"></a> `red` | `number` |\n| <a id=\"property-text\"></a> `text` | `string` |\n| <a id=\"property-uuid\"></a> `uuid?` | `string` \\| `null` |\n\n\n<!-- generated/storage/types.gen/type-aliases/PdfHighlightRect.md -->\n# Type Alias: PdfHighlightRect\n\n> **PdfHighlightRect** = \\{ `height`: `number`; `id`: `number`; `left`: `number`; `top`: `number`; `width`: `number`; \\}\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-height\"></a> `height` | `number` |\n| <a id=\"property-id\"></a> `id` | `number` |\n| <a id=\"property-left\"></a> `left` | `number` |\n| <a id=\"property-top\"></a> `top` | `number` |\n| <a id=\"property-width\"></a> `width` | `number` |\n\n\n<!-- generated/storage/types.gen/type-aliases/PdfHighlightRectAnchorRequest.md -->\n# Type Alias: PdfHighlightRectAnchorRequest\n\n> **PdfHighlightRectAnchorRequest** = \\{ `height`: `number`; `left`: `number`; `top`: `number`; `width`: `number`; \\}\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-height\"></a> `height` | `number` |\n| <a id=\"property-left\"></a> `left` | `number` |\n| <a id=\"property-top\"></a> `top` | `number` |\n| <a id=\"property-width\"></a> `width` | `number` |\n\n\n<!-- generated/storage/types.gen/type-aliases/PdfPlaceableCommentAnchor.md -->\n# Type Alias: PdfPlaceableCommentAnchor\n\n> **PdfPlaceableCommentAnchor** = \\{ `allowableEdits?`: `unknown`; `documentId`: `string`; `heightPct`: `number`; `originalIndex`: `number`; `originalPage`: `number`; `owner`: `string`; `page`: `number`; `rootId?`: `string` \\| `null`; `rotation`: `number`; `shouldLockOnSave`: `boolean`; `uuid`: `string`; `wasDeleted`: `boolean`; `wasEdited`: `boolean`; `widthPct`: `number`; `xPct`: `number`; `yPct`: `number`; \\}\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-allowableedits\"></a> `allowableEdits?` | `unknown` |\n| <a id=\"property-documentid\"></a> `documentId` | `string` |\n| <a id=\"property-heightpct\"></a> `heightPct` | `number` |\n| <a id=\"property-originalindex\"></a> `originalIndex` | `number` |\n| <a id=\"property-originalpage\"></a> `originalPage` | `number` |\n| <a id=\"property-owner\"></a> `owner` | `string` |\n| <a id=\"property-page\"></a> `page` | `number` |\n| <a id=\"property-rootid\"></a> `rootId?` | `string` \\| `null` |\n| <a id=\"property-rotation\"></a> `rotation` | `number` |\n| <a id=\"property-shouldlockonsave\"></a> `shouldLockOnSave` | `boolean` |\n| <a id=\"property-uuid\"></a> `uuid` | `string` |\n| <a id=\"property-wasdeleted\"></a> `wasDeleted` | `boolean` |\n| <a id=\"property-wasedited\"></a> `wasEdited` | `boolean` |\n| <a id=\"property-widthpct\"></a> `widthPct` | `number` |\n| <a id=\"property-xpct\"></a> `xPct` | `number` |\n| <a id=\"property-ypct\"></a> `yPct` | `number` |\n\n\n<!-- generated/storage/types.gen/type-aliases/PreSaveDocumentResponseData.md -->\n# Type Alias: PreSaveDocumentResponseData\n\n> **PreSaveDocumentResponseData** = \\{ `presignedUrls`: [`PresignedUrl`](PresignedUrl.md)[]; \\}\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-presignedurls\"></a> `presignedUrls` | [`PresignedUrl`](PresignedUrl.md)[] | Contains any presigned urls you need to upload specific bom parts with. |\n\n\n<!-- generated/storage/types.gen/type-aliases/PresignedUrl.md -->\n# Type Alias: PresignedUrl\n\n> **PresignedUrl** = \\{ `presignedUrl`: `string`; `sha`: `string`; \\}\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-presignedurl\"></a> `presignedUrl` | `string` | The presigned url used to upload the sha |\n| <a id=\"property-sha\"></a> `sha` | `string` | The sha of the item |\n\n\n<!-- generated/storage/types.gen/type-aliases/SaveBomPart.md -->\n# Type Alias: SaveBomPart\n\n> **SaveBomPart** = \\{ `path`: `string`; `sha`: `string`; \\}\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-path\"></a> `path` | `string` | The file path of the bom part content |\n| <a id=\"property-sha\"></a> `sha` | `string` | The sha of the bom part content There is an index on sha for more performant queries based on it. |\n\n\n<!-- generated/storage/types.gen/type-aliases/SaveDocumentRequest.md -->\n# Type Alias: SaveDocumentRequest\n\n> **SaveDocumentRequest** = \\{ `modificationData?`: `unknown`; `newBom?`: [`SaveBomPart`](SaveBomPart.md)[] \\| `null`; `sha?`: `string` \\| `null`; \\}\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-modificationdata\"></a> `modificationData?` | `unknown` | The modification data for the document instance. Used to store highlights and other overlays onto a static file |\n| <a id=\"property-newbom\"></a> `newBom?` | [`SaveBomPart`](SaveBomPart.md)[] \\| `null` | **DOCX ONLY** The updated BOM for the document. Containing the file path and the sha. |\n| <a id=\"property-sha\"></a> `sha?` | `string` \\| `null` | The sha of the new document. This is used to generate a presigned url to upload the new document content to s3. |\n\n\n<!-- generated/storage/types.gen/type-aliases/SaveDocumentResponseData.md -->\n# Type Alias: SaveDocumentResponseData\n\n> **SaveDocumentResponseData** = \\{ `documentMetadata`: [`DocumentResponseMetadata`](DocumentResponseMetadata.md); `presignedUrl?`: `string` \\| `null`; \\}\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-documentmetadata\"></a> `documentMetadata` | [`DocumentResponseMetadata`](DocumentResponseMetadata.md) | The updated document metadata |\n| <a id=\"property-presignedurl\"></a> `presignedUrl?` | `string` \\| `null` | If the document is an editable file, we provide a presigned url to save the updated file to. |\n\n\n<!-- generated/storage/types.gen/type-aliases/SharePermissionV2.md -->\n# Type Alias: SharePermissionV2\n\n> **SharePermissionV2** = \\{ `channelSharePermissions?`: [`ChannelSharePermission`](ChannelSharePermission.md)[] \\| `null`; `id`: `string`; `linkShare?`: `null` \\| [`LinkShare`](LinkShare.md); `linkShareAccessLevel?`: `null` \\| [`AccessLevel`](AccessLevel.md); `owner`: `string`; `teamShareAccessLevel?`: `null` \\| [`AccessLevel`](AccessLevel.md); \\}\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-channelsharepermissions\"></a> `channelSharePermissions?` | [`ChannelSharePermission`](ChannelSharePermission.md)[] \\| `null` | The channel share permissions for the item |\n| <a id=\"property-id\"></a> `id` | `string` | The share permission id |\n| <a id=\"property-linkshare\"></a> `linkShare?` | `null` \\| [`LinkShare`](LinkShare.md) | - |\n| <a id=\"property-linkshareaccesslevel\"></a> `linkShareAccessLevel?` | `null` \\| [`AccessLevel`](AccessLevel.md) | - |\n| <a id=\"property-owner\"></a> `owner` | `string` | The owner of the item |\n| <a id=\"property-teamshareaccesslevel\"></a> `teamShareAccessLevel?` | `null` \\| [`AccessLevel`](AccessLevel.md) | - |\n\n\n<!-- generated/storage/types.gen/type-aliases/SimpleMention.md -->\n# Type Alias: SimpleMention\n\n> **SimpleMention** = \\{ `entity_id`: `string`; `entity_type`: `string`; \\}\n\nA mention tracked in a message body.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | Mentioned entity identifier. |\n| <a id=\"property-entity_type\"></a> `entity_type` | `string` | Mentioned entity type. |\n\n\n<!-- generated/storage/types.gen/type-aliases/TeamRole.md -->\n# Type Alias: TeamRole\n\n> **TeamRole** = `\"member\"` \\| `\"admin\"` \\| `\"owner\"`\n\nThe role a user has within a team.\n\nOrdered least to most privileged so comparisons reflect access strength.\n\n\n<!-- generated/storage/types.gen/type-aliases/ThreadAnchor.md -->\n# Type Alias: ThreadAnchor\n\n> **ThreadAnchor** = \\{ `mark_id`: `string`; `marked_text?`: `string` \\| `null`; `type`: `\"markdown\"`; \\} \\| \\{ `anchor_id`: `string`; `marked_text?`: `string` \\| `null`; `type`: `\"pdf_highlight\"`; \\} \\| \\{ `anchor_id`: `string`; `type`: `\"pdf_placeable\"`; \\} \\| \\{ `range`: `string`; `sheetId`: `string`; `sheetName`: `string`; `type`: `\"spreadsheet\"`; \\} \\| \\{ `nodeId?`: `string` \\| `null`; `pageId`: `string`; `type`: `\"fig\"`; `x`: `number`; `y`: `number`; \\}\n\nA thread's location within its document. PDF geometry remains annotation-owned.\n\n## Union Members\n\n### Type Literal\n\n\\{ `mark_id`: `string`; `marked_text?`: `string` \\| `null`; `type`: `\"markdown\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `mark_id` | `string` | Mark UUID serialized in the document. |\n| `marked_text?` | `string` \\| `null` | The marked text as it read when the discussion was created, already trimmed and bounded. Absent on threads created or imported before snapshots were captured: the text a mark covers cannot be recovered from the mark id alone. |\n| `type` | `\"markdown\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `anchor_id`: `string`; `marked_text?`: `string` \\| `null`; `type`: `\"pdf_highlight\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `anchor_id` | `string` | Highlight annotation UUID. |\n| `marked_text?` | `string` \\| `null` | The text the highlight covers, trimmed and bounded like a markdown snapshot. The highlight owns it and it can be edited there, so it is read from the highlight whenever the thread is, never stored on the thread. Absent when the highlight carries no text. |\n| `type` | `\"pdf_highlight\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `anchor_id`: `string`; `type`: `\"pdf_placeable\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `anchor_id` | `string` | Placeable annotation UUID. |\n| `type` | `\"pdf_placeable\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `range`: `string`; `sheetId`: `string`; `sheetName`: `string`; `type`: `\"spreadsheet\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `range` | `string` | A1 cell or range, such as B4 or B4:C9. |\n| `sheetId` | `string` | Stable sheet identity within the workbook. |\n| `sheetName` | `string` | Sheet name when the discussion was created. |\n| `type` | `\"spreadsheet\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `nodeId?`: `string` \\| `null`; `pageId`: `string`; `type`: `\"fig\"`; `x`: `number`; `y`: `number`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `nodeId?` | `string` \\| `null` | Layer the pin follows; absent for a pin on the bare canvas. |\n| `pageId` | `string` | Page (canvas) the pin is on. |\n| `type` | `\"fig\"` | - |\n| `x` | `number` | Horizontal offset from the layer's origin, or the page's when the pin is on no layer, in design units. |\n| `y` | `number` | Vertical offset, measured like `x`. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ThreadState.md -->\n# Type Alias: ThreadState\n\n> **ThreadState** = \\{ `anchor?`: `null` \\| [`ThreadAnchor`](ThreadAnchor.md); `created_at`: `string`; `deleted_at?`: `string` \\| `null`; `resolved`: `boolean`; `root_id`: `string`; `updated_at`: `string`; `user_id`: `string`; \\}\n\nState belonging to a whole thread, keyed by its root message.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-anchor\"></a> `anchor?` | `null` \\| [`ThreadAnchor`](ThreadAnchor.md) | - |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | Creation time of the discussion. |\n| <a id=\"property-deleted_at\"></a> `deleted_at?` | `string` \\| `null` | Explicit deletion of the entire thread, distinct from root deletion. |\n| <a id=\"property-resolved\"></a> `resolved` | `boolean` | Whether this discussion has been resolved. |\n| <a id=\"property-root_id\"></a> `root_id` | `string` | Root message UUID; there is no separate thread identity. |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` | Last state change. |\n| <a id=\"property-user_id\"></a> `user_id` | `string` | User who owns this discussion, including imported discussions. |\n\n\n<!-- src/entities/documents/anchor/classes/DocumentAnchor.md -->\n# Class: DocumentAnchor\n\nA PDF annotation scoped to its document.\n\n## Extends\n\n- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\\<[`Anchor`](../../../../../generated/storage/types.gen/type-aliases/Anchor.md)\\>\n\n## Properties\n\n| Property | Modifier | Type | Description | Inherited from |\n| ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-document\"></a> `document` | `readonly` | [`Document`](../../document/classes/Document.md) | Owning document. | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |\n| <a id=\"property-kind\"></a> `kind` | `readonly` | () => `Promise`\\<`\"highlight\"` \\| `\"placeable\"`\\> | Annotation kind. | - |\n| <a id=\"property-page\"></a> `page` | `readonly` | () => `Promise`\\<`number`\\> | Page containing the annotation. | - |\n\n## Methods\n\n### delete()\n\n> **delete**(): `Promise`\\<`void`\\>\n\nDelete a standalone highlight annotation.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### edit()\n\n> **edit**(`options`): `Promise`\\<`void`\\>\n\nEdit a placeable comment's position and display settings.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | `Omit`\\<[`EditPdfPlaceableCommentAnchorRequest`](../../../../../generated/storage/types.gen/type-aliases/EditPdfPlaceableCommentAnchorRequest.md), `\"uuid\"`\\> |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`PdfAnchor`](../../../../../generated/storage/types.gen/type-aliases/PdfAnchor.md); `documentId`: `string`; `id`: `string`; \\}\n\nSerialize identity with its owning resource.\n\n#### Returns\n\n\\{ `detail?`: [`PdfAnchor`](../../../../../generated/storage/types.gen/type-aliases/PdfAnchor.md); `documentId`: `string`; `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`PdfAnchor`](../../../../../generated/storage/types.gen/type-aliases/PdfAnchor.md) |\n| `documentId` | `string` |\n| `id` | `string` |\n\n#### Overrides\n\n[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `document`, `id`): `DocumentAnchor`\n\nConstruct a document scoped annotation handle.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `document` | [`Document`](../../document/classes/Document.md) |\n| `id` | `string` |\n\n#### Returns\n\n`DocumentAnchor`\n\n***\n\n### from()\n\n> `static` **from**(`client`, `document`, `record`): `DocumentAnchor`\n\nSeed an annotation from a document annotation listing.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `document` | [`Document`](../../document/classes/Document.md) |\n| `record` | [`PdfAnchor`](../../../../../generated/storage/types.gen/type-aliases/PdfAnchor.md) |\n\n#### Returns\n\n`DocumentAnchor`\n\n\n<!-- src/entities/documents/comment/classes/Comment.md -->\n# Class: Comment\n\nA comment on a document: a document-parent message, addressed by its\ndocument and message UUID. Its record and mutations are the ones channel\nmessages use.\n\n## Extends\n\n- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\\<[`Message`](../../../../../generated/storage/types.gen/type-aliases/Message.md)\\>\n\n## Properties\n\n| Property | Modifier | Type | Description | Inherited from |\n| ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-createdat\"></a> `createdAt` | `readonly` | () => `Promise`\\<`string`\\> | When the comment was created. | - |\n| <a id=\"property-documentid\"></a> `documentId` | `readonly` | `string` | The document this comment belongs to. | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |\n| <a id=\"property-text\"></a> `text` | `readonly` | () => `Promise`\\<`string`\\> | The comment's text. | - |\n| <a id=\"property-updatedat\"></a> `updatedAt` | `readonly` | () => `Promise`\\<`string`\\> | When the comment was last updated. | - |\n\n## Methods\n\n### author()\n\n> **author**(): `Promise`\\<[`User`](../../../users/user/classes/User.md)\\>\n\nThe user who wrote this comment.\n\n#### Returns\n\n`Promise`\\<[`User`](../../../users/user/classes/User.md)\\>\n\n***\n\n### delete()\n\n> **delete**(): `Promise`\\<`void`\\>\n\nDelete this comment.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### document()\n\n> **document**(): [`Document`](../../document/classes/Document.md)\n\nThe document this comment is on.\n\n#### Returns\n\n[`Document`](../../document/classes/Document.md)\n\n***\n\n### edit()\n\n> **edit**(`body`): `Promise`\\<`Comment`\\>\n\nReplace the comment's text.\n\n#### Parameters\n\n| Parameter | Type | Description |\n| ------ | ------ | ------ |\n| `body` | `string` \\| [`RichMessage`](../../../../mentions/interfaces/RichMessage.md) | Plain text, or a rich body composed with msg. |\n\n#### Returns\n\n`Promise`\\<`Comment`\\>\n\n***\n\n### reply()\n\n> **reply**(`body`): `Promise`\\<`Comment`\\>\n\nReply in this comment's thread.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `body` | `string` \\| [`RichMessage`](../../../../mentions/interfaces/RichMessage.md) |\n\n#### Returns\n\n`Promise`\\<`Comment`\\>\n\n***\n\n### threadId()\n\n> **threadId**(): `Promise`\\<`string`\\>\n\nThe id of the thread this comment belongs to: its root, or itself for a root.\n\n#### Returns\n\n`Promise`\\<`string`\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`Message`](../../../../../generated/storage/types.gen/type-aliases/Message.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`Message`](../../../../../generated/storage/types.gen/type-aliases/Message.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`Message`](../../../../../generated/storage/types.gen/type-aliases/Message.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `documentId`, `id`): `Comment`\n\nA handle to a comment by id. Fields load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `documentId` | `string` |\n| `id` | `string` |\n\n#### Returns\n\n`Comment`\n\n***\n\n### from()\n\n> `static` **from**(`client`, `documentId`, `record`): `Comment`\n\nBuild a comment from a message record (pre-seeded, no fetch).\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `documentId` | `string` |\n| `record` | [`Message`](../../../../../generated/storage/types.gen/type-aliases/Message.md) |\n\n#### Returns\n\n`Comment`\n\n\n<!-- src/entities/documents/document/classes/Document.md -->\n# Class: Document\n\nA Macro document. Can be dropped into a msg template to render an\ninline link to the document.\n\n## Extends\n\n- [`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md)\\<`DocumentDetail`\\>\n\n## Extended by\n\n- [`Task`](../../../tasks/task/classes/Task.md)\n\n## Implements\n\n- [`Mentionable`](../../../../mentions/interfaces/Mentionable.md)\n\n## Properties\n\n| Property | Modifier | Type | Default value | Description | Overrides | Inherited from |\n| ------ | ------ | ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-access\"></a> `access` | `readonly` | [`EntityAccess`](../../../sharing/access/classes/EntityAccess.md) | `...` | Access requests and direct user grants. | - | - |\n| <a id=\"property-branchedfrom\"></a> `branchedFrom` | `readonly` | () => `Promise`\\<`Document` \\| `undefined`\\> | `...` | The document this one was branched from, if any. | - | - |\n| <a id=\"property-createdat\"></a> `createdAt` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | `...` | When the document was created. | - | - |\n| <a id=\"property-deletedat\"></a> `deletedAt` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | `...` | When the document was deleted, if it has been. | - | - |\n| <a id=\"property-entitytype\"></a> `entityType` | `readonly` | `\"document\"` | `'document'` | Favorites identify documents as `document`. | [`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`entityType`](../../../entity/classes/PropertiedEntity.md#property-entitytype) | - |\n| <a id=\"property-filetype\"></a> `fileType` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | `...` | The document's file type (e.g. `md`, `pdf`, `docx`). | - | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | `undefined` | - | - | [`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`id`](../../../entity/classes/PropertiedEntity.md#property-id) |\n| <a id=\"property-name\"></a> `name` | `readonly` | () => `Promise`\\<`string`\\> | `...` | The document's display name. | - | - |\n| <a id=\"property-owner\"></a> `owner` | `readonly` | () => `Promise`\\<[`User`](../../../users/user/classes/User.md)\\> | `...` | The user who owns the document. | - | - |\n| <a id=\"property-project\"></a> `project` | `readonly` | () => `Promise`\\<[`Project`](../../../projects/project/classes/Project.md) \\| `undefined`\\> | `...` | The project this document belongs to, if any. | - | - |\n| <a id=\"property-updatedat\"></a> `updatedAt` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | `...` | When the document was last updated. | - | - |\n| <a id=\"property-search\"></a> `search` | `static` | (`client`, `query`, `searchOpts?`) => `AsyncGenerator`\\<`Document`\\> | `...` | Search documents by name and content, most relevant first, auto-paginated. | - | - |\n\n## Methods\n\n### anchors()\n\n> **anchors**(): `Promise`\\<[`DocumentAnchor`](../../anchor/classes/DocumentAnchor.md)[]\\>\n\nPDF annotations in this document.\n\n#### Returns\n\n`Promise`\\<[`DocumentAnchor`](../../anchor/classes/DocumentAnchor.md)[]\\>\n\n***\n\n### branchName()\n\n> **branchName**(): `Promise`\\<`string`\\>\n\nThe git branch name derived for the document (task documents).\n\n#### Returns\n\n`Promise`\\<`string`\\>\n\n***\n\n### comment()\n\n> **comment**(`body`, `opts?`): `Promise`\\<[`Comment`](../../comment/classes/Comment.md)\\>\n\nAdd a comment. Starts a new unanchored thread, or replies to an existing\none when `threadId` (the thread's root comment id) is given.\n\n#### Parameters\n\n| Parameter | Type | Description |\n| ------ | ------ | ------ |\n| `body` | `string` \\| [`RichMessage`](../../../../mentions/interfaces/RichMessage.md) | Plain text, or a rich body composed with msg. |\n| `opts?` | \\{ `threadId?`: `string`; \\} | - |\n| `opts.threadId?` | `string` | - |\n\n#### Returns\n\n`Promise`\\<[`Comment`](../../comment/classes/Comment.md)\\>\n\nThe created comment.\n\n***\n\n### comments()\n\n> **comments**(): `Promise`\\<[`CommentThread`](../interfaces/CommentThread.md)[]\\>\n\nThe document's live comment threads, each with its comments, newest thread first.\n\n#### Returns\n\n`Promise`\\<[`CommentThread`](../interfaces/CommentThread.md)[]\\>\n\n***\n\n### content()\n\n> **content**(): `Promise`\\<`string`\\>\n\nCurrent Markdown for native documents, extracted text for PDF/Word,\nor raw file content for other formats. Native reads include live edits.\n\n#### Returns\n\n`Promise`\\<`string`\\>\n\n***\n\n### copy()\n\n> **copy**(`opts`): `Promise`\\<`Document`\\>\n\nCopy the document under a new name, optionally from a specific version.\nReturns a handle to the new document.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts` | \\{ `name`: `string`; `versionId?`: `number`; \\} |\n| `opts.name` | `string` |\n| `opts.versionId?` | `number` |\n\n#### Returns\n\n`Promise`\\<`Document`\\>\n\n***\n\n### createHighlight()\n\n> **createHighlight**(`options`): `Promise`\\<[`DocumentAnchor`](../../anchor/classes/DocumentAnchor.md)\\>\n\nCreate a standalone PDF highlight.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | `Omit`\\<[`PdfHighlightAnchorRequest`](../../../../../generated/storage/types.gen/type-aliases/PdfHighlightAnchorRequest.md), `\"uuid\"`\\> |\n\n#### Returns\n\n`Promise`\\<[`DocumentAnchor`](../../anchor/classes/DocumentAnchor.md)\\>\n\n***\n\n### delete()\n\n> **delete**(`opts?`): `Promise`\\<`void`\\>\n\nDelete the document. Soft by default (reversible with [restore](#restore));\npass `permanent: true` to delete irreversibly.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts?` | \\{ `permanent?`: `boolean`; \\} |\n| `opts.permanent?` | `boolean` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### deleteProperty()\n\n> **deleteProperty**(`assignment`): `Promise`\\<`void`\\>\n\nRemove a property from this entity, given its [properties](#properties) entry.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `assignment` | [`EntityPropertyWithDefinition`](../../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`deleteProperty`](../../../entity/classes/PropertiedEntity.md#deleteproperty)\n\n***\n\n### favorite()\n\n> **favorite**(): `Promise`\\<`Document`\\>\n\nAdd this entity to the user's favorites. Returns this handle for chaining.\nPlain unwrap: favoriting alters the user's favorites collection, not this\nentity's own detail, so there's nothing cached to invalidate.\n\n#### Returns\n\n`Promise`\\<`Document`\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`favorite`](../../../entity/classes/PropertiedEntity.md#favorite)\n\n***\n\n### githubPullRequests()\n\n> **githubPullRequests**(): `Promise`\\<[`GithubPullRequest`](../../../../../generated/storage/types.gen/type-aliases/GithubPullRequest.md)[]\\>\n\nGitHub pull requests associated with the document.\n\n#### Returns\n\n`Promise`\\<[`GithubPullRequest`](../../../../../generated/storage/types.gen/type-aliases/GithubPullRequest.md)[]\\>\n\n***\n\n### messageThreadById()\n\n> **messageThreadById**(`id`): [`MessageThread`](../../../messages/thread/classes/MessageThread.md)\n\nA shared message thread scoped to this resource.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`MessageThread`](../../../messages/thread/classes/MessageThread.md)\n\n***\n\n### move()\n\n> **move**(`project`): `Promise`\\<`void`\\>\n\nMove the document into a project (or out of one, with `null`).\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `project` | [`Project`](../../../projects/project/classes/Project.md) \\| `null` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### permission()\n\n> **permission**(): `Promise`\\<\\{ `permission`: [`EntityPermission`](../../../../../generated/storage/types.gen/type-aliases/EntityPermission.md); `status`: `\"access\"`; \\} \\| \\{ `status`: `\"no_access\"`; \\}\\>\n\nRead the caller's effective permission on this entity.\n\n#### Returns\n\n`Promise`\\<\\{ `permission`: [`EntityPermission`](../../../../../generated/storage/types.gen/type-aliases/EntityPermission.md); `status`: `\"access\"`; \\} \\| \\{ `status`: `\"no_access\"`; \\}\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`permission`](../../../entity/classes/PropertiedEntity.md#permission)\n\n***\n\n### permissionsToken()\n\n> **permissionsToken**(): `Promise`\\<`string`\\>\n\nMint a scoped permissions token.\n\n#### Returns\n\n`Promise`\\<`string`\\>\n\n***\n\n### prepareSave()\n\n> **prepareSave**(`parts`): `Promise`\\<[`PreSaveDocumentResponseData`](../../../../../generated/storage/types.gen/type-aliases/PreSaveDocumentResponseData.md)\\>\n\nPrepare multipart content saving and return the service's upload instructions.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `parts` | [`SaveBomPart`](../../../../../generated/storage/types.gen/type-aliases/SaveBomPart.md)[] |\n\n#### Returns\n\n`Promise`\\<[`PreSaveDocumentResponseData`](../../../../../generated/storage/types.gen/type-aliases/PreSaveDocumentResponseData.md)\\>\n\n***\n\n### properties()\n\n> **properties**(`opts?`): `Promise`\\<[`EntityPropertyWithDefinition`](../../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md)[]\\>\n\nThe properties set on this entity, each with its definition, value, and options.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts?` | \\{ `includeMetadata?`: `boolean`; \\} |\n| `opts.includeMetadata?` | `boolean` |\n\n#### Returns\n\n`Promise`\\<[`EntityPropertyWithDefinition`](../../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md)[]\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`properties`](../../../entity/classes/PropertiedEntity.md#properties)\n\n***\n\n### propertyReference()\n\n> **propertyReference**(): [`PropertyTargetReference`](../../../../../generated/properties/types.gen/type-aliases/PropertyTargetReference.md)\n\nThis entity's reference for bulk property operations.\n\n#### Returns\n\n[`PropertyTargetReference`](../../../../../generated/properties/types.gen/type-aliases/PropertyTargetReference.md)\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`propertyReference`](../../../entity/classes/PropertiedEntity.md#propertyreference)\n\n***\n\n### rename()\n\n> **rename**(`name`): `Promise`\\<`void`\\>\n\nRename the document.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `name` | `string` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### restore()\n\n> **restore**(): `Promise`\\<`void`\\>\n\nRestore a soft-deleted document.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### save()\n\n> **save**(`options`): `Promise`\\<[`SaveDocumentResponseData`](../../../../../generated/storage/types.gen/type-aliases/SaveDocumentResponseData.md)\\>\n\nCommit uploaded content. Does not retry uncertain writes.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | [`SaveDocumentRequest`](../../../../../generated/storage/types.gen/type-aliases/SaveDocumentRequest.md) |\n\n#### Returns\n\n`Promise`\\<[`SaveDocumentResponseData`](../../../../../generated/storage/types.gen/type-aliases/SaveDocumentResponseData.md)\\>\n\n***\n\n### setProperty()\n\n> **setProperty**(`property`, `value?`): `Promise`\\<`void`\\>\n\nSet a property value on this entity, or attach the property without a\nvalue when `value` is omitted.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `property` | [`PropertyDefinition`](../../../properties/property-definition/classes/PropertyDefinition.md) |\n| `value?` | [`SetPropertyValue`](../../../../../generated/properties/types.gen/type-aliases/SetPropertyValue.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`setProperty`](../../../entity/classes/PropertiedEntity.md#setproperty)\n\n***\n\n### setTeamShare()\n\n> **setTeamShare**(`shared`): `Promise`\\<`void`\\>\n\nShare the document with the owner's team, or unshare it.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `shared` | `boolean` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### sharePermissions()\n\n> **sharePermissions**(): `Promise`\\<[`SharePermissionV2`](../../../../../generated/storage/types.gen/type-aliases/SharePermissionV2.md)\\>\n\nSharing configuration.\n\n#### Returns\n\n`Promise`\\<[`SharePermissionV2`](../../../../../generated/storage/types.gen/type-aliases/SharePermissionV2.md)\\>\n\n***\n\n### shortId()\n\n> **shortId**(): `Promise`\\<`string`\\>\n\nThe document's short id (used in compact links and branch names).\n\n#### Returns\n\n`Promise`\\<`string`\\>\n\n***\n\n### simpleSave()\n\n> **simpleSave**(): `Promise`\\<[`SaveDocumentResponseData`](../../../../../generated/storage/types.gen/type-aliases/SaveDocumentResponseData.md)\\>\n\nCommit a simple document save.\n\n#### Returns\n\n`Promise`\\<[`SaveDocumentResponseData`](../../../../../generated/storage/types.gen/type-aliases/SaveDocumentResponseData.md)\\>\n\n***\n\n### teamShare()\n\n> **teamShare**(): `Promise`\\<[`DocumentTeamShareResponse`](../../../../../generated/storage/types.gen/type-aliases/DocumentTeamShareResponse.md)\\>\n\nWhether the document is shared with the owner's team, and which team.\n\n#### Returns\n\n`Promise`\\<[`DocumentTeamShareResponse`](../../../../../generated/storage/types.gen/type-aliases/DocumentTeamShareResponse.md)\\>\n\n***\n\n### timelinePage()\n\n> **timelinePage**(`selection?`): `Promise`\\<\\{ `entries`: (\\{ `activity`: \\{ `action`: `string`; `actor`: [`User`](../../../users/user/classes/User.md); `actor_id`: `string`; `id`: `string`; `occurred_at`: `string`; `payload?`: `unknown`; \\}; `message?`: `undefined`; `type`: `\"activity\"`; \\} \\| \\{ `activity?`: `undefined`; `message`: [`Comment`](../../comment/classes/Comment.md); `type`: `\"message\"`; \\})[]; `nextCursor`: [`MessageCursor`](../../../../../generated/storage/types.gen/type-aliases/MessageCursor.md) \\| `undefined`; `previousCursor`: [`MessageCursor`](../../../../../generated/storage/types.gen/type-aliases/MessageCursor.md) \\| `undefined`; \\}\\>\n\nA mixed message and activity timeline page.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `selection?` | [`TimelineOptions`](../../../messages/thread/interfaces/TimelineOptions.md)\\<[`Comment`](../../comment/classes/Comment.md)\\> |\n\n#### Returns\n\n`Promise`\\<\\{ `entries`: (\\{ `activity`: \\{ `action`: `string`; `actor`: [`User`](../../../users/user/classes/User.md); `actor_id`: `string`; `id`: `string`; `occurred_at`: `string`; `payload?`: `unknown`; \\}; `message?`: `undefined`; `type`: `\"activity\"`; \\} \\| \\{ `activity?`: `undefined`; `message`: [`Comment`](../../comment/classes/Comment.md); `type`: `\"message\"`; \\})[]; `nextCursor`: [`MessageCursor`](../../../../../generated/storage/types.gen/type-aliases/MessageCursor.md) \\| `undefined`; `previousCursor`: [`MessageCursor`](../../../../../generated/storage/types.gen/type-aliases/MessageCursor.md) \\| `undefined`; \\}\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`DocumentMetadataWithContent`](../../../../../generated/storage/types.gen/type-aliases/DocumentMetadataWithContent.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`DocumentMetadataWithContent`](../../../../../generated/storage/types.gen/type-aliases/DocumentMetadataWithContent.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`DocumentMetadataWithContent`](../../../../../generated/storage/types.gen/type-aliases/DocumentMetadataWithContent.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`toJSON`](../../../entity/classes/PropertiedEntity.md#tojson)\n\n***\n\n### toMention()\n\n> **toMention**(): [`MentionPart`](../../../../mentions/interfaces/MentionPart.md)\n\n#### Returns\n\n[`MentionPart`](../../../../mentions/interfaces/MentionPart.md)\n\n#### Implementation of\n\n[`Mentionable`](../../../../mentions/interfaces/Mentionable.md).[`toMention`](../../../../mentions/interfaces/Mentionable.md#tomention)\n\n***\n\n### unfavorite()\n\n> **unfavorite**(): `Promise`\\<`Document`\\>\n\nRemove this entity from the user's favorites. Returns this handle for chaining.\n\n#### Returns\n\n`Promise`\\<`Document`\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`unfavorite`](../../../entity/classes/PropertiedEntity.md#unfavorite)\n\n***\n\n### updatePropertyOptions()\n\n> **updatePropertyOptions**(`changes`): `Promise`\\<[`BulkUpdateEntityPropertyOptionsResponse`](../../../../../generated/properties/types.gen/type-aliases/BulkUpdateEntityPropertyOptionsResponse.md)\\>\n\nApply multi-select option deltas atomically across this entity's properties.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `changes` | [`PropertyOptionDelta`](../../../entity/interfaces/PropertyOptionDelta.md)[] |\n\n#### Returns\n\n`Promise`\\<[`BulkUpdateEntityPropertyOptionsResponse`](../../../../../generated/properties/types.gen/type-aliases/BulkUpdateEntityPropertyOptionsResponse.md)\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`updatePropertyOptions`](../../../entity/classes/PropertiedEntity.md#updatepropertyoptions)\n\n***\n\n### version()\n\n> **version**(`version`): [`DocumentVersion`](../../version/classes/DocumentVersion.md)\n\nA handle to an immutable version.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `version` | `number` |\n\n#### Returns\n\n[`DocumentVersion`](../../version/classes/DocumentVersion.md)\n\n***\n\n### webUrl()\n\n> **webUrl**(): `string`\n\nThe document's URL in the Macro web app.\n\n#### Returns\n\n`string`\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `id`): `Document`\n\nA handle to a document by id. Details load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `id` | `string` |\n\n#### Returns\n\n`Document`\n\n***\n\n### create()\n\n> `static` **create**(`client`, `opts`): `Promise`\\<`Document`\\>\n\nCreate a markdown document.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `opts` | \\{ `markdown?`: `string`; `name`: `string`; `project?`: [`Project`](../../../projects/project/classes/Project.md); \\} |\n| `opts.markdown?` | `string` |\n| `opts.name` | `string` |\n| `opts.project?` | [`Project`](../../../projects/project/classes/Project.md) |\n\n#### Returns\n\n`Promise`\\<`Document`\\>\n\n***\n\n### createSkill()\n\n> `static` **createSkill**(`client`, `opts`): `Promise`\\<`Document`\\>\n\nCreate a skill: a markdown document containing instructions that AI reads\nand follows when the skill is referenced in an AI input.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `opts` | \\{ `markdown?`: `string`; `name`: `string`; `project?`: [`Project`](../../../projects/project/classes/Project.md); \\} |\n| `opts.markdown?` | `string` |\n| `opts.name` | `string` |\n| `opts.project?` | [`Project`](../../../projects/project/classes/Project.md) |\n\n#### Returns\n\n`Promise`\\<`Document`\\>\n\n***\n\n### createSnippet()\n\n> `static` **createSnippet**(`client`, `opts`): `Promise`\\<`Document`\\>\n\nCreate a snippet: a reusable markdown document that can be inserted into\nany markdown area.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `opts` | \\{ `markdown?`: `string`; `name`: `string`; `project?`: [`Project`](../../../projects/project/classes/Project.md); \\} |\n| `opts.markdown?` | `string` |\n| `opts.name` | `string` |\n| `opts.project?` | [`Project`](../../../projects/project/classes/Project.md) |\n\n#### Returns\n\n`Promise`\\<`Document`\\>\n\n***\n\n### recent()\n\n> `static` **recent**(`client`, `opts?`): `AsyncGenerator`\\<`Document`\\>\n\nThe user's recent documents, most recent first, auto-paginated.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `opts?` | \\{ `fileType?`: `string`; `pageSize?`: `number`; \\} |\n| `opts.fileType?` | `string` |\n| `opts.pageSize?` | `number` |\n\n#### Returns\n\n`AsyncGenerator`\\<`Document`\\>\n\n***\n\n### recentlyDeleted()\n\n> `static` **recentlyDeleted**(`client`): `Promise`\\<`Document`[]\\>\n\nThe user's recently soft-deleted documents. The underlying endpoint also\nreturns deleted chats and projects; those are filtered out here.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`Promise`\\<`Document`[]\\>\n\n\n<!-- src/entities/documents/document/interfaces/CommentThread.md -->\n# Interface: CommentThread\n\nOne of a document's comment threads: its state and its comments.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-comments\"></a> `comments` | [`Comment`](../../comment/classes/Comment.md)[] | The root comment followed by its replies, in order. |\n| <a id=\"property-thread\"></a> `thread` | [`ThreadState`](../../../../../generated/storage/types.gen/type-aliases/ThreadState.md) | The thread state: root id, resolved flag, owner, anchor, timestamps. |\n\n\n<!-- src/entities/documents/namespace/classes/DocumentNamespace.md -->\n# Class: DocumentNamespace\n\n## Constructors\n\n### Constructor\n\n> **new DocumentNamespace**(`client`): `DocumentNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`DocumentNamespace`\n\n## Methods\n\n### byId()\n\n> **byId**(`id`): [`Document`](../../document/classes/Document.md)\n\nA handle to a document by id. Details load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`Document`](../../document/classes/Document.md)\n\n***\n\n### byTeamSlug()\n\n> **byTeamSlug**(`slug`): `Promise`\\<[`Document`](../../document/classes/Document.md)\\>\n\nResolve a team task reference such as ENG-42.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `slug` | `string` |\n\n#### Returns\n\n`Promise`\\<[`Document`](../../document/classes/Document.md)\\>\n\n***\n\n### create()\n\n> **create**(`opts`): `Promise`\\<[`Document`](../../document/classes/Document.md)\\>\n\nCreate a markdown document.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts` | \\{ `markdown?`: `string`; `name`: `string`; `project?`: [`Project`](../../../projects/project/classes/Project.md); \\} |\n| `opts.markdown?` | `string` |\n| `opts.name` | `string` |\n| `opts.project?` | [`Project`](../../../projects/project/classes/Project.md) |\n\n#### Returns\n\n`Promise`\\<[`Document`](../../document/classes/Document.md)\\>\n\n***\n\n### createSkill()\n\n> **createSkill**(`opts`): `Promise`\\<[`Document`](../../document/classes/Document.md)\\>\n\nCreate a skill: markdown instructions that AI reads and follows.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts` | \\{ `markdown?`: `string`; `name`: `string`; `project?`: [`Project`](../../../projects/project/classes/Project.md); \\} |\n| `opts.markdown?` | `string` |\n| `opts.name` | `string` |\n| `opts.project?` | [`Project`](../../../projects/project/classes/Project.md) |\n\n#### Returns\n\n`Promise`\\<[`Document`](../../document/classes/Document.md)\\>\n\n***\n\n### createSnippet()\n\n> **createSnippet**(`opts`): `Promise`\\<[`Document`](../../document/classes/Document.md)\\>\n\nCreate a snippet: a reusable markdown document.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts` | \\{ `markdown?`: `string`; `name`: `string`; `project?`: [`Project`](../../../projects/project/classes/Project.md); \\} |\n| `opts.markdown?` | `string` |\n| `opts.name` | `string` |\n| `opts.project?` | [`Project`](../../../projects/project/classes/Project.md) |\n\n#### Returns\n\n`Promise`\\<[`Document`](../../document/classes/Document.md)\\>\n\n***\n\n### createUpload()\n\n> **createUpload**(`options`): `Promise`\\<\\{ `content`: [`DocumentContent`](../../../../../generated/storage/types.gen/type-aliases/DocumentContent.md); `contentType`: `string`; `document`: [`Document`](../../document/classes/Document.md); `uploadUrl`: `string` \\| `undefined`; \\}\\>\n\nReserve a binary document and return upload instructions. Upload content before saving.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | \\{ `attachment?`: [`EmailAttachment`](../../../email/attachment/classes/EmailAttachment.md); `branchedFrom?`: [`Document`](../../document/classes/Document.md); `fileType?`: `string`; `isTask?`: `boolean`; `mimeType?`: `string`; `name`: `string`; `project?`: [`Project`](../../../projects/project/classes/Project.md); `sha`: `string`; `team?`: [`Team`](../../../teams/team/classes/Team.md); \\} |\n| `options.attachment?` | [`EmailAttachment`](../../../email/attachment/classes/EmailAttachment.md) |\n| `options.branchedFrom?` | [`Document`](../../document/classes/Document.md) |\n| `options.fileType?` | `string` |\n| `options.isTask?` | `boolean` |\n| `options.mimeType?` | `string` |\n| `options.name` | `string` |\n| `options.project?` | [`Project`](../../../projects/project/classes/Project.md) |\n| `options.sha` | `string` |\n| `options.team?` | [`Team`](../../../teams/team/classes/Team.md) |\n\n#### Returns\n\n`Promise`\\<\\{ `content`: [`DocumentContent`](../../../../../generated/storage/types.gen/type-aliases/DocumentContent.md); `contentType`: `string`; `document`: [`Document`](../../document/classes/Document.md); `uploadUrl`: `string` \\| `undefined`; \\}\\>\n\n***\n\n### recent()\n\n> **recent**(`opts?`): `AsyncGenerator`\\<[`Document`](../../document/classes/Document.md)\\>\n\nThe user's recent documents, most recent first, auto-paginated.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts?` | \\{ `fileType?`: `string`; `pageSize?`: `number`; \\} |\n| `opts.fileType?` | `string` |\n| `opts.pageSize?` | `number` |\n\n#### Returns\n\n`AsyncGenerator`\\<[`Document`](../../document/classes/Document.md)\\>\n\n***\n\n### recentlyDeleted()\n\n> **recentlyDeleted**(): `Promise`\\<[`Document`](../../document/classes/Document.md)[]\\>\n\nThe user's recently soft-deleted documents.\n\n#### Returns\n\n`Promise`\\<[`Document`](../../document/classes/Document.md)[]\\>\n\n***\n\n### search()\n\n> **search**(`query`, `opts?`): `AsyncGenerator`\\<[`Document`](../../document/classes/Document.md)\\>\n\nSearch documents by name and content, most relevant first, auto-paginated.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `query` | `string` |\n| `opts?` | [`SearchOpts`](../../../search/interfaces/SearchOpts.md) |\n\n#### Returns\n\n`AsyncGenerator`\\<[`Document`](../../document/classes/Document.md)\\>\n\n***\n\n### systemSkills()\n\n> **systemSkills**(): `Promise`\\<[`SystemSkill`](../../system-skill/classes/SystemSkill.md)[]\\>\n\nThe built-in system skills: static AI instructions with no document\nbehind them. Unlike user skills they cannot be opened or edited.\n\n#### Returns\n\n`Promise`\\<[`SystemSkill`](../../system-skill/classes/SystemSkill.md)[]\\>\n\n***\n\n### validatePermissionsToken()\n\n> **validatePermissionsToken**(`token`): `Promise`\\<\\{ `accessLevel`: [`AccessLevel`](../../../../../generated/storage/types.gen/type-aliases/AccessLevel.md); `document`: [`Document`](../../document/classes/Document.md); `expiresAt`: `number`; `issuer`: `string`; `user`: [`User`](../../../users/user/classes/User.md) \\| `undefined`; \\}\\>\n\nValidate a permissions token, returning its document and optional user handles.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `token` | `string` |\n\n#### Returns\n\n`Promise`\\<\\{ `accessLevel`: [`AccessLevel`](../../../../../generated/storage/types.gen/type-aliases/AccessLevel.md); `document`: [`Document`](../../document/classes/Document.md); `expiresAt`: `number`; `issuer`: `string`; `user`: [`User`](../../../users/user/classes/User.md) \\| `undefined`; \\}\\>\n\n\n<!-- src/entities/documents/system-skill/classes/SystemSkill.md -->\n# Class: SystemSkill\n\nA built-in system skill: static, code-defined AI instructions that surface\nto AI like skill documents but have no document behind them. System skills\ncannot be opened, edited, or deleted; reference them in AI inputs by id the\nsame way as skill documents.\n\n## Properties\n\n| Property | Modifier | Type | Description |\n| ------ | ------ | ------ | ------ |\n| <a id=\"property-id\"></a> `id` | `readonly` | `string` | The well-known id the skill is referenced by in mentions and AI tools. |\n| <a id=\"property-name\"></a> `name` | `readonly` | `string` | The skill's display name. |\n\n## Methods\n\n### list()\n\n> `static` **list**(`client`): `Promise`\\<`SystemSkill`[]\\>\n\nThe built-in system skills, in display order.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`Promise`\\<`SystemSkill`[]\\>\n\n\n<!-- src/entities/documents/version/classes/DocumentVersion.md -->\n# Class: DocumentVersion\n\nAn immutable document version, scoped to its document.\n\n## Properties\n\n| Property | Modifier | Type | Description |\n| ------ | ------ | ------ | ------ |\n| <a id=\"property-document\"></a> `document` | `readonly` | [`Document`](../../document/classes/Document.md) | Parent document. |\n| <a id=\"property-id\"></a> `id` | `readonly` | `number` | Version number. |\n\n## Methods\n\n### read()\n\n> **read**(): `Promise`\\<[`GetDocumentResponseData`](../../../../../generated/storage/types.gen/type-aliases/GetDocumentResponseData.md)\\>\n\nVersion metadata and the caller's access.\n\n#### Returns\n\n`Promise`\\<[`GetDocumentResponseData`](../../../../../generated/storage/types.gen/type-aliases/GetDocumentResponseData.md)\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `documentId`: `string`; `id`: `number`; \\}\n\nSerialize only scoped identity.\n\n#### Returns\n\n\\{ `documentId`: `string`; `id`: `number`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `documentId` | `string` |\n| `id` | `number` |\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `document`, `id`): `DocumentVersion`\n\nConstruct a version handle.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `document` | [`Document`](../../document/classes/Document.md) |\n| `id` | `number` |\n\n#### Returns\n\n`DocumentVersion`\n"},{"name": "email","description": "Search, read, draft, and send email.",- "overview": "<!-- src/entities/email/message/interfaces/SendEmailOptions.md -->\n# Interface: SendEmailOptions\n\nOptions for sending a fresh email message.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-bcc\"></a> `bcc?` | [`ApiDraftContactInfo`](../../../../../generated/email/types.gen/type-aliases/ApiDraftContactInfo.md)[] | Bcc recipients. |\n| <a id=\"property-bodytext\"></a> `bodyText` | `string` | Plain-text body. |\n| <a id=\"property-cc\"></a> `cc?` | [`ApiDraftContactInfo`](../../../../../generated/email/types.gen/type-aliases/ApiDraftContactInfo.md)[] | Cc recipients. |\n| <a id=\"property-subject\"></a> `subject` | `string` | Subject line. |\n| <a id=\"property-to\"></a> `to` | [`ApiDraftContactInfo`](../../../../../generated/email/types.gen/type-aliases/ApiDraftContactInfo.md)[] | Recipients. |\n\n\n<!-- src/entities/email/namespace/classes/EmailNamespace.md -->\n# Class: EmailNamespace\n\n## Constructors\n\n### Constructor\n\n> **new EmailNamespace**(`client`): `EmailNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`EmailNamespace`\n\n## Methods\n\n### attachment()\n\n> **attachment**(`id`): [`EmailAttachment`](../../attachment/classes/EmailAttachment.md)\n\nA handle to an email attachment by id.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`EmailAttachment`](../../attachment/classes/EmailAttachment.md)\n\n***\n\n### blockedSenders()\n\n> **blockedSenders**(): `Promise`\\<`string`[]\\>\n\nThe email addresses currently blocked.\n\n#### Returns\n\n`Promise`\\<`string`[]\\>\n\n***\n\n### blockSender()\n\n> **blockSender**(`email`): `Promise`\\<`void`\\>\n\nBlock an email sender.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `email` | `string` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### byId()\n\n> **byId**(`id`): [`EmailThread`](../../thread/classes/EmailThread.md)\n\nA handle to an email thread by id.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`EmailThread`](../../thread/classes/EmailThread.md)\n\n***\n\n### connectionProviders()\n\n> **connectionProviders**(): `Promise`\\<[`EmailConnectionProviders`](../../../../../generated/auth/types.gen/type-aliases/EmailConnectionProviders.md)\\>\n\nProviders the server currently permits this caller to connect.\n\n#### Returns\n\n`Promise`\\<[`EmailConnectionProviders`](../../../../../generated/auth/types.gen/type-aliases/EmailConnectionProviders.md)\\>\n\n***\n\n### createLabel()\n\n> **createLabel**(`name`): `Promise`\\<[`Label`](../../label/classes/Label.md)\\>\n\nCreate a user label. Returns the created label.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `name` | `string` |\n\n#### Returns\n\n`Promise`\\<[`Label`](../../label/classes/Label.md)\\>\n\n***\n\n### deleteLabel()\n\n> **deleteLabel**(`label`): `Promise`\\<`void`\\>\n\nDelete a label.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `label` | [`Label`](../../label/classes/Label.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### inbox()\n\n> **inbox**(`opts?`): `AsyncGenerator`\\<[`EmailThread`](../../thread/classes/EmailThread.md)\\>\n\nThe threads in the inbox, most recent first, auto-paginated.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts?` | [`InboxOptions`](../interfaces/InboxOptions.md) |\n\n#### Returns\n\n`AsyncGenerator`\\<[`EmailThread`](../../thread/classes/EmailThread.md)\\>\n\n***\n\n### label()\n\n> **label**(`id`): [`Label`](../../label/classes/Label.md)\n\nA handle to a label by id.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`Label`](../../label/classes/Label.md)\n\n***\n\n### labels()\n\n> **labels**(): `Promise`\\<[`Label`](../../label/classes/Label.md)[]\\>\n\nAll labels across the user's inboxes.\n\n#### Returns\n\n`Promise`\\<[`Label`](../../label/classes/Label.md)[]\\>\n\n***\n\n### link()\n\n> **link**(`id`): [`Link`](../../link/classes/Link.md)\n\nA handle to a connected inbox (email link) by id.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`Link`](../../link/classes/Link.md)\n\n***\n\n### links()\n\n> **links**(): `Promise`\\<[`Link`](../../link/classes/Link.md)[]\\>\n\nThe caller's connected inboxes (email links).\n\n#### Returns\n\n`Promise`\\<[`Link`](../../link/classes/Link.md)[]\\>\n\n***\n\n### message()\n\n> **message**(`id`): [`EmailMessage`](../../message/classes/EmailMessage.md)\n\nA handle to an email message by id.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`EmailMessage`](../../message/classes/EmailMessage.md)\n\n***\n\n### recoverDraftTransfer()\n\n> **recoverDraftTransfer**(`operationId`): `Promise`\\<[`TransferRecoveryResponse`](../../../../../generated/email/types.gen/type-aliases/TransferRecoveryResponse.md)\\>\n\nRecover a draft move using its original operation UUID; never starts a new move.\nAn empty committed result fences the old move so it cannot commit later.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `operationId` | `string` |\n\n#### Returns\n\n`Promise`\\<[`TransferRecoveryResponse`](../../../../../generated/email/types.gen/type-aliases/TransferRecoveryResponse.md)\\>\n\n***\n\n### search()\n\n> **search**(`query`, `opts?`): `AsyncGenerator`\\<[`EmailThread`](../../thread/classes/EmailThread.md)\\>\n\nSearch email threads by subject and content.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `query` | `string` |\n| `opts?` | [`SearchOpts`](../../../search/interfaces/SearchOpts.md) |\n\n#### Returns\n\n`AsyncGenerator`\\<[`EmailThread`](../../thread/classes/EmailThread.md)\\>\n\n***\n\n### send()\n\n> **send**(`opts`): `Promise`\\<[`EmailMessage`](../../message/classes/EmailMessage.md) \\| `undefined`\\>\n\nSend a new email message.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts` | [`SendEmailOptions`](../../message/interfaces/SendEmailOptions.md) |\n\n#### Returns\n\n`Promise`\\<[`EmailMessage`](../../message/classes/EmailMessage.md) \\| `undefined`\\>\n\n***\n\n### unblockSender()\n\n> **unblockSender**(`email`): `Promise`\\<`void`\\>\n\nUnblock a previously blocked sender.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `email` | `string` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n\n<!-- src/entities/email/namespace/interfaces/InboxOptions.md -->\n# Interface: InboxOptions\n\nOptions for listing inbox threads.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-pagesize\"></a> `pageSize?` | `number` | Page size (default 20, max 500). |\n| <a id=\"property-sort\"></a> `sort?` | [`ApiSortMethod`](../../../../../generated/email/types.gen/type-aliases/ApiSortMethod.md) | Sort order. Defaults to `viewed_updated`. |\n",- "documentation": "# Macro SDK: email\n\nGenerated by TypeDoc. Paths below refer to the canonical Markdown hierarchy. Other entity handles are documented in their named section; request core for shared SDK helpers.\n\n<!-- generated/auth/types.gen/type-aliases/EmailConnectionProviders.md -->\n# Type Alias: EmailConnectionProviders\n\n> **EmailConnectionProviders** = \\{ `gmail`: `boolean`; `outlook`: `boolean`; \\}\n\nActual deployment availability for the provider selector.\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-gmail\"></a> `gmail` | `boolean` |\n| <a id=\"property-outlook\"></a> `outlook` | `boolean` |\n\n\n<!-- generated/email/types.gen/type-aliases/AccessLevel.md -->\n# Type Alias: AccessLevel\n\n> **AccessLevel** = `\"view\"` \\| `\"comment\"` \\| `\"edit\"` \\| `\"owner\"`\n\nOrdered from least to most access top -> bottom\n\n\n<!-- generated/email/types.gen/type-aliases/ApiAttachmentDraft.md -->\n# Type Alias: ApiAttachmentDraft\n\n> **ApiAttachmentDraft** = \\{ `content_id?`: `string` \\| `null`; `content_type`: `string`; `draft_id`: `string`; `file_name`: `string`; `id`: `string`; `is_inline`: `boolean`; `s3_key`: `string`; `sha`: `string`; `size`: `number`; `upload_pending`: `boolean`; \\}\n\nAPI representation of a draft attachment on a message.\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-content_id\"></a> `content_id?` | `string` \\| `null` |\n| <a id=\"property-content_type\"></a> `content_type` | `string` |\n| <a id=\"property-draft_id\"></a> `draft_id` | `string` |\n| <a id=\"property-file_name\"></a> `file_name` | `string` |\n| <a id=\"property-id\"></a> `id` | `string` |\n| <a id=\"property-is_inline\"></a> `is_inline` | `boolean` |\n| <a id=\"property-s3_key\"></a> `s3_key` | `string` |\n| <a id=\"property-sha\"></a> `sha` | `string` |\n| <a id=\"property-size\"></a> `size` | `number` |\n| <a id=\"property-upload_pending\"></a> `upload_pending` | `boolean` |\n\n\n<!-- generated/email/types.gen/type-aliases/ApiAttachmentForwarded.md -->\n# Type Alias: ApiAttachmentForwarded\n\n> **ApiAttachmentForwarded** = \\{ `attachment_id`: `string`; `draft_id`: `string`; `filename?`: `string` \\| `null`; `message_provider_id`: `string`; `mime_type?`: `string` \\| `null`; `provider_attachment_id?`: `string` \\| `null`; `size_bytes?`: `number` \\| `null`; \\}\n\nAPI representation of a forwarded attachment on a message.\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-attachment_id\"></a> `attachment_id` | `string` |\n| <a id=\"property-draft_id\"></a> `draft_id` | `string` |\n| <a id=\"property-filename\"></a> `filename?` | `string` \\| `null` |\n| <a id=\"property-message_provider_id\"></a> `message_provider_id` | `string` |\n| <a id=\"property-mime_type\"></a> `mime_type?` | `string` \\| `null` |\n| <a id=\"property-provider_attachment_id\"></a> `provider_attachment_id?` | `string` \\| `null` |\n| <a id=\"property-size_bytes\"></a> `size_bytes?` | `number` \\| `null` |\n\n\n<!-- generated/email/types.gen/type-aliases/ApiContactInfo.md -->\n# Type Alias: ApiContactInfo\n\n> **ApiContactInfo** = \\{ `email`: `string`; `name?`: `string` \\| `null`; `photo_url?`: `string` \\| `null`; \\}\n\nAPI representation of a contact (sender or recipient).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-email\"></a> `email` | `string` |\n| <a id=\"property-name\"></a> `name?` | `string` \\| `null` |\n| <a id=\"property-photo_url\"></a> `photo_url?` | `string` \\| `null` |\n\n\n<!-- generated/email/types.gen/type-aliases/ApiDraftContactInfo.md -->\n# Type Alias: ApiDraftContactInfo\n\n> **ApiDraftContactInfo** = \\{ `email`: `string`; `name?`: `string` \\| `null`; `photo_url?`: `string` \\| `null`; \\}\n\nContact info for draft request/response (backward-compatible with MessageToSend shape).\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-email\"></a> `email` | `string` | Email address. |\n| <a id=\"property-name\"></a> `name?` | `string` \\| `null` | Display name. |\n| <a id=\"property-photo_url\"></a> `photo_url?` | `string` \\| `null` | Profile photo URL. |\n\n\n<!-- generated/email/types.gen/type-aliases/ApiLabel.md -->\n# Type Alias: ApiLabel\n\n> **ApiLabel** = \\{ `createdAt`: `string`; `id`: `string`; `labelListVisibility`: [`ApiLabelListVisibility`](ApiLabelListVisibility.md); `linkId`: `string`; `messageListVisibility`: [`ApiMessageListVisibility`](ApiMessageListVisibility.md); `name`: `string`; `providerLabelId`: `string`; `type`: [`ApiLabelType`](ApiLabelType.md); \\}\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-createdat\"></a> `createdAt` | `string` |\n| <a id=\"property-id\"></a> `id` | `string` |\n| <a id=\"property-labellistvisibility\"></a> `labelListVisibility` | [`ApiLabelListVisibility`](ApiLabelListVisibility.md) |\n| <a id=\"property-linkid\"></a> `linkId` | `string` |\n| <a id=\"property-messagelistvisibility\"></a> `messageListVisibility` | [`ApiMessageListVisibility`](ApiMessageListVisibility.md) |\n| <a id=\"property-name\"></a> `name` | `string` |\n| <a id=\"property-providerlabelid\"></a> `providerLabelId` | `string` |\n| <a id=\"property-type\"></a> `type` | [`ApiLabelType`](ApiLabelType.md) |\n\n\n<!-- generated/email/types.gen/type-aliases/ApiLabelListVisibility.md -->\n# Type Alias: ApiLabelListVisibility\n\n> **ApiLabelListVisibility** = `\"LabelShow\"` \\| `\"LabelShowIfUnread\"` \\| `\"LabelHide\"`\n\n\n<!-- generated/email/types.gen/type-aliases/ApiLabelType.md -->\n# Type Alias: ApiLabelType\n\n> **ApiLabelType** = `\"System\"` \\| `\"User\"`\n\n\n<!-- generated/email/types.gen/type-aliases/ApiMessage.md -->\n# Type Alias: ApiMessage\n\n> **ApiMessage** = \\{ `attachments`: [`ApiMessageAttachment`](ApiMessageAttachment.md)[]; `attachments_draft`: [`ApiAttachmentDraft`](ApiAttachmentDraft.md)[]; `attachments_forwarded`: [`ApiAttachmentForwarded`](ApiAttachmentForwarded.md)[]; `bcc`: [`ApiContactInfo`](ApiContactInfo.md)[]; `body_html_sanitized?`: `string` \\| `null`; `body_macro?`: `string` \\| `null`; `body_replyless?`: `string` \\| `null`; `body_text?`: `string` \\| `null`; `calendar_invitations?`: [`CalendarInvitation`](CalendarInvitation.md)[]; `cc`: [`ApiContactInfo`](ApiContactInfo.md)[]; `created_at`: `string`; `db_id`: `string`; `from?`: `null` \\| [`ApiContactInfo`](ApiContactInfo.md); `global_id?`: `string` \\| `null`; `has_attachments`: `boolean`; `headers_json?`: `unknown`; `internal_date_ts?`: `string` \\| `null`; `is_draft`: `boolean`; `is_read`: `boolean`; `is_sent`: `boolean`; `is_starred`: `boolean`; `labels`: [`ApiMessageLabel`](ApiMessageLabel.md)[]; `link_id`: `string`; `operation_status?`: `null` \\| [`ApiMessageOperation`](ApiMessageOperation.md); `provider_history_id?`: `string` \\| `null`; `provider_id?`: `string` \\| `null`; `provider_thread_id?`: `string` \\| `null`; `replying_to_id?`: `string` \\| `null`; `scheduled_send_time?`: `string` \\| `null`; `sent_at?`: `string` \\| `null`; `size_estimate?`: `number` \\| `null`; `snippet?`: `string` \\| `null`; `subject?`: `string` \\| `null`; `thread_db_id`: `string`; `to`: [`ApiContactInfo`](ApiContactInfo.md)[]; `updated_at`: `string`; \\}\n\nAPI representation of a fully assembled email message.\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-attachments\"></a> `attachments` | [`ApiMessageAttachment`](ApiMessageAttachment.md)[] |\n| <a id=\"property-attachments_draft\"></a> `attachments_draft` | [`ApiAttachmentDraft`](ApiAttachmentDraft.md)[] |\n| <a id=\"property-attachments_forwarded\"></a> `attachments_forwarded` | [`ApiAttachmentForwarded`](ApiAttachmentForwarded.md)[] |\n| <a id=\"property-bcc\"></a> `bcc` | [`ApiContactInfo`](ApiContactInfo.md)[] |\n| <a id=\"property-body_html_sanitized\"></a> `body_html_sanitized?` | `string` \\| `null` |\n| <a id=\"property-body_macro\"></a> `body_macro?` | `string` \\| `null` |\n| <a id=\"property-body_replyless\"></a> `body_replyless?` | `string` \\| `null` |\n| <a id=\"property-body_text\"></a> `body_text?` | `string` \\| `null` |\n| <a id=\"property-calendar_invitations\"></a> `calendar_invitations?` | [`CalendarInvitation`](CalendarInvitation.md)[] |\n| <a id=\"property-cc\"></a> `cc` | [`ApiContactInfo`](ApiContactInfo.md)[] |\n| <a id=\"property-created_at\"></a> `created_at` | `string` |\n| <a id=\"property-db_id\"></a> `db_id` | `string` |\n| <a id=\"property-from\"></a> `from?` | `null` \\| [`ApiContactInfo`](ApiContactInfo.md) |\n| <a id=\"property-global_id\"></a> `global_id?` | `string` \\| `null` |\n| <a id=\"property-has_attachments\"></a> `has_attachments` | `boolean` |\n| <a id=\"property-headers_json\"></a> `headers_json?` | `unknown` |\n| <a id=\"property-internal_date_ts\"></a> `internal_date_ts?` | `string` \\| `null` |\n| <a id=\"property-is_draft\"></a> `is_draft` | `boolean` |\n| <a id=\"property-is_read\"></a> `is_read` | `boolean` |\n| <a id=\"property-is_sent\"></a> `is_sent` | `boolean` |\n| <a id=\"property-is_starred\"></a> `is_starred` | `boolean` |\n| <a id=\"property-labels\"></a> `labels` | [`ApiMessageLabel`](ApiMessageLabel.md)[] |\n| <a id=\"property-link_id\"></a> `link_id` | `string` |\n| <a id=\"property-operation_status\"></a> `operation_status?` | `null` \\| [`ApiMessageOperation`](ApiMessageOperation.md) |\n| <a id=\"property-provider_history_id\"></a> `provider_history_id?` | `string` \\| `null` |\n| <a id=\"property-provider_id\"></a> `provider_id?` | `string` \\| `null` |\n| <a id=\"property-provider_thread_id\"></a> `provider_thread_id?` | `string` \\| `null` |\n| <a id=\"property-replying_to_id\"></a> `replying_to_id?` | `string` \\| `null` |\n| <a id=\"property-scheduled_send_time\"></a> `scheduled_send_time?` | `string` \\| `null` |\n| <a id=\"property-sent_at\"></a> `sent_at?` | `string` \\| `null` |\n| <a id=\"property-size_estimate\"></a> `size_estimate?` | `number` \\| `null` |\n| <a id=\"property-snippet\"></a> `snippet?` | `string` \\| `null` |\n| <a id=\"property-subject\"></a> `subject?` | `string` \\| `null` |\n| <a id=\"property-thread_db_id\"></a> `thread_db_id` | `string` |\n| <a id=\"property-to\"></a> `to` | [`ApiContactInfo`](ApiContactInfo.md)[] |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` |\n\n\n<!-- generated/email/types.gen/type-aliases/ApiMessageAttachment.md -->\n# Type Alias: ApiMessageAttachment\n\n> **ApiMessageAttachment** = \\{ `content_id?`: `string` \\| `null`; `data_url?`: `string` \\| `null`; `db_id`: `string`; `filename?`: `string` \\| `null`; `mime_type?`: `string` \\| `null`; `provider_id?`: `string` \\| `null`; `reference_url?`: `string` \\| `null`; `sfs_id?`: `string` \\| `null`; `size_bytes?`: `number` \\| `null`; \\}\n\nAPI representation of a provider attachment on a message.\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-content_id\"></a> `content_id?` | `string` \\| `null` |\n| <a id=\"property-data_url\"></a> `data_url?` | `string` \\| `null` |\n| <a id=\"property-db_id\"></a> `db_id` | `string` |\n| <a id=\"property-filename\"></a> `filename?` | `string` \\| `null` |\n| <a id=\"property-mime_type\"></a> `mime_type?` | `string` \\| `null` |\n| <a id=\"property-provider_id\"></a> `provider_id?` | `string` \\| `null` |\n| <a id=\"property-reference_url\"></a> `reference_url?` | `string` \\| `null` |\n| <a id=\"property-sfs_id\"></a> `sfs_id?` | `string` \\| `null` |\n| <a id=\"property-size_bytes\"></a> `size_bytes?` | `number` \\| `null` |\n\n\n<!-- generated/email/types.gen/type-aliases/ApiMessageLabel.md -->\n# Type Alias: ApiMessageLabel\n\n> **ApiMessageLabel** = \\{ `created_at`: `string`; `id?`: `string` \\| `null`; `label_list_visibility?`: `null` \\| [`ApiLabelListVisibility`](ApiLabelListVisibility.md); `link_id`: `string`; `message_list_visibility?`: `null` \\| [`ApiMessageListVisibility`](ApiMessageListVisibility.md); `name?`: `string` \\| `null`; `provider_label_id`: `string`; `type_?`: `null` \\| [`ApiLabelType`](ApiLabelType.md); \\}\n\nAPI representation of a label on a message.\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-created_at\"></a> `created_at` | `string` |\n| <a id=\"property-id\"></a> `id?` | `string` \\| `null` |\n| <a id=\"property-label_list_visibility\"></a> `label_list_visibility?` | `null` \\| [`ApiLabelListVisibility`](ApiLabelListVisibility.md) |\n| <a id=\"property-link_id\"></a> `link_id` | `string` |\n| <a id=\"property-message_list_visibility\"></a> `message_list_visibility?` | `null` \\| [`ApiMessageListVisibility`](ApiMessageListVisibility.md) |\n| <a id=\"property-name\"></a> `name?` | `string` \\| `null` |\n| <a id=\"property-provider_label_id\"></a> `provider_label_id` | `string` |\n| <a id=\"property-type_\"></a> `type_?` | `null` \\| [`ApiLabelType`](ApiLabelType.md) |\n\n\n<!-- generated/email/types.gen/type-aliases/ApiMessageListVisibility.md -->\n# Type Alias: ApiMessageListVisibility\n\n> **ApiMessageListVisibility** = `\"Show\"` \\| `\"Hide\"`\n\n\n<!-- generated/email/types.gen/type-aliases/ApiMessageOperation.md -->\n# Type Alias: ApiMessageOperation\n\n> **ApiMessageOperation** = \\{ `issue?`: `null` \\| [`ApiMessageOperationIssue`](ApiMessageOperationIssue.md); `remote_version?`: `string` \\| `null`; `revision`: `string`; `state`: [`ApiMessageOperationState`](ApiMessageOperationState.md); \\}\n\nVersions are opaque decimal strings so clients never truncate an i64.\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-issue\"></a> `issue?` | `null` \\| [`ApiMessageOperationIssue`](ApiMessageOperationIssue.md) |\n| <a id=\"property-remote_version\"></a> `remote_version?` | `string` \\| `null` |\n| <a id=\"property-revision\"></a> `revision` | `string` |\n| <a id=\"property-state\"></a> `state` | [`ApiMessageOperationState`](ApiMessageOperationState.md) |\n\n\n<!-- generated/email/types.gen/type-aliases/ApiMessageOperationIssue.md -->\n# Type Alias: ApiMessageOperationIssue\n\n> **ApiMessageOperationIssue** = `\"ACCEPTING_REMOTE\"` \\| `\"DRAFT_CONFLICT\"` \\| `\"CREATION_UNKNOWN\"` \\| `\"ATTACHMENT_UNKNOWN\"` \\| `\"SEND_UNKNOWN\"` \\| `\"SEND_REJECTED\"` \\| `\"ACCESS_REVOKED\"` \\| `\"INVALID_CONTENT\"` \\| `\"MOVE_PENDING\"` \\| `\"MOVE_CONFLICT\"` \\| `\"MOVE_SOURCE_SENT\"` \\| `\"MOVE_REAUTHORIZATION\"` \\| `\"MOVE_ORIGINAL_REMAINS\"`\n\nProvider-neutral state exposed to clients.\n\n\n<!-- generated/email/types.gen/type-aliases/ApiMessageOperationState.md -->\n# Type Alias: ApiMessageOperationState\n\n> **ApiMessageOperationState** = `\"PENDING\"` \\| `\"SYNCHRONIZED\"` \\| `\"CONFLICT\"` \\| `\"UNCERTAIN\"` \\| `\"SUBMITTING\"` \\| `\"CONFIRMING\"` \\| `\"SENT\"` \\| `\"DELETED\"` \\| `\"CANCELLED\"` \\| `\"FAILED\"`\n\nProvider-neutral state exposed to clients.\n\n\n<!-- generated/email/types.gen/type-aliases/ApiMessageResolutionAction.md -->\n# Type Alias: ApiMessageResolutionAction\n\n> **ApiMessageResolutionAction** = `\"keep_local\"` \\| `\"use_provider\"` \\| `\"recheck\"` \\| `\"retry_send\"` \\| `\"keep_original\"`\n\nA deliberate resolution of a particular observed operation version.\n\n\n<!-- generated/email/types.gen/type-aliases/ApiSortMethod.md -->\n# Type Alias: ApiSortMethod\n\n> **ApiSortMethod** = `\"viewed_at\"` \\| `\"updated_at\"` \\| `\"created_at\"` \\| `\"viewed_updated\"`\n\ncommon types of sorts based on timestamps\n\n\n<!-- generated/email/types.gen/type-aliases/ApiThread.md -->\n# Type Alias: ApiThread\n\n> **ApiThread** = \\{ `access_level`: [`AccessLevel`](AccessLevel.md); `created_at`: `string`; `db_id`: `string`; `inbox_visible`: `boolean`; `is_read`: `boolean`; `latest_inbound_message_ts?`: `string` \\| `null`; `latest_non_spam_message_ts?`: `string` \\| `null`; `latest_outbound_message_ts?`: `string` \\| `null`; `link_id`: `string`; `messages`: [`ApiMessage`](ApiMessage.md)[]; `project_id?`: `string` \\| `null`; `provider_id?`: `string` \\| `null`; `updated_at`: `string`; \\}\n\nAPI representation of a fully assembled email thread.\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-access_level\"></a> `access_level` | [`AccessLevel`](AccessLevel.md) |\n| <a id=\"property-created_at\"></a> `created_at` | `string` |\n| <a id=\"property-db_id\"></a> `db_id` | `string` |\n| <a id=\"property-inbox_visible\"></a> `inbox_visible` | `boolean` |\n| <a id=\"property-is_read\"></a> `is_read` | `boolean` |\n| <a id=\"property-latest_inbound_message_ts\"></a> `latest_inbound_message_ts?` | `string` \\| `null` |\n| <a id=\"property-latest_non_spam_message_ts\"></a> `latest_non_spam_message_ts?` | `string` \\| `null` |\n| <a id=\"property-latest_outbound_message_ts\"></a> `latest_outbound_message_ts?` | `string` \\| `null` |\n| <a id=\"property-link_id\"></a> `link_id` | `string` |\n| <a id=\"property-messages\"></a> `messages` | [`ApiMessage`](ApiMessage.md)[] |\n| <a id=\"property-project_id\"></a> `project_id?` | `string` \\| `null` |\n| <a id=\"property-provider_id\"></a> `provider_id?` | `string` \\| `null` |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` |\n\n\n<!-- generated/email/types.gen/type-aliases/Attachment.md -->\n# Type Alias: Attachment\n\n> **Attachment** = \\{ `content_id?`: `string` \\| `null`; `data_url?`: `string` \\| `null`; `db_id`: `string`; `filename?`: `string` \\| `null`; `mime_type?`: `string` \\| `null`; `provider_id?`: `string` \\| `null`; `reference_url?`: `string` \\| `null`; `sfs_id?`: `string` \\| `null`; `size_bytes?`: `number` \\| `null`; \\}\n\nAttachments of a message, as sent to us by the provider.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-content_id\"></a> `content_id?` | `string` \\| `null` | - |\n| <a id=\"property-data_url\"></a> `data_url?` | `string` \\| `null` | - |\n| <a id=\"property-db_id\"></a> `db_id` | `string` | - |\n| <a id=\"property-filename\"></a> `filename?` | `string` \\| `null` | - |\n| <a id=\"property-mime_type\"></a> `mime_type?` | `string` \\| `null` | - |\n| <a id=\"property-provider_id\"></a> `provider_id?` | `string` \\| `null` | - |\n| <a id=\"property-reference_url\"></a> `reference_url?` | `string` \\| `null` | Cloud reference: open this provider page instead of downloading bytes. |\n| <a id=\"property-sfs_id\"></a> `sfs_id?` | `string` \\| `null` | - |\n| <a id=\"property-size_bytes\"></a> `size_bytes?` | `number` \\| `null` | - |\n\n\n<!-- generated/email/types.gen/type-aliases/CalendarInvitation.md -->\n# Type Alias: CalendarInvitation\n\n> **CalendarInvitation** = \\{ `attendees`: [`InvitationParticipant`](InvitationParticipant.md)[]; `comment?`: `string` \\| `null`; `conference_url?`: `string` \\| `null`; `description?`: `string` \\| `null`; `dtstamp?`: `string` \\| `null`; `end?`: `null` \\| [`InvitationDateTime`](InvitationDateTime.md); `id`: `string`; `last_modified?`: `string` \\| `null`; `location?`: `string` \\| `null`; `method`: [`InvitationMethod`](InvitationMethod.md); `organizer?`: `null` \\| [`InvitationParticipant`](InvitationParticipant.md); `recurrence_id?`: `null` \\| [`InvitationDateTime`](InvitationDateTime.md); `recurrence_id_raw?`: `string` \\| `null`; `sequence`: `number`; `start?`: `null` \\| [`InvitationDateTime`](InvitationDateTime.md); `status?`: `string` \\| `null`; `title?`: `string` \\| `null`; `uid`: `string`; \\}\n\nDisplay snapshot of one meaningful VEVENT, owned by the email domain.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-attendees\"></a> `attendees` | [`InvitationParticipant`](InvitationParticipant.md)[] | Historical attendee identities and participation metadata. |\n| <a id=\"property-comment\"></a> `comment?` | `string` \\| `null` | Reply or counter-proposal comment. |\n| <a id=\"property-conference_url\"></a> `conference_url?` | `string` \\| `null` | Validated HTTP(S) conferencing URL; never fetched during rendering. |\n| <a id=\"property-description\"></a> `description?` | `string` \\| `null` | Plaintext description, retaining passwords and dial-in instructions. |\n| <a id=\"property-dtstamp\"></a> `dtstamp?` | `string` \\| `null` | Scheduling timestamp in its original spelling. |\n| <a id=\"property-end\"></a> `end?` | `null` \\| [`InvitationDateTime`](InvitationDateTime.md) | - |\n| <a id=\"property-id\"></a> `id` | `string` | Content-derived component identity, stable across repeated extraction. |\n| <a id=\"property-last_modified\"></a> `last_modified?` | `string` \\| `null` | Last modification timestamp in its original spelling. |\n| <a id=\"property-location\"></a> `location?` | `string` \\| `null` | Plaintext event location. |\n| <a id=\"property-method\"></a> `method` | [`InvitationMethod`](InvitationMethod.md) | Original scheduling method. |\n| <a id=\"property-organizer\"></a> `organizer?` | `null` \\| [`InvitationParticipant`](InvitationParticipant.md) | - |\n| <a id=\"property-recurrence_id\"></a> `recurrence_id?` | `null` \\| [`InvitationDateTime`](InvitationDateTime.md) | - |\n| <a id=\"property-recurrence_id_raw\"></a> `recurrence_id_raw?` | `string` \\| `null` | Original recurrence identifier spelling and parameters. |\n| <a id=\"property-sequence\"></a> `sequence` | `number` | Scheduling revision, distinct from delivery order. |\n| <a id=\"property-start\"></a> `start?` | `null` \\| [`InvitationDateTime`](InvitationDateTime.md) | - |\n| <a id=\"property-status\"></a> `status?` | `string` \\| `null` | Original event status. |\n| <a id=\"property-title\"></a> `title?` | `string` \\| `null` | Event summary. |\n| <a id=\"property-uid\"></a> `uid` | `string` | iCalendar UID; never a Google provider event ID. |\n\n\n<!-- generated/email/types.gen/type-aliases/ContactInfo.md -->\n# Type Alias: ContactInfo\n\n> **ContactInfo** = \\{ `email`: `string`; `name?`: `string` \\| `null`; `photo_url?`: `string` \\| `null`; \\}\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-email\"></a> `email` | `string` |\n| <a id=\"property-name\"></a> `name?` | `string` \\| `null` |\n| <a id=\"property-photo_url\"></a> `photo_url?` | `string` \\| `null` |\n\n\n<!-- generated/email/types.gen/type-aliases/GetAttachmentResponse.md -->\n# Type Alias: GetAttachmentResponse\n\n> **GetAttachmentResponse** = \\{ `attachment`: [`Attachment`](Attachment.md); \\}\n\nThe response returned from the get attachment endpoint\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-attachment\"></a> `attachment` | [`Attachment`](Attachment.md) |\n\n\n<!-- generated/email/types.gen/type-aliases/GetAttachmentResponses.md -->\n# Type Alias: GetAttachmentResponses\n\n> **GetAttachmentResponses** = \\{ `200`: [`GetAttachmentResponse`](GetAttachmentResponse.md); \\}\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-200\"></a> `200` | [`GetAttachmentResponse`](GetAttachmentResponse.md) |\n\n\n<!-- generated/email/types.gen/type-aliases/GetMessageResponses.md -->\n# Type Alias: GetMessageResponses\n\n> **GetMessageResponses** = \\{ `200`: [`ParsedMessage`](ParsedMessage.md); \\}\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-200\"></a> `200` | [`ParsedMessage`](ParsedMessage.md) |\n\n\n<!-- generated/email/types.gen/type-aliases/InvitationDateTime.md -->\n# Type Alias: InvitationDateTime\n\n> **InvitationDateTime** = \\{ `kind`: `\"date\"`; `value`: `string`; \\} \\| \\{ `kind`: `\"zoned\"`; `time_zone`: `string`; `value`: `string`; \\} \\| \\{ `kind`: `\"unresolved\"`; `time_zone?`: `string` \\| `null`; `value`: `string`; \\}\n\nPreserve date-only and unresolved times without manufacturing UTC instants.\n\n## Union Members\n\n### Type Literal\n\n\\{ `kind`: `\"date\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"date\"` | - |\n| `value` | `string` | ISO calendar date. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"zoned\"`; `time_zone`: `string`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"zoned\"` | - |\n| `time_zone` | `string` | IANA zone of the original TZID, or UTC. |\n| `value` | `string` | RFC3339 instant. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"unresolved\"`; `time_zone?`: `string` \\| `null`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"unresolved\"` | - |\n| `time_zone?` | `string` \\| `null` | Original TZID if present. |\n| `value` | `string` | ISO local wall time, without an offset. |\n\n\n<!-- generated/email/types.gen/type-aliases/InvitationMethod.md -->\n# Type Alias: InvitationMethod\n\n> **InvitationMethod** = `\"request\"` \\| `\"reply\"` \\| `\"cancel\"` \\| `\"counter\"` \\| `\"publish\"` \\| `\"unknown\"`\n\nOriginal scheduling method, including methods unsupported for actions.\n\n\n<!-- generated/email/types.gen/type-aliases/InvitationParticipant.md -->\n# Type Alias: InvitationParticipant\n\n> **InvitationParticipant** = \\{ `email`: `string`; `name?`: `string` \\| `null`; `participation_status?`: `string` \\| `null`; \\}\n\nScheduling participant; saved responses are historical, not current RSVP.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-email\"></a> `email` | `string` | Participant calendar address. |\n| <a id=\"property-name\"></a> `name?` | `string` \\| `null` | Sender-supplied display name. |\n| <a id=\"property-participation_status\"></a> `participation_status?` | `string` \\| `null` | Original PARTSTAT, retaining extensions. |\n\n\n<!-- generated/email/types.gen/type-aliases/LabelInfo.md -->\n# Type Alias: LabelInfo\n\n> **LabelInfo** = \\{ `name`: `string`; `provider_id`: `string`; \\}\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-name\"></a> `name` | `string` |\n| <a id=\"property-provider_id\"></a> `provider_id` | `string` |\n\n\n<!-- generated/email/types.gen/type-aliases/Link.md -->\n# Type Alias: Link\n\n> **Link** = \\{ `calendar_disabled`: `boolean`; `created_at`: `string`; `email_address`: `string`; `fusionauth_user_id`: `string`; `has_calendar_data`: `boolean`; `id`: `string`; `is_primary`: `boolean`; `is_sync_active`: `boolean`; `macro_id`: `string`; `needs_calendar_permission`: `boolean`; `needs_reauth`: `boolean`; `photo_url?`: `string` \\| `null`; `provider`: [`UserProvider`](UserProvider.md); `settings`: [`Settings`](Settings.md); `sync_status`: [`SyncStatus`](SyncStatus.md); `updated_at`: `string`; \\}\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-calendar_disabled\"></a> `calendar_disabled` | `boolean` | Whether the user turned calendar off for this inbox, which also removed its calendar data. `needs_calendar_permission` is true either way, so this is what separates \"never granted\" from \"deliberately off\" — unprompted calendar nags must stay quiet for the latter. |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | - |\n| <a id=\"property-email_address\"></a> `email_address` | `string` | - |\n| <a id=\"property-fusionauth_user_id\"></a> `fusionauth_user_id` | `string` | - |\n| <a id=\"property-has_calendar_data\"></a> `has_calendar_data` | `boolean` | Whether Macro holds calendar data for this inbox. Drives the turn-off control on its own, so removing that data never depends on the recorded scopes still matching the set Macro requests today — a set that changes as the integration narrows, stranding data behind a capability check that no longer recognizes an older grant. |\n| <a id=\"property-id\"></a> `id` | `string` | - |\n| <a id=\"property-is_primary\"></a> `is_primary` | `boolean` | - |\n| <a id=\"property-is_sync_active\"></a> `is_sync_active` | `boolean` | - |\n| <a id=\"property-macro_id\"></a> `macro_id` | `string` | - |\n| <a id=\"property-needs_calendar_permission\"></a> `needs_calendar_permission` | `boolean` | Whether the link's Google grant is missing the calendar scope. True for inboxes connected before the calendar capability existed (and for grants where the user declined it); drives the per-inbox calendar upgrade prompt. Re-running the connect flow records the new grant. |\n| <a id=\"property-needs_reauth\"></a> `needs_reauth` | `boolean` | Whether the link's Google grant needs to be reconnected. Drives the per-inbox reconnect prompt independently of the sync-status badge. |\n| <a id=\"property-photo_url\"></a> `photo_url?` | `string` \\| `null` | The inbox's own profile photo (its self-contact's SFS photo), if synced. |\n| <a id=\"property-provider\"></a> `provider` | [`UserProvider`](UserProvider.md) | - |\n| <a id=\"property-settings\"></a> `settings` | [`Settings`](Settings.md) | - |\n| <a id=\"property-sync_status\"></a> `sync_status` | [`SyncStatus`](SyncStatus.md) | - |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` | - |\n\n\n<!-- generated/email/types.gen/type-aliases/MailboxAction.md -->\n# Type Alias: MailboxAction\n\n> **MailboxAction** = \\{ `kind`: `\"read\"`; `value`: `boolean`; \\} \\| \\{ `kind`: `\"flagged\"`; `value`: `boolean`; \\} \\| \\{ `kind`: `\"archived\"`; `value`: `boolean`; \\} \\| \\{ `kind`: `\"trashed\"`; `value`: `boolean`; \\} \\| \\{ `kind`: `\"junk\"`; `value`: `boolean`; \\} \\| \\{ `kind`: `\"category\"`; `value`: \\{ `name`: `string`; `present`: `boolean`; \\}; \\}\n\nDesired organization state. Categories never stand in for folders or flags.\n\n## Union Members\n\n### Type Literal\n\n\\{ `kind`: `\"read\"`; `value`: `boolean`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"read\"` | - |\n| `value` | `boolean` | Mark correspondence read or unread. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"flagged\"`; `value`: `boolean`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"flagged\"` | - |\n| `value` | `boolean` | Set the follow-up star. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"archived\"`; `value`: `boolean`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"archived\"` | - |\n| `value` | `boolean` | Archive inbox messages, or restore received correspondence to the inbox. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"trashed\"`; `value`: `boolean`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"trashed\"` | - |\n| `value` | `boolean` | Move to recoverable trash, or restore correspondence to Inbox (drafts to Drafts). |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"junk\"`; `value`: `boolean`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"junk\"` | - |\n| `value` | `boolean` | Move to junk, or restore to the inbox. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"category\"`; `value`: \\{ `name`: `string`; `present`: `boolean`; \\}; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"category\"` | - |\n| `value` | \\{ `name`: `string`; `present`: `boolean`; \\} | Add/remove a category while preserving other provider assignments. |\n| `value.name` | `string` | - |\n| `value.present` | `boolean` | - |\n\n\n<!-- generated/email/types.gen/type-aliases/MailboxOperation.md -->\n# Type Alias: MailboxOperation\n\n> **MailboxOperation** = \\{ `action`: [`MailboxAction`](MailboxAction.md); `id`: `string`; `state`: [`MailboxOperationState`](MailboxOperationState.md); `updated_at`: `string`; \\}\n\nDurable outcome of an accepted organization action.\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-action\"></a> `action` | [`MailboxAction`](MailboxAction.md) |\n| <a id=\"property-id\"></a> `id` | `string` |\n| <a id=\"property-state\"></a> `state` | [`MailboxOperationState`](MailboxOperationState.md) |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` |\n\n\n<!-- generated/email/types.gen/type-aliases/MailboxOperationState.md -->\n# Type Alias: MailboxOperationState\n\n> **MailboxOperationState** = `\"pending\"` \\| `\"applied\"` \\| `\"failed\"` \\| `\"cancelled\"`\n\n\n<!-- generated/email/types.gen/type-aliases/MailboxSettingsChange.md -->\n# Type Alias: MailboxSettingsChange\n\n> **MailboxSettingsChange** = `\"create_label\"` \\| `\"delete_label\"` \\| `\"sender_block\"`\n\n\n<!-- generated/email/types.gen/type-aliases/MailboxSettingsOperation.md -->\n# Type Alias: MailboxSettingsOperation\n\n> **MailboxSettingsOperation** = \\{ `enabled`: `boolean`; `id`: `string`; `kind`: [`MailboxSettingsChange`](MailboxSettingsChange.md); `needs_attention`: `boolean`; `resource`: `string`; \\}\n\nAn accepted inbox configuration change awaiting provider confirmation.\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-enabled\"></a> `enabled` | `boolean` |\n| <a id=\"property-id\"></a> `id` | `string` |\n| <a id=\"property-kind\"></a> `kind` | [`MailboxSettingsChange`](MailboxSettingsChange.md) |\n| <a id=\"property-needs_attention\"></a> `needs_attention` | `boolean` |\n| <a id=\"property-resource\"></a> `resource` | `string` |\n\n\n<!-- generated/email/types.gen/type-aliases/MessageOperationResponse.md -->\n# Type Alias: MessageOperationResponse\n\n> **MessageOperationResponse** = \\{ `operation?`: `null` \\| [`ApiMessageOperation`](ApiMessageOperation.md); \\}\n\nAuthorized polling response. Gmail has no asynchronous draft operation.\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-operation\"></a> `operation?` | `null` \\| [`ApiMessageOperation`](ApiMessageOperation.md) |\n\n\n<!-- generated/email/types.gen/type-aliases/ParsedMessage.md -->\n# Type Alias: ParsedMessage\n\n> **ParsedMessage** = \\{ `bcc`: [`ContactInfo`](ContactInfo.md)[]; `body_parsed?`: `string` \\| `null`; `cc`: [`ContactInfo`](ContactInfo.md)[]; `db_id`: `string`; `from?`: `null` \\| [`ContactInfo`](ContactInfo.md); `internal_date_ts?`: `string` \\| `null`; `labels`: [`LabelInfo`](LabelInfo.md)[]; `link_id`: `string`; `subject?`: `string` \\| `null`; `thread_db_id`: `string`; `to`: [`ContactInfo`](ContactInfo.md)[]; \\}\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-bcc\"></a> `bcc` | [`ContactInfo`](ContactInfo.md)[] |\n| <a id=\"property-body_parsed\"></a> `body_parsed?` | `string` \\| `null` |\n| <a id=\"property-cc\"></a> `cc` | [`ContactInfo`](ContactInfo.md)[] |\n| <a id=\"property-db_id\"></a> `db_id` | `string` |\n| <a id=\"property-from\"></a> `from?` | `null` \\| [`ContactInfo`](ContactInfo.md) |\n| <a id=\"property-internal_date_ts\"></a> `internal_date_ts?` | `string` \\| `null` |\n| <a id=\"property-labels\"></a> `labels` | [`LabelInfo`](LabelInfo.md)[] |\n| <a id=\"property-link_id\"></a> `link_id` | `string` |\n| <a id=\"property-subject\"></a> `subject?` | `string` \\| `null` |\n| <a id=\"property-thread_db_id\"></a> `thread_db_id` | `string` |\n| <a id=\"property-to\"></a> `to` | [`ContactInfo`](ContactInfo.md)[] |\n\n\n<!-- generated/email/types.gen/type-aliases/ResolveMessageOperationRequest.md -->\n# Type Alias: ResolveMessageOperationRequest\n\n> **ResolveMessageOperationRequest** = \\{ `accept_duplicate_risk?`: `boolean`; `action`: [`ApiMessageResolutionAction`](ApiMessageResolutionAction.md); `remote_version?`: `string` \\| `null`; `revision`: `string`; \\}\n\nStale versions fail without altering the current operation.\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-accept_duplicate_risk\"></a> `accept_duplicate_risk?` | `boolean` |\n| <a id=\"property-action\"></a> `action` | [`ApiMessageResolutionAction`](ApiMessageResolutionAction.md) |\n| <a id=\"property-remote_version\"></a> `remote_version?` | `string` \\| `null` |\n| <a id=\"property-revision\"></a> `revision` | `string` |\n\n\n<!-- generated/email/types.gen/type-aliases/Settings.md -->\n# Type Alias: Settings\n\n> **Settings** = \\{ `signature?`: `string` \\| `null`; `signature_on_replies_forwards?`: `boolean` \\| `null`; \\}\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-signature\"></a> `signature?` | `string` \\| `null` | The user's email signature content (HTML). On a patch, omit or send `null` to leave unchanged (both deserialize to `None`); pass an empty string to clear it. The column cannot be set to SQL NULL via patch. |\n| <a id=\"property-signature_on_replies_forwards\"></a> `signature_on_replies_forwards?` | `boolean` \\| `null` | - |\n\n\n<!-- generated/email/types.gen/type-aliases/SyncStatus.md -->\n# Type Alias: SyncStatus\n\n> **SyncStatus** = `\"SYNCING\"` \\| `\"UP_TO_DATE\"` \\| `\"ERROR\"` \\| `\"NEEDS_REAUTH\"` \\| `\"INACTIVE\"`\n\nCoarse sync state for an inbox, used to render a one-line hint in the\nmulti-inbox settings list. Derived from the link's `is_sync_active` flag, its\nreauth health, and its most recent backfill job.\n\n\n<!-- generated/email/types.gen/type-aliases/ThreadStateField.md -->\n# Type Alias: ThreadStateField\n\n> **ThreadStateField** = `\"read\"` \\| `\"starred\"` \\| `\"trashed\"` \\| `\"junk\"`\n\nSemantic mailbox facts, independent of folder/category names.\n\n\n<!-- generated/email/types.gen/type-aliases/TransferDraftRequest.md -->\n# Type Alias: TransferDraftRequest\n\n> **TransferDraftRequest** = \\{ `destination_link_id`: `string`; `operation_id`: `string`; \\}\n\nReuse the same operation ID when retrying after a lost response.\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-destination_link_id\"></a> `destination_link_id` | `string` |\n| <a id=\"property-operation_id\"></a> `operation_id` | `string` |\n\n\n<!-- generated/email/types.gen/type-aliases/TransferDraftResponse.md -->\n# Type Alias: TransferDraftResponse\n\n> **TransferDraftResponse** = \\{ `attachments`: [`ApiAttachmentDraft`](ApiAttachmentDraft.md)[]; `message_id`: `string`; `source_id`: `string`; `source_thread_id`: `string`; `thread_id`: `string`; \\}\n\nA new identity prevents delayed writes from mutating the moved copy.\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-attachments\"></a> `attachments` | [`ApiAttachmentDraft`](ApiAttachmentDraft.md)[] |\n| <a id=\"property-message_id\"></a> `message_id` | `string` |\n| <a id=\"property-source_id\"></a> `source_id` | `string` |\n| <a id=\"property-source_thread_id\"></a> `source_thread_id` | `string` |\n| <a id=\"property-thread_id\"></a> `thread_id` | `string` |\n\n\n<!-- generated/email/types.gen/type-aliases/TransferRecoveryResponse.md -->\n# Type Alias: TransferRecoveryResponse\n\n> **TransferRecoveryResponse** = \\{ `committed?`: `null` \\| [`TransferDraftResponse`](TransferDraftResponse.md); \\}\n\nA null result confirms that the move cannot commit, even if its request was delayed.\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-committed\"></a> `committed?` | `null` \\| [`TransferDraftResponse`](TransferDraftResponse.md) |\n\n\n<!-- generated/email/types.gen/type-aliases/UpdateThreadStateRequest.md -->\n# Type Alias: UpdateThreadStateRequest\n\n> **UpdateThreadStateRequest** = \\{ `field`: [`ThreadStateField`](ThreadStateField.md); `value`: `boolean`; \\}\n\nDesired state for every applicable message in an authorized thread.\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-field\"></a> `field` | [`ThreadStateField`](ThreadStateField.md) |\n| <a id=\"property-value\"></a> `value` | `boolean` |\n\n\n<!-- generated/email/types.gen/type-aliases/UserProvider.md -->\n# Type Alias: UserProvider\n\n> **UserProvider** = `\"GMAIL\"` \\| `\"OUTLOOK\"`\n\n\n<!-- generated/properties/types.gen/type-aliases/BulkUpdateEntityPropertyOptionsResponse.md -->\n# Type Alias: BulkUpdateEntityPropertyOptionsResponse\n\n> **BulkUpdateEntityPropertyOptionsResponse** = \\{ `properties`: [`EntityPropertyOptionSelectionResponse`](EntityPropertyOptionSelectionResponse.md)[]; \\}\n\nResponse for a bulk option update: each property's reconciled final ids.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-properties\"></a> `properties` | [`EntityPropertyOptionSelectionResponse`](EntityPropertyOptionSelectionResponse.md)[] | The final option ids per updated property. |\n\n\n<!-- generated/properties/types.gen/type-aliases/DataType.md -->\n# Type Alias: DataType\n\n> **DataType** = `\"BOOLEAN\"` \\| `\"DATE\"` \\| `\"NUMBER\"` \\| `\"STRING\"` \\| `\"SELECT_NUMBER\"` \\| `\"SELECT_STRING\"` \\| `\"TAG\"` \\| `\"ENTITY\"` \\| `\"LINK\"`\n\nData type for property values, determining storage and validation.\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityProperty.md -->\n# Type Alias: EntityProperty\n\n> **EntityProperty** = \\{ `created_at`: `string`; `entity_id`: `string`; `entity_type`: [`EntityType`](EntityType.md); `id`: `string`; `property_definition_id`: `string`; `updated_at`: `string`; \\}\n\nAssignment of a property definition to a specific entity (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-created_at\"></a> `created_at` | `string` |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` |\n| <a id=\"property-entity_type\"></a> `entity_type` | [`EntityType`](EntityType.md) |\n| <a id=\"property-id\"></a> `id` | `string` |\n| <a id=\"property-property_definition_id\"></a> `property_definition_id` | `string` |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityPropertyOptionSelectionResponse.md -->\n# Type Alias: EntityPropertyOptionSelectionResponse\n\n> **EntityPropertyOptionSelectionResponse** = \\{ `option_ids`: `string`[]; `property_id`: `string`; \\}\n\nThe reconciled final option ids stored for one property after a bulk update.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-option_ids\"></a> `option_ids` | `string`[] | The final option ids the server persisted, in stored order. |\n| <a id=\"property-property_id\"></a> `property_id` | `string` | The property definition the options belong to. |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md -->\n# Type Alias: EntityPropertyWithDefinition\n\n> **EntityPropertyWithDefinition** = \\{ `definition`: [`PropertyDefinition`](PropertyDefinition.md); `options?`: [`PropertyOption`](PropertyOption.md)[] \\| `null`; `property`: [`EntityProperty`](EntityProperty.md); `value?`: `null` \\| [`PropertyValue`](PropertyValue.md); \\}\n\nEntity property with its definition, value, and options (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-definition\"></a> `definition` | [`PropertyDefinition`](PropertyDefinition.md) |\n| <a id=\"property-options\"></a> `options?` | [`PropertyOption`](PropertyOption.md)[] \\| `null` |\n| <a id=\"property-property\"></a> `property` | [`EntityProperty`](EntityProperty.md) |\n| <a id=\"property-value\"></a> `value?` | `null` \\| [`PropertyValue`](PropertyValue.md) |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityReference.md -->\n# Type Alias: EntityReference\n\n> **EntityReference** = \\{ `entity_id`: `string`; `entity_type`: [`EntityType`](EntityType.md); `specific_message_id?`: `string` \\| `null`; \\}\n\nEntity reference for entity-type property values.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | - |\n| <a id=\"property-entity_type\"></a> `entity_type` | [`EntityType`](EntityType.md) | - |\n| <a id=\"property-specific_message_id\"></a> `specific_message_id?` | `string` \\| `null` | For CHANNEL, CHAT, THREAD entity types - optional specific message ID. This allows referencing a specific message within a thread/channel/chat. |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityType.md -->\n# Type Alias: EntityType\n\n> **EntityType** = `\"CALENDAR_EVENT\"` \\| `\"CALL_RECORD\"` \\| `\"CHANNEL\"` \\| `\"CHAT\"` \\| `\"COMPANY\"` \\| `\"DATABASE_ROW\"` \\| `\"CONTACT\"` \\| `\"DOCUMENT\"` \\| `\"INITIATIVE\"` \\| `\"PROJECT\"` \\| `\"TASK\"` \\| `\"THREAD\"` \\| `\"USER\"`\n\nType of entity that can be referenced by entity properties.\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyDefinition.md -->\n# Type Alias: PropertyDefinition\n\n> **PropertyDefinition** = \\{ `created_at`: `string`; `data_type`: [`DataType`](DataType.md); `display_name`: `string`; `id`: `string`; `is_metadata`: `boolean`; `is_multi_select`: `boolean`; `is_system`: `boolean`; `owner`: [`PropertyOwner`](PropertyOwner.md); `specific_entity_type`: `null` \\| [`EntityType`](EntityType.md); `updated_at`: `string`; \\}\n\nProperty definition model (service representation).\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | - |\n| <a id=\"property-data_type\"></a> `data_type` | [`DataType`](DataType.md) | - |\n| <a id=\"property-display_name\"></a> `display_name` | `string` | - |\n| <a id=\"property-id\"></a> `id` | `string` | - |\n| <a id=\"property-is_metadata\"></a> `is_metadata` | `boolean` | Flag to indicate if this is a system-generated metadata property. Not stored in database - computed at service layer. |\n| <a id=\"property-is_multi_select\"></a> `is_multi_select` | `boolean` | - |\n| <a id=\"property-is_system\"></a> `is_system` | `boolean` | Flag to indicate if this is a system property (stored in DB). |\n| <a id=\"property-owner\"></a> `owner` | [`PropertyOwner`](PropertyOwner.md) | - |\n| <a id=\"property-specific_entity_type\"></a> `specific_entity_type` | `null` \\| [`EntityType`](EntityType.md) | - |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` | - |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyOption.md -->\n# Type Alias: PropertyOption\n\n> **PropertyOption** = \\{ `color`: `string` \\| `null`; `created_at`: `string`; `display_order`: `number`; `id`: `string`; `property_definition_id`: `string`; `updated_at`: `string`; `value`: [`PropertyOptionValue`](PropertyOptionValue.md); \\}\n\nA selectable option for select-type properties (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-color\"></a> `color` | `string` \\| `null` |\n| <a id=\"property-created_at\"></a> `created_at` | `string` |\n| <a id=\"property-display_order\"></a> `display_order` | `number` |\n| <a id=\"property-id\"></a> `id` | `string` |\n| <a id=\"property-property_definition_id\"></a> `property_definition_id` | `string` |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` |\n| <a id=\"property-value\"></a> `value` | [`PropertyOptionValue`](PropertyOptionValue.md) |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyOptionValue.md -->\n# Type Alias: PropertyOptionValue\n\n> **PropertyOptionValue** = \\{ `type`: `\"string\"`; `value`: `string`; \\} \\| \\{ `type`: `\"number\"`; `value`: `number`; \\}\n\nThe value of a property option - either a string or a number.\n\n## Union Members\n\n### Type Literal\n\n\\{ `type`: `\"string\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"string\"` | - |\n| `value` | `string` | String value for SelectString properties |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"number\"`; `value`: `number`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"number\"` | - |\n| `value` | `number` | Number value for SelectNumber properties |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyOwner.md -->\n# Type Alias: PropertyOwner\n\n> **PropertyOwner** = \\{ `scope`: `\"user\"`; `user_id`: `string`; \\} \\| \\{ `scope`: `\"team\"`; `team_id`: `string`; \\} \\| \\{ `database_id`: `string`; `scope`: `\"database\"`; \\} \\| \\{ `scope`: `\"system\"`; \\}\n\nDefines who owns a property - user-scoped, team-scoped, database-scoped, or system.\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyTargetEntityType.md -->\n# Type Alias: PropertyTargetEntityType\n\n> **PropertyTargetEntityType** = `\"CALL_RECORD\"` \\| `\"CHANNEL\"` \\| `\"CHAT\"` \\| `\"COMPANY\"` \\| `\"DATABASE_ROW\"` \\| `\"DOCUMENT\"` \\| `\"INITIATIVE\"` \\| `\"PROJECT\"` \\| `\"THREAD\"` \\| `\"USER\"`\n\nCanonical type of an entity receiving properties.\n\nTasks are documents at API boundaries. `Task` intentionally does not exist\nhere; task classification is resolved by the properties domain from the\ndocument subtype.\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyTargetReference.md -->\n# Type Alias: PropertyTargetReference\n\n> **PropertyTargetReference** = \\{ `entity_id`: `string`; `entity_type`: [`PropertyTargetEntityType`](PropertyTargetEntityType.md); \\}\n\nCanonical reference to an entity receiving properties.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | Entity identifier. |\n| <a id=\"property-entity_type\"></a> `entity_type` | [`PropertyTargetEntityType`](PropertyTargetEntityType.md) | Canonical entity type. |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyValue.md -->\n# Type Alias: PropertyValue\n\n> **PropertyValue** = \\{ `type`: `\"Boolean\"`; `value`: `boolean`; \\} \\| \\{ `type`: `\"Number\"`; `value`: `number`; \\} \\| \\{ `type`: `\"String\"`; `value`: `string`; \\} \\| \\{ `type`: `\"Date\"`; `value`: `string`; \\} \\| \\{ `type`: `\"SelectOption\"`; `value`: `string`[]; \\} \\| \\{ `type`: `\"EntityReference\"`; `value`: [`EntityReference`](EntityReference.md)[]; \\} \\| \\{ `type`: `\"Link\"`; `value`: `string`[]; \\}\n\nProperty value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to/from JSONB in the database.\n\n## Union Members\n\n### Type Literal\n\n\\{ `type`: `\"Boolean\"`; `value`: `boolean`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Boolean\"` | - |\n| `value` | `boolean` | Boolean value Serializes as: {\"type\": \"Boolean\", \"value\": true} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"Number\"`; `value`: `number`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Number\"` | - |\n| `value` | `number` | Numeric value Serializes as: {\"type\": \"Number\", \"value\": 42.5} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"String\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"String\"` | - |\n| `value` | `string` | String value Serializes as: {\"type\": \"String\", \"value\": \"text\"} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"Date\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Date\"` | - |\n| `value` | `string` | Date/timestamp value Serializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"SelectOption\"`; `value`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"SelectOption\"` | - |\n| `value` | `string`[] | Select option(s) - always an array (check is_multi_select to determine if single or multi) Single-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1) Multi-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+) |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"EntityReference\"`; `value`: [`EntityReference`](EntityReference.md)[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"EntityReference\"` | - |\n| `value` | [`EntityReference`](EntityReference.md)[] | Entity reference(s) - always an array (check is_multi_select to determine if single or multi) Single-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1) Multi-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+) |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"Link\"`; `value`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Link\"` | - |\n| `value` | `string`[] | Link value(s) - always an array (check is_multi_select to determine if single or multi) Single-select: {\"type\": \"Link\", \"value\": [\"https://example.com\"]} (length 0 or 1) Multi-select: {\"type\": \"Link\", \"value\": [\"https://example.com\", \"https://other.com\"]} (length 0+) |\n\n\n<!-- generated/properties/types.gen/type-aliases/SetPropertyValue.md -->\n# Type Alias: SetPropertyValue\n\n> **SetPropertyValue** = \\{ `type`: `\"boolean\"`; `value`: `boolean`; \\} \\| \\{ `type`: `\"date\"`; `value`: `string`; \\} \\| \\{ `type`: `\"number\"`; `value`: `number`; \\} \\| \\{ `type`: `\"string\"`; `value`: `string`; \\} \\| \\{ `option_id`: `string`; `type`: `\"select_option\"`; \\} \\| \\{ `option_ids`: `string`[]; `type`: `\"multi_select_option\"`; \\} \\| \\{ `reference`: [`EntityReference`](EntityReference.md); `type`: `\"entity_reference\"`; \\} \\| \\{ `references`: [`EntityReference`](EntityReference.md)[]; `type`: `\"multi_entity_reference\"`; \\} \\| \\{ `type`: `\"link\"`; `url`: `string`; \\} \\| \\{ `type`: `\"multi_link\"`; `urls`: `string`[]; \\}\n\nType-safe enum for setting entity property values - provides compile-time validation.\n\n\n<!-- src/entities/email/attachment/classes/EmailAttachment.md -->\n# Class: EmailAttachment\n\nA file attached to an email message. A thin handle keyed by attachment id;\nthe record loads lazily on first field access.\n\n## Extends\n\n- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\\<[`EmailAttachmentData`](../type-aliases/EmailAttachmentData.md)\\>\n\n## Properties\n\n| Property | Modifier | Type | Description | Inherited from |\n| ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-contentid\"></a> `contentId` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | The attachment's Content-ID header value (for inline attachments). | - |\n| <a id=\"property-dataurl\"></a> `dataUrl` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | A URL to the attachment's raw data, when available. | - |\n| <a id=\"property-filename\"></a> `filename` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | The attachment's original filename. | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |\n| <a id=\"property-mimetype\"></a> `mimeType` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | The attachment's MIME type. | - |\n| <a id=\"property-sfsid\"></a> `sfsId` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | The attachment's static-file-service id, when it has been stored there. | - |\n| <a id=\"property-size\"></a> `size` | `readonly` | () => `Promise`\\<`number` \\| `undefined`\\> | The attachment's size in bytes. | - |\n\n## Methods\n\n### toDocument()\n\n> **toDocument**(): `Promise`\\<[`Document`](../../../documents/document/classes/Document.md)\\>\n\nThe Macro document holding this attachment's content. Get-or-create: the\nserver returns the existing document's id, or downloads the attachment\nfrom the provider and uploads it as a new document first (deduplicated\nbehind a server-side lock).\n\n#### Returns\n\n`Promise`\\<[`Document`](../../../documents/document/classes/Document.md)\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`Attachment`](../../../../../generated/email/types.gen/type-aliases/Attachment.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`Attachment`](../../../../../generated/email/types.gen/type-aliases/Attachment.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`Attachment`](../../../../../generated/email/types.gen/type-aliases/Attachment.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `id`): `EmailAttachment`\n\nA handle to an attachment by id. Fields load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `id` | `string` |\n\n#### Returns\n\n`EmailAttachment`\n\n***\n\n### from()\n\n> `static` **from**(`client`, `data`): `EmailAttachment`\n\nBuild an attachment from an already-fetched record (pre-seeded, no fetch).\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `data` | [`Attachment`](../../../../../generated/email/types.gen/type-aliases/Attachment.md) |\n\n#### Returns\n\n`EmailAttachment`\n\n\n<!-- src/entities/email/attachment/type-aliases/EmailAttachmentData.md -->\n# Type Alias: EmailAttachmentData\n\n> **EmailAttachmentData** = [`GetAttachmentResponses`](../../../../../generated/email/types.gen/type-aliases/GetAttachmentResponses.md)\\[`200`\\]\\[`\"attachment\"`\\]\n\nThe API's representation of an email attachment (`Attachment`).\n\n\n<!-- src/entities/email/label/classes/Label.md -->\n# Class: Label\n\nAn email label. A free-to-construct handle: there is no single-label GET,\nso the detail record loads lazily on first field access by listing all\nlabels and finding this one (mirroring Link).\n\n## Extends\n\n- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\\<[`ApiLabel`](../../../../../generated/email/types.gen/type-aliases/ApiLabel.md)\\>\n\n## Properties\n\n| Property | Modifier | Type | Description | Inherited from |\n| ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-createdat\"></a> `createdAt` | `readonly` | () => `Promise`\\<`string`\\> | When the label was created. | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |\n| <a id=\"property-labellistvisibility\"></a> `labelListVisibility` | `readonly` | () => `Promise`\\<[`ApiLabelListVisibility`](../../../../../generated/email/types.gen/type-aliases/ApiLabelListVisibility.md)\\> | Whether the label is shown in the label list. | - |\n| <a id=\"property-linkid\"></a> `linkId` | `readonly` | () => `Promise`\\<`string`\\> | The inbox (email link) this label belongs to. | - |\n| <a id=\"property-messagelistvisibility\"></a> `messageListVisibility` | `readonly` | () => `Promise`\\<[`ApiMessageListVisibility`](../../../../../generated/email/types.gen/type-aliases/ApiMessageListVisibility.md)\\> | Whether the label is shown in the message list. | - |\n| <a id=\"property-name\"></a> `name` | `readonly` | () => `Promise`\\<`string`\\> | The label's display name. | - |\n| <a id=\"property-type\"></a> `type` | `readonly` | () => `Promise`\\<[`ApiLabelType`](../../../../../generated/email/types.gen/type-aliases/ApiLabelType.md)\\> | Whether this is a system label or a user-created one. | - |\n\n## Methods\n\n### delete()\n\n> **delete**(): `Promise`\\<`void`\\>\n\nDelete this label.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`ApiLabel`](../../../../../generated/email/types.gen/type-aliases/ApiLabel.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`ApiLabel`](../../../../../generated/email/types.gen/type-aliases/ApiLabel.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`ApiLabel`](../../../../../generated/email/types.gen/type-aliases/ApiLabel.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `id`): `Label`\n\nA handle to a label by id. Details load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `id` | `string` |\n\n#### Returns\n\n`Label`\n\n***\n\n### create()\n\n> `static` **create**(`client`, `name`): `Promise`\\<`Label`\\>\n\nCreate a user label.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `name` | `string` |\n\n#### Returns\n\n`Promise`\\<`Label`\\>\n\n***\n\n### list()\n\n> `static` **list**(`client`): `Promise`\\<`Label`[]\\>\n\nAll labels across the user's inboxes.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`Promise`\\<`Label`[]\\>\n\n\n<!-- src/entities/email/link/classes/Link.md -->\n# Class: Link\n\nAn email link: a connected inbox (e.g. Gmail or Outlook) that threads and\nmessages sync through. A free-to-construct handle, resolved from the\ncaller's connected links.\n\n## Extends\n\n- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\\<[`Link`](../../../../../generated/email/types.gen/type-aliases/Link.md)\\>\n\n## Properties\n\n| Property | Modifier | Type | Description | Inherited from |\n| ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-emailaddress\"></a> `emailAddress` | `readonly` | () => `Promise`\\<`string`\\> | The inbox's email address. | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |\n| <a id=\"property-isprimary\"></a> `isPrimary` | `readonly` | () => `Promise`\\<`boolean`\\> | Whether this is the user's primary inbox. | - |\n| <a id=\"property-issyncactive\"></a> `isSyncActive` | `readonly` | () => `Promise`\\<`boolean`\\> | Whether syncing is currently active for this inbox. | - |\n| <a id=\"property-needsreauth\"></a> `needsReauth` | `readonly` | () => `Promise`\\<`boolean`\\> | Whether the inbox needs to be re-authenticated. | - |\n| <a id=\"property-photourl\"></a> `photoUrl` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | The inbox's avatar URL, if any. | - |\n| <a id=\"property-provider\"></a> `provider` | `readonly` | () => `Promise`\\<[`UserProvider`](../../../../../generated/email/types.gen/type-aliases/UserProvider.md)\\> | The email provider (e.g. `GMAIL` or `OUTLOOK`). | - |\n| <a id=\"property-syncstatus\"></a> `syncStatus` | `readonly` | () => `Promise`\\<[`SyncStatus`](../../../../../generated/email/types.gen/type-aliases/SyncStatus.md)\\> | The inbox's sync status. | - |\n\n## Methods\n\n### settingsOperations()\n\n> **settingsOperations**(): `Promise`\\<[`MailboxSettingsOperation`](../../../../../generated/email/types.gen/type-aliases/MailboxSettingsOperation.md)[]\\>\n\nRead category and sender-policy changes for this inbox.\n\n#### Returns\n\n`Promise`\\<[`MailboxSettingsOperation`](../../../../../generated/email/types.gen/type-aliases/MailboxSettingsOperation.md)[]\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`Link`](../../../../../generated/email/types.gen/type-aliases/Link.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`Link`](../../../../../generated/email/types.gen/type-aliases/Link.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`Link`](../../../../../generated/email/types.gen/type-aliases/Link.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `id`): `Link`\n\nA handle to an email link by id. Details load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `id` | `string` |\n\n#### Returns\n\n`Link`\n\n***\n\n### list()\n\n> `static` **list**(`client`): `Promise`\\<`Link`[]\\>\n\nThe caller's connected email links.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`Promise`\\<`Link`[]\\>\n\n\n<!-- src/entities/email/message/classes/EmailMessage.md -->\n# Class: EmailMessage\n\nA message in an email thread. A thin handle keyed by message id; the\nrecord loads lazily on first field access.\n\n## Extends\n\n- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\\<[`EmailMessageData`](../type-aliases/EmailMessageData.md)\\>\n\n## Properties\n\n| Property | Modifier | Type | Description | Inherited from |\n| ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-bcc\"></a> `bcc` | `readonly` | () => `Promise`\\<[`ContactInfo`](../../../../../generated/email/types.gen/type-aliases/ContactInfo.md)[]\\> | The Bcc recipients. | - |\n| <a id=\"property-body\"></a> `body` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | The parsed message body, as the API returns it. | - |\n| <a id=\"property-cc\"></a> `cc` | `readonly` | () => `Promise`\\<[`ContactInfo`](../../../../../generated/email/types.gen/type-aliases/ContactInfo.md)[]\\> | The Cc recipients. | - |\n| <a id=\"property-from\"></a> `from` | `readonly` | () => `Promise`\\<[`ContactInfo`](../../../../../generated/email/types.gen/type-aliases/ContactInfo.md) \\| `undefined`\\> | The sender. | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |\n| <a id=\"property-labels\"></a> `labels` | `readonly` | () => `Promise`\\<[`LabelInfo`](../../../../../generated/email/types.gen/type-aliases/LabelInfo.md)[]\\> | Labels on this message. | - |\n| <a id=\"property-link\"></a> `link` | `readonly` | () => `Promise`\\<[`Link`](../../link/classes/Link.md)\\> | The inbox (email link) this message belongs to. | - |\n| <a id=\"property-sentat\"></a> `sentAt` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | The provider-internal date of the message. | - |\n| <a id=\"property-subject\"></a> `subject` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | The message's subject line. | - |\n| <a id=\"property-to\"></a> `to` | `readonly` | () => `Promise`\\<[`ContactInfo`](../../../../../generated/email/types.gen/type-aliases/ContactInfo.md)[]\\> | The To recipients. | - |\n\n## Methods\n\n### addLabel()\n\n> **addLabel**(`label`): `Promise`\\<`void`\\>\n\nAdd a label to this message.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `label` | [`Label`](../../label/classes/Label.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### completeDraftAttachment()\n\n> **completeDraftAttachment**(`attachmentId`): `Promise`\\<`void`\\>\n\nVerify an uploaded draft attachment before it can be sent.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `attachmentId` | `string` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### operationStatus()\n\n> **operationStatus**(): `Promise`\\<[`MessageOperationResponse`](../../../../../generated/email/types.gen/type-aliases/MessageOperationResponse.md)\\>\n\nRead the draft's durable send, upload, or conflict status without retrying it.\n\n#### Returns\n\n`Promise`\\<[`MessageOperationResponse`](../../../../../generated/email/types.gen/type-aliases/MessageOperationResponse.md)\\>\n\n***\n\n### removeLabel()\n\n> **removeLabel**(`label`): `Promise`\\<`void`\\>\n\nRemove a label from this message.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `label` | [`Label`](../../label/classes/Label.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### resolveOperation()\n\n> **resolveOperation**(`request`): `Promise`\\<`void`\\>\n\nResolve the displayed operation revision after the user chooses an action.\nRetrying an uncertain send requires explicit duplicate-risk acceptance.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `request` | [`ResolveMessageOperationRequest`](../../../../../generated/email/types.gen/type-aliases/ResolveMessageOperationRequest.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### thread()\n\n> **thread**(): `Promise`\\<[`EmailThread`](../../thread/classes/EmailThread.md)\\>\n\nThe thread this message belongs to.\n\n#### Returns\n\n`Promise`\\<[`EmailThread`](../../thread/classes/EmailThread.md)\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`ParsedMessage`](../../../../../generated/email/types.gen/type-aliases/ParsedMessage.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`ParsedMessage`](../../../../../generated/email/types.gen/type-aliases/ParsedMessage.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`ParsedMessage`](../../../../../generated/email/types.gen/type-aliases/ParsedMessage.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)\n\n***\n\n### transferDraft()\n\n> **transferDraft**(`request`): `Promise`\\<[`TransferDraftResponse`](../../../../../generated/email/types.gen/type-aliases/TransferDraftResponse.md)\\>\n\nMove a draft to another inbox using a caller-persisted operation UUID.\nContinue editing the returned message_id; the original identity is retired.\nOn an interrupted response, use email.recoverDraftTransfer(operation_id).\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `request` | [`TransferDraftRequest`](../../../../../generated/email/types.gen/type-aliases/TransferDraftRequest.md) |\n\n#### Returns\n\n`Promise`\\<[`TransferDraftResponse`](../../../../../generated/email/types.gen/type-aliases/TransferDraftResponse.md)\\>\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `id`): `EmailMessage`\n\nA handle to a message by id. Fields load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `id` | `string` |\n\n#### Returns\n\n`EmailMessage`\n\n***\n\n### from()\n\n> `static` **from**(`client`, `data`): `EmailMessage`\n\nBuild a message from an already-fetched record (pre-seeded, no fetch).\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `data` | [`ParsedMessage`](../../../../../generated/email/types.gen/type-aliases/ParsedMessage.md) |\n\n#### Returns\n\n`EmailMessage`\n\n***\n\n### send()\n\n> `static` **send**(`client`, `opts`): `Promise`\\<`EmailMessage` \\| `undefined`\\>\n\nSend a new email message. Returns a handle when the API reports the created message's id.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `opts` | [`SendEmailOptions`](../interfaces/SendEmailOptions.md) |\n\n#### Returns\n\n`Promise`\\<`EmailMessage` \\| `undefined`\\>\n\n\n<!-- src/entities/email/message/interfaces/SendEmailOptions.md -->\n# Interface: SendEmailOptions\n\nOptions for sending a fresh email message.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-bcc\"></a> `bcc?` | [`ApiDraftContactInfo`](../../../../../generated/email/types.gen/type-aliases/ApiDraftContactInfo.md)[] | Bcc recipients. |\n| <a id=\"property-bodytext\"></a> `bodyText` | `string` | Plain-text body. |\n| <a id=\"property-cc\"></a> `cc?` | [`ApiDraftContactInfo`](../../../../../generated/email/types.gen/type-aliases/ApiDraftContactInfo.md)[] | Cc recipients. |\n| <a id=\"property-subject\"></a> `subject` | `string` | Subject line. |\n| <a id=\"property-to\"></a> `to` | [`ApiDraftContactInfo`](../../../../../generated/email/types.gen/type-aliases/ApiDraftContactInfo.md)[] | Recipients. |\n\n\n<!-- src/entities/email/message/type-aliases/EmailMessageData.md -->\n# Type Alias: EmailMessageData\n\n> **EmailMessageData** = [`GetMessageResponses`](../../../../../generated/email/types.gen/type-aliases/GetMessageResponses.md)\\[`200`\\]\n\nThe API's representation of an email message (`ParsedMessage`).\n\n\n<!-- src/entities/email/namespace/classes/EmailNamespace.md -->\n# Class: EmailNamespace\n\n## Constructors\n\n### Constructor\n\n> **new EmailNamespace**(`client`): `EmailNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`EmailNamespace`\n\n## Methods\n\n### attachment()\n\n> **attachment**(`id`): [`EmailAttachment`](../../attachment/classes/EmailAttachment.md)\n\nA handle to an email attachment by id.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`EmailAttachment`](../../attachment/classes/EmailAttachment.md)\n\n***\n\n### blockedSenders()\n\n> **blockedSenders**(): `Promise`\\<`string`[]\\>\n\nThe email addresses currently blocked.\n\n#### Returns\n\n`Promise`\\<`string`[]\\>\n\n***\n\n### blockSender()\n\n> **blockSender**(`email`): `Promise`\\<`void`\\>\n\nBlock an email sender.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `email` | `string` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### byId()\n\n> **byId**(`id`): [`EmailThread`](../../thread/classes/EmailThread.md)\n\nA handle to an email thread by id.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`EmailThread`](../../thread/classes/EmailThread.md)\n\n***\n\n### connectionProviders()\n\n> **connectionProviders**(): `Promise`\\<[`EmailConnectionProviders`](../../../../../generated/auth/types.gen/type-aliases/EmailConnectionProviders.md)\\>\n\nProviders the server currently permits this caller to connect.\n\n#### Returns\n\n`Promise`\\<[`EmailConnectionProviders`](../../../../../generated/auth/types.gen/type-aliases/EmailConnectionProviders.md)\\>\n\n***\n\n### createLabel()\n\n> **createLabel**(`name`): `Promise`\\<[`Label`](../../label/classes/Label.md)\\>\n\nCreate a user label. Returns the created label.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `name` | `string` |\n\n#### Returns\n\n`Promise`\\<[`Label`](../../label/classes/Label.md)\\>\n\n***\n\n### deleteLabel()\n\n> **deleteLabel**(`label`): `Promise`\\<`void`\\>\n\nDelete a label.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `label` | [`Label`](../../label/classes/Label.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### inbox()\n\n> **inbox**(`opts?`): `AsyncGenerator`\\<[`EmailThread`](../../thread/classes/EmailThread.md)\\>\n\nThe threads in the inbox, most recent first, auto-paginated.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts?` | [`InboxOptions`](../interfaces/InboxOptions.md) |\n\n#### Returns\n\n`AsyncGenerator`\\<[`EmailThread`](../../thread/classes/EmailThread.md)\\>\n\n***\n\n### label()\n\n> **label**(`id`): [`Label`](../../label/classes/Label.md)\n\nA handle to a label by id.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`Label`](../../label/classes/Label.md)\n\n***\n\n### labels()\n\n> **labels**(): `Promise`\\<[`Label`](../../label/classes/Label.md)[]\\>\n\nAll labels across the user's inboxes.\n\n#### Returns\n\n`Promise`\\<[`Label`](../../label/classes/Label.md)[]\\>\n\n***\n\n### link()\n\n> **link**(`id`): [`Link`](../../link/classes/Link.md)\n\nA handle to a connected inbox (email link) by id.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`Link`](../../link/classes/Link.md)\n\n***\n\n### links()\n\n> **links**(): `Promise`\\<[`Link`](../../link/classes/Link.md)[]\\>\n\nThe caller's connected inboxes (email links).\n\n#### Returns\n\n`Promise`\\<[`Link`](../../link/classes/Link.md)[]\\>\n\n***\n\n### message()\n\n> **message**(`id`): [`EmailMessage`](../../message/classes/EmailMessage.md)\n\nA handle to an email message by id.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`EmailMessage`](../../message/classes/EmailMessage.md)\n\n***\n\n### recoverDraftTransfer()\n\n> **recoverDraftTransfer**(`operationId`): `Promise`\\<[`TransferRecoveryResponse`](../../../../../generated/email/types.gen/type-aliases/TransferRecoveryResponse.md)\\>\n\nRecover a draft move using its original operation UUID; never starts a new move.\nAn empty committed result fences the old move so it cannot commit later.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `operationId` | `string` |\n\n#### Returns\n\n`Promise`\\<[`TransferRecoveryResponse`](../../../../../generated/email/types.gen/type-aliases/TransferRecoveryResponse.md)\\>\n\n***\n\n### search()\n\n> **search**(`query`, `opts?`): `AsyncGenerator`\\<[`EmailThread`](../../thread/classes/EmailThread.md)\\>\n\nSearch email threads by subject and content.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `query` | `string` |\n| `opts?` | [`SearchOpts`](../../../search/interfaces/SearchOpts.md) |\n\n#### Returns\n\n`AsyncGenerator`\\<[`EmailThread`](../../thread/classes/EmailThread.md)\\>\n\n***\n\n### send()\n\n> **send**(`opts`): `Promise`\\<[`EmailMessage`](../../message/classes/EmailMessage.md) \\| `undefined`\\>\n\nSend a new email message.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts` | [`SendEmailOptions`](../../message/interfaces/SendEmailOptions.md) |\n\n#### Returns\n\n`Promise`\\<[`EmailMessage`](../../message/classes/EmailMessage.md) \\| `undefined`\\>\n\n***\n\n### unblockSender()\n\n> **unblockSender**(`email`): `Promise`\\<`void`\\>\n\nUnblock a previously blocked sender.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `email` | `string` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n\n<!-- src/entities/email/namespace/interfaces/InboxOptions.md -->\n# Interface: InboxOptions\n\nOptions for listing inbox threads.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-pagesize\"></a> `pageSize?` | `number` | Page size (default 20, max 500). |\n| <a id=\"property-sort\"></a> `sort?` | [`ApiSortMethod`](../../../../../generated/email/types.gen/type-aliases/ApiSortMethod.md) | Sort order. Defaults to `viewed_updated`. |\n\n\n<!-- src/entities/email/thread/classes/EmailThread.md -->\n# Class: EmailThread\n\nAn email thread. A free-to-construct handle: the detail record (including\nup to the first 100 messages) loads lazily on first field access.\n\n## Extends\n\n- [`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md)\\<`ThreadDetail`\\>\n\n## Properties\n\n| Property | Modifier | Type | Default value | Description | Overrides | Inherited from |\n| ------ | ------ | ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-accesslevel\"></a> `accessLevel` | `readonly` | () => `Promise`\\<[`AccessLevel`](../../../../../generated/email/types.gen/type-aliases/AccessLevel.md)\\> | `...` | The viewer's access level to this thread. | - | - |\n| <a id=\"property-createdat\"></a> `createdAt` | `readonly` | () => `Promise`\\<`string`\\> | `...` | When the thread was created. | - | - |\n| <a id=\"property-entitytype\"></a> `entityType` | `readonly` | `\"email_thread\"` | `'email_thread'` | Favorites identify email threads as `email_thread`. | [`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`entityType`](../../../entity/classes/PropertiedEntity.md#property-entitytype) | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | `undefined` | - | - | [`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`id`](../../../entity/classes/PropertiedEntity.md#property-id) |\n| <a id=\"property-inboxvisible\"></a> `inboxVisible` | `readonly` | () => `Promise`\\<`boolean`\\> | `...` | Whether the thread is visible in the inbox (i.e. not archived). | - | - |\n| <a id=\"property-isread\"></a> `isRead` | `readonly` | () => `Promise`\\<`boolean`\\> | `...` | Whether the thread has been read. | - | - |\n| <a id=\"property-latestinboundat\"></a> `latestInboundAt` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | `...` | Timestamp of the latest inbound message, if any. | - | - |\n| <a id=\"property-latestnonspamat\"></a> `latestNonSpamAt` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | `...` | Timestamp of the latest non-spam message, if any. | - | - |\n| <a id=\"property-latestoutboundat\"></a> `latestOutboundAt` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | `...` | Timestamp of the latest outbound message, if any. | - | - |\n| <a id=\"property-link\"></a> `link` | `readonly` | () => `Promise`\\<[`Link`](../../link/classes/Link.md)\\> | `...` | The inbox (email link) that owns this thread. | - | - |\n| <a id=\"property-project\"></a> `project` | `readonly` | () => `Promise`\\<[`Project`](../../../projects/project/classes/Project.md) \\| `undefined`\\> | `...` | The project this thread is attached to, if any. | - | - |\n| <a id=\"property-providerid\"></a> `providerId` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | `...` | The provider-internal thread id (e.g. Gmail/Outlook), if any. | - | - |\n| <a id=\"property-updatedat\"></a> `updatedAt` | `readonly` | () => `Promise`\\<`string`\\> | `...` | When the thread was last updated. | - | - |\n| <a id=\"property-search\"></a> `search` | `static` | (`client`, `query`, `searchOpts?`) => `AsyncGenerator`\\<`EmailThread`\\> | `...` | Search email threads by subject and content, most relevant first, auto-paginated. | - | - |\n\n## Methods\n\n### addLabel()\n\n> **addLabel**(`label`): `Promise`\\<`void`\\>\n\nAdd a label to every message in the thread.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `label` | [`Label`](../../label/classes/Label.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### archive()\n\n> **archive**(`archived?`): `Promise`\\<`void`\\>\n\nArchive the thread (or unarchive with `false`).\n\n#### Parameters\n\n| Parameter | Type | Default value |\n| ------ | ------ | ------ |\n| `archived?` | `boolean` | `true` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### attachments()\n\n> **attachments**(): `Promise`\\<[`EmailAttachment`](../../attachment/classes/EmailAttachment.md)[]\\>\n\nThe attachments across this thread's first 100 messages, pre-seeded from the thread detail.\n\n#### Returns\n\n`Promise`\\<[`EmailAttachment`](../../attachment/classes/EmailAttachment.md)[]\\>\n\n***\n\n### deleteProperty()\n\n> **deleteProperty**(`assignment`): `Promise`\\<`void`\\>\n\nRemove a property from this entity, given its [properties](#properties) entry.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `assignment` | [`EntityPropertyWithDefinition`](../../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`deleteProperty`](../../../entity/classes/PropertiedEntity.md#deleteproperty)\n\n***\n\n### favorite()\n\n> **favorite**(): `Promise`\\<`EmailThread`\\>\n\nAdd this entity to the user's favorites. Returns this handle for chaining.\nPlain unwrap: favoriting alters the user's favorites collection, not this\nentity's own detail, so there's nothing cached to invalidate.\n\n#### Returns\n\n`Promise`\\<`EmailThread`\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`favorite`](../../../entity/classes/PropertiedEntity.md#favorite)\n\n***\n\n### markSeen()\n\n> **markSeen**(): `Promise`\\<`void`\\>\n\nMark the thread as seen.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### messages()\n\n> **messages**(`opts?`): `Promise`\\<[`EmailMessage`](../../message/classes/EmailMessage.md)[]\\>\n\nThe messages in this thread, pre-seeded from the list endpoint.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts?` | \\{ `limit?`: `number`; `since?`: `string`; \\} |\n| `opts.limit?` | `number` |\n| `opts.since?` | `string` |\n\n#### Returns\n\n`Promise`\\<[`EmailMessage`](../../message/classes/EmailMessage.md)[]\\>\n\n***\n\n### moveToProject()\n\n> **moveToProject**(`project`): `Promise`\\<`void`\\>\n\nAttach the thread to a project, or clear the project with `null`.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `project` | [`Project`](../../../projects/project/classes/Project.md) \\| `null` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### operations()\n\n> **operations**(): `Promise`\\<[`MailboxOperation`](../../../../../generated/email/types.gen/type-aliases/MailboxOperation.md)[]\\>\n\nRead pending or failed mailbox changes without initiating a retry.\n\n#### Returns\n\n`Promise`\\<[`MailboxOperation`](../../../../../generated/email/types.gen/type-aliases/MailboxOperation.md)[]\\>\n\n***\n\n### participants()\n\n> **participants**(): `Promise`\\<[`ApiContactInfo`](../../../../../generated/email/types.gen/type-aliases/ApiContactInfo.md)[]\\>\n\nEveryone on the thread (senders and recipients), deduped by email.\nDerived from the thread's first 100 messages.\n\n#### Returns\n\n`Promise`\\<[`ApiContactInfo`](../../../../../generated/email/types.gen/type-aliases/ApiContactInfo.md)[]\\>\n\n***\n\n### properties()\n\n> **properties**(`opts?`): `Promise`\\<[`EntityPropertyWithDefinition`](../../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md)[]\\>\n\nThe properties set on this entity, each with its definition, value, and options.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts?` | \\{ `includeMetadata?`: `boolean`; \\} |\n| `opts.includeMetadata?` | `boolean` |\n\n#### Returns\n\n`Promise`\\<[`EntityPropertyWithDefinition`](../../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md)[]\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`properties`](../../../entity/classes/PropertiedEntity.md#properties)\n\n***\n\n### propertyReference()\n\n> **propertyReference**(): [`PropertyTargetReference`](../../../../../generated/properties/types.gen/type-aliases/PropertyTargetReference.md)\n\nThis entity's reference for bulk property operations.\n\n#### Returns\n\n[`PropertyTargetReference`](../../../../../generated/properties/types.gen/type-aliases/PropertyTargetReference.md)\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`propertyReference`](../../../entity/classes/PropertiedEntity.md#propertyreference)\n\n***\n\n### removeLabel()\n\n> **removeLabel**(`label`): `Promise`\\<`void`\\>\n\nRemove a label from every message in the thread.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `label` | [`Label`](../../label/classes/Label.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### reply()\n\n> **reply**(`opts`): `Promise`\\<[`EmailMessage`](../../message/classes/EmailMessage.md) \\| `undefined`\\>\n\nSend a reply within this thread. Returns a handle when the API reports the created message's id.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts` | [`ReplyEmailOptions`](../interfaces/ReplyEmailOptions.md) |\n\n#### Returns\n\n`Promise`\\<[`EmailMessage`](../../message/classes/EmailMessage.md) \\| `undefined`\\>\n\n***\n\n### setProperty()\n\n> **setProperty**(`property`, `value?`): `Promise`\\<`void`\\>\n\nSet a property value on this entity, or attach the property without a\nvalue when `value` is omitted.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `property` | [`PropertyDefinition`](../../../properties/property-definition/classes/PropertyDefinition.md) |\n| `value?` | [`SetPropertyValue`](../../../../../generated/properties/types.gen/type-aliases/SetPropertyValue.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`setProperty`](../../../entity/classes/PropertiedEntity.md#setproperty)\n\n***\n\n### subject()\n\n> **subject**(): `Promise`\\<`string` \\| `undefined`\\>\n\nThe thread's subject, from its first message with one.\n\n#### Returns\n\n`Promise`\\<`string` \\| `undefined`\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`ApiThread`](../../../../../generated/email/types.gen/type-aliases/ApiThread.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`ApiThread`](../../../../../generated/email/types.gen/type-aliases/ApiThread.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`ApiThread`](../../../../../generated/email/types.gen/type-aliases/ApiThread.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`toJSON`](../../../entity/classes/PropertiedEntity.md#tojson)\n\n***\n\n### unfavorite()\n\n> **unfavorite**(): `Promise`\\<`EmailThread`\\>\n\nRemove this entity from the user's favorites. Returns this handle for chaining.\n\n#### Returns\n\n`Promise`\\<`EmailThread`\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`unfavorite`](../../../entity/classes/PropertiedEntity.md#unfavorite)\n\n***\n\n### updatePropertyOptions()\n\n> **updatePropertyOptions**(`changes`): `Promise`\\<[`BulkUpdateEntityPropertyOptionsResponse`](../../../../../generated/properties/types.gen/type-aliases/BulkUpdateEntityPropertyOptionsResponse.md)\\>\n\nApply multi-select option deltas atomically across this entity's properties.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `changes` | [`PropertyOptionDelta`](../../../entity/interfaces/PropertyOptionDelta.md)[] |\n\n#### Returns\n\n`Promise`\\<[`BulkUpdateEntityPropertyOptionsResponse`](../../../../../generated/properties/types.gen/type-aliases/BulkUpdateEntityPropertyOptionsResponse.md)\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`updatePropertyOptions`](../../../entity/classes/PropertiedEntity.md#updatepropertyoptions)\n\n***\n\n### updateState()\n\n> **updateState**(`request`): `Promise`\\<`void`\\>\n\nUpdate provider-neutral read, trash, spam, or star state.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `request` | [`UpdateThreadStateRequest`](../../../../../generated/email/types.gen/type-aliases/UpdateThreadStateRequest.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `id`): `EmailThread`\n\nA handle to a thread by id. Details load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `id` | `string` |\n\n#### Returns\n\n`EmailThread`\n\n\n<!-- src/entities/email/thread/interfaces/ReplyEmailOptions.md -->\n# Interface: ReplyEmailOptions\n\nOptions for replying within an email thread.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-bcc\"></a> `bcc?` | [`ApiDraftContactInfo`](../../../../../generated/email/types.gen/type-aliases/ApiDraftContactInfo.md)[] | Bcc recipients. |\n| <a id=\"property-bodytext\"></a> `bodyText` | `string` | Plain-text body. |\n| <a id=\"property-cc\"></a> `cc?` | [`ApiDraftContactInfo`](../../../../../generated/email/types.gen/type-aliases/ApiDraftContactInfo.md)[] | Cc recipients. |\n| <a id=\"property-replyingto\"></a> `replyingTo?` | [`EmailMessage`](../../message/classes/EmailMessage.md) | The message being replied to. |\n| <a id=\"property-subject\"></a> `subject?` | `string` | Subject line. Defaults to the subject of the thread's first message. |\n| <a id=\"property-to\"></a> `to` | [`ApiDraftContactInfo`](../../../../../generated/email/types.gen/type-aliases/ApiDraftContactInfo.md)[] | Recipients. |\n"+ "overview": "<!-- src/entities/email/draft/type-aliases/DraftOptions.md -->\n# Type Alias: DraftOptions\n\n> **DraftOptions** = `Omit`\\<[`ApiDraftInput`](../../../../../generated/email/types.gen/type-aliases/ApiDraftInput.md), `\"db_id\"` \\| `\"provider_id\"` \\| `\"provider_thread_id\"` \\| `\"replying_to_id\"` \\| `\"thread_db_id\"` \\| `\"body_text\"` \\| `\"body_html\"` \\| `\"body_macro\"` \\| `\"headers_json\"` \\| `\"include_signature\"`\\> & \\{ `bodyHtml?`: `string`; `bodyMacro?`: `string`; `bodyText?`: `string`; `headers?`: [`ApiDraftInput`](../../../../../generated/email/types.gen/type-aliases/ApiDraftInput.md)\\[`\"headers_json\"`\\]; `includeSignature?`: `boolean`; `replyingTo?`: [`EmailMessage`](../../message/classes/EmailMessage.md); `thread?`: [`EmailThread`](../../thread/classes/EmailThread.md); \\}\n\nDraft content; relationships use message and thread handles.\n\n## Type Declaration\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `bodyHtml?` | `string` | HTML body. |\n| `bodyMacro?` | `string` | Macro body. |\n| `bodyText?` | `string` | Plain text body. |\n| `headers?` | [`ApiDraftInput`](../../../../../generated/email/types.gen/type-aliases/ApiDraftInput.md)\\[`\"headers_json\"`\\] | Extra headers. |\n| `includeSignature?` | `boolean` | Include the inbox signature. |\n| `replyingTo?` | [`EmailMessage`](../../message/classes/EmailMessage.md) | Message being replied to. |\n| `thread?` | [`EmailThread`](../../thread/classes/EmailThread.md) | Thread receiving this draft. |\n\n\n<!-- src/entities/email/filter/interfaces/EmailFilterOptions.md -->\n# Interface: EmailFilterOptions\n\nSender importance rule.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-emailaddress\"></a> `emailAddress?` | `string` | Match an address. |\n| <a id=\"property-emaildomain\"></a> `emailDomain?` | `string` | Match a domain. |\n| <a id=\"property-isimportant\"></a> `isImportant` | `boolean` | Whether matches are important. |\n\n\n<!-- src/entities/email/message/interfaces/SendEmailOptions.md -->\n# Interface: SendEmailOptions\n\nOptions for sending a fresh email message.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-bcc\"></a> `bcc?` | [`ApiDraftContactInfo`](../../../../../generated/email/types.gen/type-aliases/ApiDraftContactInfo.md)[] | Bcc recipients. |\n| <a id=\"property-bodytext\"></a> `bodyText` | `string` | Plain-text body. |\n| <a id=\"property-cc\"></a> `cc?` | [`ApiDraftContactInfo`](../../../../../generated/email/types.gen/type-aliases/ApiDraftContactInfo.md)[] | Cc recipients. |\n| <a id=\"property-subject\"></a> `subject` | `string` | Subject line. |\n| <a id=\"property-to\"></a> `to` | [`ApiDraftContactInfo`](../../../../../generated/email/types.gen/type-aliases/ApiDraftContactInfo.md)[] | Recipients. |\n\n\n<!-- src/entities/email/namespace/classes/EmailNamespace.md -->\n# Class: EmailNamespace\n\n## Constructors\n\n### Constructor\n\n> **new EmailNamespace**(`client`): `EmailNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`EmailNamespace`\n\n## Methods\n\n### attachment()\n\n> **attachment**(`id`): [`EmailAttachment`](../../attachment/classes/EmailAttachment.md)\n\nA handle to an email attachment by id.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`EmailAttachment`](../../attachment/classes/EmailAttachment.md)\n\n***\n\n### blockedSenders()\n\n> **blockedSenders**(): `Promise`\\<`string`[]\\>\n\nThe email addresses currently blocked.\n\n#### Returns\n\n`Promise`\\<`string`[]\\>\n\n***\n\n### blockSender()\n\n> **blockSender**(`email`): `Promise`\\<`void`\\>\n\nBlock an email sender.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `email` | `string` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### byId()\n\n> **byId**(`id`): [`EmailThread`](../../thread/classes/EmailThread.md)\n\nA handle to an email thread by id.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`EmailThread`](../../thread/classes/EmailThread.md)\n\n***\n\n### connectionProviders()\n\n> **connectionProviders**(): `Promise`\\<[`EmailConnectionProviders`](../../../../../generated/auth/types.gen/type-aliases/EmailConnectionProviders.md)\\>\n\nProviders the server currently permits this caller to connect.\n\n#### Returns\n\n`Promise`\\<[`EmailConnectionProviders`](../../../../../generated/auth/types.gen/type-aliases/EmailConnectionProviders.md)\\>\n\n***\n\n### contacts()\n\n> **contacts**(): `Promise`\\<\\{\\[`key`: `string`\\]: [`ContactInfoWithInteraction`](../../../../../generated/email/types.gen/type-aliases/ContactInfoWithInteraction.md)[]; \\}\\>\n\nAddress book contacts grouped by the service's interaction buckets.\n\n#### Returns\n\n`Promise`\\<\\{\\[`key`: `string`\\]: [`ContactInfoWithInteraction`](../../../../../generated/email/types.gen/type-aliases/ContactInfoWithInteraction.md)[]; \\}\\>\n\n***\n\n### createDraft()\n\n> **createDraft**(`options`, `inbox?`): `Promise`\\<[`EmailDraft`](../../draft/classes/EmailDraft.md)\\>\n\nCreate a draft without sending it; the inbox defaults to the caller's primary.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | [`DraftOptions`](../../draft/type-aliases/DraftOptions.md) |\n| `inbox?` | [`Link`](../../link/classes/Link.md) |\n\n#### Returns\n\n`Promise`\\<[`EmailDraft`](../../draft/classes/EmailDraft.md)\\>\n\n***\n\n### createLabel()\n\n> **createLabel**(`name`): `Promise`\\<[`Label`](../../label/classes/Label.md)\\>\n\nCreate a user label. Returns the created label.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `name` | `string` |\n\n#### Returns\n\n`Promise`\\<[`Label`](../../label/classes/Label.md)\\>\n\n***\n\n### deleteLabel()\n\n> **deleteLabel**(`label`): `Promise`\\<`void`\\>\n\nDelete a label.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `label` | [`Label`](../../label/classes/Label.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### draftById()\n\n> **draftById**(`id`): [`EmailDraft`](../../draft/classes/EmailDraft.md)\n\nConstruct a lazy draft handle.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`EmailDraft`](../../draft/classes/EmailDraft.md)\n\n***\n\n### filters()\n\n> **filters**(`inbox?`): `Promise`\\<[`EmailFilter`](../../filter/classes/EmailFilter.md)[]\\>\n\nImportance filters.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `inbox?` | [`Link`](../../link/classes/Link.md) |\n\n#### Returns\n\n`Promise`\\<[`EmailFilter`](../../filter/classes/EmailFilter.md)[]\\>\n\n***\n\n### inbox()\n\n> **inbox**(`opts?`): `AsyncGenerator`\\<[`EmailThread`](../../thread/classes/EmailThread.md)\\>\n\nThe threads in the inbox, most recent first, auto-paginated.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts?` | [`InboxOptions`](../interfaces/InboxOptions.md) |\n\n#### Returns\n\n`AsyncGenerator`\\<[`EmailThread`](../../thread/classes/EmailThread.md)\\>\n\n***\n\n### label()\n\n> **label**(`id`): [`Label`](../../label/classes/Label.md)\n\nA handle to a label by id.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`Label`](../../label/classes/Label.md)\n\n***\n\n### labels()\n\n> **labels**(): `Promise`\\<[`Label`](../../label/classes/Label.md)[]\\>\n\nAll labels across the user's inboxes.\n\n#### Returns\n\n`Promise`\\<[`Label`](../../label/classes/Label.md)[]\\>\n\n***\n\n### link()\n\n> **link**(`id`): [`Link`](../../link/classes/Link.md)\n\nA handle to a connected inbox (email link) by id.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`Link`](../../link/classes/Link.md)\n\n***\n\n### links()\n\n> **links**(): `Promise`\\<[`Link`](../../link/classes/Link.md)[]\\>\n\nThe caller's connected inboxes (email links).\n\n#### Returns\n\n`Promise`\\<[`Link`](../../link/classes/Link.md)[]\\>\n\n***\n\n### message()\n\n> **message**(`id`): [`EmailMessage`](../../message/classes/EmailMessage.md)\n\nA handle to an email message by id.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`EmailMessage`](../../message/classes/EmailMessage.md)\n\n***\n\n### recoverDraftTransfer()\n\n> **recoverDraftTransfer**(`operationId`): `Promise`\\<[`TransferRecoveryResponse`](../../../../../generated/email/types.gen/type-aliases/TransferRecoveryResponse.md)\\>\n\nRecover a draft move using its original operation UUID; never starts a new move.\nAn empty committed result fences the old move so it cannot commit later.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `operationId` | `string` |\n\n#### Returns\n\n`Promise`\\<[`TransferRecoveryResponse`](../../../../../generated/email/types.gen/type-aliases/TransferRecoveryResponse.md)\\>\n\n***\n\n### reminders()\n\n> **reminders**(`options?`): `AsyncGenerator`\\<\\{ `followup`: [`EmailFollowup`](../../../../../generated/storage/types.gen/type-aliases/EmailFollowup.md); `thread`: [`EmailThread`](../../thread/classes/EmailThread.md); \\}, `any`, `any`\\>\n\nFollow-up reminders with thread handles, automatically paginated.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options?` | `Omit`\\<\\{ `attachments?`: `string`[] \\| `null`; `calendar?`: `boolean` \\| `null`; `cursor?`: `string` \\| `null`; `done?`: `boolean` \\| `null`; `inboxIds?`: `string`[] \\| `null`; `limit?`: `number` \\| `null`; `noInboxes?`: `boolean` \\| `null`; `read?`: `boolean` \\| `null`; `tags?`: `string`[] \\| `null`; \\}, `\"cursor\"` \\| `\"inboxIds\"`\\> & \\{ `inboxes?`: [`Link`](../../link/classes/Link.md)[]; \\} |\n\n#### Returns\n\n`AsyncGenerator`\\<\\{ `followup`: [`EmailFollowup`](../../../../../generated/storage/types.gen/type-aliases/EmailFollowup.md); `thread`: [`EmailThread`](../../thread/classes/EmailThread.md); \\}, `any`, `any`\\>\n\n***\n\n### scheduled()\n\n> **scheduled**(`options?`): `AsyncGenerator`\\<[`EmailDraft`](../../draft/classes/EmailDraft.md)\\>\n\nScheduled drafts, fetched lazily in bounded pages.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options?` | \\{ `inbox?`: [`Link`](../../link/classes/Link.md); `pageSize?`: `number`; \\} |\n| `options.inbox?` | [`Link`](../../link/classes/Link.md) |\n| `options.pageSize?` | `number` |\n\n#### Returns\n\n`AsyncGenerator`\\<[`EmailDraft`](../../draft/classes/EmailDraft.md)\\>\n\n***\n\n### search()\n\n> **search**(`query`, `opts?`): `AsyncGenerator`\\<[`EmailThread`](../../thread/classes/EmailThread.md)\\>\n\nSearch email threads by subject and content.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `query` | `string` |\n| `opts?` | [`SearchOpts`](../../../search/interfaces/SearchOpts.md) |\n\n#### Returns\n\n`AsyncGenerator`\\<[`EmailThread`](../../thread/classes/EmailThread.md)\\>\n\n***\n\n### send()\n\n> **send**(`opts`): `Promise`\\<[`EmailMessage`](../../message/classes/EmailMessage.md) \\| `undefined`\\>\n\nSend a new email message.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts` | [`SendEmailOptions`](../../message/interfaces/SendEmailOptions.md) |\n\n#### Returns\n\n`Promise`\\<[`EmailMessage`](../../message/classes/EmailMessage.md) \\| `undefined`\\>\n\n***\n\n### unblockSender()\n\n> **unblockSender**(`email`): `Promise`\\<`void`\\>\n\nUnblock a previously blocked sender.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `email` | `string` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### upsertFilter()\n\n> **upsertFilter**(`options`, `inbox?`): `Promise`\\<[`EmailFilter`](../../filter/classes/EmailFilter.md)\\>\n\nCreate or replace a filter matching an address or domain.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | [`EmailFilterOptions`](../../filter/interfaces/EmailFilterOptions.md) |\n| `inbox?` | [`Link`](../../link/classes/Link.md) |\n\n#### Returns\n\n`Promise`\\<[`EmailFilter`](../../filter/classes/EmailFilter.md)\\>\n\n\n<!-- src/entities/email/namespace/interfaces/InboxOptions.md -->\n# Interface: InboxOptions\n\nOptions for listing inbox threads.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-pagesize\"></a> `pageSize?` | `number` | Page size (default 20, max 500). |\n| <a id=\"property-sort\"></a> `sort?` | [`ApiSortMethod`](../../../../../generated/email/types.gen/type-aliases/ApiSortMethod.md) | Sort order. Defaults to `viewed_updated`. |\n",+ "documentation": "# Macro SDK: email\n\nGenerated by TypeDoc. Paths below refer to the canonical Markdown hierarchy. Other entity handles are documented in their named section; request core for shared SDK helpers.\n\n<!-- generated/auth/types.gen/type-aliases/EmailConnectionProviders.md -->\n# Type Alias: EmailConnectionProviders\n\n> **EmailConnectionProviders** = \\{ `gmail`: `boolean`; `outlook`: `boolean`; \\}\n\nActual deployment availability for the provider selector.\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-gmail\"></a> `gmail` | `boolean` |\n| <a id=\"property-outlook\"></a> `outlook` | `boolean` |\n\n\n<!-- generated/email/types.gen/type-aliases/AccessLevel.md -->\n# Type Alias: AccessLevel\n\n> **AccessLevel** = `\"view\"` \\| `\"comment\"` \\| `\"edit\"` \\| `\"owner\"`\n\nOrdered from least to most access top -> bottom\n\n\n<!-- generated/email/types.gen/type-aliases/ApiAttachmentDraft.md -->\n# Type Alias: ApiAttachmentDraft\n\n> **ApiAttachmentDraft** = \\{ `content_id?`: `string` \\| `null`; `content_type`: `string`; `draft_id`: `string`; `file_name`: `string`; `id`: `string`; `is_inline`: `boolean`; `s3_key`: `string`; `sha`: `string`; `size`: `number`; `upload_pending`: `boolean`; \\}\n\nAPI representation of a draft attachment on a message.\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-content_id\"></a> `content_id?` | `string` \\| `null` |\n| <a id=\"property-content_type\"></a> `content_type` | `string` |\n| <a id=\"property-draft_id\"></a> `draft_id` | `string` |\n| <a id=\"property-file_name\"></a> `file_name` | `string` |\n| <a id=\"property-id\"></a> `id` | `string` |\n| <a id=\"property-is_inline\"></a> `is_inline` | `boolean` |\n| <a id=\"property-s3_key\"></a> `s3_key` | `string` |\n| <a id=\"property-sha\"></a> `sha` | `string` |\n| <a id=\"property-size\"></a> `size` | `number` |\n| <a id=\"property-upload_pending\"></a> `upload_pending` | `boolean` |\n\n\n<!-- generated/email/types.gen/type-aliases/ApiAttachmentForwarded.md -->\n# Type Alias: ApiAttachmentForwarded\n\n> **ApiAttachmentForwarded** = \\{ `attachment_id`: `string`; `draft_id`: `string`; `filename?`: `string` \\| `null`; `message_provider_id`: `string`; `mime_type?`: `string` \\| `null`; `provider_attachment_id?`: `string` \\| `null`; `size_bytes?`: `number` \\| `null`; \\}\n\nAPI representation of a forwarded attachment on a message.\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-attachment_id\"></a> `attachment_id` | `string` |\n| <a id=\"property-draft_id\"></a> `draft_id` | `string` |\n| <a id=\"property-filename\"></a> `filename?` | `string` \\| `null` |\n| <a id=\"property-message_provider_id\"></a> `message_provider_id` | `string` |\n| <a id=\"property-mime_type\"></a> `mime_type?` | `string` \\| `null` |\n| <a id=\"property-provider_attachment_id\"></a> `provider_attachment_id?` | `string` \\| `null` |\n| <a id=\"property-size_bytes\"></a> `size_bytes?` | `number` \\| `null` |\n\n\n<!-- generated/email/types.gen/type-aliases/ApiContactInfo.md -->\n# Type Alias: ApiContactInfo\n\n> **ApiContactInfo** = \\{ `email`: `string`; `name?`: `string` \\| `null`; `photo_url?`: `string` \\| `null`; \\}\n\nAPI representation of a contact (sender or recipient).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-email\"></a> `email` | `string` |\n| <a id=\"property-name\"></a> `name?` | `string` \\| `null` |\n| <a id=\"property-photo_url\"></a> `photo_url?` | `string` \\| `null` |\n\n\n<!-- generated/email/types.gen/type-aliases/ApiDraftContactInfo.md -->\n# Type Alias: ApiDraftContactInfo\n\n> **ApiDraftContactInfo** = \\{ `email`: `string`; `name?`: `string` \\| `null`; `photo_url?`: `string` \\| `null`; \\}\n\nContact info for draft request/response (backward-compatible with MessageToSend shape).\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-email\"></a> `email` | `string` | Email address. |\n| <a id=\"property-name\"></a> `name?` | `string` \\| `null` | Display name. |\n| <a id=\"property-photo_url\"></a> `photo_url?` | `string` \\| `null` | Profile photo URL. |\n\n\n<!-- generated/email/types.gen/type-aliases/ApiDraftInput.md -->\n# Type Alias: ApiDraftInput\n\n> **ApiDraftInput** = \\{ `bcc?`: [`ApiDraftContactInfo`](ApiDraftContactInfo.md)[] \\| `null`; `body_html?`: `string` \\| `null`; `body_macro?`: `string` \\| `null`; `body_text?`: `string` \\| `null`; `cc?`: [`ApiDraftContactInfo`](ApiDraftContactInfo.md)[] \\| `null`; `db_id?`: `string` \\| `null`; `headers_json?`: `null` \\| [`Value`](Value.md); `include_signature?`: `boolean` \\| `null`; `provider_id?`: `string` \\| `null`; `provider_thread_id?`: `string` \\| `null`; `replying_to_id?`: `string` \\| `null`; `subject`: `string`; `thread_db_id?`: `string` \\| `null`; `to?`: [`ApiDraftContactInfo`](ApiDraftContactInfo.md)[] \\| `null`; \\}\n\nThe draft input matching the current `MessageToSend` JSON shape for backward compat.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-bcc\"></a> `bcc?` | [`ApiDraftContactInfo`](ApiDraftContactInfo.md)[] \\| `null` | Bcc recipients. |\n| <a id=\"property-body_html\"></a> `body_html?` | `string` \\| `null` | HTML body (base64 URL_SAFE_NO_PAD encoded). Sanitized before storage. |\n| <a id=\"property-body_macro\"></a> `body_macro?` | `string` \\| `null` | Macro body format. |\n| <a id=\"property-body_text\"></a> `body_text?` | `string` \\| `null` | Plain text body. |\n| <a id=\"property-cc\"></a> `cc?` | [`ApiDraftContactInfo`](ApiDraftContactInfo.md)[] \\| `null` | Cc recipients. |\n| <a id=\"property-db_id\"></a> `db_id?` | `string` \\| `null` | Existing message DB ID (for updating an existing draft). |\n| <a id=\"property-headers_json\"></a> `headers_json?` | `null` \\| [`Value`](Value.md) | - |\n| <a id=\"property-include_signature\"></a> `include_signature?` | `boolean` \\| `null` | Per-message override for whether to include the signature on send: `Some(false)` to exclude (user dismissed it). Omit to use the inbox's default policy. Ignored for drafts. |\n| <a id=\"property-provider_id\"></a> `provider_id?` | `string` \\| `null` | Provider message ID. |\n| <a id=\"property-provider_thread_id\"></a> `provider_thread_id?` | `string` \\| `null` | Provider thread ID. |\n| <a id=\"property-replying_to_id\"></a> `replying_to_id?` | `string` \\| `null` | ID of the message this draft is replying to. |\n| <a id=\"property-subject\"></a> `subject` | `string` | Subject line. |\n| <a id=\"property-thread_db_id\"></a> `thread_db_id?` | `string` \\| `null` | Thread DB ID. |\n| <a id=\"property-to\"></a> `to?` | [`ApiDraftContactInfo`](ApiDraftContactInfo.md)[] \\| `null` | To recipients. |\n\n\n<!-- generated/email/types.gen/type-aliases/ApiEmailFilter.md -->\n# Type Alias: ApiEmailFilter\n\n> **ApiEmailFilter** = \\{ `created_at`: `string`; `email_address?`: `string` \\| `null`; `email_domain?`: `string` \\| `null`; `id`: `string`; `is_important`: `boolean`; \\}\n\nA single email filter in API responses.\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-created_at\"></a> `created_at` | `string` |\n| <a id=\"property-email_address\"></a> `email_address?` | `string` \\| `null` |\n| <a id=\"property-email_domain\"></a> `email_domain?` | `string` \\| `null` |\n| <a id=\"property-id\"></a> `id` | `string` |\n| <a id=\"property-is_important\"></a> `is_important` | `boolean` |\n\n\n<!-- generated/email/types.gen/type-aliases/ApiLabel.md -->\n# Type Alias: ApiLabel\n\n> **ApiLabel** = \\{ `createdAt`: `string`; `id`: `string`; `labelListVisibility`: [`ApiLabelListVisibility`](ApiLabelListVisibility.md); `linkId`: `string`; `messageListVisibility`: [`ApiMessageListVisibility`](ApiMessageListVisibility.md); `name`: `string`; `providerLabelId`: `string`; `type`: [`ApiLabelType`](ApiLabelType.md); \\}\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-createdat\"></a> `createdAt` | `string` |\n| <a id=\"property-id\"></a> `id` | `string` |\n| <a id=\"property-labellistvisibility\"></a> `labelListVisibility` | [`ApiLabelListVisibility`](ApiLabelListVisibility.md) |\n| <a id=\"property-linkid\"></a> `linkId` | `string` |\n| <a id=\"property-messagelistvisibility\"></a> `messageListVisibility` | [`ApiMessageListVisibility`](ApiMessageListVisibility.md) |\n| <a id=\"property-name\"></a> `name` | `string` |\n| <a id=\"property-providerlabelid\"></a> `providerLabelId` | `string` |\n| <a id=\"property-type\"></a> `type` | [`ApiLabelType`](ApiLabelType.md) |\n\n\n<!-- generated/email/types.gen/type-aliases/ApiLabelListVisibility.md -->\n# Type Alias: ApiLabelListVisibility\n\n> **ApiLabelListVisibility** = `\"LabelShow\"` \\| `\"LabelShowIfUnread\"` \\| `\"LabelHide\"`\n\n\n<!-- generated/email/types.gen/type-aliases/ApiLabelType.md -->\n# Type Alias: ApiLabelType\n\n> **ApiLabelType** = `\"System\"` \\| `\"User\"`\n\n\n<!-- generated/email/types.gen/type-aliases/ApiMessage.md -->\n# Type Alias: ApiMessage\n\n> **ApiMessage** = \\{ `attachments`: [`ApiMessageAttachment`](ApiMessageAttachment.md)[]; `attachments_draft`: [`ApiAttachmentDraft`](ApiAttachmentDraft.md)[]; `attachments_forwarded`: [`ApiAttachmentForwarded`](ApiAttachmentForwarded.md)[]; `bcc`: [`ApiContactInfo`](ApiContactInfo.md)[]; `body_html_sanitized?`: `string` \\| `null`; `body_macro?`: `string` \\| `null`; `body_replyless?`: `string` \\| `null`; `body_text?`: `string` \\| `null`; `calendar_invitations?`: [`CalendarInvitation`](CalendarInvitation.md)[]; `cc`: [`ApiContactInfo`](ApiContactInfo.md)[]; `created_at`: `string`; `db_id`: `string`; `from?`: `null` \\| [`ApiContactInfo`](ApiContactInfo.md); `global_id?`: `string` \\| `null`; `has_attachments`: `boolean`; `headers_json?`: `unknown`; `internal_date_ts?`: `string` \\| `null`; `is_draft`: `boolean`; `is_read`: `boolean`; `is_sent`: `boolean`; `is_starred`: `boolean`; `labels`: [`ApiMessageLabel`](ApiMessageLabel.md)[]; `link_id`: `string`; `operation_status?`: `null` \\| [`ApiMessageOperation`](ApiMessageOperation.md); `provider_history_id?`: `string` \\| `null`; `provider_id?`: `string` \\| `null`; `provider_thread_id?`: `string` \\| `null`; `replying_to_id?`: `string` \\| `null`; `scheduled_send_time?`: `string` \\| `null`; `sent_at?`: `string` \\| `null`; `size_estimate?`: `number` \\| `null`; `snippet?`: `string` \\| `null`; `subject?`: `string` \\| `null`; `thread_db_id`: `string`; `to`: [`ApiContactInfo`](ApiContactInfo.md)[]; `updated_at`: `string`; \\}\n\nAPI representation of a fully assembled email message.\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-attachments\"></a> `attachments` | [`ApiMessageAttachment`](ApiMessageAttachment.md)[] |\n| <a id=\"property-attachments_draft\"></a> `attachments_draft` | [`ApiAttachmentDraft`](ApiAttachmentDraft.md)[] |\n| <a id=\"property-attachments_forwarded\"></a> `attachments_forwarded` | [`ApiAttachmentForwarded`](ApiAttachmentForwarded.md)[] |\n| <a id=\"property-bcc\"></a> `bcc` | [`ApiContactInfo`](ApiContactInfo.md)[] |\n| <a id=\"property-body_html_sanitized\"></a> `body_html_sanitized?` | `string` \\| `null` |\n| <a id=\"property-body_macro\"></a> `body_macro?` | `string` \\| `null` |\n| <a id=\"property-body_replyless\"></a> `body_replyless?` | `string` \\| `null` |\n| <a id=\"property-body_text\"></a> `body_text?` | `string` \\| `null` |\n| <a id=\"property-calendar_invitations\"></a> `calendar_invitations?` | [`CalendarInvitation`](CalendarInvitation.md)[] |\n| <a id=\"property-cc\"></a> `cc` | [`ApiContactInfo`](ApiContactInfo.md)[] |\n| <a id=\"property-created_at\"></a> `created_at` | `string` |\n| <a id=\"property-db_id\"></a> `db_id` | `string` |\n| <a id=\"property-from\"></a> `from?` | `null` \\| [`ApiContactInfo`](ApiContactInfo.md) |\n| <a id=\"property-global_id\"></a> `global_id?` | `string` \\| `null` |\n| <a id=\"property-has_attachments\"></a> `has_attachments` | `boolean` |\n| <a id=\"property-headers_json\"></a> `headers_json?` | `unknown` |\n| <a id=\"property-internal_date_ts\"></a> `internal_date_ts?` | `string` \\| `null` |\n| <a id=\"property-is_draft\"></a> `is_draft` | `boolean` |\n| <a id=\"property-is_read\"></a> `is_read` | `boolean` |\n| <a id=\"property-is_sent\"></a> `is_sent` | `boolean` |\n| <a id=\"property-is_starred\"></a> `is_starred` | `boolean` |\n| <a id=\"property-labels\"></a> `labels` | [`ApiMessageLabel`](ApiMessageLabel.md)[] |\n| <a id=\"property-link_id\"></a> `link_id` | `string` |\n| <a id=\"property-operation_status\"></a> `operation_status?` | `null` \\| [`ApiMessageOperation`](ApiMessageOperation.md) |\n| <a id=\"property-provider_history_id\"></a> `provider_history_id?` | `string` \\| `null` |\n| <a id=\"property-provider_id\"></a> `provider_id?` | `string` \\| `null` |\n| <a id=\"property-provider_thread_id\"></a> `provider_thread_id?` | `string` \\| `null` |\n| <a id=\"property-replying_to_id\"></a> `replying_to_id?` | `string` \\| `null` |\n| <a id=\"property-scheduled_send_time\"></a> `scheduled_send_time?` | `string` \\| `null` |\n| <a id=\"property-sent_at\"></a> `sent_at?` | `string` \\| `null` |\n| <a id=\"property-size_estimate\"></a> `size_estimate?` | `number` \\| `null` |\n| <a id=\"property-snippet\"></a> `snippet?` | `string` \\| `null` |\n| <a id=\"property-subject\"></a> `subject?` | `string` \\| `null` |\n| <a id=\"property-thread_db_id\"></a> `thread_db_id` | `string` |\n| <a id=\"property-to\"></a> `to` | [`ApiContactInfo`](ApiContactInfo.md)[] |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` |\n\n\n<!-- generated/email/types.gen/type-aliases/ApiMessageAttachment.md -->\n# Type Alias: ApiMessageAttachment\n\n> **ApiMessageAttachment** = \\{ `content_id?`: `string` \\| `null`; `data_url?`: `string` \\| `null`; `db_id`: `string`; `filename?`: `string` \\| `null`; `mime_type?`: `string` \\| `null`; `provider_id?`: `string` \\| `null`; `reference_url?`: `string` \\| `null`; `sfs_id?`: `string` \\| `null`; `size_bytes?`: `number` \\| `null`; \\}\n\nAPI representation of a provider attachment on a message.\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-content_id\"></a> `content_id?` | `string` \\| `null` |\n| <a id=\"property-data_url\"></a> `data_url?` | `string` \\| `null` |\n| <a id=\"property-db_id\"></a> `db_id` | `string` |\n| <a id=\"property-filename\"></a> `filename?` | `string` \\| `null` |\n| <a id=\"property-mime_type\"></a> `mime_type?` | `string` \\| `null` |\n| <a id=\"property-provider_id\"></a> `provider_id?` | `string` \\| `null` |\n| <a id=\"property-reference_url\"></a> `reference_url?` | `string` \\| `null` |\n| <a id=\"property-sfs_id\"></a> `sfs_id?` | `string` \\| `null` |\n| <a id=\"property-size_bytes\"></a> `size_bytes?` | `number` \\| `null` |\n\n\n<!-- generated/email/types.gen/type-aliases/ApiMessageLabel.md -->\n# Type Alias: ApiMessageLabel\n\n> **ApiMessageLabel** = \\{ `created_at`: `string`; `id?`: `string` \\| `null`; `label_list_visibility?`: `null` \\| [`ApiLabelListVisibility`](ApiLabelListVisibility.md); `link_id`: `string`; `message_list_visibility?`: `null` \\| [`ApiMessageListVisibility`](ApiMessageListVisibility.md); `name?`: `string` \\| `null`; `provider_label_id`: `string`; `type_?`: `null` \\| [`ApiLabelType`](ApiLabelType.md); \\}\n\nAPI representation of a label on a message.\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-created_at\"></a> `created_at` | `string` |\n| <a id=\"property-id\"></a> `id?` | `string` \\| `null` |\n| <a id=\"property-label_list_visibility\"></a> `label_list_visibility?` | `null` \\| [`ApiLabelListVisibility`](ApiLabelListVisibility.md) |\n| <a id=\"property-link_id\"></a> `link_id` | `string` |\n| <a id=\"property-message_list_visibility\"></a> `message_list_visibility?` | `null` \\| [`ApiMessageListVisibility`](ApiMessageListVisibility.md) |\n| <a id=\"property-name\"></a> `name?` | `string` \\| `null` |\n| <a id=\"property-provider_label_id\"></a> `provider_label_id` | `string` |\n| <a id=\"property-type_\"></a> `type_?` | `null` \\| [`ApiLabelType`](ApiLabelType.md) |\n\n\n<!-- generated/email/types.gen/type-aliases/ApiMessageListVisibility.md -->\n# Type Alias: ApiMessageListVisibility\n\n> **ApiMessageListVisibility** = `\"Show\"` \\| `\"Hide\"`\n\n\n<!-- generated/email/types.gen/type-aliases/ApiMessageOperation.md -->\n# Type Alias: ApiMessageOperation\n\n> **ApiMessageOperation** = \\{ `issue?`: `null` \\| [`ApiMessageOperationIssue`](ApiMessageOperationIssue.md); `remote_version?`: `string` \\| `null`; `revision`: `string`; `state`: [`ApiMessageOperationState`](ApiMessageOperationState.md); \\}\n\nVersions are opaque decimal strings so clients never truncate an i64.\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-issue\"></a> `issue?` | `null` \\| [`ApiMessageOperationIssue`](ApiMessageOperationIssue.md) |\n| <a id=\"property-remote_version\"></a> `remote_version?` | `string` \\| `null` |\n| <a id=\"property-revision\"></a> `revision` | `string` |\n| <a id=\"property-state\"></a> `state` | [`ApiMessageOperationState`](ApiMessageOperationState.md) |\n\n\n<!-- generated/email/types.gen/type-aliases/ApiMessageOperationIssue.md -->\n# Type Alias: ApiMessageOperationIssue\n\n> **ApiMessageOperationIssue** = `\"ACCEPTING_REMOTE\"` \\| `\"DRAFT_CONFLICT\"` \\| `\"CREATION_UNKNOWN\"` \\| `\"ATTACHMENT_UNKNOWN\"` \\| `\"SEND_UNKNOWN\"` \\| `\"SEND_REJECTED\"` \\| `\"ACCESS_REVOKED\"` \\| `\"INVALID_CONTENT\"` \\| `\"MOVE_PENDING\"` \\| `\"MOVE_CONFLICT\"` \\| `\"MOVE_SOURCE_SENT\"` \\| `\"MOVE_REAUTHORIZATION\"` \\| `\"MOVE_ORIGINAL_REMAINS\"`\n\nProvider-neutral state exposed to clients.\n\n\n<!-- generated/email/types.gen/type-aliases/ApiMessageOperationState.md -->\n# Type Alias: ApiMessageOperationState\n\n> **ApiMessageOperationState** = `\"PENDING\"` \\| `\"SYNCHRONIZED\"` \\| `\"CONFLICT\"` \\| `\"UNCERTAIN\"` \\| `\"SUBMITTING\"` \\| `\"CONFIRMING\"` \\| `\"SENT\"` \\| `\"DELETED\"` \\| `\"CANCELLED\"` \\| `\"FAILED\"`\n\nProvider-neutral state exposed to clients.\n\n\n<!-- generated/email/types.gen/type-aliases/ApiMessageResolutionAction.md -->\n# Type Alias: ApiMessageResolutionAction\n\n> **ApiMessageResolutionAction** = `\"keep_local\"` \\| `\"use_provider\"` \\| `\"recheck\"` \\| `\"retry_send\"` \\| `\"keep_original\"`\n\nA deliberate resolution of a particular observed operation version.\n\n\n<!-- generated/email/types.gen/type-aliases/ApiSortMethod.md -->\n# Type Alias: ApiSortMethod\n\n> **ApiSortMethod** = `\"viewed_at\"` \\| `\"updated_at\"` \\| `\"created_at\"` \\| `\"viewed_updated\"`\n\ncommon types of sorts based on timestamps\n\n\n<!-- generated/email/types.gen/type-aliases/ApiThread.md -->\n# Type Alias: ApiThread\n\n> **ApiThread** = \\{ `access_level`: [`AccessLevel`](AccessLevel.md); `created_at`: `string`; `db_id`: `string`; `inbox_visible`: `boolean`; `is_read`: `boolean`; `latest_inbound_message_ts?`: `string` \\| `null`; `latest_non_spam_message_ts?`: `string` \\| `null`; `latest_outbound_message_ts?`: `string` \\| `null`; `link_id`: `string`; `messages`: [`ApiMessage`](ApiMessage.md)[]; `project_id?`: `string` \\| `null`; `provider_id?`: `string` \\| `null`; `updated_at`: `string`; \\}\n\nAPI representation of a fully assembled email thread.\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-access_level\"></a> `access_level` | [`AccessLevel`](AccessLevel.md) |\n| <a id=\"property-created_at\"></a> `created_at` | `string` |\n| <a id=\"property-db_id\"></a> `db_id` | `string` |\n| <a id=\"property-inbox_visible\"></a> `inbox_visible` | `boolean` |\n| <a id=\"property-is_read\"></a> `is_read` | `boolean` |\n| <a id=\"property-latest_inbound_message_ts\"></a> `latest_inbound_message_ts?` | `string` \\| `null` |\n| <a id=\"property-latest_non_spam_message_ts\"></a> `latest_non_spam_message_ts?` | `string` \\| `null` |\n| <a id=\"property-latest_outbound_message_ts\"></a> `latest_outbound_message_ts?` | `string` \\| `null` |\n| <a id=\"property-link_id\"></a> `link_id` | `string` |\n| <a id=\"property-messages\"></a> `messages` | [`ApiMessage`](ApiMessage.md)[] |\n| <a id=\"property-project_id\"></a> `project_id?` | `string` \\| `null` |\n| <a id=\"property-provider_id\"></a> `provider_id?` | `string` \\| `null` |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` |\n\n\n<!-- generated/email/types.gen/type-aliases/Attachment.md -->\n# Type Alias: Attachment\n\n> **Attachment** = \\{ `content_id?`: `string` \\| `null`; `data_url?`: `string` \\| `null`; `db_id`: `string`; `filename?`: `string` \\| `null`; `mime_type?`: `string` \\| `null`; `provider_id?`: `string` \\| `null`; `reference_url?`: `string` \\| `null`; `sfs_id?`: `string` \\| `null`; `size_bytes?`: `number` \\| `null`; \\}\n\nAttachments of a message, as sent to us by the provider.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-content_id\"></a> `content_id?` | `string` \\| `null` | - |\n| <a id=\"property-data_url\"></a> `data_url?` | `string` \\| `null` | - |\n| <a id=\"property-db_id\"></a> `db_id` | `string` | - |\n| <a id=\"property-filename\"></a> `filename?` | `string` \\| `null` | - |\n| <a id=\"property-mime_type\"></a> `mime_type?` | `string` \\| `null` | - |\n| <a id=\"property-provider_id\"></a> `provider_id?` | `string` \\| `null` | - |\n| <a id=\"property-reference_url\"></a> `reference_url?` | `string` \\| `null` | Cloud reference: open this provider page instead of downloading bytes. |\n| <a id=\"property-sfs_id\"></a> `sfs_id?` | `string` \\| `null` | - |\n| <a id=\"property-size_bytes\"></a> `size_bytes?` | `number` \\| `null` | - |\n\n\n<!-- generated/email/types.gen/type-aliases/AttendeeResponseStatus.md -->\n# Type Alias: AttendeeResponseStatus\n\n> **AttendeeResponseStatus** = `\"needs_action\"` \\| `\"accepted\"` \\| `\"declined\"` \\| `\"tentative\"`\n\nRSVP state for an attendee.\n\n\n<!-- generated/email/types.gen/type-aliases/CalendarAttendee.md -->\n# Type Alias: CalendarAttendee\n\n> **CalendarAttendee** = \\{ `comment?`: `string` \\| `null`; `displayName?`: `string` \\| `null`; `email`: `string`; `isOptional`: `boolean`; `isOrganizer`: `boolean`; `isSelf`: `boolean`; `responseStatus`: [`AttendeeResponseStatus`](AttendeeResponseStatus.md); \\}\n\nAn attendee on a calendar event.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-comment\"></a> `comment?` | `string` \\| `null` | Optional attendee comment. |\n| <a id=\"property-displayname\"></a> `displayName?` | `string` \\| `null` | Provider display name. |\n| <a id=\"property-email\"></a> `email` | `string` | Normalized email address. |\n| <a id=\"property-isoptional\"></a> `isOptional` | `boolean` | Whether attendance is optional. |\n| <a id=\"property-isorganizer\"></a> `isOrganizer` | `boolean` | Whether this attendee is the organizer. |\n| <a id=\"property-isself\"></a> `isSelf` | `boolean` | Whether this attendee is one of the viewing requester's inboxes. |\n| <a id=\"property-responsestatus\"></a> `responseStatus` | [`AttendeeResponseStatus`](AttendeeResponseStatus.md) | RSVP state. |\n\n\n<!-- generated/email/types.gen/type-aliases/CalendarEvent.md -->\n# Type Alias: CalendarEvent\n\n> **CalendarEvent** = \\{ `attendees`: [`CalendarAttendee`](CalendarAttendee.md)[]; `calendarId?`: `string` \\| `null`; `conferenceProvider?`: `null` \\| [`ConferenceProvider`](ConferenceProvider.md); `conferenceUrl?`: `string` \\| `null`; `createdAt`: `string`; `creatorEmail?`: `string` \\| `null`; `creatorName?`: `string` \\| `null`; `description?`: `string` \\| `null`; `eventType?`: [`EventType`](EventType.md); `icalUid`: `string`; `id`: `string`; `isReadOnly`: `boolean`; `location?`: `string` \\| `null`; `organizerEmail?`: `string` \\| `null`; `organizerName?`: `string` \\| `null`; `ownerId`: `string`; `recurrenceLines`: `string`[]; `reminders?`: [`EventReminders`](EventReminders.md); `sequence`: `number`; `sources?`: [`CalendarEventSourceContent`](CalendarEventSourceContent.md)[]; `status`: [`EventStatus`](EventStatus.md); `time`: [`EventTime`](EventTime.md); `title`: `string`; `transparency`: [`EventTransparency`](EventTransparency.md); `updatedAt`: `string`; `visibility`: [`EventVisibility`](EventVisibility.md); \\}\n\nA stable, first-class Macro calendar event entity.\n\nContent fields hold the canonical source's values: the account's primary\ncalendar copy when one is synced, else the freshest remaining copy.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-attendees\"></a> `attendees` | [`CalendarAttendee`](CalendarAttendee.md)[] | Attendees, keyed by email during persistence. |\n| <a id=\"property-calendarid\"></a> `calendarId?` | `string` \\| `null` | Calendar the canonical source belongs to, when known. Absent only in projections stored before calendars were attributed. |\n| <a id=\"property-conferenceprovider\"></a> `conferenceProvider?` | `null` \\| [`ConferenceProvider`](ConferenceProvider.md) | - |\n| <a id=\"property-conferenceurl\"></a> `conferenceUrl?` | `string` \\| `null` | Direct join URL when known. |\n| <a id=\"property-createdat\"></a> `createdAt` | `string` | Entity creation time. |\n| <a id=\"property-creatoremail\"></a> `creatorEmail?` | `string` \\| `null` | Provider-reported creator email. Distinct from the organizer when someone writes onto a calendar they do not own. Omitted from stored projections when unknown so events ingested before this field still compare equal. |\n| <a id=\"property-creatorname\"></a> `creatorName?` | `string` \\| `null` | Provider-reported creator display name. |\n| <a id=\"property-description\"></a> `description?` | `string` \\| `null` | Optional event body. |\n| <a id=\"property-eventtype\"></a> `eventType?` | [`EventType`](EventType.md) | Provider event type. Skipped when it is the regular type so projections stored before event types were modeled still compare equal. |\n| <a id=\"property-icaluid\"></a> `icalUid` | `string` | RFC 5545 UID used to reconcile provider and email sources. |\n| <a id=\"property-id\"></a> `id` | `string` | Macro entity identifier. |\n| <a id=\"property-isreadonly\"></a> `isReadOnly` | `boolean` | Whether the canonical source's calendar prohibits editing it. |\n| <a id=\"property-location\"></a> `location?` | `string` \\| `null` | Optional physical or virtual location label. |\n| <a id=\"property-organizeremail\"></a> `organizerEmail?` | `string` \\| `null` | Organizer email. |\n| <a id=\"property-organizername\"></a> `organizerName?` | `string` \\| `null` | Organizer display name. |\n| <a id=\"property-ownerid\"></a> `ownerId` | `string` | Macro user who owns this event entity. |\n| <a id=\"property-recurrencelines\"></a> `recurrenceLines` | `string`[] | Raw RFC 5545 recurrence properties (`RRULE`, `RDATE`, `EXDATE`). |\n| <a id=\"property-reminders\"></a> `reminders?` | [`EventReminders`](EventReminders.md) | Per-user reminder configuration. Skipped when it is the provider default so projections stored before reminders were modeled still compare equal. |\n| <a id=\"property-sequence\"></a> `sequence` | `number` | Provider/iCalendar sequence number. |\n| <a id=\"property-sources\"></a> `sources?` | [`CalendarEventSourceContent`](CalendarEventSourceContent.md)[] | Content of every active copy of this event, canonical first: the primary calendar's copy, then the freshest. A client picks the copy whose calendar it is showing and falls back to the first. Populated only on the read path, so stored projections omit it. |\n| <a id=\"property-status\"></a> `status` | [`EventStatus`](EventStatus.md) | Event status. |\n| <a id=\"property-time\"></a> `time` | [`EventTime`](EventTime.md) | Timed or all-day shape. |\n| <a id=\"property-title\"></a> `title` | `string` | Display title. |\n| <a id=\"property-transparency\"></a> `transparency` | [`EventTransparency`](EventTransparency.md) | Availability behavior. |\n| <a id=\"property-updatedat\"></a> `updatedAt` | `string` | Entity update time. |\n| <a id=\"property-visibility\"></a> `visibility` | [`EventVisibility`](EventVisibility.md) | Event visibility. |\n\n\n<!-- generated/email/types.gen/type-aliases/CalendarEventSourceContent.md -->\n# Type Alias: CalendarEventSourceContent\n\n> **CalendarEventSourceContent** = \\{ `calendarId`: `string`; `creatorEmail?`: `string` \\| `null`; `creatorName?`: `string` \\| `null`; `description?`: `string` \\| `null`; `eventType`: [`EventType`](EventType.md); `isReadOnly`: `boolean`; `location?`: `string` \\| `null`; `reminders`: [`EventReminders`](EventReminders.md); `title`: `string`; `transparency`: [`EventTransparency`](EventTransparency.md); `visibility`: [`EventVisibility`](EventVisibility.md); \\}\n\nThe content one provider copy of an event carries.\n\nGoogle keeps these fields per calendar copy: a shared calendar's copy of a\nmember's event can have its own title, type, reminders, and access role.\nThe entity holds its canonical source's values. Every other copy's values\nare read from here so a client can show the copy that belongs to the\ncalendar being viewed.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-calendarid\"></a> `calendarId` | `string` | Calendar this copy lives on. |\n| <a id=\"property-creatoremail\"></a> `creatorEmail?` | `string` \\| `null` | Provider-reported creator email. |\n| <a id=\"property-creatorname\"></a> `creatorName?` | `string` \\| `null` | Provider-reported creator display name. |\n| <a id=\"property-description\"></a> `description?` | `string` \\| `null` | Optional event body. |\n| <a id=\"property-eventtype\"></a> `eventType` | [`EventType`](EventType.md) | Provider event type. |\n| <a id=\"property-isreadonly\"></a> `isReadOnly` | `boolean` | Whether the calendar's access role prohibits editing this copy. |\n| <a id=\"property-location\"></a> `location?` | `string` \\| `null` | Optional physical or virtual location label. |\n| <a id=\"property-reminders\"></a> `reminders` | [`EventReminders`](EventReminders.md) | Reminder configuration of this copy. |\n| <a id=\"property-title\"></a> `title` | `string` | Display title. |\n| <a id=\"property-transparency\"></a> `transparency` | [`EventTransparency`](EventTransparency.md) | Availability behavior. |\n| <a id=\"property-visibility\"></a> `visibility` | [`EventVisibility`](EventVisibility.md) | Event visibility. |\n\n\n<!-- generated/email/types.gen/type-aliases/CalendarInvitation.md -->\n# Type Alias: CalendarInvitation\n\n> **CalendarInvitation** = \\{ `attendees`: [`InvitationParticipant`](InvitationParticipant.md)[]; `comment?`: `string` \\| `null`; `conference_url?`: `string` \\| `null`; `description?`: `string` \\| `null`; `dtstamp?`: `string` \\| `null`; `end?`: `null` \\| [`InvitationDateTime`](InvitationDateTime.md); `id`: `string`; `last_modified?`: `string` \\| `null`; `location?`: `string` \\| `null`; `method`: [`InvitationMethod`](InvitationMethod.md); `organizer?`: `null` \\| [`InvitationParticipant`](InvitationParticipant.md); `recurrence_id?`: `null` \\| [`InvitationDateTime`](InvitationDateTime.md); `recurrence_id_raw?`: `string` \\| `null`; `sequence`: `number`; `start?`: `null` \\| [`InvitationDateTime`](InvitationDateTime.md); `status?`: `string` \\| `null`; `title?`: `string` \\| `null`; `uid`: `string`; \\}\n\nDisplay snapshot of one meaningful VEVENT, owned by the email domain.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-attendees\"></a> `attendees` | [`InvitationParticipant`](InvitationParticipant.md)[] | Historical attendee identities and participation metadata. |\n| <a id=\"property-comment\"></a> `comment?` | `string` \\| `null` | Reply or counter-proposal comment. |\n| <a id=\"property-conference_url\"></a> `conference_url?` | `string` \\| `null` | Validated HTTP(S) conferencing URL; never fetched during rendering. |\n| <a id=\"property-description\"></a> `description?` | `string` \\| `null` | Plaintext description, retaining passwords and dial-in instructions. |\n| <a id=\"property-dtstamp\"></a> `dtstamp?` | `string` \\| `null` | Scheduling timestamp in its original spelling. |\n| <a id=\"property-end\"></a> `end?` | `null` \\| [`InvitationDateTime`](InvitationDateTime.md) | - |\n| <a id=\"property-id\"></a> `id` | `string` | Content-derived component identity, stable across repeated extraction. |\n| <a id=\"property-last_modified\"></a> `last_modified?` | `string` \\| `null` | Last modification timestamp in its original spelling. |\n| <a id=\"property-location\"></a> `location?` | `string` \\| `null` | Plaintext event location. |\n| <a id=\"property-method\"></a> `method` | [`InvitationMethod`](InvitationMethod.md) | Original scheduling method. |\n| <a id=\"property-organizer\"></a> `organizer?` | `null` \\| [`InvitationParticipant`](InvitationParticipant.md) | - |\n| <a id=\"property-recurrence_id\"></a> `recurrence_id?` | `null` \\| [`InvitationDateTime`](InvitationDateTime.md) | - |\n| <a id=\"property-recurrence_id_raw\"></a> `recurrence_id_raw?` | `string` \\| `null` | Original recurrence identifier spelling and parameters. |\n| <a id=\"property-sequence\"></a> `sequence` | `number` | Scheduling revision, distinct from delivery order. |\n| <a id=\"property-start\"></a> `start?` | `null` \\| [`InvitationDateTime`](InvitationDateTime.md) | - |\n| <a id=\"property-status\"></a> `status?` | `string` \\| `null` | Original event status. |\n| <a id=\"property-title\"></a> `title?` | `string` \\| `null` | Event summary. |\n| <a id=\"property-uid\"></a> `uid` | `string` | iCalendar UID; never a Google provider event ID. |\n\n\n<!-- generated/email/types.gen/type-aliases/CalendarOccurrence.md -->\n# Type Alias: CalendarOccurrence\n\n> **CalendarOccurrence** = \\{ `eventId`: `string`; `isCancelled`: `boolean`; `occurrenceKey`: `string`; `recurrenceId?`: `string` \\| `null`; `time`: [`EventTime`](EventTime.md); \\}\n\nA materialized recurrence instance optimized for range queries.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-eventid\"></a> `eventId` | `string` | Owning event entity. |\n| <a id=\"property-iscancelled\"></a> `isCancelled` | `boolean` | Whether the instance was cancelled. |\n| <a id=\"property-occurrencekey\"></a> `occurrenceKey` | `string` | Stable key within the event. |\n| <a id=\"property-recurrenceid\"></a> `recurrenceId?` | `string` \\| `null` | Provider recurrence identifier, when applicable. |\n| <a id=\"property-time\"></a> `time` | [`EventTime`](EventTime.md) | Instance time. |\n\n\n<!-- generated/email/types.gen/type-aliases/ConferenceProvider.md -->\n# Type Alias: ConferenceProvider\n\n> **ConferenceProvider** = `\"microsoft_teams\"` \\| `\"google_meet\"` \\| `\"other\"`\n\nThe conferencing system backing an event's join URL.\n\nCalendars can create Google Meet or Microsoft Teams according to their\ncapabilities. Imported third-party conferences are labeled separately.\nOmitting a conference change preserves the current conference; explicit\nchanges still require provider and calendar capability validation.\n\n\n<!-- generated/email/types.gen/type-aliases/ContactInfo.md -->\n# Type Alias: ContactInfo\n\n> **ContactInfo** = \\{ `email`: `string`; `name?`: `string` \\| `null`; `photo_url?`: `string` \\| `null`; \\}\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-email\"></a> `email` | `string` |\n| <a id=\"property-name\"></a> `name?` | `string` \\| `null` |\n| <a id=\"property-photo_url\"></a> `photo_url?` | `string` \\| `null` |\n\n\n<!-- generated/email/types.gen/type-aliases/ContactInfoLegacy.md -->\n# Type Alias: ContactInfoLegacy\n\n> **ContactInfoLegacy** = \\{ `email`: `string`; `email_address`: `string`; `name?`: `string` \\| `null`; `photo_url?`: `string` \\| `null`; \\}\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-email\"></a> `email` | `string` |\n| <a id=\"property-email_address\"></a> `email_address` | `string` |\n| <a id=\"property-name\"></a> `name?` | `string` \\| `null` |\n| <a id=\"property-photo_url\"></a> `photo_url?` | `string` \\| `null` |\n\n\n<!-- generated/email/types.gen/type-aliases/ContactInfoWithInteraction.md -->\n# Type Alias: ContactInfoWithInteraction\n\n> **ContactInfoWithInteraction** = [`ContactInfoLegacy`](ContactInfoLegacy.md) & \\{ `last_interaction`: `string`; \\}\n\n## Type Declaration\n\n| Name | Type |\n| ------ | ------ |\n| `last_interaction` | `string` |\n\n\n<!-- generated/email/types.gen/type-aliases/EventReminderOverride.md -->\n# Type Alias: EventReminderOverride\n\n> **EventReminderOverride** = \\{ `method`: `string`; `minutes`: `number`; \\}\n\nOne reminder: how it alerts and how many minutes before the event start\n(before midnight in the calendar's zone for all-day events) it fires.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-method\"></a> `method` | `string` | Provider method, stored verbatim; only `popup` fires Macro notifications. |\n| <a id=\"property-minutes\"></a> `minutes` | `number` | Minutes before the event start. |\n\n\n<!-- generated/email/types.gen/type-aliases/EventReminders.md -->\n# Type Alias: EventReminders\n\n> **EventReminders** = \\{ `overrides?`: [`EventReminderOverride`](EventReminderOverride.md)[]; `useDefault`: `boolean`; \\}\n\nPer-user reminder configuration for an event, mirroring Google's model:\neither the calendar's default reminders apply, or the explicit overrides\nreplace them entirely.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-overrides\"></a> `overrides?` | [`EventReminderOverride`](EventReminderOverride.md)[] | Explicit reminders replacing the defaults when `use_default` is off. |\n| <a id=\"property-usedefault\"></a> `useDefault` | `boolean` | Whether the calendar's default reminders apply. |\n\n\n<!-- generated/email/types.gen/type-aliases/EventStatus.md -->\n# Type Alias: EventStatus\n\n> **EventStatus** = `\"confirmed\"` \\| `\"tentative\"` \\| `\"cancelled\"`\n\nCanonical event status.\n\n\n<!-- generated/email/types.gen/type-aliases/EventTime.md -->\n# Type Alias: EventTime\n\n> **EventTime** = \\{ `endsAt`: `string`; `kind`: `\"timed\"`; `startsAt`: `string`; `timeZone?`: `string` \\| `null`; \\} \\| \\{ `endDate`: `string`; `kind`: `\"allDay\"`; `startDate`: `string`; \\}\n\nThe mutually exclusive time shape of a calendar event.\n\nFields are renamed per variant rather than with `rename_all_fields`\nbecause utoipa only honors variant-level serde renames when it\nderives the OpenAPI schema.\n\n## Union Members\n\n### Type Literal\n\n\\{ `endsAt`: `string`; `kind`: `\"timed\"`; `startsAt`: `string`; `timeZone?`: `string` \\| `null`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `endsAt` | `string` | Exclusive end instant; equal to the start for an imported point event. |\n| `kind` | `\"timed\"` | - |\n| `startsAt` | `string` | Inclusive start instant. |\n| `timeZone?` | `string` \\| `null` | Original IANA time-zone identifier, when supplied. |\n\n***\n\n### Type Literal\n\n\\{ `endDate`: `string`; `kind`: `\"allDay\"`; `startDate`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `endDate` | `string` | Exclusive local end date. |\n| `kind` | `\"allDay\"` | - |\n| `startDate` | `string` | Inclusive local start date. |\n\n\n<!-- generated/email/types.gen/type-aliases/EventTransparency.md -->\n# Type Alias: EventTransparency\n\n> **EventTransparency** = `\"opaque\"` \\| `\"transparent\"`\n\nWhether an event blocks availability.\n\n\n<!-- generated/email/types.gen/type-aliases/EventType.md -->\n# Type Alias: EventType\n\n> **EventType** = `\"default\"` \\| `\"out_of_office\"` \\| `\"focus_time\"` \\| `\"working_location\"` \\| `\"birthday\"` \\| `\"from_gmail\"`\n\nGoogle's event type: ordinary meetings versus the status-style entries\n(working location, out of office, focus time, birthdays) Google renders\nand notifies differently. Immutable at the provider after creation.\n\n\n<!-- generated/email/types.gen/type-aliases/EventVisibility.md -->\n# Type Alias: EventVisibility\n\n> **EventVisibility** = `\"default\"` \\| `\"public\"` \\| `\"private\"` \\| `\"confidential\"`\n\nVisibility of event details.\n\n\n<!-- generated/email/types.gen/type-aliases/GetAttachmentResponse.md -->\n# Type Alias: GetAttachmentResponse\n\n> **GetAttachmentResponse** = \\{ `attachment`: [`Attachment`](Attachment.md); \\}\n\nThe response returned from the get attachment endpoint\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-attachment\"></a> `attachment` | [`Attachment`](Attachment.md) |\n\n\n<!-- generated/email/types.gen/type-aliases/GetAttachmentResponses.md -->\n# Type Alias: GetAttachmentResponses\n\n> **GetAttachmentResponses** = \\{ `200`: [`GetAttachmentResponse`](GetAttachmentResponse.md); \\}\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-200\"></a> `200` | [`GetAttachmentResponse`](GetAttachmentResponse.md) |\n\n\n<!-- generated/email/types.gen/type-aliases/GetMessageResponses.md -->\n# Type Alias: GetMessageResponses\n\n> **GetMessageResponses** = \\{ `200`: [`ParsedMessage`](ParsedMessage.md); \\}\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-200\"></a> `200` | [`ParsedMessage`](ParsedMessage.md) |\n\n\n<!-- generated/email/types.gen/type-aliases/InvitationDateTime.md -->\n# Type Alias: InvitationDateTime\n\n> **InvitationDateTime** = \\{ `kind`: `\"date\"`; `value`: `string`; \\} \\| \\{ `kind`: `\"zoned\"`; `time_zone`: `string`; `value`: `string`; \\} \\| \\{ `kind`: `\"unresolved\"`; `time_zone?`: `string` \\| `null`; `value`: `string`; \\}\n\nPreserve date-only and unresolved times without manufacturing UTC instants.\n\n## Union Members\n\n### Type Literal\n\n\\{ `kind`: `\"date\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"date\"` | - |\n| `value` | `string` | ISO calendar date. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"zoned\"`; `time_zone`: `string`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"zoned\"` | - |\n| `time_zone` | `string` | IANA zone of the original TZID, or UTC. |\n| `value` | `string` | RFC3339 instant. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"unresolved\"`; `time_zone?`: `string` \\| `null`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"unresolved\"` | - |\n| `time_zone?` | `string` \\| `null` | Original TZID if present. |\n| `value` | `string` | ISO local wall time, without an offset. |\n\n\n<!-- generated/email/types.gen/type-aliases/InvitationMethod.md -->\n# Type Alias: InvitationMethod\n\n> **InvitationMethod** = `\"request\"` \\| `\"reply\"` \\| `\"cancel\"` \\| `\"counter\"` \\| `\"publish\"` \\| `\"unknown\"`\n\nOriginal scheduling method, including methods unsupported for actions.\n\n\n<!-- generated/email/types.gen/type-aliases/InvitationParticipant.md -->\n# Type Alias: InvitationParticipant\n\n> **InvitationParticipant** = \\{ `email`: `string`; `name?`: `string` \\| `null`; `participation_status?`: `string` \\| `null`; \\}\n\nScheduling participant; saved responses are historical, not current RSVP.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-email\"></a> `email` | `string` | Participant calendar address. |\n| <a id=\"property-name\"></a> `name?` | `string` \\| `null` | Sender-supplied display name. |\n| <a id=\"property-participation_status\"></a> `participation_status?` | `string` \\| `null` | Original PARTSTAT, retaining extensions. |\n\n\n<!-- generated/email/types.gen/type-aliases/InvitationResolution.md -->\n# Type Alias: InvitationResolution\n\n> **InvitationResolution** = \\{ `kind`: `\"disconnected\"`; \\} \\| \\{ `kind`: `\"still_syncing\"`; \\} \\| \\{ `kind`: `\"cancelled\"`; \\} \\| \\{ `kind`: `\"unavailable\"`; \\} \\| \\{ `kind`: `\"no_match\"`; \\} \\| \\{ `kind`: `\"ambiguous\"`; \\} \\| \\{ `can_join`: `boolean`; `can_respond`: `boolean`; `event`: [`CalendarEvent`](CalendarEvent.md); `is_stale`: `boolean`; `kind`: `\"resolved\"`; `occurrence`: [`CalendarOccurrence`](CalendarOccurrence.md); `responding_email`: `string`; \\}\n\nRefreshable result, distinct from the immutable email contents.\n\n## Union Members\n\n### Type Literal\n\n\\{ `kind`: `\"disconnected\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"still_syncing\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"cancelled\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"unavailable\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"no_match\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"ambiguous\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `can_join`: `boolean`; `can_respond`: `boolean`; `event`: [`CalendarEvent`](CalendarEvent.md); `is_stale`: `boolean`; `kind`: `\"resolved\"`; `occurrence`: [`CalendarOccurrence`](CalendarOccurrence.md); `responding_email`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `can_join` | `boolean` | Whether the conference link belongs to the reconciled scheduling target. |\n| `can_respond` | `boolean` | Whether a response is currently allowed. |\n| `event` | [`CalendarEvent`](CalendarEvent.md) | Current occurrence-specific content. |\n| `is_stale` | `boolean` | Whether the provider projection trails the email revision. |\n| `kind` | `\"resolved\"` | - |\n| `occurrence` | [`CalendarOccurrence`](CalendarOccurrence.md) | Original occurrence identity and current time. |\n| `responding_email` | `string` | Connected address that would respond. |\n\n\n<!-- generated/email/types.gen/type-aliases/LabelInfo.md -->\n# Type Alias: LabelInfo\n\n> **LabelInfo** = \\{ `name`: `string`; `provider_id`: `string`; \\}\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-name\"></a> `name` | `string` |\n| <a id=\"property-provider_id\"></a> `provider_id` | `string` |\n\n\n<!-- generated/email/types.gen/type-aliases/Link.md -->\n# Type Alias: Link\n\n> **Link** = \\{ `calendar_disabled`: `boolean`; `created_at`: `string`; `email_address`: `string`; `fusionauth_user_id`: `string`; `has_calendar_data`: `boolean`; `id`: `string`; `is_primary`: `boolean`; `is_sync_active`: `boolean`; `macro_id`: `string`; `needs_calendar_permission`: `boolean`; `needs_reauth`: `boolean`; `photo_url?`: `string` \\| `null`; `provider`: [`UserProvider`](UserProvider.md); `settings`: [`Settings`](Settings.md); `sync_status`: [`SyncStatus`](SyncStatus.md); `updated_at`: `string`; \\}\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-calendar_disabled\"></a> `calendar_disabled` | `boolean` | Whether the user turned calendar off for this inbox, which also removed its calendar data. `needs_calendar_permission` is true either way, so this is what separates \"never granted\" from \"deliberately off\" — unprompted calendar nags must stay quiet for the latter. |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | - |\n| <a id=\"property-email_address\"></a> `email_address` | `string` | - |\n| <a id=\"property-fusionauth_user_id\"></a> `fusionauth_user_id` | `string` | - |\n| <a id=\"property-has_calendar_data\"></a> `has_calendar_data` | `boolean` | Whether Macro holds calendar data for this inbox. Drives the turn-off control on its own, so removing that data never depends on the recorded scopes still matching the set Macro requests today — a set that changes as the integration narrows, stranding data behind a capability check that no longer recognizes an older grant. |\n| <a id=\"property-id\"></a> `id` | `string` | - |\n| <a id=\"property-is_primary\"></a> `is_primary` | `boolean` | - |\n| <a id=\"property-is_sync_active\"></a> `is_sync_active` | `boolean` | - |\n| <a id=\"property-macro_id\"></a> `macro_id` | `string` | - |\n| <a id=\"property-needs_calendar_permission\"></a> `needs_calendar_permission` | `boolean` | Whether the link's Google grant is missing the calendar scope. True for inboxes connected before the calendar capability existed (and for grants where the user declined it); drives the per-inbox calendar upgrade prompt. Re-running the connect flow records the new grant. |\n| <a id=\"property-needs_reauth\"></a> `needs_reauth` | `boolean` | Whether the link's Google grant needs to be reconnected. Drives the per-inbox reconnect prompt independently of the sync-status badge. |\n| <a id=\"property-photo_url\"></a> `photo_url?` | `string` \\| `null` | The inbox's own profile photo (its self-contact's SFS photo), if synced. |\n| <a id=\"property-provider\"></a> `provider` | [`UserProvider`](UserProvider.md) | - |\n| <a id=\"property-settings\"></a> `settings` | [`Settings`](Settings.md) | - |\n| <a id=\"property-sync_status\"></a> `sync_status` | [`SyncStatus`](SyncStatus.md) | - |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` | - |\n\n\n<!-- generated/email/types.gen/type-aliases/MailboxAction.md -->\n# Type Alias: MailboxAction\n\n> **MailboxAction** = \\{ `kind`: `\"read\"`; `value`: `boolean`; \\} \\| \\{ `kind`: `\"flagged\"`; `value`: `boolean`; \\} \\| \\{ `kind`: `\"archived\"`; `value`: `boolean`; \\} \\| \\{ `kind`: `\"trashed\"`; `value`: `boolean`; \\} \\| \\{ `kind`: `\"junk\"`; `value`: `boolean`; \\} \\| \\{ `kind`: `\"category\"`; `value`: \\{ `name`: `string`; `present`: `boolean`; \\}; \\}\n\nDesired organization state. Categories never stand in for folders or flags.\n\n## Union Members\n\n### Type Literal\n\n\\{ `kind`: `\"read\"`; `value`: `boolean`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"read\"` | - |\n| `value` | `boolean` | Mark correspondence read or unread. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"flagged\"`; `value`: `boolean`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"flagged\"` | - |\n| `value` | `boolean` | Set the follow-up star. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"archived\"`; `value`: `boolean`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"archived\"` | - |\n| `value` | `boolean` | Archive inbox messages, or restore received correspondence to the inbox. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"trashed\"`; `value`: `boolean`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"trashed\"` | - |\n| `value` | `boolean` | Move to recoverable trash, or restore correspondence to Inbox (drafts to Drafts). |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"junk\"`; `value`: `boolean`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"junk\"` | - |\n| `value` | `boolean` | Move to junk, or restore to the inbox. |\n\n***\n\n### Type Literal\n\n\\{ `kind`: `\"category\"`; `value`: \\{ `name`: `string`; `present`: `boolean`; \\}; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `kind` | `\"category\"` | - |\n| `value` | \\{ `name`: `string`; `present`: `boolean`; \\} | Add/remove a category while preserving other provider assignments. |\n| `value.name` | `string` | - |\n| `value.present` | `boolean` | - |\n\n\n<!-- generated/email/types.gen/type-aliases/MailboxOperation.md -->\n# Type Alias: MailboxOperation\n\n> **MailboxOperation** = \\{ `action`: [`MailboxAction`](MailboxAction.md); `id`: `string`; `state`: [`MailboxOperationState`](MailboxOperationState.md); `updated_at`: `string`; \\}\n\nDurable outcome of an accepted organization action.\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-action\"></a> `action` | [`MailboxAction`](MailboxAction.md) |\n| <a id=\"property-id\"></a> `id` | `string` |\n| <a id=\"property-state\"></a> `state` | [`MailboxOperationState`](MailboxOperationState.md) |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` |\n\n\n<!-- generated/email/types.gen/type-aliases/MailboxOperationState.md -->\n# Type Alias: MailboxOperationState\n\n> **MailboxOperationState** = `\"pending\"` \\| `\"applied\"` \\| `\"failed\"` \\| `\"cancelled\"`\n\n\n<!-- generated/email/types.gen/type-aliases/MailboxSettingsChange.md -->\n# Type Alias: MailboxSettingsChange\n\n> **MailboxSettingsChange** = `\"create_label\"` \\| `\"delete_label\"` \\| `\"sender_block\"`\n\n\n<!-- generated/email/types.gen/type-aliases/MailboxSettingsOperation.md -->\n# Type Alias: MailboxSettingsOperation\n\n> **MailboxSettingsOperation** = \\{ `enabled`: `boolean`; `id`: `string`; `kind`: [`MailboxSettingsChange`](MailboxSettingsChange.md); `needs_attention`: `boolean`; `resource`: `string`; \\}\n\nAn accepted inbox configuration change awaiting provider confirmation.\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-enabled\"></a> `enabled` | `boolean` |\n| <a id=\"property-id\"></a> `id` | `string` |\n| <a id=\"property-kind\"></a> `kind` | [`MailboxSettingsChange`](MailboxSettingsChange.md) |\n| <a id=\"property-needs_attention\"></a> `needs_attention` | `boolean` |\n| <a id=\"property-resource\"></a> `resource` | `string` |\n\n\n<!-- generated/email/types.gen/type-aliases/MessageOperationResponse.md -->\n# Type Alias: MessageOperationResponse\n\n> **MessageOperationResponse** = \\{ `operation?`: `null` \\| [`ApiMessageOperation`](ApiMessageOperation.md); \\}\n\nAuthorized polling response. Gmail has no asynchronous draft operation.\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-operation\"></a> `operation?` | `null` \\| [`ApiMessageOperation`](ApiMessageOperation.md) |\n\n\n<!-- generated/email/types.gen/type-aliases/ParsedMessage.md -->\n# Type Alias: ParsedMessage\n\n> **ParsedMessage** = \\{ `bcc`: [`ContactInfo`](ContactInfo.md)[]; `body_parsed?`: `string` \\| `null`; `cc`: [`ContactInfo`](ContactInfo.md)[]; `db_id`: `string`; `from?`: `null` \\| [`ContactInfo`](ContactInfo.md); `internal_date_ts?`: `string` \\| `null`; `labels`: [`LabelInfo`](LabelInfo.md)[]; `link_id`: `string`; `subject?`: `string` \\| `null`; `thread_db_id`: `string`; `to`: [`ContactInfo`](ContactInfo.md)[]; \\}\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-bcc\"></a> `bcc` | [`ContactInfo`](ContactInfo.md)[] |\n| <a id=\"property-body_parsed\"></a> `body_parsed?` | `string` \\| `null` |\n| <a id=\"property-cc\"></a> `cc` | [`ContactInfo`](ContactInfo.md)[] |\n| <a id=\"property-db_id\"></a> `db_id` | `string` |\n| <a id=\"property-from\"></a> `from?` | `null` \\| [`ContactInfo`](ContactInfo.md) |\n| <a id=\"property-internal_date_ts\"></a> `internal_date_ts?` | `string` \\| `null` |\n| <a id=\"property-labels\"></a> `labels` | [`LabelInfo`](LabelInfo.md)[] |\n| <a id=\"property-link_id\"></a> `link_id` | `string` |\n| <a id=\"property-subject\"></a> `subject?` | `string` \\| `null` |\n| <a id=\"property-thread_db_id\"></a> `thread_db_id` | `string` |\n| <a id=\"property-to\"></a> `to` | [`ContactInfo`](ContactInfo.md)[] |\n\n\n<!-- generated/email/types.gen/type-aliases/ResolveMessageOperationRequest.md -->\n# Type Alias: ResolveMessageOperationRequest\n\n> **ResolveMessageOperationRequest** = \\{ `accept_duplicate_risk?`: `boolean`; `action`: [`ApiMessageResolutionAction`](ApiMessageResolutionAction.md); `remote_version?`: `string` \\| `null`; `revision`: `string`; \\}\n\nStale versions fail without altering the current operation.\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-accept_duplicate_risk\"></a> `accept_duplicate_risk?` | `boolean` |\n| <a id=\"property-action\"></a> `action` | [`ApiMessageResolutionAction`](ApiMessageResolutionAction.md) |\n| <a id=\"property-remote_version\"></a> `remote_version?` | `string` \\| `null` |\n| <a id=\"property-revision\"></a> `revision` | `string` |\n\n\n<!-- generated/email/types.gen/type-aliases/Settings.md -->\n# Type Alias: Settings\n\n> **Settings** = \\{ `signature?`: `string` \\| `null`; `signature_on_replies_forwards?`: `boolean` \\| `null`; \\}\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-signature\"></a> `signature?` | `string` \\| `null` | The user's email signature content (HTML). On a patch, omit or send `null` to leave unchanged (both deserialize to `None`); pass an empty string to clear it. The column cannot be set to SQL NULL via patch. |\n| <a id=\"property-signature_on_replies_forwards\"></a> `signature_on_replies_forwards?` | `boolean` \\| `null` | - |\n\n\n<!-- generated/email/types.gen/type-aliases/SyncStatus.md -->\n# Type Alias: SyncStatus\n\n> **SyncStatus** = `\"SYNCING\"` \\| `\"UP_TO_DATE\"` \\| `\"ERROR\"` \\| `\"NEEDS_REAUTH\"` \\| `\"INACTIVE\"`\n\nCoarse sync state for an inbox, used to render a one-line hint in the\nmulti-inbox settings list. Derived from the link's `is_sync_active` flag, its\nreauth health, and its most recent backfill job.\n\n\n<!-- generated/email/types.gen/type-aliases/ThreadStateField.md -->\n# Type Alias: ThreadStateField\n\n> **ThreadStateField** = `\"read\"` \\| `\"starred\"` \\| `\"trashed\"` \\| `\"junk\"`\n\nSemantic mailbox facts, independent of folder/category names.\n\n\n<!-- generated/email/types.gen/type-aliases/TransferDraftRequest.md -->\n# Type Alias: TransferDraftRequest\n\n> **TransferDraftRequest** = \\{ `destination_link_id`: `string`; `operation_id`: `string`; \\}\n\nReuse the same operation ID when retrying after a lost response.\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-destination_link_id\"></a> `destination_link_id` | `string` |\n| <a id=\"property-operation_id\"></a> `operation_id` | `string` |\n\n\n<!-- generated/email/types.gen/type-aliases/TransferDraftResponse.md -->\n# Type Alias: TransferDraftResponse\n\n> **TransferDraftResponse** = \\{ `attachments`: [`ApiAttachmentDraft`](ApiAttachmentDraft.md)[]; `message_id`: `string`; `source_id`: `string`; `source_thread_id`: `string`; `thread_id`: `string`; \\}\n\nA new identity prevents delayed writes from mutating the moved copy.\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-attachments\"></a> `attachments` | [`ApiAttachmentDraft`](ApiAttachmentDraft.md)[] |\n| <a id=\"property-message_id\"></a> `message_id` | `string` |\n| <a id=\"property-source_id\"></a> `source_id` | `string` |\n| <a id=\"property-source_thread_id\"></a> `source_thread_id` | `string` |\n| <a id=\"property-thread_id\"></a> `thread_id` | `string` |\n\n\n<!-- generated/email/types.gen/type-aliases/TransferRecoveryResponse.md -->\n# Type Alias: TransferRecoveryResponse\n\n> **TransferRecoveryResponse** = \\{ `committed?`: `null` \\| [`TransferDraftResponse`](TransferDraftResponse.md); \\}\n\nA null result confirms that the move cannot commit, even if its request was delayed.\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-committed\"></a> `committed?` | `null` \\| [`TransferDraftResponse`](TransferDraftResponse.md) |\n\n\n<!-- generated/email/types.gen/type-aliases/UpdateThreadStateRequest.md -->\n# Type Alias: UpdateThreadStateRequest\n\n> **UpdateThreadStateRequest** = \\{ `field`: [`ThreadStateField`](ThreadStateField.md); `value`: `boolean`; \\}\n\nDesired state for every applicable message in an authorized thread.\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-field\"></a> `field` | [`ThreadStateField`](ThreadStateField.md) |\n| <a id=\"property-value\"></a> `value` | `boolean` |\n\n\n<!-- generated/email/types.gen/type-aliases/UserProvider.md -->\n# Type Alias: UserProvider\n\n> **UserProvider** = `\"GMAIL\"` \\| `\"OUTLOOK\"`\n\n\n<!-- generated/email/types.gen/type-aliases/Value.md -->\n# Type Alias: Value\n\n> **Value** = `unknown`\n\n\n<!-- generated/properties/types.gen/type-aliases/BulkUpdateEntityPropertyOptionsResponse.md -->\n# Type Alias: BulkUpdateEntityPropertyOptionsResponse\n\n> **BulkUpdateEntityPropertyOptionsResponse** = \\{ `properties`: [`EntityPropertyOptionSelectionResponse`](EntityPropertyOptionSelectionResponse.md)[]; \\}\n\nResponse for a bulk option update: each property's reconciled final ids.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-properties\"></a> `properties` | [`EntityPropertyOptionSelectionResponse`](EntityPropertyOptionSelectionResponse.md)[] | The final option ids per updated property. |\n\n\n<!-- generated/properties/types.gen/type-aliases/DataType.md -->\n# Type Alias: DataType\n\n> **DataType** = `\"BOOLEAN\"` \\| `\"DATE\"` \\| `\"NUMBER\"` \\| `\"STRING\"` \\| `\"SELECT_NUMBER\"` \\| `\"SELECT_STRING\"` \\| `\"TAG\"` \\| `\"ENTITY\"` \\| `\"LINK\"`\n\nData type for property values, determining storage and validation.\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityProperty.md -->\n# Type Alias: EntityProperty\n\n> **EntityProperty** = \\{ `created_at`: `string`; `entity_id`: `string`; `entity_type`: [`EntityType`](EntityType.md); `id`: `string`; `property_definition_id`: `string`; `updated_at`: `string`; \\}\n\nAssignment of a property definition to a specific entity (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-created_at\"></a> `created_at` | `string` |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` |\n| <a id=\"property-entity_type\"></a> `entity_type` | [`EntityType`](EntityType.md) |\n| <a id=\"property-id\"></a> `id` | `string` |\n| <a id=\"property-property_definition_id\"></a> `property_definition_id` | `string` |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityPropertyOptionSelectionResponse.md -->\n# Type Alias: EntityPropertyOptionSelectionResponse\n\n> **EntityPropertyOptionSelectionResponse** = \\{ `option_ids`: `string`[]; `property_id`: `string`; \\}\n\nThe reconciled final option ids stored for one property after a bulk update.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-option_ids\"></a> `option_ids` | `string`[] | The final option ids the server persisted, in stored order. |\n| <a id=\"property-property_id\"></a> `property_id` | `string` | The property definition the options belong to. |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md -->\n# Type Alias: EntityPropertyWithDefinition\n\n> **EntityPropertyWithDefinition** = \\{ `definition`: [`PropertyDefinition`](PropertyDefinition.md); `options?`: [`PropertyOption`](PropertyOption.md)[] \\| `null`; `property`: [`EntityProperty`](EntityProperty.md); `value?`: `null` \\| [`PropertyValue`](PropertyValue.md); \\}\n\nEntity property with its definition, value, and options (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-definition\"></a> `definition` | [`PropertyDefinition`](PropertyDefinition.md) |\n| <a id=\"property-options\"></a> `options?` | [`PropertyOption`](PropertyOption.md)[] \\| `null` |\n| <a id=\"property-property\"></a> `property` | [`EntityProperty`](EntityProperty.md) |\n| <a id=\"property-value\"></a> `value?` | `null` \\| [`PropertyValue`](PropertyValue.md) |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityReference.md -->\n# Type Alias: EntityReference\n\n> **EntityReference** = \\{ `entity_id`: `string`; `entity_type`: [`EntityType`](EntityType.md); `specific_message_id?`: `string` \\| `null`; \\}\n\nEntity reference for entity-type property values.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | - |\n| <a id=\"property-entity_type\"></a> `entity_type` | [`EntityType`](EntityType.md) | - |\n| <a id=\"property-specific_message_id\"></a> `specific_message_id?` | `string` \\| `null` | For CHANNEL, CHAT, THREAD entity types - optional specific message ID. This allows referencing a specific message within a thread/channel/chat. |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityType.md -->\n# Type Alias: EntityType\n\n> **EntityType** = `\"CALENDAR_EVENT\"` \\| `\"CALL_RECORD\"` \\| `\"CHANNEL\"` \\| `\"CHAT\"` \\| `\"COMPANY\"` \\| `\"DATABASE_ROW\"` \\| `\"CONTACT\"` \\| `\"DOCUMENT\"` \\| `\"INITIATIVE\"` \\| `\"PROJECT\"` \\| `\"TASK\"` \\| `\"THREAD\"` \\| `\"USER\"`\n\nType of entity that can be referenced by entity properties.\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyDefinition.md -->\n# Type Alias: PropertyDefinition\n\n> **PropertyDefinition** = \\{ `created_at`: `string`; `data_type`: [`DataType`](DataType.md); `display_name`: `string`; `id`: `string`; `is_metadata`: `boolean`; `is_multi_select`: `boolean`; `is_system`: `boolean`; `owner`: [`PropertyOwner`](PropertyOwner.md); `specific_entity_type`: `null` \\| [`EntityType`](EntityType.md); `updated_at`: `string`; \\}\n\nProperty definition model (service representation).\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | - |\n| <a id=\"property-data_type\"></a> `data_type` | [`DataType`](DataType.md) | - |\n| <a id=\"property-display_name\"></a> `display_name` | `string` | - |\n| <a id=\"property-id\"></a> `id` | `string` | - |\n| <a id=\"property-is_metadata\"></a> `is_metadata` | `boolean` | Flag to indicate if this is a system-generated metadata property. Not stored in database - computed at service layer. |\n| <a id=\"property-is_multi_select\"></a> `is_multi_select` | `boolean` | - |\n| <a id=\"property-is_system\"></a> `is_system` | `boolean` | Flag to indicate if this is a system property (stored in DB). |\n| <a id=\"property-owner\"></a> `owner` | [`PropertyOwner`](PropertyOwner.md) | - |\n| <a id=\"property-specific_entity_type\"></a> `specific_entity_type` | `null` \\| [`EntityType`](EntityType.md) | - |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` | - |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyOption.md -->\n# Type Alias: PropertyOption\n\n> **PropertyOption** = \\{ `color`: `string` \\| `null`; `created_at`: `string`; `display_order`: `number`; `id`: `string`; `property_definition_id`: `string`; `updated_at`: `string`; `value`: [`PropertyOptionValue`](PropertyOptionValue.md); \\}\n\nA selectable option for select-type properties (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-color\"></a> `color` | `string` \\| `null` |\n| <a id=\"property-created_at\"></a> `created_at` | `string` |\n| <a id=\"property-display_order\"></a> `display_order` | `number` |\n| <a id=\"property-id\"></a> `id` | `string` |\n| <a id=\"property-property_definition_id\"></a> `property_definition_id` | `string` |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` |\n| <a id=\"property-value\"></a> `value` | [`PropertyOptionValue`](PropertyOptionValue.md) |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyOptionValue.md -->\n# Type Alias: PropertyOptionValue\n\n> **PropertyOptionValue** = \\{ `type`: `\"string\"`; `value`: `string`; \\} \\| \\{ `type`: `\"number\"`; `value`: `number`; \\}\n\nThe value of a property option - either a string or a number.\n\n## Union Members\n\n### Type Literal\n\n\\{ `type`: `\"string\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"string\"` | - |\n| `value` | `string` | String value for SelectString properties |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"number\"`; `value`: `number`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"number\"` | - |\n| `value` | `number` | Number value for SelectNumber properties |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyOwner.md -->\n# Type Alias: PropertyOwner\n\n> **PropertyOwner** = \\{ `scope`: `\"user\"`; `user_id`: `string`; \\} \\| \\{ `scope`: `\"team\"`; `team_id`: `string`; \\} \\| \\{ `database_id`: `string`; `scope`: `\"database\"`; \\} \\| \\{ `scope`: `\"system\"`; \\}\n\nDefines who owns a property - user-scoped, team-scoped, database-scoped, or system.\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyTargetEntityType.md -->\n# Type Alias: PropertyTargetEntityType\n\n> **PropertyTargetEntityType** = `\"CALL_RECORD\"` \\| `\"CHANNEL\"` \\| `\"CHAT\"` \\| `\"COMPANY\"` \\| `\"DATABASE_ROW\"` \\| `\"DOCUMENT\"` \\| `\"INITIATIVE\"` \\| `\"PROJECT\"` \\| `\"THREAD\"` \\| `\"USER\"`\n\nCanonical type of an entity receiving properties.\n\nTasks are documents at API boundaries. `Task` intentionally does not exist\nhere; task classification is resolved by the properties domain from the\ndocument subtype.\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyTargetReference.md -->\n# Type Alias: PropertyTargetReference\n\n> **PropertyTargetReference** = \\{ `entity_id`: `string`; `entity_type`: [`PropertyTargetEntityType`](PropertyTargetEntityType.md); \\}\n\nCanonical reference to an entity receiving properties.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | Entity identifier. |\n| <a id=\"property-entity_type\"></a> `entity_type` | [`PropertyTargetEntityType`](PropertyTargetEntityType.md) | Canonical entity type. |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyValue.md -->\n# Type Alias: PropertyValue\n\n> **PropertyValue** = \\{ `type`: `\"Boolean\"`; `value`: `boolean`; \\} \\| \\{ `type`: `\"Number\"`; `value`: `number`; \\} \\| \\{ `type`: `\"String\"`; `value`: `string`; \\} \\| \\{ `type`: `\"Date\"`; `value`: `string`; \\} \\| \\{ `type`: `\"SelectOption\"`; `value`: `string`[]; \\} \\| \\{ `type`: `\"EntityReference\"`; `value`: [`EntityReference`](EntityReference.md)[]; \\} \\| \\{ `type`: `\"Link\"`; `value`: `string`[]; \\}\n\nProperty value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to/from JSONB in the database.\n\n## Union Members\n\n### Type Literal\n\n\\{ `type`: `\"Boolean\"`; `value`: `boolean`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Boolean\"` | - |\n| `value` | `boolean` | Boolean value Serializes as: {\"type\": \"Boolean\", \"value\": true} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"Number\"`; `value`: `number`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Number\"` | - |\n| `value` | `number` | Numeric value Serializes as: {\"type\": \"Number\", \"value\": 42.5} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"String\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"String\"` | - |\n| `value` | `string` | String value Serializes as: {\"type\": \"String\", \"value\": \"text\"} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"Date\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Date\"` | - |\n| `value` | `string` | Date/timestamp value Serializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"SelectOption\"`; `value`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"SelectOption\"` | - |\n| `value` | `string`[] | Select option(s) - always an array (check is_multi_select to determine if single or multi) Single-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1) Multi-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+) |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"EntityReference\"`; `value`: [`EntityReference`](EntityReference.md)[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"EntityReference\"` | - |\n| `value` | [`EntityReference`](EntityReference.md)[] | Entity reference(s) - always an array (check is_multi_select to determine if single or multi) Single-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1) Multi-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+) |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"Link\"`; `value`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Link\"` | - |\n| `value` | `string`[] | Link value(s) - always an array (check is_multi_select to determine if single or multi) Single-select: {\"type\": \"Link\", \"value\": [\"https://example.com\"]} (length 0 or 1) Multi-select: {\"type\": \"Link\", \"value\": [\"https://example.com\", \"https://other.com\"]} (length 0+) |\n\n\n<!-- generated/properties/types.gen/type-aliases/SetPropertyValue.md -->\n# Type Alias: SetPropertyValue\n\n> **SetPropertyValue** = \\{ `type`: `\"boolean\"`; `value`: `boolean`; \\} \\| \\{ `type`: `\"date\"`; `value`: `string`; \\} \\| \\{ `type`: `\"number\"`; `value`: `number`; \\} \\| \\{ `type`: `\"string\"`; `value`: `string`; \\} \\| \\{ `option_id`: `string`; `type`: `\"select_option\"`; \\} \\| \\{ `option_ids`: `string`[]; `type`: `\"multi_select_option\"`; \\} \\| \\{ `reference`: [`EntityReference`](EntityReference.md); `type`: `\"entity_reference\"`; \\} \\| \\{ `references`: [`EntityReference`](EntityReference.md)[]; `type`: `\"multi_entity_reference\"`; \\} \\| \\{ `type`: `\"link\"`; `url`: `string`; \\} \\| \\{ `type`: `\"multi_link\"`; `urls`: `string`[]; \\}\n\nType-safe enum for setting entity property values - provides compile-time validation.\n\n\n<!-- generated/storage/types.gen/type-aliases/AccessLevel.md -->\n# Type Alias: AccessLevel\n\n> **AccessLevel** = `\"view\"` \\| `\"comment\"` \\| `\"edit\"` \\| `\"owner\"`\n\nOrdered from least to most access top -> bottom\n\n\n<!-- generated/storage/types.gen/type-aliases/EmailFollowup.md -->\n# Type Alias: EmailFollowup\n\n> **EmailFollowup** = \\{ `condition`: [`EmailReminderCondition`](EmailReminderCondition.md); `linkId`: `string`; `remindAt`: `string`; `reminderId`: `string`; `revision`: `string`; `state`: [`FollowupState`](FollowupState.md); `threadId`: `string`; \\}\n\nPublic status shown on email and in the Reminders editor.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-condition\"></a> `condition` | [`EmailReminderCondition`](EmailReminderCondition.md) | Condition, defaulting to no reply for new follow-ups. |\n| <a id=\"property-linkid\"></a> `linkId` | `string` | Canonical owned/delegated inbox. |\n| <a id=\"property-remindat\"></a> `remindAt` | `string` | Confirmed schedule. |\n| <a id=\"property-reminderid\"></a> `reminderId` | `string` | Identity of the snooze and its delivery records. |\n| <a id=\"property-revision\"></a> `revision` | `string` | Last accepted operation; edits/removal compare this to prevent stale undo. |\n| <a id=\"property-state\"></a> `state` | [`FollowupState`](FollowupState.md) | Durable lifecycle progress. |\n| <a id=\"property-threadid\"></a> `threadId` | `string` | Conversation identity. |\n\n\n<!-- generated/storage/types.gen/type-aliases/EmailFollowupCommand.md -->\n# Type Alias: EmailFollowupCommand\n\n> **EmailFollowupCommand** = \\{ `condition`: [`EmailReminderCondition`](EmailReminderCondition.md); `expectedRevision?`: `string` \\| `null`; `operationId`: `string`; `remindAt`: `string`; `type`: `\"set\"`; \\} \\| \\{ `expectedRevision`: `string`; `operationId`: `string`; `type`: `\"remove\"`; `undo?`: `boolean`; \\}\n\nIdempotent email command. Reusing an operation ID with different data fails.\n\n## Union Members\n\n### Type Literal\n\n\\{ `condition`: [`EmailReminderCondition`](EmailReminderCondition.md); `expectedRevision?`: `string` \\| `null`; `operationId`: `string`; `remindAt`: `string`; `type`: `\"set\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `condition` | [`EmailReminderCondition`](EmailReminderCondition.md) | Reply condition. |\n| `expectedRevision?` | `string` \\| `null` | None for creation, the current revision for edits. |\n| `operationId` | `string` | Unique request identity retained across network retries. |\n| `remindAt` | `string` | One future instant; conditional recurrence is deliberately absent. |\n| `type` | `\"set\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `expectedRevision`: `string`; `operationId`: `string`; `type`: `\"remove\"`; `undo?`: `boolean`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `expectedRevision` | `string` | Reject removal if a newer edit has replaced this operation. |\n| `operationId` | `string` | Unique request identity. |\n| `type` | `\"remove\"` | - |\n| `undo?` | `boolean` | Undo restores original visibility; ordinary Remove returns to inbox. |\n\n\n<!-- generated/storage/types.gen/type-aliases/EmailFollowupResponse.md -->\n# Type Alias: EmailFollowupResponse\n\n> **EmailFollowupResponse** = \\{ `followup?`: `null` \\| [`EmailFollowup`](EmailFollowup.md); \\}\n\nLookup response, including an email with no follow-up yet.\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-followup\"></a> `followup?` | `null` \\| [`EmailFollowup`](EmailFollowup.md) |\n\n\n<!-- generated/storage/types.gen/type-aliases/EmailReminderCondition.md -->\n# Type Alias: EmailReminderCondition\n\n> **EmailReminderCondition** = `\"if_no_reply\"` \\| `\"regardless\"`\n\nWhen an email follow-up should return the conversation.\n\n\n<!-- generated/storage/types.gen/type-aliases/EntityPermission.md -->\n# Type Alias: EntityPermission\n\n> **EntityPermission** = \\{ `access_level`: [`AccessLevel`](AccessLevel.md); `type`: `\"access_level\"`; \\} \\| \\{ `type`: `\"channel_view_only\"`; \\} \\| \\{ `role`: [`ParticipantRole`](ParticipantRole.md); `type`: `\"channel_role\"`; \\} \\| \\{ `role`: [`TeamRole`](TeamRole.md); `type`: `\"team_role\"`; \\}\n\nA user's permission for an entity, discriminated by entity kind.\n\nItems (documents, chats, projects, threads) use access levels.\nChannels use view-only permission or participant roles.\n\n## Union Members\n\n### Type Literal\n\n\\{ `access_level`: [`AccessLevel`](AccessLevel.md); `type`: `\"access_level\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `access_level` | [`AccessLevel`](AccessLevel.md) | The access level the user has. |\n| `type` | `\"access_level\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"channel_view_only\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `role`: [`ParticipantRole`](ParticipantRole.md); `type`: `\"channel_role\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `role` | [`ParticipantRole`](ParticipantRole.md) | The role the user has in the channel. |\n| `type` | `\"channel_role\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `role`: [`TeamRole`](TeamRole.md); `type`: `\"team_role\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `role` | [`TeamRole`](TeamRole.md) | The role the user has in the team. |\n| `type` | `\"team_role\"` | - |\n\n\n<!-- generated/storage/types.gen/type-aliases/FollowupState.md -->\n# Type Alias: FollowupState\n\n> **FollowupState** = `\"archiving\"` \\| `\"pending\"` \\| `\"returning\"` \\| `\"returned\"` \\| `\"cancelled\"` \\| `\"removed\"`\n\nDurable progress of an email operation.\n\n\n<!-- generated/storage/types.gen/type-aliases/ParticipantRole.md -->\n# Type Alias: ParticipantRole\n\n> **ParticipantRole** = `\"owner\"` \\| `\"admin\"` \\| `\"member\"`\n\nThe role a user has within a channel.\n\n\n<!-- generated/storage/types.gen/type-aliases/TeamRole.md -->\n# Type Alias: TeamRole\n\n> **TeamRole** = `\"member\"` \\| `\"admin\"` \\| `\"owner\"`\n\nThe role a user has within a team.\n\nOrdered least to most privileged so comparisons reflect access strength.\n\n\n<!-- src/entities/email/attachment/classes/EmailAttachment.md -->\n# Class: EmailAttachment\n\nA file attached to an email message. A thin handle keyed by attachment id;\nthe record loads lazily on first field access.\n\n## Extends\n\n- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\\<[`EmailAttachmentData`](../type-aliases/EmailAttachmentData.md)\\>\n\n## Properties\n\n| Property | Modifier | Type | Description | Inherited from |\n| ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-contentid\"></a> `contentId` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | The attachment's Content-ID header value (for inline attachments). | - |\n| <a id=\"property-dataurl\"></a> `dataUrl` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | A URL to the attachment's raw data, when available. | - |\n| <a id=\"property-filename\"></a> `filename` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | The attachment's original filename. | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |\n| <a id=\"property-mimetype\"></a> `mimeType` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | The attachment's MIME type. | - |\n| <a id=\"property-sfsid\"></a> `sfsId` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | The attachment's static-file-service id, when it has been stored there. | - |\n| <a id=\"property-size\"></a> `size` | `readonly` | () => `Promise`\\<`number` \\| `undefined`\\> | The attachment's size in bytes. | - |\n\n## Methods\n\n### toDocument()\n\n> **toDocument**(): `Promise`\\<[`Document`](../../../documents/document/classes/Document.md)\\>\n\nThe Macro document holding this attachment's content. Get-or-create: the\nserver returns the existing document's id, or downloads the attachment\nfrom the provider and uploads it as a new document first (deduplicated\nbehind a server-side lock).\n\n#### Returns\n\n`Promise`\\<[`Document`](../../../documents/document/classes/Document.md)\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`Attachment`](../../../../../generated/email/types.gen/type-aliases/Attachment.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`Attachment`](../../../../../generated/email/types.gen/type-aliases/Attachment.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`Attachment`](../../../../../generated/email/types.gen/type-aliases/Attachment.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `id`): `EmailAttachment`\n\nA handle to an attachment by id. Fields load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `id` | `string` |\n\n#### Returns\n\n`EmailAttachment`\n\n***\n\n### from()\n\n> `static` **from**(`client`, `data`): `EmailAttachment`\n\nBuild an attachment from an already-fetched record (pre-seeded, no fetch).\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `data` | [`Attachment`](../../../../../generated/email/types.gen/type-aliases/Attachment.md) |\n\n#### Returns\n\n`EmailAttachment`\n\n\n<!-- src/entities/email/attachment/type-aliases/EmailAttachmentData.md -->\n# Type Alias: EmailAttachmentData\n\n> **EmailAttachmentData** = [`GetAttachmentResponses`](../../../../../generated/email/types.gen/type-aliases/GetAttachmentResponses.md)\\[`200`\\]\\[`\"attachment\"`\\]\n\nThe API's representation of an email attachment (`Attachment`).\n\n\n<!-- src/entities/email/draft/classes/DraftAttachment.md -->\n# Class: DraftAttachment\n\nAn uploaded or forwarded attachment belonging to a draft.\n\n## Properties\n\n| Property | Modifier | Type | Description |\n| ------ | ------ | ------ | ------ |\n| <a id=\"property-draft\"></a> `draft` | `readonly` | [`EmailDraft`](EmailDraft.md) | Parent draft. |\n| <a id=\"property-forwarded\"></a> `forwarded` | `readonly` | `boolean` | Whether this attachment was forwarded. |\n| <a id=\"property-id\"></a> `id` | `readonly` | `string` | Attachment identity. |\n\n## Methods\n\n### complete()\n\n> **complete**(): `Promise`\\<`void`\\>\n\nComplete verification after uploading the file.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### remove()\n\n> **remove**(): `Promise`\\<`void`\\>\n\nRemove this attachment from its draft.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `draftId`: `string`; `forwarded`: `boolean`; `id`: `string`; \\}\n\nSerialize identity without credentials.\n\n#### Returns\n\n\\{ `draftId`: `string`; `forwarded`: `boolean`; `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `draftId` | `string` |\n| `forwarded` | `boolean` |\n| `id` | `string` |\n\n***\n\n### byId()\n\n> `static` **byId**(`_client`, `draft`, `id`, `forwarded?`): `DraftAttachment`\n\nConstruct a draft scoped attachment handle.\n\n#### Parameters\n\n| Parameter | Type | Default value |\n| ------ | ------ | ------ |\n| `_client` | `MacroClient` | `undefined` |\n| `draft` | [`EmailDraft`](EmailDraft.md) | `undefined` |\n| `id` | `string` | `undefined` |\n| `forwarded?` | `boolean` | `false` |\n\n#### Returns\n\n`DraftAttachment`\n\n\n<!-- src/entities/email/draft/classes/EmailDraft.md -->\n# Class: EmailDraft\n\nA draft email. Sending remains an explicit separate operation.\n\n## Extends\n\n- [`EmailMessage`](../../message/classes/EmailMessage.md)\n\n## Properties\n\n| Property | Modifier | Type | Description | Inherited from |\n| ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-bcc\"></a> `bcc` | `readonly` | () => `Promise`\\<[`ContactInfo`](../../../../../generated/email/types.gen/type-aliases/ContactInfo.md)[]\\> | The Bcc recipients. | [`EmailMessage`](../../message/classes/EmailMessage.md).[`bcc`](../../message/classes/EmailMessage.md#property-bcc) |\n| <a id=\"property-body\"></a> `body` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | The parsed message body, as the API returns it. | [`EmailMessage`](../../message/classes/EmailMessage.md).[`body`](../../message/classes/EmailMessage.md#property-body) |\n| <a id=\"property-cc\"></a> `cc` | `readonly` | () => `Promise`\\<[`ContactInfo`](../../../../../generated/email/types.gen/type-aliases/ContactInfo.md)[]\\> | The Cc recipients. | [`EmailMessage`](../../message/classes/EmailMessage.md).[`cc`](../../message/classes/EmailMessage.md#property-cc) |\n| <a id=\"property-from\"></a> `from` | `readonly` | () => `Promise`\\<[`ContactInfo`](../../../../../generated/email/types.gen/type-aliases/ContactInfo.md) \\| `undefined`\\> | The sender. | [`EmailMessage`](../../message/classes/EmailMessage.md).[`from`](../../message/classes/EmailMessage.md#property-from) |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | - | [`EmailMessage`](../../message/classes/EmailMessage.md).[`id`](../../message/classes/EmailMessage.md#property-id) |\n| <a id=\"property-labels\"></a> `labels` | `readonly` | () => `Promise`\\<[`LabelInfo`](../../../../../generated/email/types.gen/type-aliases/LabelInfo.md)[]\\> | Labels on this message. | [`EmailMessage`](../../message/classes/EmailMessage.md).[`labels`](../../message/classes/EmailMessage.md#property-labels) |\n| <a id=\"property-link\"></a> `link` | `readonly` | () => `Promise`\\<[`Link`](../../link/classes/Link.md)\\> | The inbox (email link) this message belongs to. | [`EmailMessage`](../../message/classes/EmailMessage.md).[`link`](../../message/classes/EmailMessage.md#property-link) |\n| <a id=\"property-sentat\"></a> `sentAt` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | The provider-internal date of the message. | [`EmailMessage`](../../message/classes/EmailMessage.md).[`sentAt`](../../message/classes/EmailMessage.md#property-sentat) |\n| <a id=\"property-subject\"></a> `subject` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | The message's subject line. | [`EmailMessage`](../../message/classes/EmailMessage.md).[`subject`](../../message/classes/EmailMessage.md#property-subject) |\n| <a id=\"property-to\"></a> `to` | `readonly` | () => `Promise`\\<[`ContactInfo`](../../../../../generated/email/types.gen/type-aliases/ContactInfo.md)[]\\> | The To recipients. | [`EmailMessage`](../../message/classes/EmailMessage.md).[`to`](../../message/classes/EmailMessage.md#property-to) |\n\n## Methods\n\n### addAttachment()\n\n> **addAttachment**(`options`): `Promise`\\<\\{ `attachment`: [`DraftAttachment`](DraftAttachment.md); `contentType`: `string`; `uploadUrl`: `string`; \\}\\>\n\nReserve an attachment upload. Upload to the returned URL, then call complete().\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | \\{ `fileName`: `string`; `sha`: `string`; `size`: `number`; `uploadId?`: `string`; \\} |\n| `options.fileName` | `string` |\n| `options.sha` | `string` |\n| `options.size` | `number` |\n| `options.uploadId?` | `string` |\n\n#### Returns\n\n`Promise`\\<\\{ `attachment`: [`DraftAttachment`](DraftAttachment.md); `contentType`: `string`; `uploadUrl`: `string`; \\}\\>\n\n***\n\n### addLabel()\n\n> **addLabel**(`label`): `Promise`\\<`void`\\>\n\nAdd a label to this message.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `label` | [`Label`](../../label/classes/Label.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n#### Inherited from\n\n[`EmailMessage`](../../message/classes/EmailMessage.md).[`addLabel`](../../message/classes/EmailMessage.md#addlabel)\n\n***\n\n### completeDraftAttachment()\n\n> **completeDraftAttachment**(`attachmentId`): `Promise`\\<`void`\\>\n\nVerify an uploaded draft attachment before it can be sent.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `attachmentId` | `string` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n#### Inherited from\n\n[`EmailMessage`](../../message/classes/EmailMessage.md).[`completeDraftAttachment`](../../message/classes/EmailMessage.md#completedraftattachment)\n\n***\n\n### delete()\n\n> **delete**(): `Promise`\\<`void`\\>\n\nDelete the draft.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### forwardAttachment()\n\n> **forwardAttachment**(`attachment`): `Promise`\\<[`DraftAttachment`](DraftAttachment.md)\\>\n\nForward an existing attachment into this draft.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `attachment` | [`EmailAttachment`](../../attachment/classes/EmailAttachment.md) |\n\n#### Returns\n\n`Promise`\\<[`DraftAttachment`](DraftAttachment.md)\\>\n\n***\n\n### operationStatus()\n\n> **operationStatus**(): `Promise`\\<[`MessageOperationResponse`](../../../../../generated/email/types.gen/type-aliases/MessageOperationResponse.md)\\>\n\nRead the draft's durable send, upload, or conflict status without retrying it.\n\n#### Returns\n\n`Promise`\\<[`MessageOperationResponse`](../../../../../generated/email/types.gen/type-aliases/MessageOperationResponse.md)\\>\n\n#### Inherited from\n\n[`EmailMessage`](../../message/classes/EmailMessage.md).[`operationStatus`](../../message/classes/EmailMessage.md#operationstatus)\n\n***\n\n### removeAttachment()\n\n> **removeAttachment**(`attachment`): `Promise`\\<`void`\\>\n\nRemove a draft attachment.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `attachment` | [`DraftAttachment`](DraftAttachment.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### removeLabel()\n\n> **removeLabel**(`label`): `Promise`\\<`void`\\>\n\nRemove a label from this message.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `label` | [`Label`](../../label/classes/Label.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n#### Inherited from\n\n[`EmailMessage`](../../message/classes/EmailMessage.md).[`removeLabel`](../../message/classes/EmailMessage.md#removelabel)\n\n***\n\n### resolveOperation()\n\n> **resolveOperation**(`request`): `Promise`\\<`void`\\>\n\nResolve the displayed operation revision after the user chooses an action.\nRetrying an uncertain send requires explicit duplicate-risk acceptance.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `request` | [`ResolveMessageOperationRequest`](../../../../../generated/email/types.gen/type-aliases/ResolveMessageOperationRequest.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n#### Inherited from\n\n[`EmailMessage`](../../message/classes/EmailMessage.md).[`resolveOperation`](../../message/classes/EmailMessage.md#resolveoperation)\n\n***\n\n### schedule()\n\n> **schedule**(`sendTime`, `options?`): `Promise`\\<`void`\\>\n\nSchedule this draft for sending.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `sendTime` | `string` |\n| `options?` | \\{ `includeSignature?`: `boolean`; \\} |\n| `options.includeSignature?` | `boolean` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### thread()\n\n> **thread**(): `Promise`\\<[`EmailThread`](../../thread/classes/EmailThread.md)\\>\n\nThe thread this message belongs to.\n\n#### Returns\n\n`Promise`\\<[`EmailThread`](../../thread/classes/EmailThread.md)\\>\n\n#### Inherited from\n\n[`EmailMessage`](../../message/classes/EmailMessage.md).[`thread`](../../message/classes/EmailMessage.md#thread)\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`ParsedMessage`](../../../../../generated/email/types.gen/type-aliases/ParsedMessage.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`ParsedMessage`](../../../../../generated/email/types.gen/type-aliases/ParsedMessage.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`ParsedMessage`](../../../../../generated/email/types.gen/type-aliases/ParsedMessage.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`EmailMessage`](../../message/classes/EmailMessage.md).[`toJSON`](../../message/classes/EmailMessage.md#tojson)\n\n***\n\n### transferDraft()\n\n> **transferDraft**(`request`): `Promise`\\<[`TransferDraftResponse`](../../../../../generated/email/types.gen/type-aliases/TransferDraftResponse.md)\\>\n\nMove a draft to another inbox using a caller-persisted operation UUID.\nContinue editing the returned message_id; the original identity is retired.\nOn an interrupted response, use email.recoverDraftTransfer(operation_id).\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `request` | [`TransferDraftRequest`](../../../../../generated/email/types.gen/type-aliases/TransferDraftRequest.md) |\n\n#### Returns\n\n`Promise`\\<[`TransferDraftResponse`](../../../../../generated/email/types.gen/type-aliases/TransferDraftResponse.md)\\>\n\n#### Inherited from\n\n[`EmailMessage`](../../message/classes/EmailMessage.md).[`transferDraft`](../../message/classes/EmailMessage.md#transferdraft)\n\n***\n\n### unschedule()\n\n> **unschedule**(): `Promise`\\<`void`\\>\n\nRemove a scheduled send.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### update()\n\n> **update**(`options`): `Promise`\\<`void`\\>\n\nReplace draft content without changing its identity or sending it.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | [`DraftOptions`](../type-aliases/DraftOptions.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### verifyAttachment()\n\n> **verifyAttachment**(`attachment`): `Promise`\\<`void`\\>\n\nComplete verification of an uploaded attachment.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `attachment` | [`DraftAttachment`](DraftAttachment.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `id`): `EmailDraft`\n\nConstruct a lazy draft handle.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `id` | `string` |\n\n#### Returns\n\n`EmailDraft`\n\n#### Overrides\n\n[`EmailMessage`](../../message/classes/EmailMessage.md).[`byId`](../../message/classes/EmailMessage.md#byid)\n\n***\n\n### from()\n\n> `static` **from**(`client`, `data`): [`EmailMessage`](../../message/classes/EmailMessage.md)\n\nBuild a message from an already-fetched record (pre-seeded, no fetch).\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `data` | [`ParsedMessage`](../../../../../generated/email/types.gen/type-aliases/ParsedMessage.md) |\n\n#### Returns\n\n[`EmailMessage`](../../message/classes/EmailMessage.md)\n\n#### Inherited from\n\n[`EmailMessage`](../../message/classes/EmailMessage.md).[`from`](../../message/classes/EmailMessage.md#from)\n\n***\n\n### send()\n\n> `static` **send**(`client`, `opts`): `Promise`\\<[`EmailMessage`](../../message/classes/EmailMessage.md) \\| `undefined`\\>\n\nSend a new email message. Returns a handle when the API reports the created message's id.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `opts` | [`SendEmailOptions`](../../message/interfaces/SendEmailOptions.md) |\n\n#### Returns\n\n`Promise`\\<[`EmailMessage`](../../message/classes/EmailMessage.md) \\| `undefined`\\>\n\n#### Inherited from\n\n[`EmailMessage`](../../message/classes/EmailMessage.md).[`send`](../../message/classes/EmailMessage.md#send)\n\n\n<!-- src/entities/email/draft/functions/draftBody.md -->\n# Function: draftBody()\n\n> **draftBody**(`options`): [`ApiDraftInput`](../../../../../generated/email/types.gen/type-aliases/ApiDraftInput.md)\n\nTranslate draft content to the generated contract.\n\n## Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | [`DraftOptions`](../type-aliases/DraftOptions.md) |\n\n## Returns\n\n[`ApiDraftInput`](../../../../../generated/email/types.gen/type-aliases/ApiDraftInput.md)\n\n\n<!-- src/entities/email/draft/type-aliases/DraftOptions.md -->\n# Type Alias: DraftOptions\n\n> **DraftOptions** = `Omit`\\<[`ApiDraftInput`](../../../../../generated/email/types.gen/type-aliases/ApiDraftInput.md), `\"db_id\"` \\| `\"provider_id\"` \\| `\"provider_thread_id\"` \\| `\"replying_to_id\"` \\| `\"thread_db_id\"` \\| `\"body_text\"` \\| `\"body_html\"` \\| `\"body_macro\"` \\| `\"headers_json\"` \\| `\"include_signature\"`\\> & \\{ `bodyHtml?`: `string`; `bodyMacro?`: `string`; `bodyText?`: `string`; `headers?`: [`ApiDraftInput`](../../../../../generated/email/types.gen/type-aliases/ApiDraftInput.md)\\[`\"headers_json\"`\\]; `includeSignature?`: `boolean`; `replyingTo?`: [`EmailMessage`](../../message/classes/EmailMessage.md); `thread?`: [`EmailThread`](../../thread/classes/EmailThread.md); \\}\n\nDraft content; relationships use message and thread handles.\n\n## Type Declaration\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `bodyHtml?` | `string` | HTML body. |\n| `bodyMacro?` | `string` | Macro body. |\n| `bodyText?` | `string` | Plain text body. |\n| `headers?` | [`ApiDraftInput`](../../../../../generated/email/types.gen/type-aliases/ApiDraftInput.md)\\[`\"headers_json\"`\\] | Extra headers. |\n| `includeSignature?` | `boolean` | Include the inbox signature. |\n| `replyingTo?` | [`EmailMessage`](../../message/classes/EmailMessage.md) | Message being replied to. |\n| `thread?` | [`EmailThread`](../../thread/classes/EmailThread.md) | Thread receiving this draft. |\n\n\n<!-- src/entities/email/filter/classes/EmailFilter.md -->\n# Class: EmailFilter\n\nAn importance filter matched by sender address or domain.\n\n## Extends\n\n- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\\<[`ApiEmailFilter`](../../../../../generated/email/types.gen/type-aliases/ApiEmailFilter.md)\\>\n\n## Properties\n\n| Property | Modifier | Type | Description | Inherited from |\n| ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-emailaddress\"></a> `emailAddress` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | Matched address. | - |\n| <a id=\"property-emaildomain\"></a> `emailDomain` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | Matched domain. | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |\n| <a id=\"property-isimportant\"></a> `isImportant` | `readonly` | () => `Promise`\\<`boolean`\\> | Importance assigned by this filter. | - |\n\n## Methods\n\n### delete()\n\n> **delete**(): `Promise`\\<`void`\\>\n\nDelete this filter.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### setImportant()\n\n> **setImportant**(`isImportant`): `Promise`\\<`void`\\>\n\nChange the importance for the same sender selector.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `isImportant` | `boolean` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`ApiEmailFilter`](../../../../../generated/email/types.gen/type-aliases/ApiEmailFilter.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`ApiEmailFilter`](../../../../../generated/email/types.gen/type-aliases/ApiEmailFilter.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`ApiEmailFilter`](../../../../../generated/email/types.gen/type-aliases/ApiEmailFilter.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `id`, `inbox?`): `EmailFilter`\n\nConstruct a lazy filter handle.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `id` | `string` |\n| `inbox?` | [`Link`](../../link/classes/Link.md) |\n\n#### Returns\n\n`EmailFilter`\n\n***\n\n### from()\n\n> `static` **from**(`client`, `record`, `inbox?`): `EmailFilter`\n\nSeed from a server record.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `record` | [`ApiEmailFilter`](../../../../../generated/email/types.gen/type-aliases/ApiEmailFilter.md) |\n| `inbox?` | [`Link`](../../link/classes/Link.md) |\n\n#### Returns\n\n`EmailFilter`\n\n\n<!-- src/entities/email/filter/interfaces/EmailFilterOptions.md -->\n# Interface: EmailFilterOptions\n\nSender importance rule.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-emailaddress\"></a> `emailAddress?` | `string` | Match an address. |\n| <a id=\"property-emaildomain\"></a> `emailDomain?` | `string` | Match a domain. |\n| <a id=\"property-isimportant\"></a> `isImportant` | `boolean` | Whether matches are important. |\n\n\n<!-- src/entities/email/label/classes/Label.md -->\n# Class: Label\n\nAn email label. A free-to-construct handle: there is no single-label GET,\nso the detail record loads lazily on first field access by listing all\nlabels and finding this one (mirroring Link).\n\n## Extends\n\n- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\\<[`ApiLabel`](../../../../../generated/email/types.gen/type-aliases/ApiLabel.md)\\>\n\n## Properties\n\n| Property | Modifier | Type | Description | Inherited from |\n| ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-createdat\"></a> `createdAt` | `readonly` | () => `Promise`\\<`string`\\> | When the label was created. | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |\n| <a id=\"property-labellistvisibility\"></a> `labelListVisibility` | `readonly` | () => `Promise`\\<[`ApiLabelListVisibility`](../../../../../generated/email/types.gen/type-aliases/ApiLabelListVisibility.md)\\> | Whether the label is shown in the label list. | - |\n| <a id=\"property-linkid\"></a> `linkId` | `readonly` | () => `Promise`\\<`string`\\> | The inbox (email link) this label belongs to. | - |\n| <a id=\"property-messagelistvisibility\"></a> `messageListVisibility` | `readonly` | () => `Promise`\\<[`ApiMessageListVisibility`](../../../../../generated/email/types.gen/type-aliases/ApiMessageListVisibility.md)\\> | Whether the label is shown in the message list. | - |\n| <a id=\"property-name\"></a> `name` | `readonly` | () => `Promise`\\<`string`\\> | The label's display name. | - |\n| <a id=\"property-type\"></a> `type` | `readonly` | () => `Promise`\\<[`ApiLabelType`](../../../../../generated/email/types.gen/type-aliases/ApiLabelType.md)\\> | Whether this is a system label or a user-created one. | - |\n\n## Methods\n\n### delete()\n\n> **delete**(): `Promise`\\<`void`\\>\n\nDelete this label.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`ApiLabel`](../../../../../generated/email/types.gen/type-aliases/ApiLabel.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`ApiLabel`](../../../../../generated/email/types.gen/type-aliases/ApiLabel.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`ApiLabel`](../../../../../generated/email/types.gen/type-aliases/ApiLabel.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `id`): `Label`\n\nA handle to a label by id. Details load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `id` | `string` |\n\n#### Returns\n\n`Label`\n\n***\n\n### create()\n\n> `static` **create**(`client`, `name`): `Promise`\\<`Label`\\>\n\nCreate a user label.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `name` | `string` |\n\n#### Returns\n\n`Promise`\\<`Label`\\>\n\n***\n\n### list()\n\n> `static` **list**(`client`): `Promise`\\<`Label`[]\\>\n\nAll labels across the user's inboxes.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`Promise`\\<`Label`[]\\>\n\n\n<!-- src/entities/email/link/classes/Link.md -->\n# Class: Link\n\nAn email link: a connected inbox (e.g. Gmail or Outlook) that threads and\nmessages sync through. A free-to-construct handle, resolved from the\ncaller's connected links.\n\n## Extends\n\n- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\\<[`Link`](../../../../../generated/email/types.gen/type-aliases/Link.md)\\>\n\n## Properties\n\n| Property | Modifier | Type | Description | Inherited from |\n| ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-emailaddress\"></a> `emailAddress` | `readonly` | () => `Promise`\\<`string`\\> | The inbox's email address. | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |\n| <a id=\"property-isprimary\"></a> `isPrimary` | `readonly` | () => `Promise`\\<`boolean`\\> | Whether this is the user's primary inbox. | - |\n| <a id=\"property-issyncactive\"></a> `isSyncActive` | `readonly` | () => `Promise`\\<`boolean`\\> | Whether syncing is currently active for this inbox. | - |\n| <a id=\"property-needsreauth\"></a> `needsReauth` | `readonly` | () => `Promise`\\<`boolean`\\> | Whether the inbox needs to be re-authenticated. | - |\n| <a id=\"property-photourl\"></a> `photoUrl` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | The inbox's avatar URL, if any. | - |\n| <a id=\"property-provider\"></a> `provider` | `readonly` | () => `Promise`\\<[`UserProvider`](../../../../../generated/email/types.gen/type-aliases/UserProvider.md)\\> | The email provider (e.g. `GMAIL` or `OUTLOOK`). | - |\n| <a id=\"property-syncstatus\"></a> `syncStatus` | `readonly` | () => `Promise`\\<[`SyncStatus`](../../../../../generated/email/types.gen/type-aliases/SyncStatus.md)\\> | The inbox's sync status. | - |\n\n## Methods\n\n### settingsOperations()\n\n> **settingsOperations**(): `Promise`\\<[`MailboxSettingsOperation`](../../../../../generated/email/types.gen/type-aliases/MailboxSettingsOperation.md)[]\\>\n\nRead category and sender-policy changes for this inbox.\n\n#### Returns\n\n`Promise`\\<[`MailboxSettingsOperation`](../../../../../generated/email/types.gen/type-aliases/MailboxSettingsOperation.md)[]\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`Link`](../../../../../generated/email/types.gen/type-aliases/Link.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`Link`](../../../../../generated/email/types.gen/type-aliases/Link.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`Link`](../../../../../generated/email/types.gen/type-aliases/Link.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `id`): `Link`\n\nA handle to an email link by id. Details load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `id` | `string` |\n\n#### Returns\n\n`Link`\n\n***\n\n### list()\n\n> `static` **list**(`client`): `Promise`\\<`Link`[]\\>\n\nThe caller's connected email links.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`Promise`\\<`Link`[]\\>\n\n\n<!-- src/entities/email/message/classes/EmailMessage.md -->\n# Class: EmailMessage\n\nA message in an email thread. A thin handle keyed by message id; the\nrecord loads lazily on first field access.\n\n## Extends\n\n- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\\<[`EmailMessageData`](../type-aliases/EmailMessageData.md)\\>\n\n## Extended by\n\n- [`EmailDraft`](../../draft/classes/EmailDraft.md)\n\n## Properties\n\n| Property | Modifier | Type | Description | Inherited from |\n| ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-bcc\"></a> `bcc` | `readonly` | () => `Promise`\\<[`ContactInfo`](../../../../../generated/email/types.gen/type-aliases/ContactInfo.md)[]\\> | The Bcc recipients. | - |\n| <a id=\"property-body\"></a> `body` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | The parsed message body, as the API returns it. | - |\n| <a id=\"property-cc\"></a> `cc` | `readonly` | () => `Promise`\\<[`ContactInfo`](../../../../../generated/email/types.gen/type-aliases/ContactInfo.md)[]\\> | The Cc recipients. | - |\n| <a id=\"property-from\"></a> `from` | `readonly` | () => `Promise`\\<[`ContactInfo`](../../../../../generated/email/types.gen/type-aliases/ContactInfo.md) \\| `undefined`\\> | The sender. | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |\n| <a id=\"property-labels\"></a> `labels` | `readonly` | () => `Promise`\\<[`LabelInfo`](../../../../../generated/email/types.gen/type-aliases/LabelInfo.md)[]\\> | Labels on this message. | - |\n| <a id=\"property-link\"></a> `link` | `readonly` | () => `Promise`\\<[`Link`](../../link/classes/Link.md)\\> | The inbox (email link) this message belongs to. | - |\n| <a id=\"property-sentat\"></a> `sentAt` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | The provider-internal date of the message. | - |\n| <a id=\"property-subject\"></a> `subject` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | The message's subject line. | - |\n| <a id=\"property-to\"></a> `to` | `readonly` | () => `Promise`\\<[`ContactInfo`](../../../../../generated/email/types.gen/type-aliases/ContactInfo.md)[]\\> | The To recipients. | - |\n\n## Methods\n\n### addLabel()\n\n> **addLabel**(`label`): `Promise`\\<`void`\\>\n\nAdd a label to this message.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `label` | [`Label`](../../label/classes/Label.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### completeDraftAttachment()\n\n> **completeDraftAttachment**(`attachmentId`): `Promise`\\<`void`\\>\n\nVerify an uploaded draft attachment before it can be sent.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `attachmentId` | `string` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### operationStatus()\n\n> **operationStatus**(): `Promise`\\<[`MessageOperationResponse`](../../../../../generated/email/types.gen/type-aliases/MessageOperationResponse.md)\\>\n\nRead the draft's durable send, upload, or conflict status without retrying it.\n\n#### Returns\n\n`Promise`\\<[`MessageOperationResponse`](../../../../../generated/email/types.gen/type-aliases/MessageOperationResponse.md)\\>\n\n***\n\n### removeLabel()\n\n> **removeLabel**(`label`): `Promise`\\<`void`\\>\n\nRemove a label from this message.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `label` | [`Label`](../../label/classes/Label.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### resolveOperation()\n\n> **resolveOperation**(`request`): `Promise`\\<`void`\\>\n\nResolve the displayed operation revision after the user chooses an action.\nRetrying an uncertain send requires explicit duplicate-risk acceptance.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `request` | [`ResolveMessageOperationRequest`](../../../../../generated/email/types.gen/type-aliases/ResolveMessageOperationRequest.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### thread()\n\n> **thread**(): `Promise`\\<[`EmailThread`](../../thread/classes/EmailThread.md)\\>\n\nThe thread this message belongs to.\n\n#### Returns\n\n`Promise`\\<[`EmailThread`](../../thread/classes/EmailThread.md)\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`ParsedMessage`](../../../../../generated/email/types.gen/type-aliases/ParsedMessage.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`ParsedMessage`](../../../../../generated/email/types.gen/type-aliases/ParsedMessage.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`ParsedMessage`](../../../../../generated/email/types.gen/type-aliases/ParsedMessage.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)\n\n***\n\n### transferDraft()\n\n> **transferDraft**(`request`): `Promise`\\<[`TransferDraftResponse`](../../../../../generated/email/types.gen/type-aliases/TransferDraftResponse.md)\\>\n\nMove a draft to another inbox using a caller-persisted operation UUID.\nContinue editing the returned message_id; the original identity is retired.\nOn an interrupted response, use email.recoverDraftTransfer(operation_id).\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `request` | [`TransferDraftRequest`](../../../../../generated/email/types.gen/type-aliases/TransferDraftRequest.md) |\n\n#### Returns\n\n`Promise`\\<[`TransferDraftResponse`](../../../../../generated/email/types.gen/type-aliases/TransferDraftResponse.md)\\>\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `id`): `EmailMessage`\n\nA handle to a message by id. Fields load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `id` | `string` |\n\n#### Returns\n\n`EmailMessage`\n\n***\n\n### from()\n\n> `static` **from**(`client`, `data`): `EmailMessage`\n\nBuild a message from an already-fetched record (pre-seeded, no fetch).\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `data` | [`ParsedMessage`](../../../../../generated/email/types.gen/type-aliases/ParsedMessage.md) |\n\n#### Returns\n\n`EmailMessage`\n\n***\n\n### send()\n\n> `static` **send**(`client`, `opts`): `Promise`\\<`EmailMessage` \\| `undefined`\\>\n\nSend a new email message. Returns a handle when the API reports the created message's id.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `opts` | [`SendEmailOptions`](../interfaces/SendEmailOptions.md) |\n\n#### Returns\n\n`Promise`\\<`EmailMessage` \\| `undefined`\\>\n\n\n<!-- src/entities/email/message/interfaces/SendEmailOptions.md -->\n# Interface: SendEmailOptions\n\nOptions for sending a fresh email message.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-bcc\"></a> `bcc?` | [`ApiDraftContactInfo`](../../../../../generated/email/types.gen/type-aliases/ApiDraftContactInfo.md)[] | Bcc recipients. |\n| <a id=\"property-bodytext\"></a> `bodyText` | `string` | Plain-text body. |\n| <a id=\"property-cc\"></a> `cc?` | [`ApiDraftContactInfo`](../../../../../generated/email/types.gen/type-aliases/ApiDraftContactInfo.md)[] | Cc recipients. |\n| <a id=\"property-subject\"></a> `subject` | `string` | Subject line. |\n| <a id=\"property-to\"></a> `to` | [`ApiDraftContactInfo`](../../../../../generated/email/types.gen/type-aliases/ApiDraftContactInfo.md)[] | Recipients. |\n\n\n<!-- src/entities/email/message/type-aliases/EmailMessageData.md -->\n# Type Alias: EmailMessageData\n\n> **EmailMessageData** = [`GetMessageResponses`](../../../../../generated/email/types.gen/type-aliases/GetMessageResponses.md)\\[`200`\\]\n\nThe API's representation of an email message (`ParsedMessage`).\n\n\n<!-- src/entities/email/namespace/classes/EmailNamespace.md -->\n# Class: EmailNamespace\n\n## Constructors\n\n### Constructor\n\n> **new EmailNamespace**(`client`): `EmailNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`EmailNamespace`\n\n## Methods\n\n### attachment()\n\n> **attachment**(`id`): [`EmailAttachment`](../../attachment/classes/EmailAttachment.md)\n\nA handle to an email attachment by id.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`EmailAttachment`](../../attachment/classes/EmailAttachment.md)\n\n***\n\n### blockedSenders()\n\n> **blockedSenders**(): `Promise`\\<`string`[]\\>\n\nThe email addresses currently blocked.\n\n#### Returns\n\n`Promise`\\<`string`[]\\>\n\n***\n\n### blockSender()\n\n> **blockSender**(`email`): `Promise`\\<`void`\\>\n\nBlock an email sender.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `email` | `string` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### byId()\n\n> **byId**(`id`): [`EmailThread`](../../thread/classes/EmailThread.md)\n\nA handle to an email thread by id.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`EmailThread`](../../thread/classes/EmailThread.md)\n\n***\n\n### connectionProviders()\n\n> **connectionProviders**(): `Promise`\\<[`EmailConnectionProviders`](../../../../../generated/auth/types.gen/type-aliases/EmailConnectionProviders.md)\\>\n\nProviders the server currently permits this caller to connect.\n\n#### Returns\n\n`Promise`\\<[`EmailConnectionProviders`](../../../../../generated/auth/types.gen/type-aliases/EmailConnectionProviders.md)\\>\n\n***\n\n### contacts()\n\n> **contacts**(): `Promise`\\<\\{\\[`key`: `string`\\]: [`ContactInfoWithInteraction`](../../../../../generated/email/types.gen/type-aliases/ContactInfoWithInteraction.md)[]; \\}\\>\n\nAddress book contacts grouped by the service's interaction buckets.\n\n#### Returns\n\n`Promise`\\<\\{\\[`key`: `string`\\]: [`ContactInfoWithInteraction`](../../../../../generated/email/types.gen/type-aliases/ContactInfoWithInteraction.md)[]; \\}\\>\n\n***\n\n### createDraft()\n\n> **createDraft**(`options`, `inbox?`): `Promise`\\<[`EmailDraft`](../../draft/classes/EmailDraft.md)\\>\n\nCreate a draft without sending it; the inbox defaults to the caller's primary.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | [`DraftOptions`](../../draft/type-aliases/DraftOptions.md) |\n| `inbox?` | [`Link`](../../link/classes/Link.md) |\n\n#### Returns\n\n`Promise`\\<[`EmailDraft`](../../draft/classes/EmailDraft.md)\\>\n\n***\n\n### createLabel()\n\n> **createLabel**(`name`): `Promise`\\<[`Label`](../../label/classes/Label.md)\\>\n\nCreate a user label. Returns the created label.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `name` | `string` |\n\n#### Returns\n\n`Promise`\\<[`Label`](../../label/classes/Label.md)\\>\n\n***\n\n### deleteLabel()\n\n> **deleteLabel**(`label`): `Promise`\\<`void`\\>\n\nDelete a label.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `label` | [`Label`](../../label/classes/Label.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### draftById()\n\n> **draftById**(`id`): [`EmailDraft`](../../draft/classes/EmailDraft.md)\n\nConstruct a lazy draft handle.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`EmailDraft`](../../draft/classes/EmailDraft.md)\n\n***\n\n### filters()\n\n> **filters**(`inbox?`): `Promise`\\<[`EmailFilter`](../../filter/classes/EmailFilter.md)[]\\>\n\nImportance filters.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `inbox?` | [`Link`](../../link/classes/Link.md) |\n\n#### Returns\n\n`Promise`\\<[`EmailFilter`](../../filter/classes/EmailFilter.md)[]\\>\n\n***\n\n### inbox()\n\n> **inbox**(`opts?`): `AsyncGenerator`\\<[`EmailThread`](../../thread/classes/EmailThread.md)\\>\n\nThe threads in the inbox, most recent first, auto-paginated.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts?` | [`InboxOptions`](../interfaces/InboxOptions.md) |\n\n#### Returns\n\n`AsyncGenerator`\\<[`EmailThread`](../../thread/classes/EmailThread.md)\\>\n\n***\n\n### label()\n\n> **label**(`id`): [`Label`](../../label/classes/Label.md)\n\nA handle to a label by id.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`Label`](../../label/classes/Label.md)\n\n***\n\n### labels()\n\n> **labels**(): `Promise`\\<[`Label`](../../label/classes/Label.md)[]\\>\n\nAll labels across the user's inboxes.\n\n#### Returns\n\n`Promise`\\<[`Label`](../../label/classes/Label.md)[]\\>\n\n***\n\n### link()\n\n> **link**(`id`): [`Link`](../../link/classes/Link.md)\n\nA handle to a connected inbox (email link) by id.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`Link`](../../link/classes/Link.md)\n\n***\n\n### links()\n\n> **links**(): `Promise`\\<[`Link`](../../link/classes/Link.md)[]\\>\n\nThe caller's connected inboxes (email links).\n\n#### Returns\n\n`Promise`\\<[`Link`](../../link/classes/Link.md)[]\\>\n\n***\n\n### message()\n\n> **message**(`id`): [`EmailMessage`](../../message/classes/EmailMessage.md)\n\nA handle to an email message by id.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`EmailMessage`](../../message/classes/EmailMessage.md)\n\n***\n\n### recoverDraftTransfer()\n\n> **recoverDraftTransfer**(`operationId`): `Promise`\\<[`TransferRecoveryResponse`](../../../../../generated/email/types.gen/type-aliases/TransferRecoveryResponse.md)\\>\n\nRecover a draft move using its original operation UUID; never starts a new move.\nAn empty committed result fences the old move so it cannot commit later.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `operationId` | `string` |\n\n#### Returns\n\n`Promise`\\<[`TransferRecoveryResponse`](../../../../../generated/email/types.gen/type-aliases/TransferRecoveryResponse.md)\\>\n\n***\n\n### reminders()\n\n> **reminders**(`options?`): `AsyncGenerator`\\<\\{ `followup`: [`EmailFollowup`](../../../../../generated/storage/types.gen/type-aliases/EmailFollowup.md); `thread`: [`EmailThread`](../../thread/classes/EmailThread.md); \\}, `any`, `any`\\>\n\nFollow-up reminders with thread handles, automatically paginated.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options?` | `Omit`\\<\\{ `attachments?`: `string`[] \\| `null`; `calendar?`: `boolean` \\| `null`; `cursor?`: `string` \\| `null`; `done?`: `boolean` \\| `null`; `inboxIds?`: `string`[] \\| `null`; `limit?`: `number` \\| `null`; `noInboxes?`: `boolean` \\| `null`; `read?`: `boolean` \\| `null`; `tags?`: `string`[] \\| `null`; \\}, `\"cursor\"` \\| `\"inboxIds\"`\\> & \\{ `inboxes?`: [`Link`](../../link/classes/Link.md)[]; \\} |\n\n#### Returns\n\n`AsyncGenerator`\\<\\{ `followup`: [`EmailFollowup`](../../../../../generated/storage/types.gen/type-aliases/EmailFollowup.md); `thread`: [`EmailThread`](../../thread/classes/EmailThread.md); \\}, `any`, `any`\\>\n\n***\n\n### scheduled()\n\n> **scheduled**(`options?`): `AsyncGenerator`\\<[`EmailDraft`](../../draft/classes/EmailDraft.md)\\>\n\nScheduled drafts, fetched lazily in bounded pages.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options?` | \\{ `inbox?`: [`Link`](../../link/classes/Link.md); `pageSize?`: `number`; \\} |\n| `options.inbox?` | [`Link`](../../link/classes/Link.md) |\n| `options.pageSize?` | `number` |\n\n#### Returns\n\n`AsyncGenerator`\\<[`EmailDraft`](../../draft/classes/EmailDraft.md)\\>\n\n***\n\n### search()\n\n> **search**(`query`, `opts?`): `AsyncGenerator`\\<[`EmailThread`](../../thread/classes/EmailThread.md)\\>\n\nSearch email threads by subject and content.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `query` | `string` |\n| `opts?` | [`SearchOpts`](../../../search/interfaces/SearchOpts.md) |\n\n#### Returns\n\n`AsyncGenerator`\\<[`EmailThread`](../../thread/classes/EmailThread.md)\\>\n\n***\n\n### send()\n\n> **send**(`opts`): `Promise`\\<[`EmailMessage`](../../message/classes/EmailMessage.md) \\| `undefined`\\>\n\nSend a new email message.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts` | [`SendEmailOptions`](../../message/interfaces/SendEmailOptions.md) |\n\n#### Returns\n\n`Promise`\\<[`EmailMessage`](../../message/classes/EmailMessage.md) \\| `undefined`\\>\n\n***\n\n### unblockSender()\n\n> **unblockSender**(`email`): `Promise`\\<`void`\\>\n\nUnblock a previously blocked sender.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `email` | `string` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### upsertFilter()\n\n> **upsertFilter**(`options`, `inbox?`): `Promise`\\<[`EmailFilter`](../../filter/classes/EmailFilter.md)\\>\n\nCreate or replace a filter matching an address or domain.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | [`EmailFilterOptions`](../../filter/interfaces/EmailFilterOptions.md) |\n| `inbox?` | [`Link`](../../link/classes/Link.md) |\n\n#### Returns\n\n`Promise`\\<[`EmailFilter`](../../filter/classes/EmailFilter.md)\\>\n\n\n<!-- src/entities/email/namespace/interfaces/InboxOptions.md -->\n# Interface: InboxOptions\n\nOptions for listing inbox threads.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-pagesize\"></a> `pageSize?` | `number` | Page size (default 20, max 500). |\n| <a id=\"property-sort\"></a> `sort?` | [`ApiSortMethod`](../../../../../generated/email/types.gen/type-aliases/ApiSortMethod.md) | Sort order. Defaults to `viewed_updated`. |\n\n\n<!-- src/entities/email/thread/classes/EmailThread.md -->\n# Class: EmailThread\n\nAn email thread. A free-to-construct handle: the detail record (including\nup to the first 100 messages) loads lazily on first field access.\n\n## Extends\n\n- [`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md)\\<`ThreadDetail`\\>\n\n## Properties\n\n| Property | Modifier | Type | Default value | Description | Overrides | Inherited from |\n| ------ | ------ | ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-access\"></a> `access` | `readonly` | [`EntityAccess`](../../../sharing/access/classes/EntityAccess.md) | `...` | Access requests and direct user grants. | - | - |\n| <a id=\"property-accesslevel\"></a> `accessLevel` | `readonly` | () => `Promise`\\<[`AccessLevel`](../../../../../generated/email/types.gen/type-aliases/AccessLevel.md)\\> | `...` | The viewer's access level to this thread. | - | - |\n| <a id=\"property-createdat\"></a> `createdAt` | `readonly` | () => `Promise`\\<`string`\\> | `...` | When the thread was created. | - | - |\n| <a id=\"property-entitytype\"></a> `entityType` | `readonly` | `\"email_thread\"` | `'email_thread'` | Favorites identify email threads as `email_thread`. | [`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`entityType`](../../../entity/classes/PropertiedEntity.md#property-entitytype) | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | `undefined` | - | - | [`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`id`](../../../entity/classes/PropertiedEntity.md#property-id) |\n| <a id=\"property-inboxvisible\"></a> `inboxVisible` | `readonly` | () => `Promise`\\<`boolean`\\> | `...` | Whether the thread is visible in the inbox (i.e. not archived). | - | - |\n| <a id=\"property-isread\"></a> `isRead` | `readonly` | () => `Promise`\\<`boolean`\\> | `...` | Whether the thread has been read. | - | - |\n| <a id=\"property-latestinboundat\"></a> `latestInboundAt` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | `...` | Timestamp of the latest inbound message, if any. | - | - |\n| <a id=\"property-latestnonspamat\"></a> `latestNonSpamAt` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | `...` | Timestamp of the latest non-spam message, if any. | - | - |\n| <a id=\"property-latestoutboundat\"></a> `latestOutboundAt` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | `...` | Timestamp of the latest outbound message, if any. | - | - |\n| <a id=\"property-link\"></a> `link` | `readonly` | () => `Promise`\\<[`Link`](../../link/classes/Link.md)\\> | `...` | The inbox (email link) that owns this thread. | - | - |\n| <a id=\"property-project\"></a> `project` | `readonly` | () => `Promise`\\<[`Project`](../../../projects/project/classes/Project.md) \\| `undefined`\\> | `...` | The project this thread is attached to, if any. | - | - |\n| <a id=\"property-providerid\"></a> `providerId` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | `...` | The provider-internal thread id (e.g. Gmail/Outlook), if any. | - | - |\n| <a id=\"property-updatedat\"></a> `updatedAt` | `readonly` | () => `Promise`\\<`string`\\> | `...` | When the thread was last updated. | - | - |\n| <a id=\"property-search\"></a> `search` | `static` | (`client`, `query`, `searchOpts?`) => `AsyncGenerator`\\<`EmailThread`\\> | `...` | Search email threads by subject and content, most relevant first, auto-paginated. | - | - |\n\n## Methods\n\n### addLabel()\n\n> **addLabel**(`label`): `Promise`\\<`void`\\>\n\nAdd a label to every message in the thread.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `label` | [`Label`](../../label/classes/Label.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### archive()\n\n> **archive**(`archived?`): `Promise`\\<`void`\\>\n\nArchive the thread (or unarchive with `false`).\n\n#### Parameters\n\n| Parameter | Type | Default value |\n| ------ | ------ | ------ |\n| `archived?` | `boolean` | `true` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### attachments()\n\n> **attachments**(): `Promise`\\<[`EmailAttachment`](../../attachment/classes/EmailAttachment.md)[]\\>\n\nThe attachments across this thread's first 100 messages, pre-seeded from the thread detail.\n\n#### Returns\n\n`Promise`\\<[`EmailAttachment`](../../attachment/classes/EmailAttachment.md)[]\\>\n\n***\n\n### calendarInvitations()\n\n> **calendarInvitations**(): `Promise`\\<\\{\\[`key`: `string`\\]: [`InvitationResolution`](../../../../../generated/email/types.gen/type-aliases/InvitationResolution.md); \\}\\>\n\nCalendar invitations resolved from this thread's messages.\n\n#### Returns\n\n`Promise`\\<\\{\\[`key`: `string`\\]: [`InvitationResolution`](../../../../../generated/email/types.gen/type-aliases/InvitationResolution.md); \\}\\>\n\n***\n\n### deleteProperty()\n\n> **deleteProperty**(`assignment`): `Promise`\\<`void`\\>\n\nRemove a property from this entity, given its [properties](#properties) entry.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `assignment` | [`EntityPropertyWithDefinition`](../../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`deleteProperty`](../../../entity/classes/PropertiedEntity.md#deleteproperty)\n\n***\n\n### favorite()\n\n> **favorite**(): `Promise`\\<`EmailThread`\\>\n\nAdd this entity to the user's favorites. Returns this handle for chaining.\nPlain unwrap: favoriting alters the user's favorites collection, not this\nentity's own detail, so there's nothing cached to invalidate.\n\n#### Returns\n\n`Promise`\\<`EmailThread`\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`favorite`](../../../entity/classes/PropertiedEntity.md#favorite)\n\n***\n\n### followup()\n\n> **followup**(): `Promise`\\<[`EmailFollowupResponse`](../../../../../generated/storage/types.gen/type-aliases/EmailFollowupResponse.md)\\>\n\nRead follow-up state for this thread.\n\n#### Returns\n\n`Promise`\\<[`EmailFollowupResponse`](../../../../../generated/storage/types.gen/type-aliases/EmailFollowupResponse.md)\\>\n\n***\n\n### markSeen()\n\n> **markSeen**(): `Promise`\\<`void`\\>\n\nMark the thread as seen.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### messages()\n\n> **messages**(`opts?`): `Promise`\\<[`EmailMessage`](../../message/classes/EmailMessage.md)[]\\>\n\nThe messages in this thread, pre-seeded from the list endpoint.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts?` | \\{ `limit?`: `number`; `since?`: `string`; \\} |\n| `opts.limit?` | `number` |\n| `opts.since?` | `string` |\n\n#### Returns\n\n`Promise`\\<[`EmailMessage`](../../message/classes/EmailMessage.md)[]\\>\n\n***\n\n### moveToProject()\n\n> **moveToProject**(`project`): `Promise`\\<`void`\\>\n\nAttach the thread to a project, or clear the project with `null`.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `project` | [`Project`](../../../projects/project/classes/Project.md) \\| `null` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### operations()\n\n> **operations**(): `Promise`\\<[`MailboxOperation`](../../../../../generated/email/types.gen/type-aliases/MailboxOperation.md)[]\\>\n\nRead pending or failed mailbox changes without initiating a retry.\n\n#### Returns\n\n`Promise`\\<[`MailboxOperation`](../../../../../generated/email/types.gen/type-aliases/MailboxOperation.md)[]\\>\n\n***\n\n### participants()\n\n> **participants**(): `Promise`\\<[`ApiContactInfo`](../../../../../generated/email/types.gen/type-aliases/ApiContactInfo.md)[]\\>\n\nEveryone on the thread (senders and recipients), deduped by email.\nDerived from the thread's first 100 messages.\n\n#### Returns\n\n`Promise`\\<[`ApiContactInfo`](../../../../../generated/email/types.gen/type-aliases/ApiContactInfo.md)[]\\>\n\n***\n\n### permission()\n\n> **permission**(): `Promise`\\<\\{ `permission`: [`EntityPermission`](../../../../../generated/storage/types.gen/type-aliases/EntityPermission.md); `status`: `\"access\"`; \\} \\| \\{ `status`: `\"no_access\"`; \\}\\>\n\nRead the caller's effective permission on this entity.\n\n#### Returns\n\n`Promise`\\<\\{ `permission`: [`EntityPermission`](../../../../../generated/storage/types.gen/type-aliases/EntityPermission.md); `status`: `\"access\"`; \\} \\| \\{ `status`: `\"no_access\"`; \\}\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`permission`](../../../entity/classes/PropertiedEntity.md#permission)\n\n***\n\n### properties()\n\n> **properties**(`opts?`): `Promise`\\<[`EntityPropertyWithDefinition`](../../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md)[]\\>\n\nThe properties set on this entity, each with its definition, value, and options.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts?` | \\{ `includeMetadata?`: `boolean`; \\} |\n| `opts.includeMetadata?` | `boolean` |\n\n#### Returns\n\n`Promise`\\<[`EntityPropertyWithDefinition`](../../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md)[]\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`properties`](../../../entity/classes/PropertiedEntity.md#properties)\n\n***\n\n### propertyReference()\n\n> **propertyReference**(): [`PropertyTargetReference`](../../../../../generated/properties/types.gen/type-aliases/PropertyTargetReference.md)\n\nThis entity's reference for bulk property operations.\n\n#### Returns\n\n[`PropertyTargetReference`](../../../../../generated/properties/types.gen/type-aliases/PropertyTargetReference.md)\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`propertyReference`](../../../entity/classes/PropertiedEntity.md#propertyreference)\n\n***\n\n### removeLabel()\n\n> **removeLabel**(`label`): `Promise`\\<`void`\\>\n\nRemove a label from every message in the thread.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `label` | [`Label`](../../label/classes/Label.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### reply()\n\n> **reply**(`opts`): `Promise`\\<[`EmailMessage`](../../message/classes/EmailMessage.md) \\| `undefined`\\>\n\nSend a reply within this thread. Returns a handle when the API reports the created message's id.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts` | [`ReplyEmailOptions`](../interfaces/ReplyEmailOptions.md) |\n\n#### Returns\n\n`Promise`\\<[`EmailMessage`](../../message/classes/EmailMessage.md) \\| `undefined`\\>\n\n***\n\n### setFollowup()\n\n> **setFollowup**(`command`): `Promise`\\<[`EmailFollowup`](../../../../../generated/storage/types.gen/type-aliases/EmailFollowup.md)\\>\n\nSet or remove a follow-up using a persisted operation id and revision.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `command` | [`EmailFollowupCommand`](../../../../../generated/storage/types.gen/type-aliases/EmailFollowupCommand.md) |\n\n#### Returns\n\n`Promise`\\<[`EmailFollowup`](../../../../../generated/storage/types.gen/type-aliases/EmailFollowup.md)\\>\n\n***\n\n### setProperty()\n\n> **setProperty**(`property`, `value?`): `Promise`\\<`void`\\>\n\nSet a property value on this entity, or attach the property without a\nvalue when `value` is omitted.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `property` | [`PropertyDefinition`](../../../properties/property-definition/classes/PropertyDefinition.md) |\n| `value?` | [`SetPropertyValue`](../../../../../generated/properties/types.gen/type-aliases/SetPropertyValue.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`setProperty`](../../../entity/classes/PropertiedEntity.md#setproperty)\n\n***\n\n### subject()\n\n> **subject**(): `Promise`\\<`string` \\| `undefined`\\>\n\nThe thread's subject, from its first message with one.\n\n#### Returns\n\n`Promise`\\<`string` \\| `undefined`\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`ApiThread`](../../../../../generated/email/types.gen/type-aliases/ApiThread.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`ApiThread`](../../../../../generated/email/types.gen/type-aliases/ApiThread.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`ApiThread`](../../../../../generated/email/types.gen/type-aliases/ApiThread.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`toJSON`](../../../entity/classes/PropertiedEntity.md#tojson)\n\n***\n\n### unfavorite()\n\n> **unfavorite**(): `Promise`\\<`EmailThread`\\>\n\nRemove this entity from the user's favorites. Returns this handle for chaining.\n\n#### Returns\n\n`Promise`\\<`EmailThread`\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`unfavorite`](../../../entity/classes/PropertiedEntity.md#unfavorite)\n\n***\n\n### update()\n\n> **update**(`options`): `Promise`\\<`void`\\>\n\nChange project membership or share permissions for this thread.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | \\{ `project?`: [`Project`](../../../projects/project/classes/Project.md) \\| `null`; `sharePermission?`: [`SharePermissionOptions`](../../../sharing/permissions/type-aliases/SharePermissionOptions.md); \\} |\n| `options.project?` | [`Project`](../../../projects/project/classes/Project.md) \\| `null` |\n| `options.sharePermission?` | [`SharePermissionOptions`](../../../sharing/permissions/type-aliases/SharePermissionOptions.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### updatePropertyOptions()\n\n> **updatePropertyOptions**(`changes`): `Promise`\\<[`BulkUpdateEntityPropertyOptionsResponse`](../../../../../generated/properties/types.gen/type-aliases/BulkUpdateEntityPropertyOptionsResponse.md)\\>\n\nApply multi-select option deltas atomically across this entity's properties.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `changes` | [`PropertyOptionDelta`](../../../entity/interfaces/PropertyOptionDelta.md)[] |\n\n#### Returns\n\n`Promise`\\<[`BulkUpdateEntityPropertyOptionsResponse`](../../../../../generated/properties/types.gen/type-aliases/BulkUpdateEntityPropertyOptionsResponse.md)\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`updatePropertyOptions`](../../../entity/classes/PropertiedEntity.md#updatepropertyoptions)\n\n***\n\n### updateState()\n\n> **updateState**(`request`): `Promise`\\<`void`\\>\n\nUpdate provider-neutral read, trash, spam, or star state.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `request` | [`UpdateThreadStateRequest`](../../../../../generated/email/types.gen/type-aliases/UpdateThreadStateRequest.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `id`): `EmailThread`\n\nA handle to a thread by id. Details load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `id` | `string` |\n\n#### Returns\n\n`EmailThread`\n\n\n<!-- src/entities/email/thread/interfaces/ReplyEmailOptions.md -->\n# Interface: ReplyEmailOptions\n\nOptions for replying within an email thread.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-bcc\"></a> `bcc?` | [`ApiDraftContactInfo`](../../../../../generated/email/types.gen/type-aliases/ApiDraftContactInfo.md)[] | Bcc recipients. |\n| <a id=\"property-bodytext\"></a> `bodyText` | `string` | Plain-text body. |\n| <a id=\"property-cc\"></a> `cc?` | [`ApiDraftContactInfo`](../../../../../generated/email/types.gen/type-aliases/ApiDraftContactInfo.md)[] | Cc recipients. |\n| <a id=\"property-replyingto\"></a> `replyingTo?` | [`EmailMessage`](../../message/classes/EmailMessage.md) | The message being replied to. |\n| <a id=\"property-subject\"></a> `subject?` | `string` | Subject line. Defaults to the subject of the thread's first message. |\n| <a id=\"property-to\"></a> `to` | [`ApiDraftContactInfo`](../../../../../generated/email/types.gen/type-aliases/ApiDraftContactInfo.md)[] | Recipients. |\n"},{"name": "favorites",@@ -75,7 +123,7 @@"name": "foreignEntities","description": "Resolve linked external entities.","overview": "<!-- src/entities/foreign/namespace/classes/ForeignEntityNamespace.md -->\n# Class: ForeignEntityNamespace\n\n## Constructors\n\n### Constructor\n\n> **new ForeignEntityNamespace**(`client`): `ForeignEntityNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`ForeignEntityNamespace`\n\n## Methods\n\n### byId()\n\n> **byId**(`id`): [`ForeignEntity`](../../foreign-entity/classes/ForeignEntity.md)\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`ForeignEntity`](../../foreign-entity/classes/ForeignEntity.md)\n\n***\n\n### bySource()\n\n> **bySource**(`source`, `foreignEntityId`): `Promise`\\<[`ForeignEntity`](../../foreign-entity/classes/ForeignEntity.md)\\>\n\nLook a foreign entity up by the identifier its source system assigned.\n\n`foreignEntityId` may contain slashes — sources store them inside the\nidentifier, for example `owner/repo/pull/12`.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `source` | `string` |\n| `foreignEntityId` | `string` |\n\n#### Returns\n\n`Promise`\\<[`ForeignEntity`](../../foreign-entity/classes/ForeignEntity.md)\\>\n\n***\n\n### githubPullRequestFacets()\n\n> **githubPullRequestFacets**(): `Promise`\\<[`GithubPullRequestFacets`](../interfaces/GithubPullRequestFacets.md)\\>\n\nRepositories, authors, assignees, and labels among the GitHub pull\nrequests visible to the authenticated user and their team, each with how\nmany pull requests it covers. A pull request visible to both the user and\nthe team counts once.\n\n#### Returns\n\n`Promise`\\<[`GithubPullRequestFacets`](../interfaces/GithubPullRequestFacets.md)\\>\n\n\n<!-- src/entities/foreign/namespace/interfaces/GithubPullRequestFacets.md -->\n# Interface: GithubPullRequestFacets\n\nRepositories, authors, assignees, and labels among the GitHub pull requests\nvisible to the caller.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-assignees\"></a> `assignees` | [`GithubUserFacet`](../type-aliases/GithubUserFacet.md)[] | Assignees, most pull requests first. |\n| <a id=\"property-authors\"></a> `authors` | [`GithubUserFacet`](../type-aliases/GithubUserFacet.md)[] | Authors, most pull requests first. |\n| <a id=\"property-labels\"></a> `labels` | [`GithubLabelFacet`](../type-aliases/GithubLabelFacet.md)[] | Labels, most pull requests first. |\n| <a id=\"property-repositories\"></a> `repositories` | [`GithubRepositoryFacet`](../../../../../generated/storage/types.gen/type-aliases/GithubRepositoryFacet.md)[] | Repositories, most pull requests first. |\n\n\n<!-- src/entities/foreign/namespace/type-aliases/GithubLabelFacet.md -->\n# Type Alias: GithubLabelFacet\n\n> **GithubLabelFacet** = `Omit`\\<[`GithubLabelFacet`](../../../../../generated/storage/types.gen/type-aliases/GithubLabelFacet.md), `\"color\"`\\> & \\{ `color?`: `string`; \\}\n\nA label among the GitHub pull requests visible to the caller.\n\n## Type Declaration\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `color?` | `string` | The label's most recently synced color, as six hex digits without `#`. |\n\n\n<!-- src/entities/foreign/namespace/type-aliases/GithubUserFacet.md -->\n# Type Alias: GithubUserFacet\n\n> **GithubUserFacet** = `Omit`\\<[`GithubUserFacet`](../../../../../generated/storage/types.gen/type-aliases/GithubUserFacet.md), `\"login\"`\\> & \\{ `login?`: `string`; \\}\n\nA GitHub user among the pull requests visible to the caller, as an author or an assignee.\n\n## Type Declaration\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `login?` | `string` | The user's most recently synced GitHub login, when known. |\n",- "documentation": "# Macro SDK: foreignEntities\n\nGenerated by TypeDoc. Paths below refer to the canonical Markdown hierarchy. Other entity handles are documented in their named section; request core for shared SDK helpers.\n\n<!-- generated/storage/types.gen/type-aliases/ForeignEntity.md -->\n# Type Alias: ForeignEntity\n\n> **ForeignEntity** = \\{ `createdAt`: `string`; `foreignEntityId`: `string`; `foreignEntitySource`: `string`; `id`: `string`; `metadata`: `unknown`; `storedForAuthEntity`: `string`; `storedForId`: `string`; `updatedAt`: `string`; \\}\n\nA persisted mapping to an entity owned by an external system.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-createdat\"></a> `createdAt` | `string` | Timestamp when the record was created. |\n| <a id=\"property-foreignentityid\"></a> `foreignEntityId` | `string` | Identifier assigned by the external system. |\n| <a id=\"property-foreignentitysource\"></a> `foreignEntitySource` | `string` | Source system that owns the external identifier. |\n| <a id=\"property-id\"></a> `id` | `string` | Internal primary key for this foreign entity record. |\n| <a id=\"property-metadata\"></a> `metadata` | `unknown` | Arbitrary metadata stored with the mapping. |\n| <a id=\"property-storedforauthentity\"></a> `storedForAuthEntity` | `string` | Internal auth entity namespace this foreign entity is stored for. |\n| <a id=\"property-storedforid\"></a> `storedForId` | `string` | Internal entity identifier this foreign entity is stored for. |\n| <a id=\"property-updatedat\"></a> `updatedAt` | `string` | Timestamp when the record was last updated. |\n\n\n<!-- generated/storage/types.gen/type-aliases/GithubLabelFacet.md -->\n# Type Alias: GithubLabelFacet\n\n> **GithubLabelFacet** = \\{ `color?`: `string` \\| `null`; `count`: `number`; `name`: `string`; \\}\n\nA label among the visible GitHub pull requests. Labels with the same name in different\nrepositories count together.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-color\"></a> `color?` | `string` \\| `null` | The label's most recently synced color, as six hex digits without `#`. |\n| <a id=\"property-count\"></a> `count` | `number` | Number of visible pull requests with the label. |\n| <a id=\"property-name\"></a> `name` | `string` | The label's name. |\n\n\n<!-- generated/storage/types.gen/type-aliases/GithubRepositoryFacet.md -->\n# Type Alias: GithubRepositoryFacet\n\n> **GithubRepositoryFacet** = \\{ `count`: `number`; `repository`: `string`; `repositoryId`: `string`; \\}\n\nA repository among the visible GitHub pull requests.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-count\"></a> `count` | `number` | Number of visible pull requests in the repository. |\n| <a id=\"property-repository\"></a> `repository` | `string` | The repository's most recently synced name, as `owner/repo`. |\n| <a id=\"property-repositoryid\"></a> `repositoryId` | `string` | The numeric GitHub repository id, which survives renames and transfers. |\n\n\n<!-- generated/storage/types.gen/type-aliases/GithubUserFacet.md -->\n# Type Alias: GithubUserFacet\n\n> **GithubUserFacet** = \\{ `count`: `number`; `githubUserId`: `string`; `login?`: `string` \\| `null`; \\}\n\nA GitHub user among the visible pull requests, as an author or an assignee.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-count\"></a> `count` | `number` | Number of visible pull requests the user opened, or is assigned to. |\n| <a id=\"property-githubuserid\"></a> `githubUserId` | `string` | The user's numeric GitHub user id. |\n| <a id=\"property-login\"></a> `login?` | `string` \\| `null` | The user's most recently synced GitHub login, when known. |\n\n\n<!-- src/entities/foreign/foreign-entity/classes/ForeignEntity.md -->\n# Class: ForeignEntity\n\nA read-only mapping to an entity owned by an external system (e.g. a\nGitHub pull request). Keyed by the internal foreign-entity record id.\n\n## Extends\n\n- [`FavoritableEntity`](../../../entity/classes/FavoritableEntity.md)\\<`ForeignEntityDetail`\\>\n\n## Properties\n\n| Property | Modifier | Type | Default value | Description | Overrides | Inherited from |\n| ------ | ------ | ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-createdat\"></a> `createdAt` | `readonly` | () => `Promise`\\<`string`\\> | `...` | When the record was created (ISO timestamp). | - | - |\n| <a id=\"property-entitytype\"></a> `entityType` | `readonly` | `\"foreign_entity\"` | `'foreign_entity'` | Favorites identify foreign entities as `foreign_entity`. | [`FavoritableEntity`](../../../entity/classes/FavoritableEntity.md).[`entityType`](../../../entity/classes/FavoritableEntity.md#property-entitytype) | - |\n| <a id=\"property-foreignentityid\"></a> `foreignEntityId` | `readonly` | () => `Promise`\\<`string`\\> | `...` | The identifier assigned by the external system. | - | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | `undefined` | - | - | [`FavoritableEntity`](../../../entity/classes/FavoritableEntity.md).[`id`](../../../entity/classes/FavoritableEntity.md#property-id) |\n| <a id=\"property-source\"></a> `source` | `readonly` | () => `Promise`\\<`string`\\> | `...` | The source system that owns the external identifier (e.g. `github_pull_request`). | - | - |\n| <a id=\"property-storedforauthentity\"></a> `storedForAuthEntity` | `readonly` | () => `Promise`\\<`string`\\> | `...` | The internal auth entity namespace this foreign entity is stored for. | - | - |\n| <a id=\"property-storedforid\"></a> `storedForId` | `readonly` | () => `Promise`\\<`string`\\> | `...` | The internal entity id this foreign entity is stored for. | - | - |\n| <a id=\"property-updatedat\"></a> `updatedAt` | `readonly` | () => `Promise`\\<`string`\\> | `...` | When the record was last updated (ISO timestamp). | - | - |\n\n## Methods\n\n### favorite()\n\n> **favorite**(): `Promise`\\<`ForeignEntity`\\>\n\nAdd this entity to the user's favorites. Returns this handle for chaining.\nPlain unwrap: favoriting alters the user's favorites collection, not this\nentity's own detail, so there's nothing cached to invalidate.\n\n#### Returns\n\n`Promise`\\<`ForeignEntity`\\>\n\n#### Inherited from\n\n[`FavoritableEntity`](../../../entity/classes/FavoritableEntity.md).[`favorite`](../../../entity/classes/FavoritableEntity.md#favorite)\n\n***\n\n### metadata()\n\n> **metadata**(): `Promise`\\<`unknown`\\>\n\nArbitrary source-specific metadata stored with the mapping.\n\n#### Returns\n\n`Promise`\\<`unknown`\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`ForeignEntity`](../../../../../generated/storage/types.gen/type-aliases/ForeignEntity.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`ForeignEntity`](../../../../../generated/storage/types.gen/type-aliases/ForeignEntity.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`ForeignEntity`](../../../../../generated/storage/types.gen/type-aliases/ForeignEntity.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`FavoritableEntity`](../../../entity/classes/FavoritableEntity.md).[`toJSON`](../../../entity/classes/FavoritableEntity.md#tojson)\n\n***\n\n### unfavorite()\n\n> **unfavorite**(): `Promise`\\<`ForeignEntity`\\>\n\nRemove this entity from the user's favorites. Returns this handle for chaining.\n\n#### Returns\n\n`Promise`\\<`ForeignEntity`\\>\n\n#### Inherited from\n\n[`FavoritableEntity`](../../../entity/classes/FavoritableEntity.md).[`unfavorite`](../../../entity/classes/FavoritableEntity.md#unfavorite)\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `id`): `ForeignEntity`\n\nA handle to a foreign entity by its internal record id. Details load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `id` | `string` |\n\n#### Returns\n\n`ForeignEntity`\n\n***\n\n### fromRecord()\n\n> `static` **fromRecord**(`client`, `record`): `ForeignEntity`\n\nBuild a foreign entity from an already-fetched record (pre-seeded, no fetch).\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `record` | [`ForeignEntity`](../../../../../generated/storage/types.gen/type-aliases/ForeignEntity.md) |\n\n#### Returns\n\n`ForeignEntity`\n\n\n<!-- src/entities/foreign/namespace/classes/ForeignEntityNamespace.md -->\n# Class: ForeignEntityNamespace\n\n## Constructors\n\n### Constructor\n\n> **new ForeignEntityNamespace**(`client`): `ForeignEntityNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`ForeignEntityNamespace`\n\n## Methods\n\n### byId()\n\n> **byId**(`id`): [`ForeignEntity`](../../foreign-entity/classes/ForeignEntity.md)\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`ForeignEntity`](../../foreign-entity/classes/ForeignEntity.md)\n\n***\n\n### bySource()\n\n> **bySource**(`source`, `foreignEntityId`): `Promise`\\<[`ForeignEntity`](../../foreign-entity/classes/ForeignEntity.md)\\>\n\nLook a foreign entity up by the identifier its source system assigned.\n\n`foreignEntityId` may contain slashes — sources store them inside the\nidentifier, for example `owner/repo/pull/12`.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `source` | `string` |\n| `foreignEntityId` | `string` |\n\n#### Returns\n\n`Promise`\\<[`ForeignEntity`](../../foreign-entity/classes/ForeignEntity.md)\\>\n\n***\n\n### githubPullRequestFacets()\n\n> **githubPullRequestFacets**(): `Promise`\\<[`GithubPullRequestFacets`](../interfaces/GithubPullRequestFacets.md)\\>\n\nRepositories, authors, assignees, and labels among the GitHub pull\nrequests visible to the authenticated user and their team, each with how\nmany pull requests it covers. A pull request visible to both the user and\nthe team counts once.\n\n#### Returns\n\n`Promise`\\<[`GithubPullRequestFacets`](../interfaces/GithubPullRequestFacets.md)\\>\n\n\n<!-- src/entities/foreign/namespace/interfaces/GithubPullRequestFacets.md -->\n# Interface: GithubPullRequestFacets\n\nRepositories, authors, assignees, and labels among the GitHub pull requests\nvisible to the caller.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-assignees\"></a> `assignees` | [`GithubUserFacet`](../type-aliases/GithubUserFacet.md)[] | Assignees, most pull requests first. |\n| <a id=\"property-authors\"></a> `authors` | [`GithubUserFacet`](../type-aliases/GithubUserFacet.md)[] | Authors, most pull requests first. |\n| <a id=\"property-labels\"></a> `labels` | [`GithubLabelFacet`](../type-aliases/GithubLabelFacet.md)[] | Labels, most pull requests first. |\n| <a id=\"property-repositories\"></a> `repositories` | [`GithubRepositoryFacet`](../../../../../generated/storage/types.gen/type-aliases/GithubRepositoryFacet.md)[] | Repositories, most pull requests first. |\n\n\n<!-- src/entities/foreign/namespace/type-aliases/GithubLabelFacet.md -->\n# Type Alias: GithubLabelFacet\n\n> **GithubLabelFacet** = `Omit`\\<[`GithubLabelFacet`](../../../../../generated/storage/types.gen/type-aliases/GithubLabelFacet.md), `\"color\"`\\> & \\{ `color?`: `string`; \\}\n\nA label among the GitHub pull requests visible to the caller.\n\n## Type Declaration\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `color?` | `string` | The label's most recently synced color, as six hex digits without `#`. |\n\n\n<!-- src/entities/foreign/namespace/type-aliases/GithubUserFacet.md -->\n# Type Alias: GithubUserFacet\n\n> **GithubUserFacet** = `Omit`\\<[`GithubUserFacet`](../../../../../generated/storage/types.gen/type-aliases/GithubUserFacet.md), `\"login\"`\\> & \\{ `login?`: `string`; \\}\n\nA GitHub user among the pull requests visible to the caller, as an author or an assignee.\n\n## Type Declaration\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `login?` | `string` | The user's most recently synced GitHub login, when known. |\n"+ "documentation": "# Macro SDK: foreignEntities\n\nGenerated by TypeDoc. Paths below refer to the canonical Markdown hierarchy. Other entity handles are documented in their named section; request core for shared SDK helpers.\n\n<!-- generated/storage/types.gen/type-aliases/AccessLevel.md -->\n# Type Alias: AccessLevel\n\n> **AccessLevel** = `\"view\"` \\| `\"comment\"` \\| `\"edit\"` \\| `\"owner\"`\n\nOrdered from least to most access top -> bottom\n\n\n<!-- generated/storage/types.gen/type-aliases/EntityPermission.md -->\n# Type Alias: EntityPermission\n\n> **EntityPermission** = \\{ `access_level`: [`AccessLevel`](AccessLevel.md); `type`: `\"access_level\"`; \\} \\| \\{ `type`: `\"channel_view_only\"`; \\} \\| \\{ `role`: [`ParticipantRole`](ParticipantRole.md); `type`: `\"channel_role\"`; \\} \\| \\{ `role`: [`TeamRole`](TeamRole.md); `type`: `\"team_role\"`; \\}\n\nA user's permission for an entity, discriminated by entity kind.\n\nItems (documents, chats, projects, threads) use access levels.\nChannels use view-only permission or participant roles.\n\n## Union Members\n\n### Type Literal\n\n\\{ `access_level`: [`AccessLevel`](AccessLevel.md); `type`: `\"access_level\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `access_level` | [`AccessLevel`](AccessLevel.md) | The access level the user has. |\n| `type` | `\"access_level\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"channel_view_only\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `role`: [`ParticipantRole`](ParticipantRole.md); `type`: `\"channel_role\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `role` | [`ParticipantRole`](ParticipantRole.md) | The role the user has in the channel. |\n| `type` | `\"channel_role\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `role`: [`TeamRole`](TeamRole.md); `type`: `\"team_role\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `role` | [`TeamRole`](TeamRole.md) | The role the user has in the team. |\n| `type` | `\"team_role\"` | - |\n\n\n<!-- generated/storage/types.gen/type-aliases/ForeignEntity.md -->\n# Type Alias: ForeignEntity\n\n> **ForeignEntity** = \\{ `createdAt`: `string`; `foreignEntityId`: `string`; `foreignEntitySource`: `string`; `id`: `string`; `metadata`: `unknown`; `storedForAuthEntity`: `string`; `storedForId`: `string`; `updatedAt`: `string`; \\}\n\nA persisted mapping to an entity owned by an external system.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-createdat\"></a> `createdAt` | `string` | Timestamp when the record was created. |\n| <a id=\"property-foreignentityid\"></a> `foreignEntityId` | `string` | Identifier assigned by the external system. |\n| <a id=\"property-foreignentitysource\"></a> `foreignEntitySource` | `string` | Source system that owns the external identifier. |\n| <a id=\"property-id\"></a> `id` | `string` | Internal primary key for this foreign entity record. |\n| <a id=\"property-metadata\"></a> `metadata` | `unknown` | Arbitrary metadata stored with the mapping. |\n| <a id=\"property-storedforauthentity\"></a> `storedForAuthEntity` | `string` | Internal auth entity namespace this foreign entity is stored for. |\n| <a id=\"property-storedforid\"></a> `storedForId` | `string` | Internal entity identifier this foreign entity is stored for. |\n| <a id=\"property-updatedat\"></a> `updatedAt` | `string` | Timestamp when the record was last updated. |\n\n\n<!-- generated/storage/types.gen/type-aliases/GithubLabelFacet.md -->\n# Type Alias: GithubLabelFacet\n\n> **GithubLabelFacet** = \\{ `color?`: `string` \\| `null`; `count`: `number`; `name`: `string`; \\}\n\nA label among the visible GitHub pull requests. Labels with the same name in different\nrepositories count together.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-color\"></a> `color?` | `string` \\| `null` | The label's most recently synced color, as six hex digits without `#`. |\n| <a id=\"property-count\"></a> `count` | `number` | Number of visible pull requests with the label. |\n| <a id=\"property-name\"></a> `name` | `string` | The label's name. |\n\n\n<!-- generated/storage/types.gen/type-aliases/GithubRepositoryFacet.md -->\n# Type Alias: GithubRepositoryFacet\n\n> **GithubRepositoryFacet** = \\{ `count`: `number`; `repository`: `string`; `repositoryId`: `string`; \\}\n\nA repository among the visible GitHub pull requests.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-count\"></a> `count` | `number` | Number of visible pull requests in the repository. |\n| <a id=\"property-repository\"></a> `repository` | `string` | The repository's most recently synced name, as `owner/repo`. |\n| <a id=\"property-repositoryid\"></a> `repositoryId` | `string` | The numeric GitHub repository id, which survives renames and transfers. |\n\n\n<!-- generated/storage/types.gen/type-aliases/GithubUserFacet.md -->\n# Type Alias: GithubUserFacet\n\n> **GithubUserFacet** = \\{ `count`: `number`; `githubUserId`: `string`; `login?`: `string` \\| `null`; \\}\n\nA GitHub user among the visible pull requests, as an author or an assignee.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-count\"></a> `count` | `number` | Number of visible pull requests the user opened, or is assigned to. |\n| <a id=\"property-githubuserid\"></a> `githubUserId` | `string` | The user's numeric GitHub user id. |\n| <a id=\"property-login\"></a> `login?` | `string` \\| `null` | The user's most recently synced GitHub login, when known. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ParticipantRole.md -->\n# Type Alias: ParticipantRole\n\n> **ParticipantRole** = `\"owner\"` \\| `\"admin\"` \\| `\"member\"`\n\nThe role a user has within a channel.\n\n\n<!-- generated/storage/types.gen/type-aliases/TeamRole.md -->\n# Type Alias: TeamRole\n\n> **TeamRole** = `\"member\"` \\| `\"admin\"` \\| `\"owner\"`\n\nThe role a user has within a team.\n\nOrdered least to most privileged so comparisons reflect access strength.\n\n\n<!-- src/entities/foreign/foreign-entity/classes/ForeignEntity.md -->\n# Class: ForeignEntity\n\nA read-only mapping to an entity owned by an external system (e.g. a\nGitHub pull request). Keyed by the internal foreign-entity record id.\n\n## Extends\n\n- [`FavoritableEntity`](../../../entity/classes/FavoritableEntity.md)\\<`ForeignEntityDetail`\\>\n\n## Properties\n\n| Property | Modifier | Type | Default value | Description | Overrides | Inherited from |\n| ------ | ------ | ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-createdat\"></a> `createdAt` | `readonly` | () => `Promise`\\<`string`\\> | `...` | When the record was created (ISO timestamp). | - | - |\n| <a id=\"property-entitytype\"></a> `entityType` | `readonly` | `\"foreign_entity\"` | `'foreign_entity'` | Favorites identify foreign entities as `foreign_entity`. | [`FavoritableEntity`](../../../entity/classes/FavoritableEntity.md).[`entityType`](../../../entity/classes/FavoritableEntity.md#property-entitytype) | - |\n| <a id=\"property-foreignentityid\"></a> `foreignEntityId` | `readonly` | () => `Promise`\\<`string`\\> | `...` | The identifier assigned by the external system. | - | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | `undefined` | - | - | [`FavoritableEntity`](../../../entity/classes/FavoritableEntity.md).[`id`](../../../entity/classes/FavoritableEntity.md#property-id) |\n| <a id=\"property-source\"></a> `source` | `readonly` | () => `Promise`\\<`string`\\> | `...` | The source system that owns the external identifier (e.g. `github_pull_request`). | - | - |\n| <a id=\"property-storedforauthentity\"></a> `storedForAuthEntity` | `readonly` | () => `Promise`\\<`string`\\> | `...` | The internal auth entity namespace this foreign entity is stored for. | - | - |\n| <a id=\"property-storedforid\"></a> `storedForId` | `readonly` | () => `Promise`\\<`string`\\> | `...` | The internal entity id this foreign entity is stored for. | - | - |\n| <a id=\"property-updatedat\"></a> `updatedAt` | `readonly` | () => `Promise`\\<`string`\\> | `...` | When the record was last updated (ISO timestamp). | - | - |\n\n## Methods\n\n### favorite()\n\n> **favorite**(): `Promise`\\<`ForeignEntity`\\>\n\nAdd this entity to the user's favorites. Returns this handle for chaining.\nPlain unwrap: favoriting alters the user's favorites collection, not this\nentity's own detail, so there's nothing cached to invalidate.\n\n#### Returns\n\n`Promise`\\<`ForeignEntity`\\>\n\n#### Inherited from\n\n[`FavoritableEntity`](../../../entity/classes/FavoritableEntity.md).[`favorite`](../../../entity/classes/FavoritableEntity.md#favorite)\n\n***\n\n### metadata()\n\n> **metadata**(): `Promise`\\<`unknown`\\>\n\nArbitrary source-specific metadata stored with the mapping.\n\n#### Returns\n\n`Promise`\\<`unknown`\\>\n\n***\n\n### permission()\n\n> **permission**(): `Promise`\\<\\{ `permission`: [`EntityPermission`](../../../../../generated/storage/types.gen/type-aliases/EntityPermission.md); `status`: `\"access\"`; \\} \\| \\{ `status`: `\"no_access\"`; \\}\\>\n\nRead the caller's effective permission on this entity.\n\n#### Returns\n\n`Promise`\\<\\{ `permission`: [`EntityPermission`](../../../../../generated/storage/types.gen/type-aliases/EntityPermission.md); `status`: `\"access\"`; \\} \\| \\{ `status`: `\"no_access\"`; \\}\\>\n\n#### Inherited from\n\n[`FavoritableEntity`](../../../entity/classes/FavoritableEntity.md).[`permission`](../../../entity/classes/FavoritableEntity.md#permission)\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`ForeignEntity`](../../../../../generated/storage/types.gen/type-aliases/ForeignEntity.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`ForeignEntity`](../../../../../generated/storage/types.gen/type-aliases/ForeignEntity.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`ForeignEntity`](../../../../../generated/storage/types.gen/type-aliases/ForeignEntity.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`FavoritableEntity`](../../../entity/classes/FavoritableEntity.md).[`toJSON`](../../../entity/classes/FavoritableEntity.md#tojson)\n\n***\n\n### unfavorite()\n\n> **unfavorite**(): `Promise`\\<`ForeignEntity`\\>\n\nRemove this entity from the user's favorites. Returns this handle for chaining.\n\n#### Returns\n\n`Promise`\\<`ForeignEntity`\\>\n\n#### Inherited from\n\n[`FavoritableEntity`](../../../entity/classes/FavoritableEntity.md).[`unfavorite`](../../../entity/classes/FavoritableEntity.md#unfavorite)\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `id`): `ForeignEntity`\n\nA handle to a foreign entity by its internal record id. Details load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `id` | `string` |\n\n#### Returns\n\n`ForeignEntity`\n\n***\n\n### fromRecord()\n\n> `static` **fromRecord**(`client`, `record`): `ForeignEntity`\n\nBuild a foreign entity from an already-fetched record (pre-seeded, no fetch).\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `record` | [`ForeignEntity`](../../../../../generated/storage/types.gen/type-aliases/ForeignEntity.md) |\n\n#### Returns\n\n`ForeignEntity`\n\n\n<!-- src/entities/foreign/namespace/classes/ForeignEntityNamespace.md -->\n# Class: ForeignEntityNamespace\n\n## Constructors\n\n### Constructor\n\n> **new ForeignEntityNamespace**(`client`): `ForeignEntityNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`ForeignEntityNamespace`\n\n## Methods\n\n### byId()\n\n> **byId**(`id`): [`ForeignEntity`](../../foreign-entity/classes/ForeignEntity.md)\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`ForeignEntity`](../../foreign-entity/classes/ForeignEntity.md)\n\n***\n\n### bySource()\n\n> **bySource**(`source`, `foreignEntityId`): `Promise`\\<[`ForeignEntity`](../../foreign-entity/classes/ForeignEntity.md)\\>\n\nLook a foreign entity up by the identifier its source system assigned.\n\n`foreignEntityId` may contain slashes — sources store them inside the\nidentifier, for example `owner/repo/pull/12`.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `source` | `string` |\n| `foreignEntityId` | `string` |\n\n#### Returns\n\n`Promise`\\<[`ForeignEntity`](../../foreign-entity/classes/ForeignEntity.md)\\>\n\n***\n\n### githubPullRequestFacets()\n\n> **githubPullRequestFacets**(): `Promise`\\<[`GithubPullRequestFacets`](../interfaces/GithubPullRequestFacets.md)\\>\n\nRepositories, authors, assignees, and labels among the GitHub pull\nrequests visible to the authenticated user and their team, each with how\nmany pull requests it covers. A pull request visible to both the user and\nthe team counts once.\n\n#### Returns\n\n`Promise`\\<[`GithubPullRequestFacets`](../interfaces/GithubPullRequestFacets.md)\\>\n\n\n<!-- src/entities/foreign/namespace/interfaces/GithubPullRequestFacets.md -->\n# Interface: GithubPullRequestFacets\n\nRepositories, authors, assignees, and labels among the GitHub pull requests\nvisible to the caller.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-assignees\"></a> `assignees` | [`GithubUserFacet`](../type-aliases/GithubUserFacet.md)[] | Assignees, most pull requests first. |\n| <a id=\"property-authors\"></a> `authors` | [`GithubUserFacet`](../type-aliases/GithubUserFacet.md)[] | Authors, most pull requests first. |\n| <a id=\"property-labels\"></a> `labels` | [`GithubLabelFacet`](../type-aliases/GithubLabelFacet.md)[] | Labels, most pull requests first. |\n| <a id=\"property-repositories\"></a> `repositories` | [`GithubRepositoryFacet`](../../../../../generated/storage/types.gen/type-aliases/GithubRepositoryFacet.md)[] | Repositories, most pull requests first. |\n\n\n<!-- src/entities/foreign/namespace/type-aliases/GithubLabelFacet.md -->\n# Type Alias: GithubLabelFacet\n\n> **GithubLabelFacet** = `Omit`\\<[`GithubLabelFacet`](../../../../../generated/storage/types.gen/type-aliases/GithubLabelFacet.md), `\"color\"`\\> & \\{ `color?`: `string`; \\}\n\nA label among the GitHub pull requests visible to the caller.\n\n## Type Declaration\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `color?` | `string` | The label's most recently synced color, as six hex digits without `#`. |\n\n\n<!-- src/entities/foreign/namespace/type-aliases/GithubUserFacet.md -->\n# Type Alias: GithubUserFacet\n\n> **GithubUserFacet** = `Omit`\\<[`GithubUserFacet`](../../../../../generated/storage/types.gen/type-aliases/GithubUserFacet.md), `\"login\"`\\> & \\{ `login?`: `string`; \\}\n\nA GitHub user among the pull requests visible to the caller, as an author or an assignee.\n\n## Type Declaration\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `login?` | `string` | The user's most recently synced GitHub login, when known. |\n"},{"name": "forms",@@ -99,7 +147,7 @@"name": "projects","description": "Organize entities into projects.","overview": "<!-- src/entities/projects/namespace/classes/ProjectNamespace.md -->\n# Class: ProjectNamespace\n\n## Constructors\n\n### Constructor\n\n> **new ProjectNamespace**(`client`): `ProjectNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`ProjectNamespace`\n\n## Methods\n\n### byId()\n\n> **byId**(`id`): [`Project`](../../project/classes/Project.md)\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`Project`](../../project/classes/Project.md)\n\n***\n\n### create()\n\n> **create**(`opts`): `Promise`\\<[`Project`](../../project/classes/Project.md)\\>\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts` | \\{ `name`: `string`; `parent?`: [`Project`](../../project/classes/Project.md); \\} |\n| `opts.name` | `string` |\n| `opts.parent?` | [`Project`](../../project/classes/Project.md) |\n\n#### Returns\n\n`Promise`\\<[`Project`](../../project/classes/Project.md)\\>\n\n***\n\n### search()\n\n> **search**(`query`, `opts?`): `AsyncGenerator`\\<[`Project`](../../project/classes/Project.md)\\>\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `query` | `string` |\n| `opts?` | [`SearchOpts`](../../../search/interfaces/SearchOpts.md) |\n\n#### Returns\n\n`AsyncGenerator`\\<[`Project`](../../project/classes/Project.md)\\>\n",- "documentation": "# Macro SDK: projects\n\nGenerated by TypeDoc. Paths below refer to the canonical Markdown hierarchy. Other entity handles are documented in their named section; request core for shared SDK helpers.\n\n<!-- generated/properties/types.gen/type-aliases/BulkUpdateEntityPropertyOptionsResponse.md -->\n# Type Alias: BulkUpdateEntityPropertyOptionsResponse\n\n> **BulkUpdateEntityPropertyOptionsResponse** = \\{ `properties`: [`EntityPropertyOptionSelectionResponse`](EntityPropertyOptionSelectionResponse.md)[]; \\}\n\nResponse for a bulk option update: each property's reconciled final ids.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-properties\"></a> `properties` | [`EntityPropertyOptionSelectionResponse`](EntityPropertyOptionSelectionResponse.md)[] | The final option ids per updated property. |\n\n\n<!-- generated/properties/types.gen/type-aliases/DataType.md -->\n# Type Alias: DataType\n\n> **DataType** = `\"BOOLEAN\"` \\| `\"DATE\"` \\| `\"NUMBER\"` \\| `\"STRING\"` \\| `\"SELECT_NUMBER\"` \\| `\"SELECT_STRING\"` \\| `\"TAG\"` \\| `\"ENTITY\"` \\| `\"LINK\"`\n\nData type for property values, determining storage and validation.\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityProperty.md -->\n# Type Alias: EntityProperty\n\n> **EntityProperty** = \\{ `created_at`: `string`; `entity_id`: `string`; `entity_type`: [`EntityType`](EntityType.md); `id`: `string`; `property_definition_id`: `string`; `updated_at`: `string`; \\}\n\nAssignment of a property definition to a specific entity (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-created_at\"></a> `created_at` | `string` |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` |\n| <a id=\"property-entity_type\"></a> `entity_type` | [`EntityType`](EntityType.md) |\n| <a id=\"property-id\"></a> `id` | `string` |\n| <a id=\"property-property_definition_id\"></a> `property_definition_id` | `string` |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityPropertyOptionSelectionResponse.md -->\n# Type Alias: EntityPropertyOptionSelectionResponse\n\n> **EntityPropertyOptionSelectionResponse** = \\{ `option_ids`: `string`[]; `property_id`: `string`; \\}\n\nThe reconciled final option ids stored for one property after a bulk update.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-option_ids\"></a> `option_ids` | `string`[] | The final option ids the server persisted, in stored order. |\n| <a id=\"property-property_id\"></a> `property_id` | `string` | The property definition the options belong to. |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md -->\n# Type Alias: EntityPropertyWithDefinition\n\n> **EntityPropertyWithDefinition** = \\{ `definition`: [`PropertyDefinition`](PropertyDefinition.md); `options?`: [`PropertyOption`](PropertyOption.md)[] \\| `null`; `property`: [`EntityProperty`](EntityProperty.md); `value?`: `null` \\| [`PropertyValue`](PropertyValue.md); \\}\n\nEntity property with its definition, value, and options (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-definition\"></a> `definition` | [`PropertyDefinition`](PropertyDefinition.md) |\n| <a id=\"property-options\"></a> `options?` | [`PropertyOption`](PropertyOption.md)[] \\| `null` |\n| <a id=\"property-property\"></a> `property` | [`EntityProperty`](EntityProperty.md) |\n| <a id=\"property-value\"></a> `value?` | `null` \\| [`PropertyValue`](PropertyValue.md) |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityReference.md -->\n# Type Alias: EntityReference\n\n> **EntityReference** = \\{ `entity_id`: `string`; `entity_type`: [`EntityType`](EntityType.md); `specific_message_id?`: `string` \\| `null`; \\}\n\nEntity reference for entity-type property values.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | - |\n| <a id=\"property-entity_type\"></a> `entity_type` | [`EntityType`](EntityType.md) | - |\n| <a id=\"property-specific_message_id\"></a> `specific_message_id?` | `string` \\| `null` | For CHANNEL, CHAT, THREAD entity types - optional specific message ID. This allows referencing a specific message within a thread/channel/chat. |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityType.md -->\n# Type Alias: EntityType\n\n> **EntityType** = `\"CALENDAR_EVENT\"` \\| `\"CALL_RECORD\"` \\| `\"CHANNEL\"` \\| `\"CHAT\"` \\| `\"COMPANY\"` \\| `\"DATABASE_ROW\"` \\| `\"CONTACT\"` \\| `\"DOCUMENT\"` \\| `\"INITIATIVE\"` \\| `\"PROJECT\"` \\| `\"TASK\"` \\| `\"THREAD\"` \\| `\"USER\"`\n\nType of entity that can be referenced by entity properties.\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyDefinition.md -->\n# Type Alias: PropertyDefinition\n\n> **PropertyDefinition** = \\{ `created_at`: `string`; `data_type`: [`DataType`](DataType.md); `display_name`: `string`; `id`: `string`; `is_metadata`: `boolean`; `is_multi_select`: `boolean`; `is_system`: `boolean`; `owner`: [`PropertyOwner`](PropertyOwner.md); `specific_entity_type`: `null` \\| [`EntityType`](EntityType.md); `updated_at`: `string`; \\}\n\nProperty definition model (service representation).\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | - |\n| <a id=\"property-data_type\"></a> `data_type` | [`DataType`](DataType.md) | - |\n| <a id=\"property-display_name\"></a> `display_name` | `string` | - |\n| <a id=\"property-id\"></a> `id` | `string` | - |\n| <a id=\"property-is_metadata\"></a> `is_metadata` | `boolean` | Flag to indicate if this is a system-generated metadata property. Not stored in database - computed at service layer. |\n| <a id=\"property-is_multi_select\"></a> `is_multi_select` | `boolean` | - |\n| <a id=\"property-is_system\"></a> `is_system` | `boolean` | Flag to indicate if this is a system property (stored in DB). |\n| <a id=\"property-owner\"></a> `owner` | [`PropertyOwner`](PropertyOwner.md) | - |\n| <a id=\"property-specific_entity_type\"></a> `specific_entity_type` | `null` \\| [`EntityType`](EntityType.md) | - |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` | - |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyOption.md -->\n# Type Alias: PropertyOption\n\n> **PropertyOption** = \\{ `color`: `string` \\| `null`; `created_at`: `string`; `display_order`: `number`; `id`: `string`; `property_definition_id`: `string`; `updated_at`: `string`; `value`: [`PropertyOptionValue`](PropertyOptionValue.md); \\}\n\nA selectable option for select-type properties (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-color\"></a> `color` | `string` \\| `null` |\n| <a id=\"property-created_at\"></a> `created_at` | `string` |\n| <a id=\"property-display_order\"></a> `display_order` | `number` |\n| <a id=\"property-id\"></a> `id` | `string` |\n| <a id=\"property-property_definition_id\"></a> `property_definition_id` | `string` |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` |\n| <a id=\"property-value\"></a> `value` | [`PropertyOptionValue`](PropertyOptionValue.md) |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyOptionValue.md -->\n# Type Alias: PropertyOptionValue\n\n> **PropertyOptionValue** = \\{ `type`: `\"string\"`; `value`: `string`; \\} \\| \\{ `type`: `\"number\"`; `value`: `number`; \\}\n\nThe value of a property option - either a string or a number.\n\n## Union Members\n\n### Type Literal\n\n\\{ `type`: `\"string\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"string\"` | - |\n| `value` | `string` | String value for SelectString properties |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"number\"`; `value`: `number`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"number\"` | - |\n| `value` | `number` | Number value for SelectNumber properties |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyOwner.md -->\n# Type Alias: PropertyOwner\n\n> **PropertyOwner** = \\{ `scope`: `\"user\"`; `user_id`: `string`; \\} \\| \\{ `scope`: `\"team\"`; `team_id`: `string`; \\} \\| \\{ `database_id`: `string`; `scope`: `\"database\"`; \\} \\| \\{ `scope`: `\"system\"`; \\}\n\nDefines who owns a property - user-scoped, team-scoped, database-scoped, or system.\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyTargetEntityType.md -->\n# Type Alias: PropertyTargetEntityType\n\n> **PropertyTargetEntityType** = `\"CALL_RECORD\"` \\| `\"CHANNEL\"` \\| `\"CHAT\"` \\| `\"COMPANY\"` \\| `\"DATABASE_ROW\"` \\| `\"DOCUMENT\"` \\| `\"INITIATIVE\"` \\| `\"PROJECT\"` \\| `\"THREAD\"` \\| `\"USER\"`\n\nCanonical type of an entity receiving properties.\n\nTasks are documents at API boundaries. `Task` intentionally does not exist\nhere; task classification is resolved by the properties domain from the\ndocument subtype.\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyTargetReference.md -->\n# Type Alias: PropertyTargetReference\n\n> **PropertyTargetReference** = \\{ `entity_id`: `string`; `entity_type`: [`PropertyTargetEntityType`](PropertyTargetEntityType.md); \\}\n\nCanonical reference to an entity receiving properties.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | Entity identifier. |\n| <a id=\"property-entity_type\"></a> `entity_type` | [`PropertyTargetEntityType`](PropertyTargetEntityType.md) | Canonical entity type. |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyValue.md -->\n# Type Alias: PropertyValue\n\n> **PropertyValue** = \\{ `type`: `\"Boolean\"`; `value`: `boolean`; \\} \\| \\{ `type`: `\"Number\"`; `value`: `number`; \\} \\| \\{ `type`: `\"String\"`; `value`: `string`; \\} \\| \\{ `type`: `\"Date\"`; `value`: `string`; \\} \\| \\{ `type`: `\"SelectOption\"`; `value`: `string`[]; \\} \\| \\{ `type`: `\"EntityReference\"`; `value`: [`EntityReference`](EntityReference.md)[]; \\} \\| \\{ `type`: `\"Link\"`; `value`: `string`[]; \\}\n\nProperty value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to/from JSONB in the database.\n\n## Union Members\n\n### Type Literal\n\n\\{ `type`: `\"Boolean\"`; `value`: `boolean`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Boolean\"` | - |\n| `value` | `boolean` | Boolean value Serializes as: {\"type\": \"Boolean\", \"value\": true} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"Number\"`; `value`: `number`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Number\"` | - |\n| `value` | `number` | Numeric value Serializes as: {\"type\": \"Number\", \"value\": 42.5} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"String\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"String\"` | - |\n| `value` | `string` | String value Serializes as: {\"type\": \"String\", \"value\": \"text\"} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"Date\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Date\"` | - |\n| `value` | `string` | Date/timestamp value Serializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"SelectOption\"`; `value`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"SelectOption\"` | - |\n| `value` | `string`[] | Select option(s) - always an array (check is_multi_select to determine if single or multi) Single-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1) Multi-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+) |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"EntityReference\"`; `value`: [`EntityReference`](EntityReference.md)[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"EntityReference\"` | - |\n| `value` | [`EntityReference`](EntityReference.md)[] | Entity reference(s) - always an array (check is_multi_select to determine if single or multi) Single-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1) Multi-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+) |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"Link\"`; `value`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Link\"` | - |\n| `value` | `string`[] | Link value(s) - always an array (check is_multi_select to determine if single or multi) Single-select: {\"type\": \"Link\", \"value\": [\"https://example.com\"]} (length 0 or 1) Multi-select: {\"type\": \"Link\", \"value\": [\"https://example.com\", \"https://other.com\"]} (length 0+) |\n\n\n<!-- generated/properties/types.gen/type-aliases/SetPropertyValue.md -->\n# Type Alias: SetPropertyValue\n\n> **SetPropertyValue** = \\{ `type`: `\"boolean\"`; `value`: `boolean`; \\} \\| \\{ `type`: `\"date\"`; `value`: `string`; \\} \\| \\{ `type`: `\"number\"`; `value`: `number`; \\} \\| \\{ `type`: `\"string\"`; `value`: `string`; \\} \\| \\{ `option_id`: `string`; `type`: `\"select_option\"`; \\} \\| \\{ `option_ids`: `string`[]; `type`: `\"multi_select_option\"`; \\} \\| \\{ `reference`: [`EntityReference`](EntityReference.md); `type`: `\"entity_reference\"`; \\} \\| \\{ `references`: [`EntityReference`](EntityReference.md)[]; `type`: `\"multi_entity_reference\"`; \\} \\| \\{ `type`: `\"link\"`; `url`: `string`; \\} \\| \\{ `type`: `\"multi_link\"`; `urls`: `string`[]; \\}\n\nType-safe enum for setting entity property values - provides compile-time validation.\n\n\n<!-- generated/storage/types.gen/type-aliases/BasicDocument.md -->\n# Type Alias: BasicDocument\n\n> **BasicDocument** = \\{ `branchedFromId?`: `string` \\| `null`; `branchedFromVersionId?`: `number` \\| `null`; `createdAt?`: `string` \\| `null`; `deletedAt?`: `string` \\| `null`; `documentFamilyId?`: `number` \\| `null`; `documentVersionId`: `number`; `fileType?`: `string` \\| `null`; `id`: `string`; `name`: `string`; `owner`: `string`; `projectId?`: `string` \\| `null`; `sha?`: `string` \\| `null`; `subType?`: `null` \\| [`BasicDocumentSubType`](BasicDocumentSubType.md); `updatedAt?`: `string` \\| `null`; \\}\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-branchedfromid\"></a> `branchedFromId?` | `string` \\| `null` | The id of the document this document branched from |\n| <a id=\"property-branchedfromversionid\"></a> `branchedFromVersionId?` | `number` \\| `null` | The id of the version this document branched from This could be either DocumentInstance or DocumentBom id depending on the file type |\n| <a id=\"property-createdat\"></a> `createdAt?` | `string` \\| `null` | The time the document was created |\n| <a id=\"property-deletedat\"></a> `deletedAt?` | `string` \\| `null` | The time the document was deleted |\n| <a id=\"property-documentfamilyid\"></a> `documentFamilyId?` | `number` \\| `null` | The id of the document family this document belongs to |\n| <a id=\"property-documentversionid\"></a> `documentVersionId` | `number` | The version of the document This could be the document_instance_id or document_bom_id depending on the file type |\n| <a id=\"property-filetype\"></a> `fileType?` | `string` \\| `null` | The file type of the document (e.g. pdf, docx) |\n| <a id=\"property-id\"></a> `id` | `string` | The document id |\n| <a id=\"property-name\"></a> `name` | `string` | The name of the document |\n| <a id=\"property-owner\"></a> `owner` | `string` | The owner of the document |\n| <a id=\"property-projectid\"></a> `projectId?` | `string` \\| `null` | The id of the project that this document belongs to |\n| <a id=\"property-sha\"></a> `sha?` | `string` \\| `null` | If the document is a PDF, this is the SHA of the pdf If the document is a DOCX, this will not be present |\n| <a id=\"property-subtype\"></a> `subType?` | `null` \\| [`BasicDocumentSubType`](BasicDocumentSubType.md) | - |\n| <a id=\"property-updatedat\"></a> `updatedAt?` | `string` \\| `null` | The time the document instance / document BOM was updated |\n\n\n<!-- generated/storage/types.gen/type-aliases/BasicDocumentSubType.md -->\n# Type Alias: BasicDocumentSubType\n\n> **BasicDocumentSubType** = \\{ `is_completed`: `boolean`; `type`: `\"task\"`; \\} \\| \\{ `type`: `\"snippet\"`; \\} \\| \\{ `type`: `\"skill\"`; \\} \\| \\{ `type`: `\"initiative_description\"`; \\}\n\nSub type of a document with associated properties encoded in each variant.\nThis ensures type-safety: task properties only exist when the document is a task.\n\n## Union Members\n\n### Type Literal\n\n\\{ `is_completed`: `boolean`; `type`: `\"task\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `is_completed` | `boolean` | Whether the task is completed. True if the Status property is set to \"Completed\". |\n| `type` | `\"task\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"snippet\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"skill\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"initiative_description\"`; \\}\n\n\n<!-- generated/storage/types.gen/type-aliases/Chat.md -->\n# Type Alias: Chat\n\n> **Chat** = \\{ `createdAt?`: `string` \\| `null`; `deletedAt?`: `string` \\| `null`; `id`: `string`; `isPersistent`: `boolean`; `model?`: `string` \\| `null`; `name`: `string`; `projectId?`: `string` \\| `null`; `tokenCount?`: `number` \\| `null`; `updatedAt?`: `string` \\| `null`; `userId`: `string`; \\}\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-createdat\"></a> `createdAt?` | `string` \\| `null` | The time the chat was created |\n| <a id=\"property-deletedat\"></a> `deletedAt?` | `string` \\| `null` | The time the chat was deleted |\n| <a id=\"property-id\"></a> `id` | `string` | The chat uuid |\n| <a id=\"property-ispersistent\"></a> `isPersistent` | `boolean` | - |\n| <a id=\"property-model\"></a> `model?` | `string` \\| `null` | The model used to generate the chat |\n| <a id=\"property-name\"></a> `name` | `string` | The name of the chat |\n| <a id=\"property-projectid\"></a> `projectId?` | `string` \\| `null` | The project id of the chat |\n| <a id=\"property-tokencount\"></a> `tokenCount?` | `number` \\| `null` | - |\n| <a id=\"property-updatedat\"></a> `updatedAt?` | `string` \\| `null` | The time the chat was last updated |\n| <a id=\"property-userid\"></a> `userId` | `string` | Who the chat belongs to |\n\n\n<!-- generated/storage/types.gen/type-aliases/Item.md -->\n# Type Alias: Item\n\n> **Item** = \\{ `type`: `\"document\"`; \\} & [`BasicDocument`](BasicDocument.md) \\| \\{ `type`: `\"chat\"`; \\} & [`Chat`](Chat.md) \\| \\{ `type`: `\"project\"`; \\} & [`Project`](Project.md)\n\n\n<!-- generated/storage/types.gen/type-aliases/Project.md -->\n# Type Alias: Project\n\n> **Project** = \\{ `createdAt?`: `string` \\| `null`; `deletedAt?`: `string` \\| `null`; `id`: `string`; `name`: `string`; `parentId?`: `string` \\| `null`; `updatedAt?`: `string` \\| `null`; `userId`: `string`; \\}\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-createdat\"></a> `createdAt?` | `string` \\| `null` | The time the project was created |\n| <a id=\"property-deletedat\"></a> `deletedAt?` | `string` \\| `null` | - |\n| <a id=\"property-id\"></a> `id` | `string` | The id of the project |\n| <a id=\"property-name\"></a> `name` | `string` | The name of the project |\n| <a id=\"property-parentid\"></a> `parentId?` | `string` \\| `null` | The parent project id |\n| <a id=\"property-updatedat\"></a> `updatedAt?` | `string` \\| `null` | The time the project was updated |\n| <a id=\"property-userid\"></a> `userId` | `string` | The user id of who created the project |\n\n\n<!-- src/entities/projects/namespace/classes/ProjectNamespace.md -->\n# Class: ProjectNamespace\n\n## Constructors\n\n### Constructor\n\n> **new ProjectNamespace**(`client`): `ProjectNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`ProjectNamespace`\n\n## Methods\n\n### byId()\n\n> **byId**(`id`): [`Project`](../../project/classes/Project.md)\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`Project`](../../project/classes/Project.md)\n\n***\n\n### create()\n\n> **create**(`opts`): `Promise`\\<[`Project`](../../project/classes/Project.md)\\>\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts` | \\{ `name`: `string`; `parent?`: [`Project`](../../project/classes/Project.md); \\} |\n| `opts.name` | `string` |\n| `opts.parent?` | [`Project`](../../project/classes/Project.md) |\n\n#### Returns\n\n`Promise`\\<[`Project`](../../project/classes/Project.md)\\>\n\n***\n\n### search()\n\n> **search**(`query`, `opts?`): `AsyncGenerator`\\<[`Project`](../../project/classes/Project.md)\\>\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `query` | `string` |\n| `opts?` | [`SearchOpts`](../../../search/interfaces/SearchOpts.md) |\n\n#### Returns\n\n`AsyncGenerator`\\<[`Project`](../../project/classes/Project.md)\\>\n\n\n<!-- src/entities/projects/project/classes/Project.md -->\n# Class: Project\n\nA Macro project: a folder-like container for documents, chats, and subprojects.\n\n## Extends\n\n- [`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md)\\<`ProjectDetail`\\>\n\n## Properties\n\n| Property | Modifier | Type | Default value | Description | Overrides | Inherited from |\n| ------ | ------ | ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-createdat\"></a> `createdAt` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | `...` | When the project was created (RFC 3339 timestamp). | - | - |\n| <a id=\"property-entitytype\"></a> `entityType` | `readonly` | `\"project\"` | `'project'` | Favorites identify projects as `project`. | [`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`entityType`](../../../entity/classes/PropertiedEntity.md#property-entitytype) | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | `undefined` | - | - | [`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`id`](../../../entity/classes/PropertiedEntity.md#property-id) |\n| <a id=\"property-name\"></a> `name` | `readonly` | () => `Promise`\\<`string`\\> | `...` | The project's display name. | - | - |\n| <a id=\"property-parent\"></a> `parent` | `readonly` | () => `Promise`\\<`Project` \\| `undefined`\\> | `...` | The parent project, if this project is nested. | - | - |\n| <a id=\"property-search\"></a> `search` | `static` | (`client`, `query`, `searchOpts?`) => `AsyncGenerator`\\<`Project`\\> | `...` | Search projects by name and content, most relevant first, auto-paginated. | - | - |\n\n## Methods\n\n### delete()\n\n> **delete**(`opts?`): `Promise`\\<`void`\\>\n\nDelete the project and its contents. Soft by default (reversible with\n[restore](#restore)); pass `permanent: true` to delete irreversibly.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts?` | \\{ `permanent?`: `boolean`; \\} |\n| `opts.permanent?` | `boolean` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### deleteProperty()\n\n> **deleteProperty**(`assignment`): `Promise`\\<`void`\\>\n\nRemove a property from this entity, given its [properties](#properties) entry.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `assignment` | [`EntityPropertyWithDefinition`](../../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`deleteProperty`](../../../entity/classes/PropertiedEntity.md#deleteproperty)\n\n***\n\n### favorite()\n\n> **favorite**(): `Promise`\\<`Project`\\>\n\nAdd this entity to the user's favorites. Returns this handle for chaining.\nPlain unwrap: favoriting alters the user's favorites collection, not this\nentity's own detail, so there's nothing cached to invalidate.\n\n#### Returns\n\n`Promise`\\<`Project`\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`favorite`](../../../entity/classes/PropertiedEntity.md#favorite)\n\n***\n\n### items()\n\n> **items**(): `Promise`\\<[`Item`](../../../../../generated/storage/types.gen/type-aliases/Item.md)[]\\>\n\nThe items (documents, chats, subprojects) directly inside this project.\n\n#### Returns\n\n`Promise`\\<[`Item`](../../../../../generated/storage/types.gen/type-aliases/Item.md)[]\\>\n\n***\n\n### properties()\n\n> **properties**(`opts?`): `Promise`\\<[`EntityPropertyWithDefinition`](../../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md)[]\\>\n\nThe properties set on this entity, each with its definition, value, and options.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts?` | \\{ `includeMetadata?`: `boolean`; \\} |\n| `opts.includeMetadata?` | `boolean` |\n\n#### Returns\n\n`Promise`\\<[`EntityPropertyWithDefinition`](../../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md)[]\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`properties`](../../../entity/classes/PropertiedEntity.md#properties)\n\n***\n\n### propertyReference()\n\n> **propertyReference**(): [`PropertyTargetReference`](../../../../../generated/properties/types.gen/type-aliases/PropertyTargetReference.md)\n\nThis entity's reference for bulk property operations.\n\n#### Returns\n\n[`PropertyTargetReference`](../../../../../generated/properties/types.gen/type-aliases/PropertyTargetReference.md)\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`propertyReference`](../../../entity/classes/PropertiedEntity.md#propertyreference)\n\n***\n\n### rename()\n\n> **rename**(`name`): `Promise`\\<`void`\\>\n\nRename the project.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `name` | `string` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### restore()\n\n> **restore**(): `Promise`\\<`void`\\>\n\nRestore a soft-deleted project.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### setProperty()\n\n> **setProperty**(`property`, `value?`): `Promise`\\<`void`\\>\n\nSet a property value on this entity, or attach the property without a\nvalue when `value` is omitted.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `property` | [`PropertyDefinition`](../../../properties/property-definition/classes/PropertyDefinition.md) |\n| `value?` | [`SetPropertyValue`](../../../../../generated/properties/types.gen/type-aliases/SetPropertyValue.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`setProperty`](../../../entity/classes/PropertiedEntity.md#setproperty)\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`Project`](../../../../../generated/storage/types.gen/type-aliases/Project.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`Project`](../../../../../generated/storage/types.gen/type-aliases/Project.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`Project`](../../../../../generated/storage/types.gen/type-aliases/Project.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`toJSON`](../../../entity/classes/PropertiedEntity.md#tojson)\n\n***\n\n### unfavorite()\n\n> **unfavorite**(): `Promise`\\<`Project`\\>\n\nRemove this entity from the user's favorites. Returns this handle for chaining.\n\n#### Returns\n\n`Promise`\\<`Project`\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`unfavorite`](../../../entity/classes/PropertiedEntity.md#unfavorite)\n\n***\n\n### updatePropertyOptions()\n\n> **updatePropertyOptions**(`changes`): `Promise`\\<[`BulkUpdateEntityPropertyOptionsResponse`](../../../../../generated/properties/types.gen/type-aliases/BulkUpdateEntityPropertyOptionsResponse.md)\\>\n\nApply multi-select option deltas atomically across this entity's properties.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `changes` | [`PropertyOptionDelta`](../../../entity/interfaces/PropertyOptionDelta.md)[] |\n\n#### Returns\n\n`Promise`\\<[`BulkUpdateEntityPropertyOptionsResponse`](../../../../../generated/properties/types.gen/type-aliases/BulkUpdateEntityPropertyOptionsResponse.md)\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`updatePropertyOptions`](../../../entity/classes/PropertiedEntity.md#updatepropertyoptions)\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `id`): `Project`\n\nA handle to a project by id. Details load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `id` | `string` |\n\n#### Returns\n\n`Project`\n\n***\n\n### create()\n\n> `static` **create**(`client`, `opts`): `Promise`\\<`Project`\\>\n\nCreate a project, optionally nested inside a parent project.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `opts` | \\{ `name`: `string`; `parent?`: `Project`; \\} |\n| `opts.name` | `string` |\n| `opts.parent?` | `Project` |\n\n#### Returns\n\n`Promise`\\<`Project`\\>\n"+ "documentation": "# Macro SDK: projects\n\nGenerated by TypeDoc. Paths below refer to the canonical Markdown hierarchy. Other entity handles are documented in their named section; request core for shared SDK helpers.\n\n<!-- generated/properties/types.gen/type-aliases/BulkUpdateEntityPropertyOptionsResponse.md -->\n# Type Alias: BulkUpdateEntityPropertyOptionsResponse\n\n> **BulkUpdateEntityPropertyOptionsResponse** = \\{ `properties`: [`EntityPropertyOptionSelectionResponse`](EntityPropertyOptionSelectionResponse.md)[]; \\}\n\nResponse for a bulk option update: each property's reconciled final ids.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-properties\"></a> `properties` | [`EntityPropertyOptionSelectionResponse`](EntityPropertyOptionSelectionResponse.md)[] | The final option ids per updated property. |\n\n\n<!-- generated/properties/types.gen/type-aliases/DataType.md -->\n# Type Alias: DataType\n\n> **DataType** = `\"BOOLEAN\"` \\| `\"DATE\"` \\| `\"NUMBER\"` \\| `\"STRING\"` \\| `\"SELECT_NUMBER\"` \\| `\"SELECT_STRING\"` \\| `\"TAG\"` \\| `\"ENTITY\"` \\| `\"LINK\"`\n\nData type for property values, determining storage and validation.\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityProperty.md -->\n# Type Alias: EntityProperty\n\n> **EntityProperty** = \\{ `created_at`: `string`; `entity_id`: `string`; `entity_type`: [`EntityType`](EntityType.md); `id`: `string`; `property_definition_id`: `string`; `updated_at`: `string`; \\}\n\nAssignment of a property definition to a specific entity (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-created_at\"></a> `created_at` | `string` |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` |\n| <a id=\"property-entity_type\"></a> `entity_type` | [`EntityType`](EntityType.md) |\n| <a id=\"property-id\"></a> `id` | `string` |\n| <a id=\"property-property_definition_id\"></a> `property_definition_id` | `string` |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityPropertyOptionSelectionResponse.md -->\n# Type Alias: EntityPropertyOptionSelectionResponse\n\n> **EntityPropertyOptionSelectionResponse** = \\{ `option_ids`: `string`[]; `property_id`: `string`; \\}\n\nThe reconciled final option ids stored for one property after a bulk update.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-option_ids\"></a> `option_ids` | `string`[] | The final option ids the server persisted, in stored order. |\n| <a id=\"property-property_id\"></a> `property_id` | `string` | The property definition the options belong to. |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md -->\n# Type Alias: EntityPropertyWithDefinition\n\n> **EntityPropertyWithDefinition** = \\{ `definition`: [`PropertyDefinition`](PropertyDefinition.md); `options?`: [`PropertyOption`](PropertyOption.md)[] \\| `null`; `property`: [`EntityProperty`](EntityProperty.md); `value?`: `null` \\| [`PropertyValue`](PropertyValue.md); \\}\n\nEntity property with its definition, value, and options (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-definition\"></a> `definition` | [`PropertyDefinition`](PropertyDefinition.md) |\n| <a id=\"property-options\"></a> `options?` | [`PropertyOption`](PropertyOption.md)[] \\| `null` |\n| <a id=\"property-property\"></a> `property` | [`EntityProperty`](EntityProperty.md) |\n| <a id=\"property-value\"></a> `value?` | `null` \\| [`PropertyValue`](PropertyValue.md) |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityReference.md -->\n# Type Alias: EntityReference\n\n> **EntityReference** = \\{ `entity_id`: `string`; `entity_type`: [`EntityType`](EntityType.md); `specific_message_id?`: `string` \\| `null`; \\}\n\nEntity reference for entity-type property values.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | - |\n| <a id=\"property-entity_type\"></a> `entity_type` | [`EntityType`](EntityType.md) | - |\n| <a id=\"property-specific_message_id\"></a> `specific_message_id?` | `string` \\| `null` | For CHANNEL, CHAT, THREAD entity types - optional specific message ID. This allows referencing a specific message within a thread/channel/chat. |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityType.md -->\n# Type Alias: EntityType\n\n> **EntityType** = `\"CALENDAR_EVENT\"` \\| `\"CALL_RECORD\"` \\| `\"CHANNEL\"` \\| `\"CHAT\"` \\| `\"COMPANY\"` \\| `\"DATABASE_ROW\"` \\| `\"CONTACT\"` \\| `\"DOCUMENT\"` \\| `\"INITIATIVE\"` \\| `\"PROJECT\"` \\| `\"TASK\"` \\| `\"THREAD\"` \\| `\"USER\"`\n\nType of entity that can be referenced by entity properties.\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyDefinition.md -->\n# Type Alias: PropertyDefinition\n\n> **PropertyDefinition** = \\{ `created_at`: `string`; `data_type`: [`DataType`](DataType.md); `display_name`: `string`; `id`: `string`; `is_metadata`: `boolean`; `is_multi_select`: `boolean`; `is_system`: `boolean`; `owner`: [`PropertyOwner`](PropertyOwner.md); `specific_entity_type`: `null` \\| [`EntityType`](EntityType.md); `updated_at`: `string`; \\}\n\nProperty definition model (service representation).\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | - |\n| <a id=\"property-data_type\"></a> `data_type` | [`DataType`](DataType.md) | - |\n| <a id=\"property-display_name\"></a> `display_name` | `string` | - |\n| <a id=\"property-id\"></a> `id` | `string` | - |\n| <a id=\"property-is_metadata\"></a> `is_metadata` | `boolean` | Flag to indicate if this is a system-generated metadata property. Not stored in database - computed at service layer. |\n| <a id=\"property-is_multi_select\"></a> `is_multi_select` | `boolean` | - |\n| <a id=\"property-is_system\"></a> `is_system` | `boolean` | Flag to indicate if this is a system property (stored in DB). |\n| <a id=\"property-owner\"></a> `owner` | [`PropertyOwner`](PropertyOwner.md) | - |\n| <a id=\"property-specific_entity_type\"></a> `specific_entity_type` | `null` \\| [`EntityType`](EntityType.md) | - |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` | - |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyOption.md -->\n# Type Alias: PropertyOption\n\n> **PropertyOption** = \\{ `color`: `string` \\| `null`; `created_at`: `string`; `display_order`: `number`; `id`: `string`; `property_definition_id`: `string`; `updated_at`: `string`; `value`: [`PropertyOptionValue`](PropertyOptionValue.md); \\}\n\nA selectable option for select-type properties (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-color\"></a> `color` | `string` \\| `null` |\n| <a id=\"property-created_at\"></a> `created_at` | `string` |\n| <a id=\"property-display_order\"></a> `display_order` | `number` |\n| <a id=\"property-id\"></a> `id` | `string` |\n| <a id=\"property-property_definition_id\"></a> `property_definition_id` | `string` |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` |\n| <a id=\"property-value\"></a> `value` | [`PropertyOptionValue`](PropertyOptionValue.md) |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyOptionValue.md -->\n# Type Alias: PropertyOptionValue\n\n> **PropertyOptionValue** = \\{ `type`: `\"string\"`; `value`: `string`; \\} \\| \\{ `type`: `\"number\"`; `value`: `number`; \\}\n\nThe value of a property option - either a string or a number.\n\n## Union Members\n\n### Type Literal\n\n\\{ `type`: `\"string\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"string\"` | - |\n| `value` | `string` | String value for SelectString properties |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"number\"`; `value`: `number`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"number\"` | - |\n| `value` | `number` | Number value for SelectNumber properties |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyOwner.md -->\n# Type Alias: PropertyOwner\n\n> **PropertyOwner** = \\{ `scope`: `\"user\"`; `user_id`: `string`; \\} \\| \\{ `scope`: `\"team\"`; `team_id`: `string`; \\} \\| \\{ `database_id`: `string`; `scope`: `\"database\"`; \\} \\| \\{ `scope`: `\"system\"`; \\}\n\nDefines who owns a property - user-scoped, team-scoped, database-scoped, or system.\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyTargetEntityType.md -->\n# Type Alias: PropertyTargetEntityType\n\n> **PropertyTargetEntityType** = `\"CALL_RECORD\"` \\| `\"CHANNEL\"` \\| `\"CHAT\"` \\| `\"COMPANY\"` \\| `\"DATABASE_ROW\"` \\| `\"DOCUMENT\"` \\| `\"INITIATIVE\"` \\| `\"PROJECT\"` \\| `\"THREAD\"` \\| `\"USER\"`\n\nCanonical type of an entity receiving properties.\n\nTasks are documents at API boundaries. `Task` intentionally does not exist\nhere; task classification is resolved by the properties domain from the\ndocument subtype.\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyTargetReference.md -->\n# Type Alias: PropertyTargetReference\n\n> **PropertyTargetReference** = \\{ `entity_id`: `string`; `entity_type`: [`PropertyTargetEntityType`](PropertyTargetEntityType.md); \\}\n\nCanonical reference to an entity receiving properties.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | Entity identifier. |\n| <a id=\"property-entity_type\"></a> `entity_type` | [`PropertyTargetEntityType`](PropertyTargetEntityType.md) | Canonical entity type. |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyValue.md -->\n# Type Alias: PropertyValue\n\n> **PropertyValue** = \\{ `type`: `\"Boolean\"`; `value`: `boolean`; \\} \\| \\{ `type`: `\"Number\"`; `value`: `number`; \\} \\| \\{ `type`: `\"String\"`; `value`: `string`; \\} \\| \\{ `type`: `\"Date\"`; `value`: `string`; \\} \\| \\{ `type`: `\"SelectOption\"`; `value`: `string`[]; \\} \\| \\{ `type`: `\"EntityReference\"`; `value`: [`EntityReference`](EntityReference.md)[]; \\} \\| \\{ `type`: `\"Link\"`; `value`: `string`[]; \\}\n\nProperty value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to/from JSONB in the database.\n\n## Union Members\n\n### Type Literal\n\n\\{ `type`: `\"Boolean\"`; `value`: `boolean`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Boolean\"` | - |\n| `value` | `boolean` | Boolean value Serializes as: {\"type\": \"Boolean\", \"value\": true} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"Number\"`; `value`: `number`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Number\"` | - |\n| `value` | `number` | Numeric value Serializes as: {\"type\": \"Number\", \"value\": 42.5} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"String\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"String\"` | - |\n| `value` | `string` | String value Serializes as: {\"type\": \"String\", \"value\": \"text\"} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"Date\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Date\"` | - |\n| `value` | `string` | Date/timestamp value Serializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"SelectOption\"`; `value`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"SelectOption\"` | - |\n| `value` | `string`[] | Select option(s) - always an array (check is_multi_select to determine if single or multi) Single-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1) Multi-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+) |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"EntityReference\"`; `value`: [`EntityReference`](EntityReference.md)[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"EntityReference\"` | - |\n| `value` | [`EntityReference`](EntityReference.md)[] | Entity reference(s) - always an array (check is_multi_select to determine if single or multi) Single-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1) Multi-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+) |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"Link\"`; `value`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Link\"` | - |\n| `value` | `string`[] | Link value(s) - always an array (check is_multi_select to determine if single or multi) Single-select: {\"type\": \"Link\", \"value\": [\"https://example.com\"]} (length 0 or 1) Multi-select: {\"type\": \"Link\", \"value\": [\"https://example.com\", \"https://other.com\"]} (length 0+) |\n\n\n<!-- generated/properties/types.gen/type-aliases/SetPropertyValue.md -->\n# Type Alias: SetPropertyValue\n\n> **SetPropertyValue** = \\{ `type`: `\"boolean\"`; `value`: `boolean`; \\} \\| \\{ `type`: `\"date\"`; `value`: `string`; \\} \\| \\{ `type`: `\"number\"`; `value`: `number`; \\} \\| \\{ `type`: `\"string\"`; `value`: `string`; \\} \\| \\{ `option_id`: `string`; `type`: `\"select_option\"`; \\} \\| \\{ `option_ids`: `string`[]; `type`: `\"multi_select_option\"`; \\} \\| \\{ `reference`: [`EntityReference`](EntityReference.md); `type`: `\"entity_reference\"`; \\} \\| \\{ `references`: [`EntityReference`](EntityReference.md)[]; `type`: `\"multi_entity_reference\"`; \\} \\| \\{ `type`: `\"link\"`; `url`: `string`; \\} \\| \\{ `type`: `\"multi_link\"`; `urls`: `string`[]; \\}\n\nType-safe enum for setting entity property values - provides compile-time validation.\n\n\n<!-- generated/storage/types.gen/type-aliases/AccessLevel.md -->\n# Type Alias: AccessLevel\n\n> **AccessLevel** = `\"view\"` \\| `\"comment\"` \\| `\"edit\"` \\| `\"owner\"`\n\nOrdered from least to most access top -> bottom\n\n\n<!-- generated/storage/types.gen/type-aliases/BasicDocument.md -->\n# Type Alias: BasicDocument\n\n> **BasicDocument** = \\{ `branchedFromId?`: `string` \\| `null`; `branchedFromVersionId?`: `number` \\| `null`; `createdAt?`: `string` \\| `null`; `deletedAt?`: `string` \\| `null`; `documentFamilyId?`: `number` \\| `null`; `documentVersionId`: `number`; `fileType?`: `string` \\| `null`; `id`: `string`; `name`: `string`; `owner`: `string`; `projectId?`: `string` \\| `null`; `sha?`: `string` \\| `null`; `subType?`: `null` \\| [`BasicDocumentSubType`](BasicDocumentSubType.md); `updatedAt?`: `string` \\| `null`; \\}\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-branchedfromid\"></a> `branchedFromId?` | `string` \\| `null` | The id of the document this document branched from |\n| <a id=\"property-branchedfromversionid\"></a> `branchedFromVersionId?` | `number` \\| `null` | The id of the version this document branched from This could be either DocumentInstance or DocumentBom id depending on the file type |\n| <a id=\"property-createdat\"></a> `createdAt?` | `string` \\| `null` | The time the document was created |\n| <a id=\"property-deletedat\"></a> `deletedAt?` | `string` \\| `null` | The time the document was deleted |\n| <a id=\"property-documentfamilyid\"></a> `documentFamilyId?` | `number` \\| `null` | The id of the document family this document belongs to |\n| <a id=\"property-documentversionid\"></a> `documentVersionId` | `number` | The version of the document This could be the document_instance_id or document_bom_id depending on the file type |\n| <a id=\"property-filetype\"></a> `fileType?` | `string` \\| `null` | The file type of the document (e.g. pdf, docx) |\n| <a id=\"property-id\"></a> `id` | `string` | The document id |\n| <a id=\"property-name\"></a> `name` | `string` | The name of the document |\n| <a id=\"property-owner\"></a> `owner` | `string` | The owner of the document |\n| <a id=\"property-projectid\"></a> `projectId?` | `string` \\| `null` | The id of the project that this document belongs to |\n| <a id=\"property-sha\"></a> `sha?` | `string` \\| `null` | If the document is a PDF, this is the SHA of the pdf If the document is a DOCX, this will not be present |\n| <a id=\"property-subtype\"></a> `subType?` | `null` \\| [`BasicDocumentSubType`](BasicDocumentSubType.md) | - |\n| <a id=\"property-updatedat\"></a> `updatedAt?` | `string` \\| `null` | The time the document instance / document BOM was updated |\n\n\n<!-- generated/storage/types.gen/type-aliases/BasicDocumentSubType.md -->\n# Type Alias: BasicDocumentSubType\n\n> **BasicDocumentSubType** = \\{ `is_completed`: `boolean`; `type`: `\"task\"`; \\} \\| \\{ `type`: `\"snippet\"`; \\} \\| \\{ `type`: `\"skill\"`; \\} \\| \\{ `type`: `\"initiative_description\"`; \\}\n\nSub type of a document with associated properties encoded in each variant.\nThis ensures type-safety: task properties only exist when the document is a task.\n\n## Union Members\n\n### Type Literal\n\n\\{ `is_completed`: `boolean`; `type`: `\"task\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `is_completed` | `boolean` | Whether the task is completed. True if the Status property is set to \"Completed\". |\n| `type` | `\"task\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"snippet\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"skill\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"initiative_description\"`; \\}\n\n\n<!-- generated/storage/types.gen/type-aliases/ChannelSharePermission.md -->\n# Type Alias: ChannelSharePermission\n\n> **ChannelSharePermission** = \\{ `access_level`: [`AccessLevel`](AccessLevel.md); `channel_id`: `string`; \\}\n\nThe channel share permission\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-access_level\"></a> `access_level` | [`AccessLevel`](AccessLevel.md) | The access level for the channel |\n| <a id=\"property-channel_id\"></a> `channel_id` | `string` | The channel id |\n\n\n<!-- generated/storage/types.gen/type-aliases/Chat.md -->\n# Type Alias: Chat\n\n> **Chat** = \\{ `createdAt?`: `string` \\| `null`; `deletedAt?`: `string` \\| `null`; `id`: `string`; `isPersistent`: `boolean`; `model?`: `string` \\| `null`; `name`: `string`; `projectId?`: `string` \\| `null`; `tokenCount?`: `number` \\| `null`; `updatedAt?`: `string` \\| `null`; `userId`: `string`; \\}\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-createdat\"></a> `createdAt?` | `string` \\| `null` | The time the chat was created |\n| <a id=\"property-deletedat\"></a> `deletedAt?` | `string` \\| `null` | The time the chat was deleted |\n| <a id=\"property-id\"></a> `id` | `string` | The chat uuid |\n| <a id=\"property-ispersistent\"></a> `isPersistent` | `boolean` | - |\n| <a id=\"property-model\"></a> `model?` | `string` \\| `null` | The model used to generate the chat |\n| <a id=\"property-name\"></a> `name` | `string` | The name of the chat |\n| <a id=\"property-projectid\"></a> `projectId?` | `string` \\| `null` | The project id of the chat |\n| <a id=\"property-tokencount\"></a> `tokenCount?` | `number` \\| `null` | - |\n| <a id=\"property-updatedat\"></a> `updatedAt?` | `string` \\| `null` | The time the chat was last updated |\n| <a id=\"property-userid\"></a> `userId` | `string` | Who the chat belongs to |\n\n\n<!-- generated/storage/types.gen/type-aliases/EntityPermission.md -->\n# Type Alias: EntityPermission\n\n> **EntityPermission** = \\{ `access_level`: [`AccessLevel`](AccessLevel.md); `type`: `\"access_level\"`; \\} \\| \\{ `type`: `\"channel_view_only\"`; \\} \\| \\{ `role`: [`ParticipantRole`](ParticipantRole.md); `type`: `\"channel_role\"`; \\} \\| \\{ `role`: [`TeamRole`](TeamRole.md); `type`: `\"team_role\"`; \\}\n\nA user's permission for an entity, discriminated by entity kind.\n\nItems (documents, chats, projects, threads) use access levels.\nChannels use view-only permission or participant roles.\n\n## Union Members\n\n### Type Literal\n\n\\{ `access_level`: [`AccessLevel`](AccessLevel.md); `type`: `\"access_level\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `access_level` | [`AccessLevel`](AccessLevel.md) | The access level the user has. |\n| `type` | `\"access_level\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"channel_view_only\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `role`: [`ParticipantRole`](ParticipantRole.md); `type`: `\"channel_role\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `role` | [`ParticipantRole`](ParticipantRole.md) | The role the user has in the channel. |\n| `type` | `\"channel_role\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `role`: [`TeamRole`](TeamRole.md); `type`: `\"team_role\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `role` | [`TeamRole`](TeamRole.md) | The role the user has in the team. |\n| `type` | `\"team_role\"` | - |\n\n\n<!-- generated/storage/types.gen/type-aliases/Item.md -->\n# Type Alias: Item\n\n> **Item** = \\{ `type`: `\"document\"`; \\} & [`BasicDocument`](BasicDocument.md) \\| \\{ `type`: `\"chat\"`; \\} & [`Chat`](Chat.md) \\| \\{ `type`: `\"project\"`; \\} & [`Project`](Project.md)\n\n\n<!-- generated/storage/types.gen/type-aliases/LinkShare.md -->\n# Type Alias: LinkShare\n\n> **LinkShare** = `\"PUBLIC\"` \\| `\"TEAM\"`\n\nDefines who can access an item through its share link.\n\n\n<!-- generated/storage/types.gen/type-aliases/ParticipantRole.md -->\n# Type Alias: ParticipantRole\n\n> **ParticipantRole** = `\"owner\"` \\| `\"admin\"` \\| `\"member\"`\n\nThe role a user has within a channel.\n\n\n<!-- generated/storage/types.gen/type-aliases/Project.md -->\n# Type Alias: Project\n\n> **Project** = \\{ `createdAt?`: `string` \\| `null`; `deletedAt?`: `string` \\| `null`; `id`: `string`; `name`: `string`; `parentId?`: `string` \\| `null`; `updatedAt?`: `string` \\| `null`; `userId`: `string`; \\}\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-createdat\"></a> `createdAt?` | `string` \\| `null` | The time the project was created |\n| <a id=\"property-deletedat\"></a> `deletedAt?` | `string` \\| `null` | - |\n| <a id=\"property-id\"></a> `id` | `string` | The id of the project |\n| <a id=\"property-name\"></a> `name` | `string` | The name of the project |\n| <a id=\"property-parentid\"></a> `parentId?` | `string` \\| `null` | The parent project id |\n| <a id=\"property-updatedat\"></a> `updatedAt?` | `string` \\| `null` | The time the project was updated |\n| <a id=\"property-userid\"></a> `userId` | `string` | The user id of who created the project |\n\n\n<!-- generated/storage/types.gen/type-aliases/SharePermissionV2.md -->\n# Type Alias: SharePermissionV2\n\n> **SharePermissionV2** = \\{ `channelSharePermissions?`: [`ChannelSharePermission`](ChannelSharePermission.md)[] \\| `null`; `id`: `string`; `linkShare?`: `null` \\| [`LinkShare`](LinkShare.md); `linkShareAccessLevel?`: `null` \\| [`AccessLevel`](AccessLevel.md); `owner`: `string`; `teamShareAccessLevel?`: `null` \\| [`AccessLevel`](AccessLevel.md); \\}\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-channelsharepermissions\"></a> `channelSharePermissions?` | [`ChannelSharePermission`](ChannelSharePermission.md)[] \\| `null` | The channel share permissions for the item |\n| <a id=\"property-id\"></a> `id` | `string` | The share permission id |\n| <a id=\"property-linkshare\"></a> `linkShare?` | `null` \\| [`LinkShare`](LinkShare.md) | - |\n| <a id=\"property-linkshareaccesslevel\"></a> `linkShareAccessLevel?` | `null` \\| [`AccessLevel`](AccessLevel.md) | - |\n| <a id=\"property-owner\"></a> `owner` | `string` | The owner of the item |\n| <a id=\"property-teamshareaccesslevel\"></a> `teamShareAccessLevel?` | `null` \\| [`AccessLevel`](AccessLevel.md) | - |\n\n\n<!-- generated/storage/types.gen/type-aliases/TeamRole.md -->\n# Type Alias: TeamRole\n\n> **TeamRole** = `\"member\"` \\| `\"admin\"` \\| `\"owner\"`\n\nThe role a user has within a team.\n\nOrdered least to most privileged so comparisons reflect access strength.\n\n\n<!-- src/entities/projects/namespace/classes/ProjectNamespace.md -->\n# Class: ProjectNamespace\n\n## Constructors\n\n### Constructor\n\n> **new ProjectNamespace**(`client`): `ProjectNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`ProjectNamespace`\n\n## Methods\n\n### byId()\n\n> **byId**(`id`): [`Project`](../../project/classes/Project.md)\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`Project`](../../project/classes/Project.md)\n\n***\n\n### create()\n\n> **create**(`opts`): `Promise`\\<[`Project`](../../project/classes/Project.md)\\>\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts` | \\{ `name`: `string`; `parent?`: [`Project`](../../project/classes/Project.md); \\} |\n| `opts.name` | `string` |\n| `opts.parent?` | [`Project`](../../project/classes/Project.md) |\n\n#### Returns\n\n`Promise`\\<[`Project`](../../project/classes/Project.md)\\>\n\n***\n\n### search()\n\n> **search**(`query`, `opts?`): `AsyncGenerator`\\<[`Project`](../../project/classes/Project.md)\\>\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `query` | `string` |\n| `opts?` | [`SearchOpts`](../../../search/interfaces/SearchOpts.md) |\n\n#### Returns\n\n`AsyncGenerator`\\<[`Project`](../../project/classes/Project.md)\\>\n\n\n<!-- src/entities/projects/project/classes/Project.md -->\n# Class: Project\n\nA Macro project: a folder-like container for documents, chats, and subprojects.\n\n## Extends\n\n- [`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md)\\<`ProjectDetail`\\>\n\n## Properties\n\n| Property | Modifier | Type | Default value | Description | Overrides | Inherited from |\n| ------ | ------ | ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-access\"></a> `access` | `readonly` | [`EntityAccess`](../../../sharing/access/classes/EntityAccess.md) | `...` | Access requests and direct user grants. | - | - |\n| <a id=\"property-createdat\"></a> `createdAt` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | `...` | When the project was created (RFC 3339 timestamp). | - | - |\n| <a id=\"property-entitytype\"></a> `entityType` | `readonly` | `\"project\"` | `'project'` | Favorites identify projects as `project`. | [`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`entityType`](../../../entity/classes/PropertiedEntity.md#property-entitytype) | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | `undefined` | - | - | [`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`id`](../../../entity/classes/PropertiedEntity.md#property-id) |\n| <a id=\"property-name\"></a> `name` | `readonly` | () => `Promise`\\<`string`\\> | `...` | The project's display name. | - | - |\n| <a id=\"property-parent\"></a> `parent` | `readonly` | () => `Promise`\\<`Project` \\| `undefined`\\> | `...` | The parent project, if this project is nested. | - | - |\n| <a id=\"property-search\"></a> `search` | `static` | (`client`, `query`, `searchOpts?`) => `AsyncGenerator`\\<`Project`\\> | `...` | Search projects by name and content, most relevant first, auto-paginated. | - | - |\n\n## Methods\n\n### accessLevel()\n\n> **accessLevel**(): `Promise`\\<`\"view\"` \\| `\"comment\"` \\| `\"edit\"` \\| `\"owner\"`\\>\n\nRead the caller's effective access level.\n\n#### Returns\n\n`Promise`\\<`\"view\"` \\| `\"comment\"` \\| `\"edit\"` \\| `\"owner\"`\\>\n\n***\n\n### delete()\n\n> **delete**(`opts?`): `Promise`\\<`void`\\>\n\nDelete the project and its contents. Soft by default (reversible with\n[restore](#restore)); pass `permanent: true` to delete irreversibly.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts?` | \\{ `permanent?`: `boolean`; \\} |\n| `opts.permanent?` | `boolean` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### deleteProperty()\n\n> **deleteProperty**(`assignment`): `Promise`\\<`void`\\>\n\nRemove a property from this entity, given its [properties](#properties) entry.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `assignment` | [`EntityPropertyWithDefinition`](../../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`deleteProperty`](../../../entity/classes/PropertiedEntity.md#deleteproperty)\n\n***\n\n### favorite()\n\n> **favorite**(): `Promise`\\<`Project`\\>\n\nAdd this entity to the user's favorites. Returns this handle for chaining.\nPlain unwrap: favoriting alters the user's favorites collection, not this\nentity's own detail, so there's nothing cached to invalidate.\n\n#### Returns\n\n`Promise`\\<`Project`\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`favorite`](../../../entity/classes/PropertiedEntity.md#favorite)\n\n***\n\n### items()\n\n> **items**(): `Promise`\\<[`Item`](../../../../../generated/storage/types.gen/type-aliases/Item.md)[]\\>\n\nThe items (documents, chats, subprojects) directly inside this project.\n\n#### Returns\n\n`Promise`\\<[`Item`](../../../../../generated/storage/types.gen/type-aliases/Item.md)[]\\>\n\n***\n\n### permission()\n\n> **permission**(): `Promise`\\<\\{ `permission`: [`EntityPermission`](../../../../../generated/storage/types.gen/type-aliases/EntityPermission.md); `status`: `\"access\"`; \\} \\| \\{ `status`: `\"no_access\"`; \\}\\>\n\nRead the caller's effective permission on this entity.\n\n#### Returns\n\n`Promise`\\<\\{ `permission`: [`EntityPermission`](../../../../../generated/storage/types.gen/type-aliases/EntityPermission.md); `status`: `\"access\"`; \\} \\| \\{ `status`: `\"no_access\"`; \\}\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`permission`](../../../entity/classes/PropertiedEntity.md#permission)\n\n***\n\n### properties()\n\n> **properties**(`opts?`): `Promise`\\<[`EntityPropertyWithDefinition`](../../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md)[]\\>\n\nThe properties set on this entity, each with its definition, value, and options.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts?` | \\{ `includeMetadata?`: `boolean`; \\} |\n| `opts.includeMetadata?` | `boolean` |\n\n#### Returns\n\n`Promise`\\<[`EntityPropertyWithDefinition`](../../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md)[]\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`properties`](../../../entity/classes/PropertiedEntity.md#properties)\n\n***\n\n### propertyReference()\n\n> **propertyReference**(): [`PropertyTargetReference`](../../../../../generated/properties/types.gen/type-aliases/PropertyTargetReference.md)\n\nThis entity's reference for bulk property operations.\n\n#### Returns\n\n[`PropertyTargetReference`](../../../../../generated/properties/types.gen/type-aliases/PropertyTargetReference.md)\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`propertyReference`](../../../entity/classes/PropertiedEntity.md#propertyreference)\n\n***\n\n### rename()\n\n> **rename**(`name`): `Promise`\\<`void`\\>\n\nRename the project.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `name` | `string` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### restore()\n\n> **restore**(): `Promise`\\<`void`\\>\n\nRestore a soft-deleted project.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### setProperty()\n\n> **setProperty**(`property`, `value?`): `Promise`\\<`void`\\>\n\nSet a property value on this entity, or attach the property without a\nvalue when `value` is omitted.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `property` | [`PropertyDefinition`](../../../properties/property-definition/classes/PropertyDefinition.md) |\n| `value?` | [`SetPropertyValue`](../../../../../generated/properties/types.gen/type-aliases/SetPropertyValue.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`setProperty`](../../../entity/classes/PropertiedEntity.md#setproperty)\n\n***\n\n### sharePermissions()\n\n> **sharePermissions**(): `Promise`\\<[`SharePermissionV2`](../../../../../generated/storage/types.gen/type-aliases/SharePermissionV2.md)\\>\n\nRead this project's sharing configuration.\n\n#### Returns\n\n`Promise`\\<[`SharePermissionV2`](../../../../../generated/storage/types.gen/type-aliases/SharePermissionV2.md)\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`Project`](../../../../../generated/storage/types.gen/type-aliases/Project.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`Project`](../../../../../generated/storage/types.gen/type-aliases/Project.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`Project`](../../../../../generated/storage/types.gen/type-aliases/Project.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`toJSON`](../../../entity/classes/PropertiedEntity.md#tojson)\n\n***\n\n### unfavorite()\n\n> **unfavorite**(): `Promise`\\<`Project`\\>\n\nRemove this entity from the user's favorites. Returns this handle for chaining.\n\n#### Returns\n\n`Promise`\\<`Project`\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`unfavorite`](../../../entity/classes/PropertiedEntity.md#unfavorite)\n\n***\n\n### updatePropertyOptions()\n\n> **updatePropertyOptions**(`changes`): `Promise`\\<[`BulkUpdateEntityPropertyOptionsResponse`](../../../../../generated/properties/types.gen/type-aliases/BulkUpdateEntityPropertyOptionsResponse.md)\\>\n\nApply multi-select option deltas atomically across this entity's properties.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `changes` | [`PropertyOptionDelta`](../../../entity/interfaces/PropertyOptionDelta.md)[] |\n\n#### Returns\n\n`Promise`\\<[`BulkUpdateEntityPropertyOptionsResponse`](../../../../../generated/properties/types.gen/type-aliases/BulkUpdateEntityPropertyOptionsResponse.md)\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`updatePropertyOptions`](../../../entity/classes/PropertiedEntity.md#updatepropertyoptions)\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `id`): `Project`\n\nA handle to a project by id. Details load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `id` | `string` |\n\n#### Returns\n\n`Project`\n\n***\n\n### create()\n\n> `static` **create**(`client`, `opts`): `Promise`\\<`Project`\\>\n\nCreate a project, optionally nested inside a parent project.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `opts` | \\{ `name`: `string`; `parent?`: `Project`; \\} |\n| `opts.name` | `string` |\n| `opts.parent?` | `Project` |\n\n#### Returns\n\n`Promise`\\<`Project`\\>\n"},{"name": "properties",@@ -111,7 +159,7 @@"name": "tasks","description": "Search, create, and update tasks.","overview": "<!-- src/entities/tasks/namespace/classes/TaskNamespace.md -->\n# Class: TaskNamespace\n\n## Constructors\n\n### Constructor\n\n> **new TaskNamespace**(`client`): `TaskNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`TaskNamespace`\n\n## Methods\n\n### byId()\n\n> **byId**(`id`): [`Task`](../../task/classes/Task.md)\n\nA handle to a task by document id. Details load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`Task`](../../task/classes/Task.md)\n\n***\n\n### create()\n\n> **create**(`opts`): `Promise`\\<[`Task`](../../task/classes/Task.md)\\>\n\nCreate a task.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts` | \\{ `markdown?`: `string`; `name`: `string`; `project?`: [`Project`](../../../projects/project/classes/Project.md); `shareWithTeam?`: `boolean`; `team?`: [`Team`](../../../teams/team/classes/Team.md); \\} |\n| `opts.markdown?` | `string` |\n| `opts.name` | `string` |\n| `opts.project?` | [`Project`](../../../projects/project/classes/Project.md) |\n| `opts.shareWithTeam?` | `boolean` |\n| `opts.team?` | [`Team`](../../../teams/team/classes/Team.md) |\n\n#### Returns\n\n`Promise`\\<[`Task`](../../task/classes/Task.md)\\>\n\n***\n\n### forPullRequest()\n\n> **forPullRequest**(`url`): `Promise`\\<[`Task`](../../task/classes/Task.md)[]\\>\n\nThe tasks the GitHub pull request at `url` references, oldest link first.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `url` | `string` |\n\n#### Returns\n\n`Promise`\\<[`Task`](../../task/classes/Task.md)[]\\>\n\n***\n\n### search()\n\n> **search**(`query`, `opts?`): `AsyncGenerator`\\<[`Task`](../../task/classes/Task.md)\\>\n\nSearch tasks by name and content, most relevant first, auto-paginated.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `query` | `string` |\n| `opts?` | [`SearchOpts`](../../../search/interfaces/SearchOpts.md) |\n\n#### Returns\n\n`AsyncGenerator`\\<[`Task`](../../task/classes/Task.md)\\>\n",- "documentation": "# Macro SDK: tasks\n\nGenerated by TypeDoc. Paths below refer to the canonical Markdown hierarchy. Other entity handles are documented in their named section; request core for shared SDK helpers.\n\n<!-- generated/properties/types.gen/type-aliases/BulkUpdateEntityPropertyOptionsResponse.md -->\n# Type Alias: BulkUpdateEntityPropertyOptionsResponse\n\n> **BulkUpdateEntityPropertyOptionsResponse** = \\{ `properties`: [`EntityPropertyOptionSelectionResponse`](EntityPropertyOptionSelectionResponse.md)[]; \\}\n\nResponse for a bulk option update: each property's reconciled final ids.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-properties\"></a> `properties` | [`EntityPropertyOptionSelectionResponse`](EntityPropertyOptionSelectionResponse.md)[] | The final option ids per updated property. |\n\n\n<!-- generated/properties/types.gen/type-aliases/DataType.md -->\n# Type Alias: DataType\n\n> **DataType** = `\"BOOLEAN\"` \\| `\"DATE\"` \\| `\"NUMBER\"` \\| `\"STRING\"` \\| `\"SELECT_NUMBER\"` \\| `\"SELECT_STRING\"` \\| `\"TAG\"` \\| `\"ENTITY\"` \\| `\"LINK\"`\n\nData type for property values, determining storage and validation.\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityProperty.md -->\n# Type Alias: EntityProperty\n\n> **EntityProperty** = \\{ `created_at`: `string`; `entity_id`: `string`; `entity_type`: [`EntityType`](EntityType.md); `id`: `string`; `property_definition_id`: `string`; `updated_at`: `string`; \\}\n\nAssignment of a property definition to a specific entity (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-created_at\"></a> `created_at` | `string` |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` |\n| <a id=\"property-entity_type\"></a> `entity_type` | [`EntityType`](EntityType.md) |\n| <a id=\"property-id\"></a> `id` | `string` |\n| <a id=\"property-property_definition_id\"></a> `property_definition_id` | `string` |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityPropertyOptionSelectionResponse.md -->\n# Type Alias: EntityPropertyOptionSelectionResponse\n\n> **EntityPropertyOptionSelectionResponse** = \\{ `option_ids`: `string`[]; `property_id`: `string`; \\}\n\nThe reconciled final option ids stored for one property after a bulk update.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-option_ids\"></a> `option_ids` | `string`[] | The final option ids the server persisted, in stored order. |\n| <a id=\"property-property_id\"></a> `property_id` | `string` | The property definition the options belong to. |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md -->\n# Type Alias: EntityPropertyWithDefinition\n\n> **EntityPropertyWithDefinition** = \\{ `definition`: [`PropertyDefinition`](PropertyDefinition.md); `options?`: [`PropertyOption`](PropertyOption.md)[] \\| `null`; `property`: [`EntityProperty`](EntityProperty.md); `value?`: `null` \\| [`PropertyValue`](PropertyValue.md); \\}\n\nEntity property with its definition, value, and options (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-definition\"></a> `definition` | [`PropertyDefinition`](PropertyDefinition.md) |\n| <a id=\"property-options\"></a> `options?` | [`PropertyOption`](PropertyOption.md)[] \\| `null` |\n| <a id=\"property-property\"></a> `property` | [`EntityProperty`](EntityProperty.md) |\n| <a id=\"property-value\"></a> `value?` | `null` \\| [`PropertyValue`](PropertyValue.md) |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityReference.md -->\n# Type Alias: EntityReference\n\n> **EntityReference** = \\{ `entity_id`: `string`; `entity_type`: [`EntityType`](EntityType.md); `specific_message_id?`: `string` \\| `null`; \\}\n\nEntity reference for entity-type property values.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | - |\n| <a id=\"property-entity_type\"></a> `entity_type` | [`EntityType`](EntityType.md) | - |\n| <a id=\"property-specific_message_id\"></a> `specific_message_id?` | `string` \\| `null` | For CHANNEL, CHAT, THREAD entity types - optional specific message ID. This allows referencing a specific message within a thread/channel/chat. |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityType.md -->\n# Type Alias: EntityType\n\n> **EntityType** = `\"CALENDAR_EVENT\"` \\| `\"CALL_RECORD\"` \\| `\"CHANNEL\"` \\| `\"CHAT\"` \\| `\"COMPANY\"` \\| `\"DATABASE_ROW\"` \\| `\"CONTACT\"` \\| `\"DOCUMENT\"` \\| `\"INITIATIVE\"` \\| `\"PROJECT\"` \\| `\"TASK\"` \\| `\"THREAD\"` \\| `\"USER\"`\n\nType of entity that can be referenced by entity properties.\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyDefinition.md -->\n# Type Alias: PropertyDefinition\n\n> **PropertyDefinition** = \\{ `created_at`: `string`; `data_type`: [`DataType`](DataType.md); `display_name`: `string`; `id`: `string`; `is_metadata`: `boolean`; `is_multi_select`: `boolean`; `is_system`: `boolean`; `owner`: [`PropertyOwner`](PropertyOwner.md); `specific_entity_type`: `null` \\| [`EntityType`](EntityType.md); `updated_at`: `string`; \\}\n\nProperty definition model (service representation).\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | - |\n| <a id=\"property-data_type\"></a> `data_type` | [`DataType`](DataType.md) | - |\n| <a id=\"property-display_name\"></a> `display_name` | `string` | - |\n| <a id=\"property-id\"></a> `id` | `string` | - |\n| <a id=\"property-is_metadata\"></a> `is_metadata` | `boolean` | Flag to indicate if this is a system-generated metadata property. Not stored in database - computed at service layer. |\n| <a id=\"property-is_multi_select\"></a> `is_multi_select` | `boolean` | - |\n| <a id=\"property-is_system\"></a> `is_system` | `boolean` | Flag to indicate if this is a system property (stored in DB). |\n| <a id=\"property-owner\"></a> `owner` | [`PropertyOwner`](PropertyOwner.md) | - |\n| <a id=\"property-specific_entity_type\"></a> `specific_entity_type` | `null` \\| [`EntityType`](EntityType.md) | - |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` | - |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyOption.md -->\n# Type Alias: PropertyOption\n\n> **PropertyOption** = \\{ `color`: `string` \\| `null`; `created_at`: `string`; `display_order`: `number`; `id`: `string`; `property_definition_id`: `string`; `updated_at`: `string`; `value`: [`PropertyOptionValue`](PropertyOptionValue.md); \\}\n\nA selectable option for select-type properties (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-color\"></a> `color` | `string` \\| `null` |\n| <a id=\"property-created_at\"></a> `created_at` | `string` |\n| <a id=\"property-display_order\"></a> `display_order` | `number` |\n| <a id=\"property-id\"></a> `id` | `string` |\n| <a id=\"property-property_definition_id\"></a> `property_definition_id` | `string` |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` |\n| <a id=\"property-value\"></a> `value` | [`PropertyOptionValue`](PropertyOptionValue.md) |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyOptionValue.md -->\n# Type Alias: PropertyOptionValue\n\n> **PropertyOptionValue** = \\{ `type`: `\"string\"`; `value`: `string`; \\} \\| \\{ `type`: `\"number\"`; `value`: `number`; \\}\n\nThe value of a property option - either a string or a number.\n\n## Union Members\n\n### Type Literal\n\n\\{ `type`: `\"string\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"string\"` | - |\n| `value` | `string` | String value for SelectString properties |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"number\"`; `value`: `number`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"number\"` | - |\n| `value` | `number` | Number value for SelectNumber properties |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyOwner.md -->\n# Type Alias: PropertyOwner\n\n> **PropertyOwner** = \\{ `scope`: `\"user\"`; `user_id`: `string`; \\} \\| \\{ `scope`: `\"team\"`; `team_id`: `string`; \\} \\| \\{ `database_id`: `string`; `scope`: `\"database\"`; \\} \\| \\{ `scope`: `\"system\"`; \\}\n\nDefines who owns a property - user-scoped, team-scoped, database-scoped, or system.\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyTargetEntityType.md -->\n# Type Alias: PropertyTargetEntityType\n\n> **PropertyTargetEntityType** = `\"CALL_RECORD\"` \\| `\"CHANNEL\"` \\| `\"CHAT\"` \\| `\"COMPANY\"` \\| `\"DATABASE_ROW\"` \\| `\"DOCUMENT\"` \\| `\"INITIATIVE\"` \\| `\"PROJECT\"` \\| `\"THREAD\"` \\| `\"USER\"`\n\nCanonical type of an entity receiving properties.\n\nTasks are documents at API boundaries. `Task` intentionally does not exist\nhere; task classification is resolved by the properties domain from the\ndocument subtype.\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyTargetReference.md -->\n# Type Alias: PropertyTargetReference\n\n> **PropertyTargetReference** = \\{ `entity_id`: `string`; `entity_type`: [`PropertyTargetEntityType`](PropertyTargetEntityType.md); \\}\n\nCanonical reference to an entity receiving properties.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | Entity identifier. |\n| <a id=\"property-entity_type\"></a> `entity_type` | [`PropertyTargetEntityType`](PropertyTargetEntityType.md) | Canonical entity type. |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyValue.md -->\n# Type Alias: PropertyValue\n\n> **PropertyValue** = \\{ `type`: `\"Boolean\"`; `value`: `boolean`; \\} \\| \\{ `type`: `\"Number\"`; `value`: `number`; \\} \\| \\{ `type`: `\"String\"`; `value`: `string`; \\} \\| \\{ `type`: `\"Date\"`; `value`: `string`; \\} \\| \\{ `type`: `\"SelectOption\"`; `value`: `string`[]; \\} \\| \\{ `type`: `\"EntityReference\"`; `value`: [`EntityReference`](EntityReference.md)[]; \\} \\| \\{ `type`: `\"Link\"`; `value`: `string`[]; \\}\n\nProperty value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to/from JSONB in the database.\n\n## Union Members\n\n### Type Literal\n\n\\{ `type`: `\"Boolean\"`; `value`: `boolean`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Boolean\"` | - |\n| `value` | `boolean` | Boolean value Serializes as: {\"type\": \"Boolean\", \"value\": true} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"Number\"`; `value`: `number`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Number\"` | - |\n| `value` | `number` | Numeric value Serializes as: {\"type\": \"Number\", \"value\": 42.5} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"String\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"String\"` | - |\n| `value` | `string` | String value Serializes as: {\"type\": \"String\", \"value\": \"text\"} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"Date\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Date\"` | - |\n| `value` | `string` | Date/timestamp value Serializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"SelectOption\"`; `value`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"SelectOption\"` | - |\n| `value` | `string`[] | Select option(s) - always an array (check is_multi_select to determine if single or multi) Single-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1) Multi-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+) |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"EntityReference\"`; `value`: [`EntityReference`](EntityReference.md)[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"EntityReference\"` | - |\n| `value` | [`EntityReference`](EntityReference.md)[] | Entity reference(s) - always an array (check is_multi_select to determine if single or multi) Single-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1) Multi-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+) |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"Link\"`; `value`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Link\"` | - |\n| `value` | `string`[] | Link value(s) - always an array (check is_multi_select to determine if single or multi) Single-select: {\"type\": \"Link\", \"value\": [\"https://example.com\"]} (length 0 or 1) Multi-select: {\"type\": \"Link\", \"value\": [\"https://example.com\", \"https://other.com\"]} (length 0+) |\n\n\n<!-- generated/properties/types.gen/type-aliases/SetPropertyValue.md -->\n# Type Alias: SetPropertyValue\n\n> **SetPropertyValue** = \\{ `type`: `\"boolean\"`; `value`: `boolean`; \\} \\| \\{ `type`: `\"date\"`; `value`: `string`; \\} \\| \\{ `type`: `\"number\"`; `value`: `number`; \\} \\| \\{ `type`: `\"string\"`; `value`: `string`; \\} \\| \\{ `option_id`: `string`; `type`: `\"select_option\"`; \\} \\| \\{ `option_ids`: `string`[]; `type`: `\"multi_select_option\"`; \\} \\| \\{ `reference`: [`EntityReference`](EntityReference.md); `type`: `\"entity_reference\"`; \\} \\| \\{ `references`: [`EntityReference`](EntityReference.md)[]; `type`: `\"multi_entity_reference\"`; \\} \\| \\{ `type`: `\"link\"`; `url`: `string`; \\} \\| \\{ `type`: `\"multi_link\"`; `urls`: `string`[]; \\}\n\nType-safe enum for setting entity property values - provides compile-time validation.\n\n\n<!-- generated/storage/types.gen/type-aliases/BomPart.md -->\n# Type Alias: BomPart\n\n> **BomPart** = \\{ `id`: `string`; `path`: `string`; `sha`: `string`; \\}\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-id\"></a> `id` | `string` | The uuid of the bom part |\n| <a id=\"property-path\"></a> `path` | `string` | The file path of the bom part content |\n| <a id=\"property-sha\"></a> `sha` | `string` | The sha of the bom part content There is an index on sha for more performant queries based on it. |\n\n\n<!-- generated/storage/types.gen/type-aliases/DocumentContent.md -->\n# Type Alias: DocumentContent\n\n> **DocumentContent** = \\{ `location?`: `null` \\| [`DocumentContentLocation`](DocumentContentLocation.md); `state`: [`DocumentContentState`](DocumentContentState.md); \\}\n\nAPI-visible content lifecycle and location metadata.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-location\"></a> `location?` | `null` \\| [`DocumentContentLocation`](DocumentContentLocation.md) | - |\n| <a id=\"property-state\"></a> `state` | [`DocumentContentState`](DocumentContentState.md) | The current lifecycle state of the content. |\n\n\n<!-- generated/storage/types.gen/type-aliases/DocumentContentLocation.md -->\n# Type Alias: DocumentContentLocation\n\n> **DocumentContentLocation** = `\"object_storage\"` \\| `\"sync_service\"` \\| `\"docx_bom_parts\"` \\| `\"converted_pdf\"` \\| `\"unknown\"`\n\nWhere document content is, or is expected to be, read from.\n\n\n<!-- generated/storage/types.gen/type-aliases/DocumentContentState.md -->\n# Type Alias: DocumentContentState\n\n> **DocumentContentState** = `\"unknown\"` \\| `\"pending\"` \\| `\"ready\"`\n\nAPI-visible content lifecycle state derived from current document metadata.\n\n\n<!-- generated/storage/types.gen/type-aliases/DocumentMetadata.md -->\n# Type Alias: DocumentMetadata\n\n> **DocumentMetadata** = \\{ `branchedFromId?`: `string` \\| `null`; `branchedFromVersionId?`: `number` \\| `null`; `createdAt?`: `string` \\| `null`; `deletedAt?`: `string` \\| `null`; `documentBom?`: [`BomPart`](BomPart.md)[] \\| `null`; `documentFamilyId?`: `number` \\| `null`; `documentId`: `string`; `documentName`: `string`; `documentVersionId`: `number`; `fileType?`: `string` \\| `null`; `modificationData?`: `unknown`; `owner`: `string`; `projectId?`: `string` \\| `null`; `projectName?`: `string` \\| `null`; `sha?`: `string` \\| `null`; `subType?`: `null` \\| [`DocumentSubType`](DocumentSubType.md); `updatedAt?`: `string` \\| `null`; \\}\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-branchedfromid\"></a> `branchedFromId?` | `string` \\| `null` | The id of the document this document branched from |\n| <a id=\"property-branchedfromversionid\"></a> `branchedFromVersionId?` | `number` \\| `null` | The id of the version this document branched from This could be either DocumentInstance or DocumentBom id depending on the file type |\n| <a id=\"property-createdat\"></a> `createdAt?` | `string` \\| `null` | The time the document was created |\n| <a id=\"property-deletedat\"></a> `deletedAt?` | `string` \\| `null` | The time the document was deleted |\n| <a id=\"property-documentbom\"></a> `documentBom?` | [`BomPart`](BomPart.md)[] \\| `null` | If the document is a DOCX document and unzipped, the document_bom will be present |\n| <a id=\"property-documentfamilyid\"></a> `documentFamilyId?` | `number` \\| `null` | The id of the document family this document belongs to |\n| <a id=\"property-documentid\"></a> `documentId` | `string` | The document id |\n| <a id=\"property-documentname\"></a> `documentName` | `string` | The name of the document |\n| <a id=\"property-documentversionid\"></a> `documentVersionId` | `number` | The version of the document This could be the document_instance_id or document_bom_id depending on the file type |\n| <a id=\"property-filetype\"></a> `fileType?` | `string` \\| `null` | The file type of the document (file extension) |\n| <a id=\"property-modificationdata\"></a> `modificationData?` | `unknown` | The modification data for the document instance. This is only used for PDF documents. |\n| <a id=\"property-owner\"></a> `owner` | `string` | The owner of the document |\n| <a id=\"property-projectid\"></a> `projectId?` | `string` \\| `null` | The id of the project that this document belongs to |\n| <a id=\"property-projectname\"></a> `projectName?` | `string` \\| `null` | The name of the project that this document belongs to |\n| <a id=\"property-sha\"></a> `sha?` | `string` \\| `null` | If the document is a PDF, this is the SHA of the pdf If the document is a DOCX, this will not be present |\n| <a id=\"property-subtype\"></a> `subType?` | `null` \\| [`DocumentSubType`](DocumentSubType.md) | - |\n| <a id=\"property-updatedat\"></a> `updatedAt?` | `string` \\| `null` | The time the document instance / document BOM was updated |\n\n\n<!-- generated/storage/types.gen/type-aliases/DocumentMetadataWithContent.md -->\n# Type Alias: DocumentMetadataWithContent\n\n> **DocumentMetadataWithContent** = [`DocumentMetadata`](DocumentMetadata.md) & \\{ `content`: [`DocumentContent`](DocumentContent.md); `teamId?`: `string` \\| `null`; `teamTaskId?`: `number` \\| `null`; \\}\n\nFull document metadata plus content lifecycle metadata.\n\n## Type Declaration\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `content` | [`DocumentContent`](DocumentContent.md) | Content lifecycle and location metadata. |\n| `teamId?` | `string` \\| `null` | The team this task number is scoped to, for task documents. |\n| `teamTaskId?` | `number` \\| `null` | The task number assigned within the team, for task documents. |\n\n\n<!-- generated/storage/types.gen/type-aliases/DocumentSubType.md -->\n# Type Alias: DocumentSubType\n\n> **DocumentSubType** = `\"task\"` \\| `\"snippet\"` \\| `\"skill\"` \\| `\"initiative_description\"`\n\nThe document sub type enum represents all values of document sub types.\nThese values should match the `document_sub_type_value` table in macrodb.\n\nWire, database, and `Display` spellings are all `snake_case` so a\nmulti-word variant serializes identically in every system.\n\n\n<!-- generated/storage/types.gen/type-aliases/DocumentTeamShareResponse.md -->\n# Type Alias: DocumentTeamShareResponse\n\n> **DocumentTeamShareResponse** = \\{ `sharedWithTeam`: `boolean`; `teamId?`: `string` \\| `null`; \\}\n\nThe team-share state of a document. The team is resolved from the document\nowner's team membership.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-sharedwithteam\"></a> `sharedWithTeam` | `boolean` | Whether explicit team sharing is enabled; inherited team access does not count. |\n| <a id=\"property-teamid\"></a> `teamId?` | `string` \\| `null` | The owner's team the document is (or would be) shared with. `None` when the owner does not belong to a team. |\n\n\n<!-- generated/storage/types.gen/type-aliases/GithubPullRequest.md -->\n# Type Alias: GithubPullRequest\n\n> **GithubPullRequest** = \\{ `additions?`: `number` \\| `null`; `checks?`: [`GithubPullRequestCheckRun`](GithubPullRequestCheckRun.md)[] \\| `null`; `comments?`: [`GithubPullRequestComment`](GithubPullRequestComment.md)[] \\| `null`; `deletions?`: `number` \\| `null`; `displayName`: `string`; `foreignEntityId?`: `string` \\| `null`; `githubKey`: `string`; `name?`: `string` \\| `null`; `number`: `number`; `owner`: `string`; `repo`: `string`; `status?`: `string` \\| `null`; `url`: `string`; \\}\n\nDisplay-ready data for a GitHub pull request associated with a task.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-additions\"></a> `additions?` | `number` \\| `null` | The number of added lines in the pull request, when enrichment data is available. |\n| <a id=\"property-checks\"></a> `checks?` | [`GithubPullRequestCheckRun`](GithubPullRequestCheckRun.md)[] \\| `null` | Check runs collected from the pull request head commit, when enrichment data is available. |\n| <a id=\"property-comments\"></a> `comments?` | [`GithubPullRequestComment`](GithubPullRequestComment.md)[] \\| `null` | Comments collected from the pull request, when enrichment data is available. |\n| <a id=\"property-deletions\"></a> `deletions?` | `number` \\| `null` | The number of deleted lines in the pull request, when enrichment data is available. |\n| <a id=\"property-displayname\"></a> `displayName` | `string` | A compact label suitable for display in the UI. |\n| <a id=\"property-foreignentityid\"></a> `foreignEntityId?` | `string` \\| `null` | The internal `foreign_entity.id` UUID for the GitHub pull request row. |\n| <a id=\"property-githubkey\"></a> `githubKey` | `string` | The stored GitHub association key, in `owner/repo/pull/number` format. |\n| <a id=\"property-name\"></a> `name?` | `string` \\| `null` | The GitHub pull request title, when enrichment data is available. |\n| <a id=\"property-number\"></a> `number` | `number` | The GitHub pull request number. |\n| <a id=\"property-owner\"></a> `owner` | `string` | The GitHub repository owner or organization. |\n| <a id=\"property-repo\"></a> `repo` | `string` | The GitHub repository name. |\n| <a id=\"property-status\"></a> `status?` | `string` \\| `null` | The GitHub pull request status, when enrichment data is available. |\n| <a id=\"property-url\"></a> `url` | `string` | The public GitHub URL for the pull request. |\n\n\n<!-- generated/storage/types.gen/type-aliases/GithubPullRequestCheckRun.md -->\n# Type Alias: GithubPullRequestCheckRun\n\n> **GithubPullRequestCheckRun** = \\{ `completedAt?`: `string` \\| `null`; `conclusion?`: `string` \\| `null`; `id`: `number`; `name`: `string`; `startedAt?`: `string` \\| `null`; `status`: `string`; `url?`: `string` \\| `null`; \\}\n\nA check run associated with a GitHub pull request.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-completedat\"></a> `completedAt?` | `string` \\| `null` | When the check run completed, when available. |\n| <a id=\"property-conclusion\"></a> `conclusion?` | `string` \\| `null` | The raw GitHub check run conclusion, when the run has completed. |\n| <a id=\"property-id\"></a> `id` | `number` | The unique GitHub identifier for the check run. |\n| <a id=\"property-name\"></a> `name` | `string` | The check run name. |\n| <a id=\"property-startedat\"></a> `startedAt?` | `string` \\| `null` | When the check run started, when available. |\n| <a id=\"property-status\"></a> `status` | `string` | The raw GitHub check run status. |\n| <a id=\"property-url\"></a> `url?` | `string` \\| `null` | The public GitHub URL for the check run, when available. |\n\n\n<!-- generated/storage/types.gen/type-aliases/GithubPullRequestComment.md -->\n# Type Alias: GithubPullRequestComment\n\n> **GithubPullRequestComment** = \\{ `authorAssociation?`: `string` \\| `null`; `authorId?`: `number` \\| `null`; `authorLogin?`: `string` \\| `null`; `body`: `string`; `createdAt?`: `string` \\| `null`; `id`: `number`; `inReplyToId?`: `number` \\| `null`; `line?`: `number` \\| `null`; `originalLine?`: `number` \\| `null`; `path?`: `string` \\| `null`; `pullRequestReviewId?`: `number` \\| `null`; `source`: `string`; `updatedAt?`: `string` \\| `null`; `url?`: `string` \\| `null`; \\}\n\nA comment associated with a GitHub pull request.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-authorassociation\"></a> `authorAssociation?` | `string` \\| `null` | GitHub's relationship label for the author, when available. |\n| <a id=\"property-authorid\"></a> `authorId?` | `number` \\| `null` | The stable numeric GitHub user id for the comment author, when available. |\n| <a id=\"property-authorlogin\"></a> `authorLogin?` | `string` \\| `null` | The GitHub login for the comment author, when available. |\n| <a id=\"property-body\"></a> `body` | `string` | The comment or review body text. |\n| <a id=\"property-createdat\"></a> `createdAt?` | `string` \\| `null` | When the comment was created or the review was submitted. |\n| <a id=\"property-id\"></a> `id` | `number` | The unique GitHub identifier for the comment or review. |\n| <a id=\"property-inreplytoid\"></a> `inReplyToId?` | `number` \\| `null` | The id of the comment this one replies to, when it is part of a review thread. Only ever present on `review_comment` sources. |\n| <a id=\"property-line\"></a> `line?` | `number` \\| `null` | The line in the current diff the comment is anchored to. Cleared by GitHub when later commits outdate the comment's diff. |\n| <a id=\"property-originalline\"></a> `originalLine?` | `number` \\| `null` | The line the comment was originally anchored to, kept even when the diff has since changed. |\n| <a id=\"property-path\"></a> `path?` | `string` \\| `null` | The repository-relative file path the review comment is anchored to. Only ever present on `review_comment` sources. |\n| <a id=\"property-pullrequestreviewid\"></a> `pullRequestReviewId?` | `number` \\| `null` | The id of the pull request review this comment was submitted with. Only ever present on `review_comment` sources. |\n| <a id=\"property-source\"></a> `source` | `string` | The GitHub source for the comment, such as `issue_comment` or `review_comment`. |\n| <a id=\"property-updatedat\"></a> `updatedAt?` | `string` \\| `null` | When the comment or review was last updated. |\n| <a id=\"property-url\"></a> `url?` | `string` \\| `null` | The public GitHub URL for the comment or review, when available. |\n\n\n<!-- src/entities/tasks/namespace/classes/TaskNamespace.md -->\n# Class: TaskNamespace\n\n## Constructors\n\n### Constructor\n\n> **new TaskNamespace**(`client`): `TaskNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`TaskNamespace`\n\n## Methods\n\n### byId()\n\n> **byId**(`id`): [`Task`](../../task/classes/Task.md)\n\nA handle to a task by document id. Details load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`Task`](../../task/classes/Task.md)\n\n***\n\n### create()\n\n> **create**(`opts`): `Promise`\\<[`Task`](../../task/classes/Task.md)\\>\n\nCreate a task.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts` | \\{ `markdown?`: `string`; `name`: `string`; `project?`: [`Project`](../../../projects/project/classes/Project.md); `shareWithTeam?`: `boolean`; `team?`: [`Team`](../../../teams/team/classes/Team.md); \\} |\n| `opts.markdown?` | `string` |\n| `opts.name` | `string` |\n| `opts.project?` | [`Project`](../../../projects/project/classes/Project.md) |\n| `opts.shareWithTeam?` | `boolean` |\n| `opts.team?` | [`Team`](../../../teams/team/classes/Team.md) |\n\n#### Returns\n\n`Promise`\\<[`Task`](../../task/classes/Task.md)\\>\n\n***\n\n### forPullRequest()\n\n> **forPullRequest**(`url`): `Promise`\\<[`Task`](../../task/classes/Task.md)[]\\>\n\nThe tasks the GitHub pull request at `url` references, oldest link first.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `url` | `string` |\n\n#### Returns\n\n`Promise`\\<[`Task`](../../task/classes/Task.md)[]\\>\n\n***\n\n### search()\n\n> **search**(`query`, `opts?`): `AsyncGenerator`\\<[`Task`](../../task/classes/Task.md)\\>\n\nSearch tasks by name and content, most relevant first, auto-paginated.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `query` | `string` |\n| `opts?` | [`SearchOpts`](../../../search/interfaces/SearchOpts.md) |\n\n#### Returns\n\n`AsyncGenerator`\\<[`Task`](../../task/classes/Task.md)\\>\n\n\n<!-- src/entities/tasks/task/classes/Task.md -->\n# Class: Task\n\nA Macro task: a document with sub-type `task`. Inherits the full document\nsurface ([Document.rename](../../../documents/document/classes/Document.md#rename), move, delete, restore, content, events)\nand adds task-specific state.\n\n## Extends\n\n- [`Document`](../../../documents/document/classes/Document.md)\n\n## Properties\n\n| Property | Modifier | Type | Default value | Description | Overrides | Inherited from |\n| ------ | ------ | ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-branchedfrom\"></a> `branchedFrom` | `readonly` | () => `Promise`\\<[`Document`](../../../documents/document/classes/Document.md) \\| `undefined`\\> | `...` | The document this one was branched from, if any. | - | [`Document`](../../../documents/document/classes/Document.md).[`branchedFrom`](../../../documents/document/classes/Document.md#property-branchedfrom) |\n| <a id=\"property-createdat\"></a> `createdAt` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | `...` | When the document was created. | - | [`Document`](../../../documents/document/classes/Document.md).[`createdAt`](../../../documents/document/classes/Document.md#property-createdat) |\n| <a id=\"property-deletedat\"></a> `deletedAt` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | `...` | When the document was deleted, if it has been. | - | [`Document`](../../../documents/document/classes/Document.md).[`deletedAt`](../../../documents/document/classes/Document.md#property-deletedat) |\n| <a id=\"property-entitytype\"></a> `entityType` | `readonly` | `\"document\"` | `'document'` | Favorites identify documents as `document`. | - | [`Document`](../../../documents/document/classes/Document.md).[`entityType`](../../../documents/document/classes/Document.md#property-entitytype) |\n| <a id=\"property-filetype\"></a> `fileType` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | `...` | The document's file type (e.g. `md`, `pdf`, `docx`). | - | [`Document`](../../../documents/document/classes/Document.md).[`fileType`](../../../documents/document/classes/Document.md#property-filetype) |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | `undefined` | - | - | [`Document`](../../../documents/document/classes/Document.md).[`id`](../../../documents/document/classes/Document.md#property-id) |\n| <a id=\"property-name\"></a> `name` | `readonly` | () => `Promise`\\<`string`\\> | `...` | The document's display name. | - | [`Document`](../../../documents/document/classes/Document.md).[`name`](../../../documents/document/classes/Document.md#property-name) |\n| <a id=\"property-owner\"></a> `owner` | `readonly` | () => `Promise`\\<[`User`](../../../users/user/classes/User.md)\\> | `...` | The user who owns the document. | - | [`Document`](../../../documents/document/classes/Document.md).[`owner`](../../../documents/document/classes/Document.md#property-owner) |\n| <a id=\"property-project\"></a> `project` | `readonly` | () => `Promise`\\<[`Project`](../../../projects/project/classes/Project.md) \\| `undefined`\\> | `...` | The project this document belongs to, if any. | - | [`Document`](../../../documents/document/classes/Document.md).[`project`](../../../documents/document/classes/Document.md#property-project) |\n| <a id=\"property-updatedat\"></a> `updatedAt` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | `...` | When the document was last updated. | - | [`Document`](../../../documents/document/classes/Document.md).[`updatedAt`](../../../documents/document/classes/Document.md#property-updatedat) |\n| <a id=\"property-search\"></a> `search` | `static` | (`client`, `query`, `searchOpts?`) => `AsyncGenerator`\\<`Task`\\> | `...` | Search tasks by name and content, most relevant first, auto-paginated. | [`Document`](../../../documents/document/classes/Document.md).[`search`](../../../documents/document/classes/Document.md#property-search) | - |\n\n## Methods\n\n### branchName()\n\n> **branchName**(): `Promise`\\<`string`\\>\n\nThe git branch name derived for the document (task documents).\n\n#### Returns\n\n`Promise`\\<`string`\\>\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`branchName`](../../../documents/document/classes/Document.md#branchname)\n\n***\n\n### comment()\n\n> **comment**(`body`, `opts?`): `Promise`\\<[`Comment`](../../../documents/comment/classes/Comment.md)\\>\n\nAdd a comment. Starts a new unanchored thread, or replies to an existing\none when `threadId` (the thread's root comment id) is given.\n\n#### Parameters\n\n| Parameter | Type | Description |\n| ------ | ------ | ------ |\n| `body` | `string` \\| [`RichMessage`](../../../../mentions/interfaces/RichMessage.md) | Plain text, or a rich body composed with msg. |\n| `opts?` | \\{ `threadId?`: `string`; \\} | - |\n| `opts.threadId?` | `string` | - |\n\n#### Returns\n\n`Promise`\\<[`Comment`](../../../documents/comment/classes/Comment.md)\\>\n\nThe created comment.\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`comment`](../../../documents/document/classes/Document.md#comment)\n\n***\n\n### comments()\n\n> **comments**(): `Promise`\\<[`CommentThread`](../../../documents/document/interfaces/CommentThread.md)[]\\>\n\nThe document's live comment threads, each with its comments, newest thread first.\n\n#### Returns\n\n`Promise`\\<[`CommentThread`](../../../documents/document/interfaces/CommentThread.md)[]\\>\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`comments`](../../../documents/document/classes/Document.md#comments)\n\n***\n\n### completed()\n\n> **completed**(): `Promise`\\<`boolean` \\| `undefined`\\>\n\nWhether the task is completed (its Status property is \"Completed\");\n`undefined` if the document is not a task.\n\n#### Returns\n\n`Promise`\\<`boolean` \\| `undefined`\\>\n\n***\n\n### content()\n\n> **content**(): `Promise`\\<`string`\\>\n\nCurrent Markdown for native documents, extracted text for PDF/Word,\nor raw file content for other formats. Native reads include live edits.\n\n#### Returns\n\n`Promise`\\<`string`\\>\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`content`](../../../documents/document/classes/Document.md#content)\n\n***\n\n### copy()\n\n> **copy**(`opts`): `Promise`\\<[`Document`](../../../documents/document/classes/Document.md)\\>\n\nCopy the document under a new name, optionally from a specific version.\nReturns a handle to the new document.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts` | \\{ `name`: `string`; `versionId?`: `number`; \\} |\n| `opts.name` | `string` |\n| `opts.versionId?` | `number` |\n\n#### Returns\n\n`Promise`\\<[`Document`](../../../documents/document/classes/Document.md)\\>\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`copy`](../../../documents/document/classes/Document.md#copy)\n\n***\n\n### delete()\n\n> **delete**(`opts?`): `Promise`\\<`void`\\>\n\nDelete the document. Soft by default (reversible with [restore](../../../documents/document/classes/Document.md#restore));\npass `permanent: true` to delete irreversibly.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts?` | \\{ `permanent?`: `boolean`; \\} |\n| `opts.permanent?` | `boolean` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`delete`](../../../documents/document/classes/Document.md#delete)\n\n***\n\n### deleteProperty()\n\n> **deleteProperty**(`assignment`): `Promise`\\<`void`\\>\n\nRemove a property from this entity, given its [properties](#properties) entry.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `assignment` | [`EntityPropertyWithDefinition`](../../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`deleteProperty`](../../../documents/document/classes/Document.md#deleteproperty)\n\n***\n\n### favorite()\n\n> **favorite**(): `Promise`\\<`Task`\\>\n\nAdd this entity to the user's favorites. Returns this handle for chaining.\nPlain unwrap: favoriting alters the user's favorites collection, not this\nentity's own detail, so there's nothing cached to invalidate.\n\n#### Returns\n\n`Promise`\\<`Task`\\>\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`favorite`](../../../documents/document/classes/Document.md#favorite)\n\n***\n\n### githubPullRequests()\n\n> **githubPullRequests**(): `Promise`\\<[`GithubPullRequest`](../../../../../generated/storage/types.gen/type-aliases/GithubPullRequest.md)[]\\>\n\nGitHub pull requests associated with the document.\n\n#### Returns\n\n`Promise`\\<[`GithubPullRequest`](../../../../../generated/storage/types.gen/type-aliases/GithubPullRequest.md)[]\\>\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`githubPullRequests`](../../../documents/document/classes/Document.md#githubpullrequests)\n\n***\n\n### move()\n\n> **move**(`project`): `Promise`\\<`void`\\>\n\nMove the document into a project (or out of one, with `null`).\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `project` | [`Project`](../../../projects/project/classes/Project.md) \\| `null` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`move`](../../../documents/document/classes/Document.md#move)\n\n***\n\n### properties()\n\n> **properties**(`opts?`): `Promise`\\<[`EntityPropertyWithDefinition`](../../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md)[]\\>\n\nThe properties set on this entity, each with its definition, value, and options.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts?` | \\{ `includeMetadata?`: `boolean`; \\} |\n| `opts.includeMetadata?` | `boolean` |\n\n#### Returns\n\n`Promise`\\<[`EntityPropertyWithDefinition`](../../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md)[]\\>\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`properties`](../../../documents/document/classes/Document.md#properties)\n\n***\n\n### propertyReference()\n\n> **propertyReference**(): [`PropertyTargetReference`](../../../../../generated/properties/types.gen/type-aliases/PropertyTargetReference.md)\n\nThis entity's reference for bulk property operations.\n\n#### Returns\n\n[`PropertyTargetReference`](../../../../../generated/properties/types.gen/type-aliases/PropertyTargetReference.md)\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`propertyReference`](../../../documents/document/classes/Document.md#propertyreference)\n\n***\n\n### rename()\n\n> **rename**(`name`): `Promise`\\<`void`\\>\n\nRename the document.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `name` | `string` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`rename`](../../../documents/document/classes/Document.md#rename)\n\n***\n\n### restore()\n\n> **restore**(): `Promise`\\<`void`\\>\n\nRestore a soft-deleted document.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`restore`](../../../documents/document/classes/Document.md#restore)\n\n***\n\n### setProperty()\n\n> **setProperty**(`property`, `value?`): `Promise`\\<`void`\\>\n\nSet a property value on this entity, or attach the property without a\nvalue when `value` is omitted.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `property` | [`PropertyDefinition`](../../../properties/property-definition/classes/PropertyDefinition.md) |\n| `value?` | [`SetPropertyValue`](../../../../../generated/properties/types.gen/type-aliases/SetPropertyValue.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`setProperty`](../../../documents/document/classes/Document.md#setproperty)\n\n***\n\n### setTeamShare()\n\n> **setTeamShare**(`shared`): `Promise`\\<`void`\\>\n\nShare the document with the owner's team, or unshare it.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `shared` | `boolean` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`setTeamShare`](../../../documents/document/classes/Document.md#setteamshare)\n\n***\n\n### shortId()\n\n> **shortId**(): `Promise`\\<`string`\\>\n\nThe document's short id (used in compact links and branch names).\n\n#### Returns\n\n`Promise`\\<`string`\\>\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`shortId`](../../../documents/document/classes/Document.md#shortid)\n\n***\n\n### teamShare()\n\n> **teamShare**(): `Promise`\\<[`DocumentTeamShareResponse`](../../../../../generated/storage/types.gen/type-aliases/DocumentTeamShareResponse.md)\\>\n\nWhether the document is shared with the owner's team, and which team.\n\n#### Returns\n\n`Promise`\\<[`DocumentTeamShareResponse`](../../../../../generated/storage/types.gen/type-aliases/DocumentTeamShareResponse.md)\\>\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`teamShare`](../../../documents/document/classes/Document.md#teamshare)\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`DocumentMetadataWithContent`](../../../../../generated/storage/types.gen/type-aliases/DocumentMetadataWithContent.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`DocumentMetadataWithContent`](../../../../../generated/storage/types.gen/type-aliases/DocumentMetadataWithContent.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`DocumentMetadataWithContent`](../../../../../generated/storage/types.gen/type-aliases/DocumentMetadataWithContent.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`toJSON`](../../../documents/document/classes/Document.md#tojson)\n\n***\n\n### toMention()\n\n> **toMention**(): [`MentionPart`](../../../../mentions/interfaces/MentionPart.md)\n\n#### Returns\n\n[`MentionPart`](../../../../mentions/interfaces/MentionPart.md)\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`toMention`](../../../documents/document/classes/Document.md#tomention)\n\n***\n\n### unfavorite()\n\n> **unfavorite**(): `Promise`\\<`Task`\\>\n\nRemove this entity from the user's favorites. Returns this handle for chaining.\n\n#### Returns\n\n`Promise`\\<`Task`\\>\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`unfavorite`](../../../documents/document/classes/Document.md#unfavorite)\n\n***\n\n### updatePropertyOptions()\n\n> **updatePropertyOptions**(`changes`): `Promise`\\<[`BulkUpdateEntityPropertyOptionsResponse`](../../../../../generated/properties/types.gen/type-aliases/BulkUpdateEntityPropertyOptionsResponse.md)\\>\n\nApply multi-select option deltas atomically across this entity's properties.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `changes` | [`PropertyOptionDelta`](../../../entity/interfaces/PropertyOptionDelta.md)[] |\n\n#### Returns\n\n`Promise`\\<[`BulkUpdateEntityPropertyOptionsResponse`](../../../../../generated/properties/types.gen/type-aliases/BulkUpdateEntityPropertyOptionsResponse.md)\\>\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`updatePropertyOptions`](../../../documents/document/classes/Document.md#updatepropertyoptions)\n\n***\n\n### webUrl()\n\n> **webUrl**(): `string`\n\nThe task's URL in the Macro web app.\n\n#### Returns\n\n`string`\n\n#### Overrides\n\n[`Document`](../../../documents/document/classes/Document.md).[`webUrl`](../../../documents/document/classes/Document.md#weburl)\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `id`): `Task`\n\nA handle to a task by document id. Details load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `id` | `string` |\n\n#### Returns\n\n`Task`\n\n#### Overrides\n\n[`Document`](../../../documents/document/classes/Document.md).[`byId`](../../../documents/document/classes/Document.md#byid)\n\n***\n\n### create()\n\n> `static` **create**(`client`, `opts`): `Promise`\\<`Task`\\>\n\nCreate a task. `team` scopes the team task number and may be omitted\nwhen the creator belongs to exactly one team; `shareWithTeam` defaults\nto true.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `opts` | \\{ `markdown?`: `string`; `name`: `string`; `project?`: [`Project`](../../../projects/project/classes/Project.md); `shareWithTeam?`: `boolean`; `team?`: [`Team`](../../../teams/team/classes/Team.md); \\} |\n| `opts.markdown?` | `string` |\n| `opts.name` | `string` |\n| `opts.project?` | [`Project`](../../../projects/project/classes/Project.md) |\n| `opts.shareWithTeam?` | `boolean` |\n| `opts.team?` | [`Team`](../../../teams/team/classes/Team.md) |\n\n#### Returns\n\n`Promise`\\<`Task`\\>\n\n#### Overrides\n\n[`Document`](../../../documents/document/classes/Document.md).[`create`](../../../documents/document/classes/Document.md#create)\n\n***\n\n### createSkill()\n\n> `static` **createSkill**(`client`, `opts`): `Promise`\\<[`Document`](../../../documents/document/classes/Document.md)\\>\n\nCreate a skill: a markdown document containing instructions that AI reads\nand follows when the skill is referenced in an AI input.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `opts` | \\{ `markdown?`: `string`; `name`: `string`; `project?`: [`Project`](../../../projects/project/classes/Project.md); \\} |\n| `opts.markdown?` | `string` |\n| `opts.name` | `string` |\n| `opts.project?` | [`Project`](../../../projects/project/classes/Project.md) |\n\n#### Returns\n\n`Promise`\\<[`Document`](../../../documents/document/classes/Document.md)\\>\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`createSkill`](../../../documents/document/classes/Document.md#createskill)\n\n***\n\n### createSnippet()\n\n> `static` **createSnippet**(`client`, `opts`): `Promise`\\<[`Document`](../../../documents/document/classes/Document.md)\\>\n\nCreate a snippet: a reusable markdown document that can be inserted into\nany markdown area.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `opts` | \\{ `markdown?`: `string`; `name`: `string`; `project?`: [`Project`](../../../projects/project/classes/Project.md); \\} |\n| `opts.markdown?` | `string` |\n| `opts.name` | `string` |\n| `opts.project?` | [`Project`](../../../projects/project/classes/Project.md) |\n\n#### Returns\n\n`Promise`\\<[`Document`](../../../documents/document/classes/Document.md)\\>\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`createSnippet`](../../../documents/document/classes/Document.md#createsnippet)\n\n***\n\n### forPullRequest()\n\n> `static` **forPullRequest**(`client`, `url`): `Promise`\\<`Task`[]\\>\n\nThe tasks the GitHub pull request at `url` references (as `MACRO-<id>` in\nits text, branch, or comments), oldest link first. Empty when the caller\ncannot see the pull request; tasks the caller cannot open still appear.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `url` | `string` |\n\n#### Returns\n\n`Promise`\\<`Task`[]\\>\n\n***\n\n### recent()\n\n> `static` **recent**(`client`, `opts?`): `AsyncGenerator`\\<[`Document`](../../../documents/document/classes/Document.md)\\>\n\nThe user's recent documents, most recent first, auto-paginated.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `opts?` | \\{ `fileType?`: `string`; `pageSize?`: `number`; \\} |\n| `opts.fileType?` | `string` |\n| `opts.pageSize?` | `number` |\n\n#### Returns\n\n`AsyncGenerator`\\<[`Document`](../../../documents/document/classes/Document.md)\\>\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`recent`](../../../documents/document/classes/Document.md#recent)\n\n***\n\n### recentlyDeleted()\n\n> `static` **recentlyDeleted**(`client`): `Promise`\\<[`Document`](../../../documents/document/classes/Document.md)[]\\>\n\nThe user's recently soft-deleted documents. The underlying endpoint also\nreturns deleted chats and projects; those are filtered out here.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`Promise`\\<[`Document`](../../../documents/document/classes/Document.md)[]\\>\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`recentlyDeleted`](../../../documents/document/classes/Document.md#recentlydeleted)\n"+ "documentation": "# Macro SDK: tasks\n\nGenerated by TypeDoc. Paths below refer to the canonical Markdown hierarchy. Other entity handles are documented in their named section; request core for shared SDK helpers.\n\n<!-- generated/properties/types.gen/type-aliases/BulkUpdateEntityPropertyOptionsResponse.md -->\n# Type Alias: BulkUpdateEntityPropertyOptionsResponse\n\n> **BulkUpdateEntityPropertyOptionsResponse** = \\{ `properties`: [`EntityPropertyOptionSelectionResponse`](EntityPropertyOptionSelectionResponse.md)[]; \\}\n\nResponse for a bulk option update: each property's reconciled final ids.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-properties\"></a> `properties` | [`EntityPropertyOptionSelectionResponse`](EntityPropertyOptionSelectionResponse.md)[] | The final option ids per updated property. |\n\n\n<!-- generated/properties/types.gen/type-aliases/DataType.md -->\n# Type Alias: DataType\n\n> **DataType** = `\"BOOLEAN\"` \\| `\"DATE\"` \\| `\"NUMBER\"` \\| `\"STRING\"` \\| `\"SELECT_NUMBER\"` \\| `\"SELECT_STRING\"` \\| `\"TAG\"` \\| `\"ENTITY\"` \\| `\"LINK\"`\n\nData type for property values, determining storage and validation.\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityProperty.md -->\n# Type Alias: EntityProperty\n\n> **EntityProperty** = \\{ `created_at`: `string`; `entity_id`: `string`; `entity_type`: [`EntityType`](EntityType.md); `id`: `string`; `property_definition_id`: `string`; `updated_at`: `string`; \\}\n\nAssignment of a property definition to a specific entity (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-created_at\"></a> `created_at` | `string` |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` |\n| <a id=\"property-entity_type\"></a> `entity_type` | [`EntityType`](EntityType.md) |\n| <a id=\"property-id\"></a> `id` | `string` |\n| <a id=\"property-property_definition_id\"></a> `property_definition_id` | `string` |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityPropertyOptionSelectionResponse.md -->\n# Type Alias: EntityPropertyOptionSelectionResponse\n\n> **EntityPropertyOptionSelectionResponse** = \\{ `option_ids`: `string`[]; `property_id`: `string`; \\}\n\nThe reconciled final option ids stored for one property after a bulk update.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-option_ids\"></a> `option_ids` | `string`[] | The final option ids the server persisted, in stored order. |\n| <a id=\"property-property_id\"></a> `property_id` | `string` | The property definition the options belong to. |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md -->\n# Type Alias: EntityPropertyWithDefinition\n\n> **EntityPropertyWithDefinition** = \\{ `definition`: [`PropertyDefinition`](PropertyDefinition.md); `options?`: [`PropertyOption`](PropertyOption.md)[] \\| `null`; `property`: [`EntityProperty`](EntityProperty.md); `value?`: `null` \\| [`PropertyValue`](PropertyValue.md); \\}\n\nEntity property with its definition, value, and options (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-definition\"></a> `definition` | [`PropertyDefinition`](PropertyDefinition.md) |\n| <a id=\"property-options\"></a> `options?` | [`PropertyOption`](PropertyOption.md)[] \\| `null` |\n| <a id=\"property-property\"></a> `property` | [`EntityProperty`](EntityProperty.md) |\n| <a id=\"property-value\"></a> `value?` | `null` \\| [`PropertyValue`](PropertyValue.md) |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityReference.md -->\n# Type Alias: EntityReference\n\n> **EntityReference** = \\{ `entity_id`: `string`; `entity_type`: [`EntityType`](EntityType.md); `specific_message_id?`: `string` \\| `null`; \\}\n\nEntity reference for entity-type property values.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | - |\n| <a id=\"property-entity_type\"></a> `entity_type` | [`EntityType`](EntityType.md) | - |\n| <a id=\"property-specific_message_id\"></a> `specific_message_id?` | `string` \\| `null` | For CHANNEL, CHAT, THREAD entity types - optional specific message ID. This allows referencing a specific message within a thread/channel/chat. |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityType.md -->\n# Type Alias: EntityType\n\n> **EntityType** = `\"CALENDAR_EVENT\"` \\| `\"CALL_RECORD\"` \\| `\"CHANNEL\"` \\| `\"CHAT\"` \\| `\"COMPANY\"` \\| `\"DATABASE_ROW\"` \\| `\"CONTACT\"` \\| `\"DOCUMENT\"` \\| `\"INITIATIVE\"` \\| `\"PROJECT\"` \\| `\"TASK\"` \\| `\"THREAD\"` \\| `\"USER\"`\n\nType of entity that can be referenced by entity properties.\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyDefinition.md -->\n# Type Alias: PropertyDefinition\n\n> **PropertyDefinition** = \\{ `created_at`: `string`; `data_type`: [`DataType`](DataType.md); `display_name`: `string`; `id`: `string`; `is_metadata`: `boolean`; `is_multi_select`: `boolean`; `is_system`: `boolean`; `owner`: [`PropertyOwner`](PropertyOwner.md); `specific_entity_type`: `null` \\| [`EntityType`](EntityType.md); `updated_at`: `string`; \\}\n\nProperty definition model (service representation).\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | - |\n| <a id=\"property-data_type\"></a> `data_type` | [`DataType`](DataType.md) | - |\n| <a id=\"property-display_name\"></a> `display_name` | `string` | - |\n| <a id=\"property-id\"></a> `id` | `string` | - |\n| <a id=\"property-is_metadata\"></a> `is_metadata` | `boolean` | Flag to indicate if this is a system-generated metadata property. Not stored in database - computed at service layer. |\n| <a id=\"property-is_multi_select\"></a> `is_multi_select` | `boolean` | - |\n| <a id=\"property-is_system\"></a> `is_system` | `boolean` | Flag to indicate if this is a system property (stored in DB). |\n| <a id=\"property-owner\"></a> `owner` | [`PropertyOwner`](PropertyOwner.md) | - |\n| <a id=\"property-specific_entity_type\"></a> `specific_entity_type` | `null` \\| [`EntityType`](EntityType.md) | - |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` | - |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyOption.md -->\n# Type Alias: PropertyOption\n\n> **PropertyOption** = \\{ `color`: `string` \\| `null`; `created_at`: `string`; `display_order`: `number`; `id`: `string`; `property_definition_id`: `string`; `updated_at`: `string`; `value`: [`PropertyOptionValue`](PropertyOptionValue.md); \\}\n\nA selectable option for select-type properties (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-color\"></a> `color` | `string` \\| `null` |\n| <a id=\"property-created_at\"></a> `created_at` | `string` |\n| <a id=\"property-display_order\"></a> `display_order` | `number` |\n| <a id=\"property-id\"></a> `id` | `string` |\n| <a id=\"property-property_definition_id\"></a> `property_definition_id` | `string` |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` |\n| <a id=\"property-value\"></a> `value` | [`PropertyOptionValue`](PropertyOptionValue.md) |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyOptionValue.md -->\n# Type Alias: PropertyOptionValue\n\n> **PropertyOptionValue** = \\{ `type`: `\"string\"`; `value`: `string`; \\} \\| \\{ `type`: `\"number\"`; `value`: `number`; \\}\n\nThe value of a property option - either a string or a number.\n\n## Union Members\n\n### Type Literal\n\n\\{ `type`: `\"string\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"string\"` | - |\n| `value` | `string` | String value for SelectString properties |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"number\"`; `value`: `number`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"number\"` | - |\n| `value` | `number` | Number value for SelectNumber properties |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyOwner.md -->\n# Type Alias: PropertyOwner\n\n> **PropertyOwner** = \\{ `scope`: `\"user\"`; `user_id`: `string`; \\} \\| \\{ `scope`: `\"team\"`; `team_id`: `string`; \\} \\| \\{ `database_id`: `string`; `scope`: `\"database\"`; \\} \\| \\{ `scope`: `\"system\"`; \\}\n\nDefines who owns a property - user-scoped, team-scoped, database-scoped, or system.\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyTargetEntityType.md -->\n# Type Alias: PropertyTargetEntityType\n\n> **PropertyTargetEntityType** = `\"CALL_RECORD\"` \\| `\"CHANNEL\"` \\| `\"CHAT\"` \\| `\"COMPANY\"` \\| `\"DATABASE_ROW\"` \\| `\"DOCUMENT\"` \\| `\"INITIATIVE\"` \\| `\"PROJECT\"` \\| `\"THREAD\"` \\| `\"USER\"`\n\nCanonical type of an entity receiving properties.\n\nTasks are documents at API boundaries. `Task` intentionally does not exist\nhere; task classification is resolved by the properties domain from the\ndocument subtype.\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyTargetReference.md -->\n# Type Alias: PropertyTargetReference\n\n> **PropertyTargetReference** = \\{ `entity_id`: `string`; `entity_type`: [`PropertyTargetEntityType`](PropertyTargetEntityType.md); \\}\n\nCanonical reference to an entity receiving properties.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | Entity identifier. |\n| <a id=\"property-entity_type\"></a> `entity_type` | [`PropertyTargetEntityType`](PropertyTargetEntityType.md) | Canonical entity type. |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyValue.md -->\n# Type Alias: PropertyValue\n\n> **PropertyValue** = \\{ `type`: `\"Boolean\"`; `value`: `boolean`; \\} \\| \\{ `type`: `\"Number\"`; `value`: `number`; \\} \\| \\{ `type`: `\"String\"`; `value`: `string`; \\} \\| \\{ `type`: `\"Date\"`; `value`: `string`; \\} \\| \\{ `type`: `\"SelectOption\"`; `value`: `string`[]; \\} \\| \\{ `type`: `\"EntityReference\"`; `value`: [`EntityReference`](EntityReference.md)[]; \\} \\| \\{ `type`: `\"Link\"`; `value`: `string`[]; \\}\n\nProperty value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to/from JSONB in the database.\n\n## Union Members\n\n### Type Literal\n\n\\{ `type`: `\"Boolean\"`; `value`: `boolean`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Boolean\"` | - |\n| `value` | `boolean` | Boolean value Serializes as: {\"type\": \"Boolean\", \"value\": true} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"Number\"`; `value`: `number`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Number\"` | - |\n| `value` | `number` | Numeric value Serializes as: {\"type\": \"Number\", \"value\": 42.5} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"String\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"String\"` | - |\n| `value` | `string` | String value Serializes as: {\"type\": \"String\", \"value\": \"text\"} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"Date\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Date\"` | - |\n| `value` | `string` | Date/timestamp value Serializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"SelectOption\"`; `value`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"SelectOption\"` | - |\n| `value` | `string`[] | Select option(s) - always an array (check is_multi_select to determine if single or multi) Single-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1) Multi-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+) |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"EntityReference\"`; `value`: [`EntityReference`](EntityReference.md)[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"EntityReference\"` | - |\n| `value` | [`EntityReference`](EntityReference.md)[] | Entity reference(s) - always an array (check is_multi_select to determine if single or multi) Single-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1) Multi-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+) |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"Link\"`; `value`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Link\"` | - |\n| `value` | `string`[] | Link value(s) - always an array (check is_multi_select to determine if single or multi) Single-select: {\"type\": \"Link\", \"value\": [\"https://example.com\"]} (length 0 or 1) Multi-select: {\"type\": \"Link\", \"value\": [\"https://example.com\", \"https://other.com\"]} (length 0+) |\n\n\n<!-- generated/properties/types.gen/type-aliases/SetPropertyValue.md -->\n# Type Alias: SetPropertyValue\n\n> **SetPropertyValue** = \\{ `type`: `\"boolean\"`; `value`: `boolean`; \\} \\| \\{ `type`: `\"date\"`; `value`: `string`; \\} \\| \\{ `type`: `\"number\"`; `value`: `number`; \\} \\| \\{ `type`: `\"string\"`; `value`: `string`; \\} \\| \\{ `option_id`: `string`; `type`: `\"select_option\"`; \\} \\| \\{ `option_ids`: `string`[]; `type`: `\"multi_select_option\"`; \\} \\| \\{ `reference`: [`EntityReference`](EntityReference.md); `type`: `\"entity_reference\"`; \\} \\| \\{ `references`: [`EntityReference`](EntityReference.md)[]; `type`: `\"multi_entity_reference\"`; \\} \\| \\{ `type`: `\"link\"`; `url`: `string`; \\} \\| \\{ `type`: `\"multi_link\"`; `urls`: `string`[]; \\}\n\nType-safe enum for setting entity property values - provides compile-time validation.\n\n\n<!-- generated/storage/types.gen/type-aliases/AccessLevel.md -->\n# Type Alias: AccessLevel\n\n> **AccessLevel** = `\"view\"` \\| `\"comment\"` \\| `\"edit\"` \\| `\"owner\"`\n\nOrdered from least to most access top -> bottom\n\n\n<!-- generated/storage/types.gen/type-aliases/BomPart.md -->\n# Type Alias: BomPart\n\n> **BomPart** = \\{ `id`: `string`; `path`: `string`; `sha`: `string`; \\}\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-id\"></a> `id` | `string` | The uuid of the bom part |\n| <a id=\"property-path\"></a> `path` | `string` | The file path of the bom part content |\n| <a id=\"property-sha\"></a> `sha` | `string` | The sha of the bom part content There is an index on sha for more performant queries based on it. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ChannelSharePermission.md -->\n# Type Alias: ChannelSharePermission\n\n> **ChannelSharePermission** = \\{ `access_level`: [`AccessLevel`](AccessLevel.md); `channel_id`: `string`; \\}\n\nThe channel share permission\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-access_level\"></a> `access_level` | [`AccessLevel`](AccessLevel.md) | The access level for the channel |\n| <a id=\"property-channel_id\"></a> `channel_id` | `string` | The channel id |\n\n\n<!-- generated/storage/types.gen/type-aliases/DocumentContent.md -->\n# Type Alias: DocumentContent\n\n> **DocumentContent** = \\{ `location?`: `null` \\| [`DocumentContentLocation`](DocumentContentLocation.md); `state`: [`DocumentContentState`](DocumentContentState.md); \\}\n\nAPI-visible content lifecycle and location metadata.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-location\"></a> `location?` | `null` \\| [`DocumentContentLocation`](DocumentContentLocation.md) | - |\n| <a id=\"property-state\"></a> `state` | [`DocumentContentState`](DocumentContentState.md) | The current lifecycle state of the content. |\n\n\n<!-- generated/storage/types.gen/type-aliases/DocumentContentLocation.md -->\n# Type Alias: DocumentContentLocation\n\n> **DocumentContentLocation** = `\"object_storage\"` \\| `\"sync_service\"` \\| `\"docx_bom_parts\"` \\| `\"converted_pdf\"` \\| `\"unknown\"`\n\nWhere document content is, or is expected to be, read from.\n\n\n<!-- generated/storage/types.gen/type-aliases/DocumentContentState.md -->\n# Type Alias: DocumentContentState\n\n> **DocumentContentState** = `\"unknown\"` \\| `\"pending\"` \\| `\"ready\"`\n\nAPI-visible content lifecycle state derived from current document metadata.\n\n\n<!-- generated/storage/types.gen/type-aliases/DocumentMetadata.md -->\n# Type Alias: DocumentMetadata\n\n> **DocumentMetadata** = \\{ `branchedFromId?`: `string` \\| `null`; `branchedFromVersionId?`: `number` \\| `null`; `createdAt?`: `string` \\| `null`; `deletedAt?`: `string` \\| `null`; `documentBom?`: [`BomPart`](BomPart.md)[] \\| `null`; `documentFamilyId?`: `number` \\| `null`; `documentId`: `string`; `documentName`: `string`; `documentVersionId`: `number`; `fileType?`: `string` \\| `null`; `modificationData?`: `unknown`; `owner`: `string`; `projectId?`: `string` \\| `null`; `projectName?`: `string` \\| `null`; `sha?`: `string` \\| `null`; `subType?`: `null` \\| [`DocumentSubType`](DocumentSubType.md); `updatedAt?`: `string` \\| `null`; \\}\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-branchedfromid\"></a> `branchedFromId?` | `string` \\| `null` | The id of the document this document branched from |\n| <a id=\"property-branchedfromversionid\"></a> `branchedFromVersionId?` | `number` \\| `null` | The id of the version this document branched from This could be either DocumentInstance or DocumentBom id depending on the file type |\n| <a id=\"property-createdat\"></a> `createdAt?` | `string` \\| `null` | The time the document was created |\n| <a id=\"property-deletedat\"></a> `deletedAt?` | `string` \\| `null` | The time the document was deleted |\n| <a id=\"property-documentbom\"></a> `documentBom?` | [`BomPart`](BomPart.md)[] \\| `null` | If the document is a DOCX document and unzipped, the document_bom will be present |\n| <a id=\"property-documentfamilyid\"></a> `documentFamilyId?` | `number` \\| `null` | The id of the document family this document belongs to |\n| <a id=\"property-documentid\"></a> `documentId` | `string` | The document id |\n| <a id=\"property-documentname\"></a> `documentName` | `string` | The name of the document |\n| <a id=\"property-documentversionid\"></a> `documentVersionId` | `number` | The version of the document This could be the document_instance_id or document_bom_id depending on the file type |\n| <a id=\"property-filetype\"></a> `fileType?` | `string` \\| `null` | The file type of the document (file extension) |\n| <a id=\"property-modificationdata\"></a> `modificationData?` | `unknown` | The modification data for the document instance. This is only used for PDF documents. |\n| <a id=\"property-owner\"></a> `owner` | `string` | The owner of the document |\n| <a id=\"property-projectid\"></a> `projectId?` | `string` \\| `null` | The id of the project that this document belongs to |\n| <a id=\"property-projectname\"></a> `projectName?` | `string` \\| `null` | The name of the project that this document belongs to |\n| <a id=\"property-sha\"></a> `sha?` | `string` \\| `null` | If the document is a PDF, this is the SHA of the pdf If the document is a DOCX, this will not be present |\n| <a id=\"property-subtype\"></a> `subType?` | `null` \\| [`DocumentSubType`](DocumentSubType.md) | - |\n| <a id=\"property-updatedat\"></a> `updatedAt?` | `string` \\| `null` | The time the document instance / document BOM was updated |\n\n\n<!-- generated/storage/types.gen/type-aliases/DocumentMetadataWithContent.md -->\n# Type Alias: DocumentMetadataWithContent\n\n> **DocumentMetadataWithContent** = [`DocumentMetadata`](DocumentMetadata.md) & \\{ `content`: [`DocumentContent`](DocumentContent.md); `teamId?`: `string` \\| `null`; `teamTaskId?`: `number` \\| `null`; \\}\n\nFull document metadata plus content lifecycle metadata.\n\n## Type Declaration\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `content` | [`DocumentContent`](DocumentContent.md) | Content lifecycle and location metadata. |\n| `teamId?` | `string` \\| `null` | The team this task number is scoped to, for task documents. |\n| `teamTaskId?` | `number` \\| `null` | The task number assigned within the team, for task documents. |\n\n\n<!-- generated/storage/types.gen/type-aliases/DocumentResponseMetadata.md -->\n# Type Alias: DocumentResponseMetadata\n\n> **DocumentResponseMetadata** = \\{ `branchedFromId?`: `string` \\| `null`; `branchedFromVersionId?`: `number` \\| `null`; `createdAt?`: `string` \\| `null`; `documentBom?`: [`BomPart`](BomPart.md)[] \\| `null`; `documentFamilyId?`: `number` \\| `null`; `documentId`: `string`; `documentName`: `string`; `documentVersionId`: `number`; `fileType?`: `string` \\| `null`; `modificationData?`: `unknown`; `owner`: `string`; `sha?`: `string` \\| `null`; `subType?`: `null` \\| [`DocumentSubType`](DocumentSubType.md); `updatedAt?`: `string` \\| `null`; \\}\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-branchedfromid\"></a> `branchedFromId?` | `string` \\| `null` | The id of the document this document branched from |\n| <a id=\"property-branchedfromversionid\"></a> `branchedFromVersionId?` | `number` \\| `null` | The id of the version this document branched from This could be either DocumentInstance or DocumentBom id depending on the file type |\n| <a id=\"property-createdat\"></a> `createdAt?` | `string` \\| `null` | The time the document was created |\n| <a id=\"property-documentbom\"></a> `documentBom?` | [`BomPart`](BomPart.md)[] \\| `null` | If the document is a DOCX document, the document_bom will be present |\n| <a id=\"property-documentfamilyid\"></a> `documentFamilyId?` | `number` \\| `null` | The id of the document family this document belongs to |\n| <a id=\"property-documentid\"></a> `documentId` | `string` | The document id |\n| <a id=\"property-documentname\"></a> `documentName` | `string` | The name of the document |\n| <a id=\"property-documentversionid\"></a> `documentVersionId` | `number` | The version of the document This could be the document_instance_id or document_bom_id depending on the file type |\n| <a id=\"property-filetype\"></a> `fileType?` | `string` \\| `null` | The file type of the document |\n| <a id=\"property-modificationdata\"></a> `modificationData?` | `unknown` | The modification data for the document instance. This is only used for PDF documents. |\n| <a id=\"property-owner\"></a> `owner` | `string` | The owner of the document |\n| <a id=\"property-sha\"></a> `sha?` | `string` \\| `null` | If the document is a PDF, this is the SHA of the pdf If the document is a DOCX, this will not be present |\n| <a id=\"property-subtype\"></a> `subType?` | `null` \\| [`DocumentSubType`](DocumentSubType.md) | - |\n| <a id=\"property-updatedat\"></a> `updatedAt?` | `string` \\| `null` | The time the document instance / document BOM was updated |\n\n\n<!-- generated/storage/types.gen/type-aliases/DocumentSubType.md -->\n# Type Alias: DocumentSubType\n\n> **DocumentSubType** = `\"task\"` \\| `\"snippet\"` \\| `\"skill\"` \\| `\"initiative_description\"`\n\nThe document sub type enum represents all values of document sub types.\nThese values should match the `document_sub_type_value` table in macrodb.\n\nWire, database, and `Display` spellings are all `snake_case` so a\nmulti-word variant serializes identically in every system.\n\n\n<!-- generated/storage/types.gen/type-aliases/DocumentTeamShareResponse.md -->\n# Type Alias: DocumentTeamShareResponse\n\n> **DocumentTeamShareResponse** = \\{ `sharedWithTeam`: `boolean`; `teamId?`: `string` \\| `null`; \\}\n\nThe team-share state of a document. The team is resolved from the document\nowner's team membership.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-sharedwithteam\"></a> `sharedWithTeam` | `boolean` | Whether explicit team sharing is enabled; inherited team access does not count. |\n| <a id=\"property-teamid\"></a> `teamId?` | `string` \\| `null` | The owner's team the document is (or would be) shared with. `None` when the owner does not belong to a team. |\n\n\n<!-- generated/storage/types.gen/type-aliases/EntityPermission.md -->\n# Type Alias: EntityPermission\n\n> **EntityPermission** = \\{ `access_level`: [`AccessLevel`](AccessLevel.md); `type`: `\"access_level\"`; \\} \\| \\{ `type`: `\"channel_view_only\"`; \\} \\| \\{ `role`: [`ParticipantRole`](ParticipantRole.md); `type`: `\"channel_role\"`; \\} \\| \\{ `role`: [`TeamRole`](TeamRole.md); `type`: `\"team_role\"`; \\}\n\nA user's permission for an entity, discriminated by entity kind.\n\nItems (documents, chats, projects, threads) use access levels.\nChannels use view-only permission or participant roles.\n\n## Union Members\n\n### Type Literal\n\n\\{ `access_level`: [`AccessLevel`](AccessLevel.md); `type`: `\"access_level\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `access_level` | [`AccessLevel`](AccessLevel.md) | The access level the user has. |\n| `type` | `\"access_level\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"channel_view_only\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `role`: [`ParticipantRole`](ParticipantRole.md); `type`: `\"channel_role\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `role` | [`ParticipantRole`](ParticipantRole.md) | The role the user has in the channel. |\n| `type` | `\"channel_role\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `role`: [`TeamRole`](TeamRole.md); `type`: `\"team_role\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `role` | [`TeamRole`](TeamRole.md) | The role the user has in the team. |\n| `type` | `\"team_role\"` | - |\n\n\n<!-- generated/storage/types.gen/type-aliases/GithubPullRequest.md -->\n# Type Alias: GithubPullRequest\n\n> **GithubPullRequest** = \\{ `additions?`: `number` \\| `null`; `checks?`: [`GithubPullRequestCheckRun`](GithubPullRequestCheckRun.md)[] \\| `null`; `comments?`: [`GithubPullRequestComment`](GithubPullRequestComment.md)[] \\| `null`; `deletions?`: `number` \\| `null`; `displayName`: `string`; `foreignEntityId?`: `string` \\| `null`; `githubKey`: `string`; `name?`: `string` \\| `null`; `number`: `number`; `owner`: `string`; `repo`: `string`; `status?`: `string` \\| `null`; `url`: `string`; \\}\n\nDisplay-ready data for a GitHub pull request associated with a task.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-additions\"></a> `additions?` | `number` \\| `null` | The number of added lines in the pull request, when enrichment data is available. |\n| <a id=\"property-checks\"></a> `checks?` | [`GithubPullRequestCheckRun`](GithubPullRequestCheckRun.md)[] \\| `null` | Check runs collected from the pull request head commit, when enrichment data is available. |\n| <a id=\"property-comments\"></a> `comments?` | [`GithubPullRequestComment`](GithubPullRequestComment.md)[] \\| `null` | Comments collected from the pull request, when enrichment data is available. |\n| <a id=\"property-deletions\"></a> `deletions?` | `number` \\| `null` | The number of deleted lines in the pull request, when enrichment data is available. |\n| <a id=\"property-displayname\"></a> `displayName` | `string` | A compact label suitable for display in the UI. |\n| <a id=\"property-foreignentityid\"></a> `foreignEntityId?` | `string` \\| `null` | The internal `foreign_entity.id` UUID for the GitHub pull request row. |\n| <a id=\"property-githubkey\"></a> `githubKey` | `string` | The stored GitHub association key, in `owner/repo/pull/number` format. |\n| <a id=\"property-name\"></a> `name?` | `string` \\| `null` | The GitHub pull request title, when enrichment data is available. |\n| <a id=\"property-number\"></a> `number` | `number` | The GitHub pull request number. |\n| <a id=\"property-owner\"></a> `owner` | `string` | The GitHub repository owner or organization. |\n| <a id=\"property-repo\"></a> `repo` | `string` | The GitHub repository name. |\n| <a id=\"property-status\"></a> `status?` | `string` \\| `null` | The GitHub pull request status, when enrichment data is available. |\n| <a id=\"property-url\"></a> `url` | `string` | The public GitHub URL for the pull request. |\n\n\n<!-- generated/storage/types.gen/type-aliases/GithubPullRequestCheckRun.md -->\n# Type Alias: GithubPullRequestCheckRun\n\n> **GithubPullRequestCheckRun** = \\{ `completedAt?`: `string` \\| `null`; `conclusion?`: `string` \\| `null`; `id`: `number`; `name`: `string`; `startedAt?`: `string` \\| `null`; `status`: `string`; `url?`: `string` \\| `null`; \\}\n\nA check run associated with a GitHub pull request.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-completedat\"></a> `completedAt?` | `string` \\| `null` | When the check run completed, when available. |\n| <a id=\"property-conclusion\"></a> `conclusion?` | `string` \\| `null` | The raw GitHub check run conclusion, when the run has completed. |\n| <a id=\"property-id\"></a> `id` | `number` | The unique GitHub identifier for the check run. |\n| <a id=\"property-name\"></a> `name` | `string` | The check run name. |\n| <a id=\"property-startedat\"></a> `startedAt?` | `string` \\| `null` | When the check run started, when available. |\n| <a id=\"property-status\"></a> `status` | `string` | The raw GitHub check run status. |\n| <a id=\"property-url\"></a> `url?` | `string` \\| `null` | The public GitHub URL for the check run, when available. |\n\n\n<!-- generated/storage/types.gen/type-aliases/GithubPullRequestComment.md -->\n# Type Alias: GithubPullRequestComment\n\n> **GithubPullRequestComment** = \\{ `authorAssociation?`: `string` \\| `null`; `authorId?`: `number` \\| `null`; `authorLogin?`: `string` \\| `null`; `body`: `string`; `createdAt?`: `string` \\| `null`; `id`: `number`; `inReplyToId?`: `number` \\| `null`; `line?`: `number` \\| `null`; `originalLine?`: `number` \\| `null`; `path?`: `string` \\| `null`; `pullRequestReviewId?`: `number` \\| `null`; `source`: `string`; `updatedAt?`: `string` \\| `null`; `url?`: `string` \\| `null`; \\}\n\nA comment associated with a GitHub pull request.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-authorassociation\"></a> `authorAssociation?` | `string` \\| `null` | GitHub's relationship label for the author, when available. |\n| <a id=\"property-authorid\"></a> `authorId?` | `number` \\| `null` | The stable numeric GitHub user id for the comment author, when available. |\n| <a id=\"property-authorlogin\"></a> `authorLogin?` | `string` \\| `null` | The GitHub login for the comment author, when available. |\n| <a id=\"property-body\"></a> `body` | `string` | The comment or review body text. |\n| <a id=\"property-createdat\"></a> `createdAt?` | `string` \\| `null` | When the comment was created or the review was submitted. |\n| <a id=\"property-id\"></a> `id` | `number` | The unique GitHub identifier for the comment or review. |\n| <a id=\"property-inreplytoid\"></a> `inReplyToId?` | `number` \\| `null` | The id of the comment this one replies to, when it is part of a review thread. Only ever present on `review_comment` sources. |\n| <a id=\"property-line\"></a> `line?` | `number` \\| `null` | The line in the current diff the comment is anchored to. Cleared by GitHub when later commits outdate the comment's diff. |\n| <a id=\"property-originalline\"></a> `originalLine?` | `number` \\| `null` | The line the comment was originally anchored to, kept even when the diff has since changed. |\n| <a id=\"property-path\"></a> `path?` | `string` \\| `null` | The repository-relative file path the review comment is anchored to. Only ever present on `review_comment` sources. |\n| <a id=\"property-pullrequestreviewid\"></a> `pullRequestReviewId?` | `number` \\| `null` | The id of the pull request review this comment was submitted with. Only ever present on `review_comment` sources. |\n| <a id=\"property-source\"></a> `source` | `string` | The GitHub source for the comment, such as `issue_comment` or `review_comment`. |\n| <a id=\"property-updatedat\"></a> `updatedAt?` | `string` \\| `null` | When the comment or review was last updated. |\n| <a id=\"property-url\"></a> `url?` | `string` \\| `null` | The public GitHub URL for the comment or review, when available. |\n\n\n<!-- generated/storage/types.gen/type-aliases/HighlightType.md -->\n# Type Alias: HighlightType\n\n> **HighlightType** = `1` \\| `2` \\| `3`\n\n\n<!-- generated/storage/types.gen/type-aliases/LinkShare.md -->\n# Type Alias: LinkShare\n\n> **LinkShare** = `\"PUBLIC\"` \\| `\"TEAM\"`\n\nDefines who can access an item through its share link.\n\n\n<!-- generated/storage/types.gen/type-aliases/MessageCursor.md -->\n# Type Alias: MessageCursor\n\n> **MessageCursor** = \\{ `created_at`: `string`; `id`: `string`; \\}\n\nCursor for a chronological parent timeline.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | Last message creation time or activity occurrence time. |\n| <a id=\"property-id\"></a> `id` | `string` | Last entry UUID, used to break timestamp ties across both sources. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ParticipantRole.md -->\n# Type Alias: ParticipantRole\n\n> **ParticipantRole** = `\"owner\"` \\| `\"admin\"` \\| `\"member\"`\n\nThe role a user has within a channel.\n\n\n<!-- generated/storage/types.gen/type-aliases/PdfHighlightAnchorRequest.md -->\n# Type Alias: PdfHighlightAnchorRequest\n\n> **PdfHighlightAnchorRequest** = \\{ `alpha`: `number`; `blue`: `number`; `green`: `number`; `highlightRects`: [`PdfHighlightRectAnchorRequest`](PdfHighlightRectAnchorRequest.md)[]; `highlightType`: [`HighlightType`](HighlightType.md); `page`: `number`; `pageViewportHeight`: `number`; `pageViewportWidth`: `number`; `red`: `number`; `text`: `string`; `uuid?`: `string` \\| `null`; \\}\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-alpha\"></a> `alpha` | `number` |\n| <a id=\"property-blue\"></a> `blue` | `number` |\n| <a id=\"property-green\"></a> `green` | `number` |\n| <a id=\"property-highlightrects\"></a> `highlightRects` | [`PdfHighlightRectAnchorRequest`](PdfHighlightRectAnchorRequest.md)[] |\n| <a id=\"property-highlighttype\"></a> `highlightType` | [`HighlightType`](HighlightType.md) |\n| <a id=\"property-page\"></a> `page` | `number` |\n| <a id=\"property-pageviewportheight\"></a> `pageViewportHeight` | `number` |\n| <a id=\"property-pageviewportwidth\"></a> `pageViewportWidth` | `number` |\n| <a id=\"property-red\"></a> `red` | `number` |\n| <a id=\"property-text\"></a> `text` | `string` |\n| <a id=\"property-uuid\"></a> `uuid?` | `string` \\| `null` |\n\n\n<!-- generated/storage/types.gen/type-aliases/PdfHighlightRectAnchorRequest.md -->\n# Type Alias: PdfHighlightRectAnchorRequest\n\n> **PdfHighlightRectAnchorRequest** = \\{ `height`: `number`; `left`: `number`; `top`: `number`; `width`: `number`; \\}\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-height\"></a> `height` | `number` |\n| <a id=\"property-left\"></a> `left` | `number` |\n| <a id=\"property-top\"></a> `top` | `number` |\n| <a id=\"property-width\"></a> `width` | `number` |\n\n\n<!-- generated/storage/types.gen/type-aliases/PreSaveDocumentResponseData.md -->\n# Type Alias: PreSaveDocumentResponseData\n\n> **PreSaveDocumentResponseData** = \\{ `presignedUrls`: [`PresignedUrl`](PresignedUrl.md)[]; \\}\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-presignedurls\"></a> `presignedUrls` | [`PresignedUrl`](PresignedUrl.md)[] | Contains any presigned urls you need to upload specific bom parts with. |\n\n\n<!-- generated/storage/types.gen/type-aliases/PresignedUrl.md -->\n# Type Alias: PresignedUrl\n\n> **PresignedUrl** = \\{ `presignedUrl`: `string`; `sha`: `string`; \\}\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-presignedurl\"></a> `presignedUrl` | `string` | The presigned url used to upload the sha |\n| <a id=\"property-sha\"></a> `sha` | `string` | The sha of the item |\n\n\n<!-- generated/storage/types.gen/type-aliases/SaveBomPart.md -->\n# Type Alias: SaveBomPart\n\n> **SaveBomPart** = \\{ `path`: `string`; `sha`: `string`; \\}\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-path\"></a> `path` | `string` | The file path of the bom part content |\n| <a id=\"property-sha\"></a> `sha` | `string` | The sha of the bom part content There is an index on sha for more performant queries based on it. |\n\n\n<!-- generated/storage/types.gen/type-aliases/SaveDocumentRequest.md -->\n# Type Alias: SaveDocumentRequest\n\n> **SaveDocumentRequest** = \\{ `modificationData?`: `unknown`; `newBom?`: [`SaveBomPart`](SaveBomPart.md)[] \\| `null`; `sha?`: `string` \\| `null`; \\}\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-modificationdata\"></a> `modificationData?` | `unknown` | The modification data for the document instance. Used to store highlights and other overlays onto a static file |\n| <a id=\"property-newbom\"></a> `newBom?` | [`SaveBomPart`](SaveBomPart.md)[] \\| `null` | **DOCX ONLY** The updated BOM for the document. Containing the file path and the sha. |\n| <a id=\"property-sha\"></a> `sha?` | `string` \\| `null` | The sha of the new document. This is used to generate a presigned url to upload the new document content to s3. |\n\n\n<!-- generated/storage/types.gen/type-aliases/SaveDocumentResponseData.md -->\n# Type Alias: SaveDocumentResponseData\n\n> **SaveDocumentResponseData** = \\{ `documentMetadata`: [`DocumentResponseMetadata`](DocumentResponseMetadata.md); `presignedUrl?`: `string` \\| `null`; \\}\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-documentmetadata\"></a> `documentMetadata` | [`DocumentResponseMetadata`](DocumentResponseMetadata.md) | The updated document metadata |\n| <a id=\"property-presignedurl\"></a> `presignedUrl?` | `string` \\| `null` | If the document is an editable file, we provide a presigned url to save the updated file to. |\n\n\n<!-- generated/storage/types.gen/type-aliases/SharePermissionV2.md -->\n# Type Alias: SharePermissionV2\n\n> **SharePermissionV2** = \\{ `channelSharePermissions?`: [`ChannelSharePermission`](ChannelSharePermission.md)[] \\| `null`; `id`: `string`; `linkShare?`: `null` \\| [`LinkShare`](LinkShare.md); `linkShareAccessLevel?`: `null` \\| [`AccessLevel`](AccessLevel.md); `owner`: `string`; `teamShareAccessLevel?`: `null` \\| [`AccessLevel`](AccessLevel.md); \\}\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-channelsharepermissions\"></a> `channelSharePermissions?` | [`ChannelSharePermission`](ChannelSharePermission.md)[] \\| `null` | The channel share permissions for the item |\n| <a id=\"property-id\"></a> `id` | `string` | The share permission id |\n| <a id=\"property-linkshare\"></a> `linkShare?` | `null` \\| [`LinkShare`](LinkShare.md) | - |\n| <a id=\"property-linkshareaccesslevel\"></a> `linkShareAccessLevel?` | `null` \\| [`AccessLevel`](AccessLevel.md) | - |\n| <a id=\"property-owner\"></a> `owner` | `string` | The owner of the item |\n| <a id=\"property-teamshareaccesslevel\"></a> `teamShareAccessLevel?` | `null` \\| [`AccessLevel`](AccessLevel.md) | - |\n\n\n<!-- generated/storage/types.gen/type-aliases/TeamRole.md -->\n# Type Alias: TeamRole\n\n> **TeamRole** = `\"member\"` \\| `\"admin\"` \\| `\"owner\"`\n\nThe role a user has within a team.\n\nOrdered least to most privileged so comparisons reflect access strength.\n\n\n<!-- src/entities/tasks/namespace/classes/TaskNamespace.md -->\n# Class: TaskNamespace\n\n## Constructors\n\n### Constructor\n\n> **new TaskNamespace**(`client`): `TaskNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`TaskNamespace`\n\n## Methods\n\n### byId()\n\n> **byId**(`id`): [`Task`](../../task/classes/Task.md)\n\nA handle to a task by document id. Details load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`Task`](../../task/classes/Task.md)\n\n***\n\n### create()\n\n> **create**(`opts`): `Promise`\\<[`Task`](../../task/classes/Task.md)\\>\n\nCreate a task.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts` | \\{ `markdown?`: `string`; `name`: `string`; `project?`: [`Project`](../../../projects/project/classes/Project.md); `shareWithTeam?`: `boolean`; `team?`: [`Team`](../../../teams/team/classes/Team.md); \\} |\n| `opts.markdown?` | `string` |\n| `opts.name` | `string` |\n| `opts.project?` | [`Project`](../../../projects/project/classes/Project.md) |\n| `opts.shareWithTeam?` | `boolean` |\n| `opts.team?` | [`Team`](../../../teams/team/classes/Team.md) |\n\n#### Returns\n\n`Promise`\\<[`Task`](../../task/classes/Task.md)\\>\n\n***\n\n### forPullRequest()\n\n> **forPullRequest**(`url`): `Promise`\\<[`Task`](../../task/classes/Task.md)[]\\>\n\nThe tasks the GitHub pull request at `url` references, oldest link first.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `url` | `string` |\n\n#### Returns\n\n`Promise`\\<[`Task`](../../task/classes/Task.md)[]\\>\n\n***\n\n### search()\n\n> **search**(`query`, `opts?`): `AsyncGenerator`\\<[`Task`](../../task/classes/Task.md)\\>\n\nSearch tasks by name and content, most relevant first, auto-paginated.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `query` | `string` |\n| `opts?` | [`SearchOpts`](../../../search/interfaces/SearchOpts.md) |\n\n#### Returns\n\n`AsyncGenerator`\\<[`Task`](../../task/classes/Task.md)\\>\n\n\n<!-- src/entities/tasks/task/classes/Task.md -->\n# Class: Task\n\nA Macro task: a document with sub-type `task`. Inherits the full document\nsurface ([Document.rename](../../../documents/document/classes/Document.md#rename), move, delete, restore, content, events)\nand adds task-specific state.\n\n## Extends\n\n- [`Document`](../../../documents/document/classes/Document.md)\n\n## Properties\n\n| Property | Modifier | Type | Default value | Description | Overrides | Inherited from |\n| ------ | ------ | ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-access\"></a> `access` | `readonly` | [`EntityAccess`](../../../sharing/access/classes/EntityAccess.md) | `...` | Access requests and direct user grants. | - | [`Document`](../../../documents/document/classes/Document.md).[`access`](../../../documents/document/classes/Document.md#property-access) |\n| <a id=\"property-branchedfrom\"></a> `branchedFrom` | `readonly` | () => `Promise`\\<[`Document`](../../../documents/document/classes/Document.md) \\| `undefined`\\> | `...` | The document this one was branched from, if any. | - | [`Document`](../../../documents/document/classes/Document.md).[`branchedFrom`](../../../documents/document/classes/Document.md#property-branchedfrom) |\n| <a id=\"property-createdat\"></a> `createdAt` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | `...` | When the document was created. | - | [`Document`](../../../documents/document/classes/Document.md).[`createdAt`](../../../documents/document/classes/Document.md#property-createdat) |\n| <a id=\"property-deletedat\"></a> `deletedAt` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | `...` | When the document was deleted, if it has been. | - | [`Document`](../../../documents/document/classes/Document.md).[`deletedAt`](../../../documents/document/classes/Document.md#property-deletedat) |\n| <a id=\"property-entitytype\"></a> `entityType` | `readonly` | `\"document\"` | `'document'` | Favorites identify documents as `document`. | - | [`Document`](../../../documents/document/classes/Document.md).[`entityType`](../../../documents/document/classes/Document.md#property-entitytype) |\n| <a id=\"property-filetype\"></a> `fileType` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | `...` | The document's file type (e.g. `md`, `pdf`, `docx`). | - | [`Document`](../../../documents/document/classes/Document.md).[`fileType`](../../../documents/document/classes/Document.md#property-filetype) |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | `undefined` | - | - | [`Document`](../../../documents/document/classes/Document.md).[`id`](../../../documents/document/classes/Document.md#property-id) |\n| <a id=\"property-name\"></a> `name` | `readonly` | () => `Promise`\\<`string`\\> | `...` | The document's display name. | - | [`Document`](../../../documents/document/classes/Document.md).[`name`](../../../documents/document/classes/Document.md#property-name) |\n| <a id=\"property-owner\"></a> `owner` | `readonly` | () => `Promise`\\<[`User`](../../../users/user/classes/User.md)\\> | `...` | The user who owns the document. | - | [`Document`](../../../documents/document/classes/Document.md).[`owner`](../../../documents/document/classes/Document.md#property-owner) |\n| <a id=\"property-project\"></a> `project` | `readonly` | () => `Promise`\\<[`Project`](../../../projects/project/classes/Project.md) \\| `undefined`\\> | `...` | The project this document belongs to, if any. | - | [`Document`](../../../documents/document/classes/Document.md).[`project`](../../../documents/document/classes/Document.md#property-project) |\n| <a id=\"property-updatedat\"></a> `updatedAt` | `readonly` | () => `Promise`\\<`string` \\| `undefined`\\> | `...` | When the document was last updated. | - | [`Document`](../../../documents/document/classes/Document.md).[`updatedAt`](../../../documents/document/classes/Document.md#property-updatedat) |\n| <a id=\"property-search\"></a> `search` | `static` | (`client`, `query`, `searchOpts?`) => `AsyncGenerator`\\<`Task`\\> | `...` | Search tasks by name and content, most relevant first, auto-paginated. | [`Document`](../../../documents/document/classes/Document.md).[`search`](../../../documents/document/classes/Document.md#property-search) | - |\n\n## Methods\n\n### anchors()\n\n> **anchors**(): `Promise`\\<[`DocumentAnchor`](../../../documents/anchor/classes/DocumentAnchor.md)[]\\>\n\nPDF annotations in this document.\n\n#### Returns\n\n`Promise`\\<[`DocumentAnchor`](../../../documents/anchor/classes/DocumentAnchor.md)[]\\>\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`anchors`](../../../documents/document/classes/Document.md#anchors)\n\n***\n\n### branchName()\n\n> **branchName**(): `Promise`\\<`string`\\>\n\nThe git branch name derived for the document (task documents).\n\n#### Returns\n\n`Promise`\\<`string`\\>\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`branchName`](../../../documents/document/classes/Document.md#branchname)\n\n***\n\n### comment()\n\n> **comment**(`body`, `opts?`): `Promise`\\<[`Comment`](../../../documents/comment/classes/Comment.md)\\>\n\nAdd a comment. Starts a new unanchored thread, or replies to an existing\none when `threadId` (the thread's root comment id) is given.\n\n#### Parameters\n\n| Parameter | Type | Description |\n| ------ | ------ | ------ |\n| `body` | `string` \\| [`RichMessage`](../../../../mentions/interfaces/RichMessage.md) | Plain text, or a rich body composed with msg. |\n| `opts?` | \\{ `threadId?`: `string`; \\} | - |\n| `opts.threadId?` | `string` | - |\n\n#### Returns\n\n`Promise`\\<[`Comment`](../../../documents/comment/classes/Comment.md)\\>\n\nThe created comment.\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`comment`](../../../documents/document/classes/Document.md#comment)\n\n***\n\n### comments()\n\n> **comments**(): `Promise`\\<[`CommentThread`](../../../documents/document/interfaces/CommentThread.md)[]\\>\n\nThe document's live comment threads, each with its comments, newest thread first.\n\n#### Returns\n\n`Promise`\\<[`CommentThread`](../../../documents/document/interfaces/CommentThread.md)[]\\>\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`comments`](../../../documents/document/classes/Document.md#comments)\n\n***\n\n### completed()\n\n> **completed**(): `Promise`\\<`boolean` \\| `undefined`\\>\n\nWhether the task is completed (its Status property is \"Completed\");\n`undefined` if the document is not a task.\n\n#### Returns\n\n`Promise`\\<`boolean` \\| `undefined`\\>\n\n***\n\n### content()\n\n> **content**(): `Promise`\\<`string`\\>\n\nCurrent Markdown for native documents, extracted text for PDF/Word,\nor raw file content for other formats. Native reads include live edits.\n\n#### Returns\n\n`Promise`\\<`string`\\>\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`content`](../../../documents/document/classes/Document.md#content)\n\n***\n\n### copy()\n\n> **copy**(`opts`): `Promise`\\<[`Document`](../../../documents/document/classes/Document.md)\\>\n\nCopy the document under a new name, optionally from a specific version.\nReturns a handle to the new document.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts` | \\{ `name`: `string`; `versionId?`: `number`; \\} |\n| `opts.name` | `string` |\n| `opts.versionId?` | `number` |\n\n#### Returns\n\n`Promise`\\<[`Document`](../../../documents/document/classes/Document.md)\\>\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`copy`](../../../documents/document/classes/Document.md#copy)\n\n***\n\n### createHighlight()\n\n> **createHighlight**(`options`): `Promise`\\<[`DocumentAnchor`](../../../documents/anchor/classes/DocumentAnchor.md)\\>\n\nCreate a standalone PDF highlight.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | `Omit`\\<[`PdfHighlightAnchorRequest`](../../../../../generated/storage/types.gen/type-aliases/PdfHighlightAnchorRequest.md), `\"uuid\"`\\> |\n\n#### Returns\n\n`Promise`\\<[`DocumentAnchor`](../../../documents/anchor/classes/DocumentAnchor.md)\\>\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`createHighlight`](../../../documents/document/classes/Document.md#createhighlight)\n\n***\n\n### delete()\n\n> **delete**(`opts?`): `Promise`\\<`void`\\>\n\nDelete the document. Soft by default (reversible with [restore](../../../documents/document/classes/Document.md#restore));\npass `permanent: true` to delete irreversibly.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts?` | \\{ `permanent?`: `boolean`; \\} |\n| `opts.permanent?` | `boolean` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`delete`](../../../documents/document/classes/Document.md#delete)\n\n***\n\n### deleteProperty()\n\n> **deleteProperty**(`assignment`): `Promise`\\<`void`\\>\n\nRemove a property from this entity, given its [properties](#properties) entry.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `assignment` | [`EntityPropertyWithDefinition`](../../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`deleteProperty`](../../../documents/document/classes/Document.md#deleteproperty)\n\n***\n\n### favorite()\n\n> **favorite**(): `Promise`\\<`Task`\\>\n\nAdd this entity to the user's favorites. Returns this handle for chaining.\nPlain unwrap: favoriting alters the user's favorites collection, not this\nentity's own detail, so there's nothing cached to invalidate.\n\n#### Returns\n\n`Promise`\\<`Task`\\>\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`favorite`](../../../documents/document/classes/Document.md#favorite)\n\n***\n\n### githubPullRequests()\n\n> **githubPullRequests**(): `Promise`\\<[`GithubPullRequest`](../../../../../generated/storage/types.gen/type-aliases/GithubPullRequest.md)[]\\>\n\nGitHub pull requests associated with the document.\n\n#### Returns\n\n`Promise`\\<[`GithubPullRequest`](../../../../../generated/storage/types.gen/type-aliases/GithubPullRequest.md)[]\\>\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`githubPullRequests`](../../../documents/document/classes/Document.md#githubpullrequests)\n\n***\n\n### messageThreadById()\n\n> **messageThreadById**(`id`): [`MessageThread`](../../../messages/thread/classes/MessageThread.md)\n\nA shared message thread scoped to this resource.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`MessageThread`](../../../messages/thread/classes/MessageThread.md)\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`messageThreadById`](../../../documents/document/classes/Document.md#messagethreadbyid)\n\n***\n\n### move()\n\n> **move**(`project`): `Promise`\\<`void`\\>\n\nMove the document into a project (or out of one, with `null`).\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `project` | [`Project`](../../../projects/project/classes/Project.md) \\| `null` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`move`](../../../documents/document/classes/Document.md#move)\n\n***\n\n### permission()\n\n> **permission**(): `Promise`\\<\\{ `permission`: [`EntityPermission`](../../../../../generated/storage/types.gen/type-aliases/EntityPermission.md); `status`: `\"access\"`; \\} \\| \\{ `status`: `\"no_access\"`; \\}\\>\n\nRead the caller's effective permission on this entity.\n\n#### Returns\n\n`Promise`\\<\\{ `permission`: [`EntityPermission`](../../../../../generated/storage/types.gen/type-aliases/EntityPermission.md); `status`: `\"access\"`; \\} \\| \\{ `status`: `\"no_access\"`; \\}\\>\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`permission`](../../../documents/document/classes/Document.md#permission)\n\n***\n\n### permissionsToken()\n\n> **permissionsToken**(): `Promise`\\<`string`\\>\n\nMint a scoped permissions token.\n\n#### Returns\n\n`Promise`\\<`string`\\>\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`permissionsToken`](../../../documents/document/classes/Document.md#permissionstoken)\n\n***\n\n### prepareSave()\n\n> **prepareSave**(`parts`): `Promise`\\<[`PreSaveDocumentResponseData`](../../../../../generated/storage/types.gen/type-aliases/PreSaveDocumentResponseData.md)\\>\n\nPrepare multipart content saving and return the service's upload instructions.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `parts` | [`SaveBomPart`](../../../../../generated/storage/types.gen/type-aliases/SaveBomPart.md)[] |\n\n#### Returns\n\n`Promise`\\<[`PreSaveDocumentResponseData`](../../../../../generated/storage/types.gen/type-aliases/PreSaveDocumentResponseData.md)\\>\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`prepareSave`](../../../documents/document/classes/Document.md#preparesave)\n\n***\n\n### properties()\n\n> **properties**(`opts?`): `Promise`\\<[`EntityPropertyWithDefinition`](../../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md)[]\\>\n\nThe properties set on this entity, each with its definition, value, and options.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts?` | \\{ `includeMetadata?`: `boolean`; \\} |\n| `opts.includeMetadata?` | `boolean` |\n\n#### Returns\n\n`Promise`\\<[`EntityPropertyWithDefinition`](../../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md)[]\\>\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`properties`](../../../documents/document/classes/Document.md#properties)\n\n***\n\n### propertyReference()\n\n> **propertyReference**(): [`PropertyTargetReference`](../../../../../generated/properties/types.gen/type-aliases/PropertyTargetReference.md)\n\nThis entity's reference for bulk property operations.\n\n#### Returns\n\n[`PropertyTargetReference`](../../../../../generated/properties/types.gen/type-aliases/PropertyTargetReference.md)\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`propertyReference`](../../../documents/document/classes/Document.md#propertyreference)\n\n***\n\n### rename()\n\n> **rename**(`name`): `Promise`\\<`void`\\>\n\nRename the document.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `name` | `string` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`rename`](../../../documents/document/classes/Document.md#rename)\n\n***\n\n### restore()\n\n> **restore**(): `Promise`\\<`void`\\>\n\nRestore a soft-deleted document.\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`restore`](../../../documents/document/classes/Document.md#restore)\n\n***\n\n### save()\n\n> **save**(`options`): `Promise`\\<[`SaveDocumentResponseData`](../../../../../generated/storage/types.gen/type-aliases/SaveDocumentResponseData.md)\\>\n\nCommit uploaded content. Does not retry uncertain writes.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | [`SaveDocumentRequest`](../../../../../generated/storage/types.gen/type-aliases/SaveDocumentRequest.md) |\n\n#### Returns\n\n`Promise`\\<[`SaveDocumentResponseData`](../../../../../generated/storage/types.gen/type-aliases/SaveDocumentResponseData.md)\\>\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`save`](../../../documents/document/classes/Document.md#save)\n\n***\n\n### setProperty()\n\n> **setProperty**(`property`, `value?`): `Promise`\\<`void`\\>\n\nSet a property value on this entity, or attach the property without a\nvalue when `value` is omitted.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `property` | [`PropertyDefinition`](../../../properties/property-definition/classes/PropertyDefinition.md) |\n| `value?` | [`SetPropertyValue`](../../../../../generated/properties/types.gen/type-aliases/SetPropertyValue.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`setProperty`](../../../documents/document/classes/Document.md#setproperty)\n\n***\n\n### setTeamShare()\n\n> **setTeamShare**(`shared`): `Promise`\\<`void`\\>\n\nShare the document with the owner's team, or unshare it.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `shared` | `boolean` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`setTeamShare`](../../../documents/document/classes/Document.md#setteamshare)\n\n***\n\n### sharePermissions()\n\n> **sharePermissions**(): `Promise`\\<[`SharePermissionV2`](../../../../../generated/storage/types.gen/type-aliases/SharePermissionV2.md)\\>\n\nSharing configuration.\n\n#### Returns\n\n`Promise`\\<[`SharePermissionV2`](../../../../../generated/storage/types.gen/type-aliases/SharePermissionV2.md)\\>\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`sharePermissions`](../../../documents/document/classes/Document.md#sharepermissions)\n\n***\n\n### shortId()\n\n> **shortId**(): `Promise`\\<`string`\\>\n\nThe document's short id (used in compact links and branch names).\n\n#### Returns\n\n`Promise`\\<`string`\\>\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`shortId`](../../../documents/document/classes/Document.md#shortid)\n\n***\n\n### simpleSave()\n\n> **simpleSave**(): `Promise`\\<[`SaveDocumentResponseData`](../../../../../generated/storage/types.gen/type-aliases/SaveDocumentResponseData.md)\\>\n\nCommit a simple document save.\n\n#### Returns\n\n`Promise`\\<[`SaveDocumentResponseData`](../../../../../generated/storage/types.gen/type-aliases/SaveDocumentResponseData.md)\\>\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`simpleSave`](../../../documents/document/classes/Document.md#simplesave)\n\n***\n\n### teamShare()\n\n> **teamShare**(): `Promise`\\<[`DocumentTeamShareResponse`](../../../../../generated/storage/types.gen/type-aliases/DocumentTeamShareResponse.md)\\>\n\nWhether the document is shared with the owner's team, and which team.\n\n#### Returns\n\n`Promise`\\<[`DocumentTeamShareResponse`](../../../../../generated/storage/types.gen/type-aliases/DocumentTeamShareResponse.md)\\>\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`teamShare`](../../../documents/document/classes/Document.md#teamshare)\n\n***\n\n### timelinePage()\n\n> **timelinePage**(`selection?`): `Promise`\\<\\{ `entries`: (\\{ `activity`: \\{ `action`: `string`; `actor`: [`User`](../../../users/user/classes/User.md); `actor_id`: `string`; `id`: `string`; `occurred_at`: `string`; `payload?`: `unknown`; \\}; `message?`: `undefined`; `type`: `\"activity\"`; \\} \\| \\{ `activity?`: `undefined`; `message`: [`Comment`](../../../documents/comment/classes/Comment.md); `type`: `\"message\"`; \\})[]; `nextCursor`: [`MessageCursor`](../../../../../generated/storage/types.gen/type-aliases/MessageCursor.md) \\| `undefined`; `previousCursor`: [`MessageCursor`](../../../../../generated/storage/types.gen/type-aliases/MessageCursor.md) \\| `undefined`; \\}\\>\n\nA mixed message and activity timeline page.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `selection?` | [`TimelineOptions`](../../../messages/thread/interfaces/TimelineOptions.md)\\<[`Comment`](../../../documents/comment/classes/Comment.md)\\> |\n\n#### Returns\n\n`Promise`\\<\\{ `entries`: (\\{ `activity`: \\{ `action`: `string`; `actor`: [`User`](../../../users/user/classes/User.md); `actor_id`: `string`; `id`: `string`; `occurred_at`: `string`; `payload?`: `unknown`; \\}; `message?`: `undefined`; `type`: `\"activity\"`; \\} \\| \\{ `activity?`: `undefined`; `message`: [`Comment`](../../../documents/comment/classes/Comment.md); `type`: `\"message\"`; \\})[]; `nextCursor`: [`MessageCursor`](../../../../../generated/storage/types.gen/type-aliases/MessageCursor.md) \\| `undefined`; `previousCursor`: [`MessageCursor`](../../../../../generated/storage/types.gen/type-aliases/MessageCursor.md) \\| `undefined`; \\}\\>\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`timelinePage`](../../../documents/document/classes/Document.md#timelinepage)\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`DocumentMetadataWithContent`](../../../../../generated/storage/types.gen/type-aliases/DocumentMetadataWithContent.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`DocumentMetadataWithContent`](../../../../../generated/storage/types.gen/type-aliases/DocumentMetadataWithContent.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`DocumentMetadataWithContent`](../../../../../generated/storage/types.gen/type-aliases/DocumentMetadataWithContent.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`toJSON`](../../../documents/document/classes/Document.md#tojson)\n\n***\n\n### toMention()\n\n> **toMention**(): [`MentionPart`](../../../../mentions/interfaces/MentionPart.md)\n\n#### Returns\n\n[`MentionPart`](../../../../mentions/interfaces/MentionPart.md)\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`toMention`](../../../documents/document/classes/Document.md#tomention)\n\n***\n\n### unfavorite()\n\n> **unfavorite**(): `Promise`\\<`Task`\\>\n\nRemove this entity from the user's favorites. Returns this handle for chaining.\n\n#### Returns\n\n`Promise`\\<`Task`\\>\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`unfavorite`](../../../documents/document/classes/Document.md#unfavorite)\n\n***\n\n### updatePropertyOptions()\n\n> **updatePropertyOptions**(`changes`): `Promise`\\<[`BulkUpdateEntityPropertyOptionsResponse`](../../../../../generated/properties/types.gen/type-aliases/BulkUpdateEntityPropertyOptionsResponse.md)\\>\n\nApply multi-select option deltas atomically across this entity's properties.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `changes` | [`PropertyOptionDelta`](../../../entity/interfaces/PropertyOptionDelta.md)[] |\n\n#### Returns\n\n`Promise`\\<[`BulkUpdateEntityPropertyOptionsResponse`](../../../../../generated/properties/types.gen/type-aliases/BulkUpdateEntityPropertyOptionsResponse.md)\\>\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`updatePropertyOptions`](../../../documents/document/classes/Document.md#updatepropertyoptions)\n\n***\n\n### version()\n\n> **version**(`version`): [`DocumentVersion`](../../../documents/version/classes/DocumentVersion.md)\n\nA handle to an immutable version.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `version` | `number` |\n\n#### Returns\n\n[`DocumentVersion`](../../../documents/version/classes/DocumentVersion.md)\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`version`](../../../documents/document/classes/Document.md#version)\n\n***\n\n### webUrl()\n\n> **webUrl**(): `string`\n\nThe task's URL in the Macro web app.\n\n#### Returns\n\n`string`\n\n#### Overrides\n\n[`Document`](../../../documents/document/classes/Document.md).[`webUrl`](../../../documents/document/classes/Document.md#weburl)\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `id`): `Task`\n\nA handle to a task by document id. Details load on first access.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `id` | `string` |\n\n#### Returns\n\n`Task`\n\n#### Overrides\n\n[`Document`](../../../documents/document/classes/Document.md).[`byId`](../../../documents/document/classes/Document.md#byid)\n\n***\n\n### create()\n\n> `static` **create**(`client`, `opts`): `Promise`\\<`Task`\\>\n\nCreate a task. `team` scopes the team task number and may be omitted\nwhen the creator belongs to exactly one team; `shareWithTeam` defaults\nto true.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `opts` | \\{ `markdown?`: `string`; `name`: `string`; `project?`: [`Project`](../../../projects/project/classes/Project.md); `shareWithTeam?`: `boolean`; `team?`: [`Team`](../../../teams/team/classes/Team.md); \\} |\n| `opts.markdown?` | `string` |\n| `opts.name` | `string` |\n| `opts.project?` | [`Project`](../../../projects/project/classes/Project.md) |\n| `opts.shareWithTeam?` | `boolean` |\n| `opts.team?` | [`Team`](../../../teams/team/classes/Team.md) |\n\n#### Returns\n\n`Promise`\\<`Task`\\>\n\n#### Overrides\n\n[`Document`](../../../documents/document/classes/Document.md).[`create`](../../../documents/document/classes/Document.md#create)\n\n***\n\n### createSkill()\n\n> `static` **createSkill**(`client`, `opts`): `Promise`\\<[`Document`](../../../documents/document/classes/Document.md)\\>\n\nCreate a skill: a markdown document containing instructions that AI reads\nand follows when the skill is referenced in an AI input.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `opts` | \\{ `markdown?`: `string`; `name`: `string`; `project?`: [`Project`](../../../projects/project/classes/Project.md); \\} |\n| `opts.markdown?` | `string` |\n| `opts.name` | `string` |\n| `opts.project?` | [`Project`](../../../projects/project/classes/Project.md) |\n\n#### Returns\n\n`Promise`\\<[`Document`](../../../documents/document/classes/Document.md)\\>\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`createSkill`](../../../documents/document/classes/Document.md#createskill)\n\n***\n\n### createSnippet()\n\n> `static` **createSnippet**(`client`, `opts`): `Promise`\\<[`Document`](../../../documents/document/classes/Document.md)\\>\n\nCreate a snippet: a reusable markdown document that can be inserted into\nany markdown area.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `opts` | \\{ `markdown?`: `string`; `name`: `string`; `project?`: [`Project`](../../../projects/project/classes/Project.md); \\} |\n| `opts.markdown?` | `string` |\n| `opts.name` | `string` |\n| `opts.project?` | [`Project`](../../../projects/project/classes/Project.md) |\n\n#### Returns\n\n`Promise`\\<[`Document`](../../../documents/document/classes/Document.md)\\>\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`createSnippet`](../../../documents/document/classes/Document.md#createsnippet)\n\n***\n\n### forPullRequest()\n\n> `static` **forPullRequest**(`client`, `url`): `Promise`\\<`Task`[]\\>\n\nThe tasks the GitHub pull request at `url` references (as `MACRO-<id>` in\nits text, branch, or comments), oldest link first. Empty when the caller\ncannot see the pull request; tasks the caller cannot open still appear.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `url` | `string` |\n\n#### Returns\n\n`Promise`\\<`Task`[]\\>\n\n***\n\n### recent()\n\n> `static` **recent**(`client`, `opts?`): `AsyncGenerator`\\<[`Document`](../../../documents/document/classes/Document.md)\\>\n\nThe user's recent documents, most recent first, auto-paginated.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `opts?` | \\{ `fileType?`: `string`; `pageSize?`: `number`; \\} |\n| `opts.fileType?` | `string` |\n| `opts.pageSize?` | `number` |\n\n#### Returns\n\n`AsyncGenerator`\\<[`Document`](../../../documents/document/classes/Document.md)\\>\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`recent`](../../../documents/document/classes/Document.md#recent)\n\n***\n\n### recentlyDeleted()\n\n> `static` **recentlyDeleted**(`client`): `Promise`\\<[`Document`](../../../documents/document/classes/Document.md)[]\\>\n\nThe user's recently soft-deleted documents. The underlying endpoint also\nreturns deleted chats and projects; those are filtered out here.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`Promise`\\<[`Document`](../../../documents/document/classes/Document.md)[]\\>\n\n#### Inherited from\n\n[`Document`](../../../documents/document/classes/Document.md).[`recentlyDeleted`](../../../documents/document/classes/Document.md#recentlydeleted)\n"},{"name": "teams",@@ -123,7 +171,7 @@"name": "users","description": "Look up users and their profiles.","overview": "<!-- src/entities/users/namespace/classes/UserNamespace.md -->\n# Class: UserNamespace\n\n## Constructors\n\n### Constructor\n\n> **new UserNamespace**(`client`): `UserNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`UserNamespace`\n\n## Methods\n\n### byId()\n\n> **byId**(`id`): [`User`](../../user/classes/User.md)\n\nA handle to a user by id.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`User`](../../user/classes/User.md)\n\n***\n\n### me()\n\n> **me**(): `Promise`\\<[`User`](../../user/classes/User.md)\\>\n\nThe current authenticated user.\n\n#### Returns\n\n`Promise`\\<[`User`](../../user/classes/User.md)\\>\n",- "documentation": "# Macro SDK: users\n\nGenerated by TypeDoc. Paths below refer to the canonical Markdown hierarchy. Other entity handles are documented in their named section; request core for shared SDK helpers.\n\n<!-- generated/auth/types.gen/type-aliases/UserName.md -->\n# Type Alias: UserName\n\n> **UserName** = \\{ `first_name?`: `string` \\| `null`; `id`: `string`; `last_name?`: `string` \\| `null`; \\}\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-first_name\"></a> `first_name?` | `string` \\| `null` |\n| <a id=\"property-id\"></a> `id` | `string` |\n| <a id=\"property-last_name\"></a> `last_name?` | `string` \\| `null` |\n\n\n<!-- generated/properties/types.gen/type-aliases/BulkUpdateEntityPropertyOptionsResponse.md -->\n# Type Alias: BulkUpdateEntityPropertyOptionsResponse\n\n> **BulkUpdateEntityPropertyOptionsResponse** = \\{ `properties`: [`EntityPropertyOptionSelectionResponse`](EntityPropertyOptionSelectionResponse.md)[]; \\}\n\nResponse for a bulk option update: each property's reconciled final ids.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-properties\"></a> `properties` | [`EntityPropertyOptionSelectionResponse`](EntityPropertyOptionSelectionResponse.md)[] | The final option ids per updated property. |\n\n\n<!-- generated/properties/types.gen/type-aliases/DataType.md -->\n# Type Alias: DataType\n\n> **DataType** = `\"BOOLEAN\"` \\| `\"DATE\"` \\| `\"NUMBER\"` \\| `\"STRING\"` \\| `\"SELECT_NUMBER\"` \\| `\"SELECT_STRING\"` \\| `\"TAG\"` \\| `\"ENTITY\"` \\| `\"LINK\"`\n\nData type for property values, determining storage and validation.\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityProperty.md -->\n# Type Alias: EntityProperty\n\n> **EntityProperty** = \\{ `created_at`: `string`; `entity_id`: `string`; `entity_type`: [`EntityType`](EntityType.md); `id`: `string`; `property_definition_id`: `string`; `updated_at`: `string`; \\}\n\nAssignment of a property definition to a specific entity (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-created_at\"></a> `created_at` | `string` |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` |\n| <a id=\"property-entity_type\"></a> `entity_type` | [`EntityType`](EntityType.md) |\n| <a id=\"property-id\"></a> `id` | `string` |\n| <a id=\"property-property_definition_id\"></a> `property_definition_id` | `string` |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityPropertyOptionSelectionResponse.md -->\n# Type Alias: EntityPropertyOptionSelectionResponse\n\n> **EntityPropertyOptionSelectionResponse** = \\{ `option_ids`: `string`[]; `property_id`: `string`; \\}\n\nThe reconciled final option ids stored for one property after a bulk update.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-option_ids\"></a> `option_ids` | `string`[] | The final option ids the server persisted, in stored order. |\n| <a id=\"property-property_id\"></a> `property_id` | `string` | The property definition the options belong to. |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md -->\n# Type Alias: EntityPropertyWithDefinition\n\n> **EntityPropertyWithDefinition** = \\{ `definition`: [`PropertyDefinition`](PropertyDefinition.md); `options?`: [`PropertyOption`](PropertyOption.md)[] \\| `null`; `property`: [`EntityProperty`](EntityProperty.md); `value?`: `null` \\| [`PropertyValue`](PropertyValue.md); \\}\n\nEntity property with its definition, value, and options (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-definition\"></a> `definition` | [`PropertyDefinition`](PropertyDefinition.md) |\n| <a id=\"property-options\"></a> `options?` | [`PropertyOption`](PropertyOption.md)[] \\| `null` |\n| <a id=\"property-property\"></a> `property` | [`EntityProperty`](EntityProperty.md) |\n| <a id=\"property-value\"></a> `value?` | `null` \\| [`PropertyValue`](PropertyValue.md) |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityReference.md -->\n# Type Alias: EntityReference\n\n> **EntityReference** = \\{ `entity_id`: `string`; `entity_type`: [`EntityType`](EntityType.md); `specific_message_id?`: `string` \\| `null`; \\}\n\nEntity reference for entity-type property values.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | - |\n| <a id=\"property-entity_type\"></a> `entity_type` | [`EntityType`](EntityType.md) | - |\n| <a id=\"property-specific_message_id\"></a> `specific_message_id?` | `string` \\| `null` | For CHANNEL, CHAT, THREAD entity types - optional specific message ID. This allows referencing a specific message within a thread/channel/chat. |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityType.md -->\n# Type Alias: EntityType\n\n> **EntityType** = `\"CALENDAR_EVENT\"` \\| `\"CALL_RECORD\"` \\| `\"CHANNEL\"` \\| `\"CHAT\"` \\| `\"COMPANY\"` \\| `\"DATABASE_ROW\"` \\| `\"CONTACT\"` \\| `\"DOCUMENT\"` \\| `\"INITIATIVE\"` \\| `\"PROJECT\"` \\| `\"TASK\"` \\| `\"THREAD\"` \\| `\"USER\"`\n\nType of entity that can be referenced by entity properties.\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyDefinition.md -->\n# Type Alias: PropertyDefinition\n\n> **PropertyDefinition** = \\{ `created_at`: `string`; `data_type`: [`DataType`](DataType.md); `display_name`: `string`; `id`: `string`; `is_metadata`: `boolean`; `is_multi_select`: `boolean`; `is_system`: `boolean`; `owner`: [`PropertyOwner`](PropertyOwner.md); `specific_entity_type`: `null` \\| [`EntityType`](EntityType.md); `updated_at`: `string`; \\}\n\nProperty definition model (service representation).\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | - |\n| <a id=\"property-data_type\"></a> `data_type` | [`DataType`](DataType.md) | - |\n| <a id=\"property-display_name\"></a> `display_name` | `string` | - |\n| <a id=\"property-id\"></a> `id` | `string` | - |\n| <a id=\"property-is_metadata\"></a> `is_metadata` | `boolean` | Flag to indicate if this is a system-generated metadata property. Not stored in database - computed at service layer. |\n| <a id=\"property-is_multi_select\"></a> `is_multi_select` | `boolean` | - |\n| <a id=\"property-is_system\"></a> `is_system` | `boolean` | Flag to indicate if this is a system property (stored in DB). |\n| <a id=\"property-owner\"></a> `owner` | [`PropertyOwner`](PropertyOwner.md) | - |\n| <a id=\"property-specific_entity_type\"></a> `specific_entity_type` | `null` \\| [`EntityType`](EntityType.md) | - |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` | - |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyOption.md -->\n# Type Alias: PropertyOption\n\n> **PropertyOption** = \\{ `color`: `string` \\| `null`; `created_at`: `string`; `display_order`: `number`; `id`: `string`; `property_definition_id`: `string`; `updated_at`: `string`; `value`: [`PropertyOptionValue`](PropertyOptionValue.md); \\}\n\nA selectable option for select-type properties (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-color\"></a> `color` | `string` \\| `null` |\n| <a id=\"property-created_at\"></a> `created_at` | `string` |\n| <a id=\"property-display_order\"></a> `display_order` | `number` |\n| <a id=\"property-id\"></a> `id` | `string` |\n| <a id=\"property-property_definition_id\"></a> `property_definition_id` | `string` |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` |\n| <a id=\"property-value\"></a> `value` | [`PropertyOptionValue`](PropertyOptionValue.md) |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyOptionValue.md -->\n# Type Alias: PropertyOptionValue\n\n> **PropertyOptionValue** = \\{ `type`: `\"string\"`; `value`: `string`; \\} \\| \\{ `type`: `\"number\"`; `value`: `number`; \\}\n\nThe value of a property option - either a string or a number.\n\n## Union Members\n\n### Type Literal\n\n\\{ `type`: `\"string\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"string\"` | - |\n| `value` | `string` | String value for SelectString properties |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"number\"`; `value`: `number`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"number\"` | - |\n| `value` | `number` | Number value for SelectNumber properties |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyOwner.md -->\n# Type Alias: PropertyOwner\n\n> **PropertyOwner** = \\{ `scope`: `\"user\"`; `user_id`: `string`; \\} \\| \\{ `scope`: `\"team\"`; `team_id`: `string`; \\} \\| \\{ `database_id`: `string`; `scope`: `\"database\"`; \\} \\| \\{ `scope`: `\"system\"`; \\}\n\nDefines who owns a property - user-scoped, team-scoped, database-scoped, or system.\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyTargetEntityType.md -->\n# Type Alias: PropertyTargetEntityType\n\n> **PropertyTargetEntityType** = `\"CALL_RECORD\"` \\| `\"CHANNEL\"` \\| `\"CHAT\"` \\| `\"COMPANY\"` \\| `\"DATABASE_ROW\"` \\| `\"DOCUMENT\"` \\| `\"INITIATIVE\"` \\| `\"PROJECT\"` \\| `\"THREAD\"` \\| `\"USER\"`\n\nCanonical type of an entity receiving properties.\n\nTasks are documents at API boundaries. `Task` intentionally does not exist\nhere; task classification is resolved by the properties domain from the\ndocument subtype.\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyTargetReference.md -->\n# Type Alias: PropertyTargetReference\n\n> **PropertyTargetReference** = \\{ `entity_id`: `string`; `entity_type`: [`PropertyTargetEntityType`](PropertyTargetEntityType.md); \\}\n\nCanonical reference to an entity receiving properties.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | Entity identifier. |\n| <a id=\"property-entity_type\"></a> `entity_type` | [`PropertyTargetEntityType`](PropertyTargetEntityType.md) | Canonical entity type. |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyValue.md -->\n# Type Alias: PropertyValue\n\n> **PropertyValue** = \\{ `type`: `\"Boolean\"`; `value`: `boolean`; \\} \\| \\{ `type`: `\"Number\"`; `value`: `number`; \\} \\| \\{ `type`: `\"String\"`; `value`: `string`; \\} \\| \\{ `type`: `\"Date\"`; `value`: `string`; \\} \\| \\{ `type`: `\"SelectOption\"`; `value`: `string`[]; \\} \\| \\{ `type`: `\"EntityReference\"`; `value`: [`EntityReference`](EntityReference.md)[]; \\} \\| \\{ `type`: `\"Link\"`; `value`: `string`[]; \\}\n\nProperty value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to/from JSONB in the database.\n\n## Union Members\n\n### Type Literal\n\n\\{ `type`: `\"Boolean\"`; `value`: `boolean`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Boolean\"` | - |\n| `value` | `boolean` | Boolean value Serializes as: {\"type\": \"Boolean\", \"value\": true} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"Number\"`; `value`: `number`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Number\"` | - |\n| `value` | `number` | Numeric value Serializes as: {\"type\": \"Number\", \"value\": 42.5} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"String\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"String\"` | - |\n| `value` | `string` | String value Serializes as: {\"type\": \"String\", \"value\": \"text\"} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"Date\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Date\"` | - |\n| `value` | `string` | Date/timestamp value Serializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"SelectOption\"`; `value`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"SelectOption\"` | - |\n| `value` | `string`[] | Select option(s) - always an array (check is_multi_select to determine if single or multi) Single-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1) Multi-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+) |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"EntityReference\"`; `value`: [`EntityReference`](EntityReference.md)[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"EntityReference\"` | - |\n| `value` | [`EntityReference`](EntityReference.md)[] | Entity reference(s) - always an array (check is_multi_select to determine if single or multi) Single-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1) Multi-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+) |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"Link\"`; `value`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Link\"` | - |\n| `value` | `string`[] | Link value(s) - always an array (check is_multi_select to determine if single or multi) Single-select: {\"type\": \"Link\", \"value\": [\"https://example.com\"]} (length 0 or 1) Multi-select: {\"type\": \"Link\", \"value\": [\"https://example.com\", \"https://other.com\"]} (length 0+) |\n\n\n<!-- generated/properties/types.gen/type-aliases/SetPropertyValue.md -->\n# Type Alias: SetPropertyValue\n\n> **SetPropertyValue** = \\{ `type`: `\"boolean\"`; `value`: `boolean`; \\} \\| \\{ `type`: `\"date\"`; `value`: `string`; \\} \\| \\{ `type`: `\"number\"`; `value`: `number`; \\} \\| \\{ `type`: `\"string\"`; `value`: `string`; \\} \\| \\{ `option_id`: `string`; `type`: `\"select_option\"`; \\} \\| \\{ `option_ids`: `string`[]; `type`: `\"multi_select_option\"`; \\} \\| \\{ `reference`: [`EntityReference`](EntityReference.md); `type`: `\"entity_reference\"`; \\} \\| \\{ `references`: [`EntityReference`](EntityReference.md)[]; `type`: `\"multi_entity_reference\"`; \\} \\| \\{ `type`: `\"link\"`; `url`: `string`; \\} \\| \\{ `type`: `\"multi_link\"`; `urls`: `string`[]; \\}\n\nType-safe enum for setting entity property values - provides compile-time validation.\n\n\n<!-- src/entities/users/namespace/classes/UserNamespace.md -->\n# Class: UserNamespace\n\n## Constructors\n\n### Constructor\n\n> **new UserNamespace**(`client`): `UserNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`UserNamespace`\n\n## Methods\n\n### byId()\n\n> **byId**(`id`): [`User`](../../user/classes/User.md)\n\nA handle to a user by id.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`User`](../../user/classes/User.md)\n\n***\n\n### me()\n\n> **me**(): `Promise`\\<[`User`](../../user/classes/User.md)\\>\n\nThe current authenticated user.\n\n#### Returns\n\n`Promise`\\<[`User`](../../user/classes/User.md)\\>\n\n\n<!-- src/entities/users/user/classes/User.md -->\n# Class: User\n\nA Macro user. Identity lives in the auth service, so details like the\ndisplay name are fetched on demand. Can be dropped into a msg\ntemplate to @-mention the user.\n\n## Extends\n\n- [`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md)\\<[`UserName`](../../../../../generated/auth/types.gen/type-aliases/UserName.md)\\>\n\n## Implements\n\n- [`Mentionable`](../../../../mentions/interfaces/Mentionable.md)\n\n## Properties\n\n| Property | Modifier | Type | Default value | Description | Overrides | Inherited from |\n| ------ | ------ | ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-entitytype\"></a> `entityType` | `readonly` | `\"user\"` | `'user'` | Favorites identify users as `user`. | [`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`entityType`](../../../entity/classes/PropertiedEntity.md#property-entitytype) | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | `undefined` | - | - | [`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`id`](../../../entity/classes/PropertiedEntity.md#property-id) |\n\n## Methods\n\n### deleteProperty()\n\n> **deleteProperty**(`assignment`): `Promise`\\<`void`\\>\n\nRemove a property from this entity, given its [properties](#properties) entry.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `assignment` | [`EntityPropertyWithDefinition`](../../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`deleteProperty`](../../../entity/classes/PropertiedEntity.md#deleteproperty)\n\n***\n\n### dm()\n\n> **dm**(): `Promise`\\<[`Channel`](../../../channels/channel/classes/Channel.md)\\>\n\nOpen (or create) your direct-message channel with this user.\n\n#### Returns\n\n`Promise`\\<[`Channel`](../../../channels/channel/classes/Channel.md)\\>\n\nThe DM `Channel`.\n\n***\n\n### email()\n\n> **email**(): `string` \\| `undefined`\n\nThis user's email address. Macro user ids encode it as `macro|<email>`,\nso this reads straight off the id — no auth-service endpoint returns\nemails for arbitrary users.\n\n#### Returns\n\n`string` \\| `undefined`\n\nThe email, or `undefined` if the id is not email-derived.\n\n***\n\n### favorite()\n\n> **favorite**(): `Promise`\\<`User`\\>\n\nAdd this entity to the user's favorites. Returns this handle for chaining.\nPlain unwrap: favoriting alters the user's favorites collection, not this\nentity's own detail, so there's nothing cached to invalidate.\n\n#### Returns\n\n`Promise`\\<`User`\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`favorite`](../../../entity/classes/PropertiedEntity.md#favorite)\n\n***\n\n### name()\n\n> **name**(): `Promise`\\<`string` \\| `undefined`\\>\n\nThis user's display name, fetched from the auth service (falling back to\nyour email contacts when the Macro profile has none).\n\n#### Returns\n\n`Promise`\\<`string` \\| `undefined`\\>\n\nThe full name, or `undefined` if the user has no name on record.\n\n***\n\n### properties()\n\n> **properties**(`opts?`): `Promise`\\<[`EntityPropertyWithDefinition`](../../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md)[]\\>\n\nThe properties set on this entity, each with its definition, value, and options.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts?` | \\{ `includeMetadata?`: `boolean`; \\} |\n| `opts.includeMetadata?` | `boolean` |\n\n#### Returns\n\n`Promise`\\<[`EntityPropertyWithDefinition`](../../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md)[]\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`properties`](../../../entity/classes/PropertiedEntity.md#properties)\n\n***\n\n### propertyReference()\n\n> **propertyReference**(): [`PropertyTargetReference`](../../../../../generated/properties/types.gen/type-aliases/PropertyTargetReference.md)\n\nThis entity's reference for bulk property operations.\n\n#### Returns\n\n[`PropertyTargetReference`](../../../../../generated/properties/types.gen/type-aliases/PropertyTargetReference.md)\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`propertyReference`](../../../entity/classes/PropertiedEntity.md#propertyreference)\n\n***\n\n### setProperty()\n\n> **setProperty**(`property`, `value?`): `Promise`\\<`void`\\>\n\nSet a property value on this entity, or attach the property without a\nvalue when `value` is omitted.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `property` | [`PropertyDefinition`](../../../properties/property-definition/classes/PropertyDefinition.md) |\n| `value?` | [`SetPropertyValue`](../../../../../generated/properties/types.gen/type-aliases/SetPropertyValue.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`setProperty`](../../../entity/classes/PropertiedEntity.md#setproperty)\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`UserName`](../../../../../generated/auth/types.gen/type-aliases/UserName.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`UserName`](../../../../../generated/auth/types.gen/type-aliases/UserName.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`UserName`](../../../../../generated/auth/types.gen/type-aliases/UserName.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`toJSON`](../../../entity/classes/PropertiedEntity.md#tojson)\n\n***\n\n### toMention()\n\n> **toMention**(): [`MentionPart`](../../../../mentions/interfaces/MentionPart.md)\n\n#### Returns\n\n[`MentionPart`](../../../../mentions/interfaces/MentionPart.md)\n\n#### Implementation of\n\n[`Mentionable`](../../../../mentions/interfaces/Mentionable.md).[`toMention`](../../../../mentions/interfaces/Mentionable.md#tomention)\n\n***\n\n### unfavorite()\n\n> **unfavorite**(): `Promise`\\<`User`\\>\n\nRemove this entity from the user's favorites. Returns this handle for chaining.\n\n#### Returns\n\n`Promise`\\<`User`\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`unfavorite`](../../../entity/classes/PropertiedEntity.md#unfavorite)\n\n***\n\n### updatePropertyOptions()\n\n> **updatePropertyOptions**(`changes`): `Promise`\\<[`BulkUpdateEntityPropertyOptionsResponse`](../../../../../generated/properties/types.gen/type-aliases/BulkUpdateEntityPropertyOptionsResponse.md)\\>\n\nApply multi-select option deltas atomically across this entity's properties.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `changes` | [`PropertyOptionDelta`](../../../entity/interfaces/PropertyOptionDelta.md)[] |\n\n#### Returns\n\n`Promise`\\<[`BulkUpdateEntityPropertyOptionsResponse`](../../../../../generated/properties/types.gen/type-aliases/BulkUpdateEntityPropertyOptionsResponse.md)\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`updatePropertyOptions`](../../../entity/classes/PropertiedEntity.md#updatepropertyoptions)\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `id`): `User`\n\nA handle to a user by id.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `id` | `string` |\n\n#### Returns\n\n`User`\n\n***\n\n### me()\n\n> `static` **me**(`client`): `Promise`\\<`User`\\>\n\nA handle to the current authenticated user.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`Promise`\\<`User`\\>\n"+ "documentation": "# Macro SDK: users\n\nGenerated by TypeDoc. Paths below refer to the canonical Markdown hierarchy. Other entity handles are documented in their named section; request core for shared SDK helpers.\n\n<!-- generated/auth/types.gen/type-aliases/UserName.md -->\n# Type Alias: UserName\n\n> **UserName** = \\{ `first_name?`: `string` \\| `null`; `id`: `string`; `last_name?`: `string` \\| `null`; \\}\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-first_name\"></a> `first_name?` | `string` \\| `null` |\n| <a id=\"property-id\"></a> `id` | `string` |\n| <a id=\"property-last_name\"></a> `last_name?` | `string` \\| `null` |\n\n\n<!-- generated/properties/types.gen/type-aliases/BulkUpdateEntityPropertyOptionsResponse.md -->\n# Type Alias: BulkUpdateEntityPropertyOptionsResponse\n\n> **BulkUpdateEntityPropertyOptionsResponse** = \\{ `properties`: [`EntityPropertyOptionSelectionResponse`](EntityPropertyOptionSelectionResponse.md)[]; \\}\n\nResponse for a bulk option update: each property's reconciled final ids.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-properties\"></a> `properties` | [`EntityPropertyOptionSelectionResponse`](EntityPropertyOptionSelectionResponse.md)[] | The final option ids per updated property. |\n\n\n<!-- generated/properties/types.gen/type-aliases/DataType.md -->\n# Type Alias: DataType\n\n> **DataType** = `\"BOOLEAN\"` \\| `\"DATE\"` \\| `\"NUMBER\"` \\| `\"STRING\"` \\| `\"SELECT_NUMBER\"` \\| `\"SELECT_STRING\"` \\| `\"TAG\"` \\| `\"ENTITY\"` \\| `\"LINK\"`\n\nData type for property values, determining storage and validation.\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityProperty.md -->\n# Type Alias: EntityProperty\n\n> **EntityProperty** = \\{ `created_at`: `string`; `entity_id`: `string`; `entity_type`: [`EntityType`](EntityType.md); `id`: `string`; `property_definition_id`: `string`; `updated_at`: `string`; \\}\n\nAssignment of a property definition to a specific entity (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-created_at\"></a> `created_at` | `string` |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` |\n| <a id=\"property-entity_type\"></a> `entity_type` | [`EntityType`](EntityType.md) |\n| <a id=\"property-id\"></a> `id` | `string` |\n| <a id=\"property-property_definition_id\"></a> `property_definition_id` | `string` |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityPropertyOptionSelectionResponse.md -->\n# Type Alias: EntityPropertyOptionSelectionResponse\n\n> **EntityPropertyOptionSelectionResponse** = \\{ `option_ids`: `string`[]; `property_id`: `string`; \\}\n\nThe reconciled final option ids stored for one property after a bulk update.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-option_ids\"></a> `option_ids` | `string`[] | The final option ids the server persisted, in stored order. |\n| <a id=\"property-property_id\"></a> `property_id` | `string` | The property definition the options belong to. |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md -->\n# Type Alias: EntityPropertyWithDefinition\n\n> **EntityPropertyWithDefinition** = \\{ `definition`: [`PropertyDefinition`](PropertyDefinition.md); `options?`: [`PropertyOption`](PropertyOption.md)[] \\| `null`; `property`: [`EntityProperty`](EntityProperty.md); `value?`: `null` \\| [`PropertyValue`](PropertyValue.md); \\}\n\nEntity property with its definition, value, and options (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-definition\"></a> `definition` | [`PropertyDefinition`](PropertyDefinition.md) |\n| <a id=\"property-options\"></a> `options?` | [`PropertyOption`](PropertyOption.md)[] \\| `null` |\n| <a id=\"property-property\"></a> `property` | [`EntityProperty`](EntityProperty.md) |\n| <a id=\"property-value\"></a> `value?` | `null` \\| [`PropertyValue`](PropertyValue.md) |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityReference.md -->\n# Type Alias: EntityReference\n\n> **EntityReference** = \\{ `entity_id`: `string`; `entity_type`: [`EntityType`](EntityType.md); `specific_message_id?`: `string` \\| `null`; \\}\n\nEntity reference for entity-type property values.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | - |\n| <a id=\"property-entity_type\"></a> `entity_type` | [`EntityType`](EntityType.md) | - |\n| <a id=\"property-specific_message_id\"></a> `specific_message_id?` | `string` \\| `null` | For CHANNEL, CHAT, THREAD entity types - optional specific message ID. This allows referencing a specific message within a thread/channel/chat. |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityType.md -->\n# Type Alias: EntityType\n\n> **EntityType** = `\"CALENDAR_EVENT\"` \\| `\"CALL_RECORD\"` \\| `\"CHANNEL\"` \\| `\"CHAT\"` \\| `\"COMPANY\"` \\| `\"DATABASE_ROW\"` \\| `\"CONTACT\"` \\| `\"DOCUMENT\"` \\| `\"INITIATIVE\"` \\| `\"PROJECT\"` \\| `\"TASK\"` \\| `\"THREAD\"` \\| `\"USER\"`\n\nType of entity that can be referenced by entity properties.\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyDefinition.md -->\n# Type Alias: PropertyDefinition\n\n> **PropertyDefinition** = \\{ `created_at`: `string`; `data_type`: [`DataType`](DataType.md); `display_name`: `string`; `id`: `string`; `is_metadata`: `boolean`; `is_multi_select`: `boolean`; `is_system`: `boolean`; `owner`: [`PropertyOwner`](PropertyOwner.md); `specific_entity_type`: `null` \\| [`EntityType`](EntityType.md); `updated_at`: `string`; \\}\n\nProperty definition model (service representation).\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | - |\n| <a id=\"property-data_type\"></a> `data_type` | [`DataType`](DataType.md) | - |\n| <a id=\"property-display_name\"></a> `display_name` | `string` | - |\n| <a id=\"property-id\"></a> `id` | `string` | - |\n| <a id=\"property-is_metadata\"></a> `is_metadata` | `boolean` | Flag to indicate if this is a system-generated metadata property. Not stored in database - computed at service layer. |\n| <a id=\"property-is_multi_select\"></a> `is_multi_select` | `boolean` | - |\n| <a id=\"property-is_system\"></a> `is_system` | `boolean` | Flag to indicate if this is a system property (stored in DB). |\n| <a id=\"property-owner\"></a> `owner` | [`PropertyOwner`](PropertyOwner.md) | - |\n| <a id=\"property-specific_entity_type\"></a> `specific_entity_type` | `null` \\| [`EntityType`](EntityType.md) | - |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` | - |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyOption.md -->\n# Type Alias: PropertyOption\n\n> **PropertyOption** = \\{ `color`: `string` \\| `null`; `created_at`: `string`; `display_order`: `number`; `id`: `string`; `property_definition_id`: `string`; `updated_at`: `string`; `value`: [`PropertyOptionValue`](PropertyOptionValue.md); \\}\n\nA selectable option for select-type properties (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-color\"></a> `color` | `string` \\| `null` |\n| <a id=\"property-created_at\"></a> `created_at` | `string` |\n| <a id=\"property-display_order\"></a> `display_order` | `number` |\n| <a id=\"property-id\"></a> `id` | `string` |\n| <a id=\"property-property_definition_id\"></a> `property_definition_id` | `string` |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` |\n| <a id=\"property-value\"></a> `value` | [`PropertyOptionValue`](PropertyOptionValue.md) |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyOptionValue.md -->\n# Type Alias: PropertyOptionValue\n\n> **PropertyOptionValue** = \\{ `type`: `\"string\"`; `value`: `string`; \\} \\| \\{ `type`: `\"number\"`; `value`: `number`; \\}\n\nThe value of a property option - either a string or a number.\n\n## Union Members\n\n### Type Literal\n\n\\{ `type`: `\"string\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"string\"` | - |\n| `value` | `string` | String value for SelectString properties |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"number\"`; `value`: `number`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"number\"` | - |\n| `value` | `number` | Number value for SelectNumber properties |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyOwner.md -->\n# Type Alias: PropertyOwner\n\n> **PropertyOwner** = \\{ `scope`: `\"user\"`; `user_id`: `string`; \\} \\| \\{ `scope`: `\"team\"`; `team_id`: `string`; \\} \\| \\{ `database_id`: `string`; `scope`: `\"database\"`; \\} \\| \\{ `scope`: `\"system\"`; \\}\n\nDefines who owns a property - user-scoped, team-scoped, database-scoped, or system.\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyTargetEntityType.md -->\n# Type Alias: PropertyTargetEntityType\n\n> **PropertyTargetEntityType** = `\"CALL_RECORD\"` \\| `\"CHANNEL\"` \\| `\"CHAT\"` \\| `\"COMPANY\"` \\| `\"DATABASE_ROW\"` \\| `\"DOCUMENT\"` \\| `\"INITIATIVE\"` \\| `\"PROJECT\"` \\| `\"THREAD\"` \\| `\"USER\"`\n\nCanonical type of an entity receiving properties.\n\nTasks are documents at API boundaries. `Task` intentionally does not exist\nhere; task classification is resolved by the properties domain from the\ndocument subtype.\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyTargetReference.md -->\n# Type Alias: PropertyTargetReference\n\n> **PropertyTargetReference** = \\{ `entity_id`: `string`; `entity_type`: [`PropertyTargetEntityType`](PropertyTargetEntityType.md); \\}\n\nCanonical reference to an entity receiving properties.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | Entity identifier. |\n| <a id=\"property-entity_type\"></a> `entity_type` | [`PropertyTargetEntityType`](PropertyTargetEntityType.md) | Canonical entity type. |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyValue.md -->\n# Type Alias: PropertyValue\n\n> **PropertyValue** = \\{ `type`: `\"Boolean\"`; `value`: `boolean`; \\} \\| \\{ `type`: `\"Number\"`; `value`: `number`; \\} \\| \\{ `type`: `\"String\"`; `value`: `string`; \\} \\| \\{ `type`: `\"Date\"`; `value`: `string`; \\} \\| \\{ `type`: `\"SelectOption\"`; `value`: `string`[]; \\} \\| \\{ `type`: `\"EntityReference\"`; `value`: [`EntityReference`](EntityReference.md)[]; \\} \\| \\{ `type`: `\"Link\"`; `value`: `string`[]; \\}\n\nProperty value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to/from JSONB in the database.\n\n## Union Members\n\n### Type Literal\n\n\\{ `type`: `\"Boolean\"`; `value`: `boolean`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Boolean\"` | - |\n| `value` | `boolean` | Boolean value Serializes as: {\"type\": \"Boolean\", \"value\": true} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"Number\"`; `value`: `number`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Number\"` | - |\n| `value` | `number` | Numeric value Serializes as: {\"type\": \"Number\", \"value\": 42.5} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"String\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"String\"` | - |\n| `value` | `string` | String value Serializes as: {\"type\": \"String\", \"value\": \"text\"} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"Date\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Date\"` | - |\n| `value` | `string` | Date/timestamp value Serializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"SelectOption\"`; `value`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"SelectOption\"` | - |\n| `value` | `string`[] | Select option(s) - always an array (check is_multi_select to determine if single or multi) Single-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1) Multi-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+) |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"EntityReference\"`; `value`: [`EntityReference`](EntityReference.md)[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"EntityReference\"` | - |\n| `value` | [`EntityReference`](EntityReference.md)[] | Entity reference(s) - always an array (check is_multi_select to determine if single or multi) Single-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1) Multi-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+) |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"Link\"`; `value`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Link\"` | - |\n| `value` | `string`[] | Link value(s) - always an array (check is_multi_select to determine if single or multi) Single-select: {\"type\": \"Link\", \"value\": [\"https://example.com\"]} (length 0 or 1) Multi-select: {\"type\": \"Link\", \"value\": [\"https://example.com\", \"https://other.com\"]} (length 0+) |\n\n\n<!-- generated/properties/types.gen/type-aliases/SetPropertyValue.md -->\n# Type Alias: SetPropertyValue\n\n> **SetPropertyValue** = \\{ `type`: `\"boolean\"`; `value`: `boolean`; \\} \\| \\{ `type`: `\"date\"`; `value`: `string`; \\} \\| \\{ `type`: `\"number\"`; `value`: `number`; \\} \\| \\{ `type`: `\"string\"`; `value`: `string`; \\} \\| \\{ `option_id`: `string`; `type`: `\"select_option\"`; \\} \\| \\{ `option_ids`: `string`[]; `type`: `\"multi_select_option\"`; \\} \\| \\{ `reference`: [`EntityReference`](EntityReference.md); `type`: `\"entity_reference\"`; \\} \\| \\{ `references`: [`EntityReference`](EntityReference.md)[]; `type`: `\"multi_entity_reference\"`; \\} \\| \\{ `type`: `\"link\"`; `url`: `string`; \\} \\| \\{ `type`: `\"multi_link\"`; `urls`: `string`[]; \\}\n\nType-safe enum for setting entity property values - provides compile-time validation.\n\n\n<!-- generated/storage/types.gen/type-aliases/AccessLevel.md -->\n# Type Alias: AccessLevel\n\n> **AccessLevel** = `\"view\"` \\| `\"comment\"` \\| `\"edit\"` \\| `\"owner\"`\n\nOrdered from least to most access top -> bottom\n\n\n<!-- generated/storage/types.gen/type-aliases/EntityPermission.md -->\n# Type Alias: EntityPermission\n\n> **EntityPermission** = \\{ `access_level`: [`AccessLevel`](AccessLevel.md); `type`: `\"access_level\"`; \\} \\| \\{ `type`: `\"channel_view_only\"`; \\} \\| \\{ `role`: [`ParticipantRole`](ParticipantRole.md); `type`: `\"channel_role\"`; \\} \\| \\{ `role`: [`TeamRole`](TeamRole.md); `type`: `\"team_role\"`; \\}\n\nA user's permission for an entity, discriminated by entity kind.\n\nItems (documents, chats, projects, threads) use access levels.\nChannels use view-only permission or participant roles.\n\n## Union Members\n\n### Type Literal\n\n\\{ `access_level`: [`AccessLevel`](AccessLevel.md); `type`: `\"access_level\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `access_level` | [`AccessLevel`](AccessLevel.md) | The access level the user has. |\n| `type` | `\"access_level\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"channel_view_only\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `role`: [`ParticipantRole`](ParticipantRole.md); `type`: `\"channel_role\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `role` | [`ParticipantRole`](ParticipantRole.md) | The role the user has in the channel. |\n| `type` | `\"channel_role\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `role`: [`TeamRole`](TeamRole.md); `type`: `\"team_role\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `role` | [`TeamRole`](TeamRole.md) | The role the user has in the team. |\n| `type` | `\"team_role\"` | - |\n\n\n<!-- generated/storage/types.gen/type-aliases/ParticipantRole.md -->\n# Type Alias: ParticipantRole\n\n> **ParticipantRole** = `\"owner\"` \\| `\"admin\"` \\| `\"member\"`\n\nThe role a user has within a channel.\n\n\n<!-- generated/storage/types.gen/type-aliases/TeamRole.md -->\n# Type Alias: TeamRole\n\n> **TeamRole** = `\"member\"` \\| `\"admin\"` \\| `\"owner\"`\n\nThe role a user has within a team.\n\nOrdered least to most privileged so comparisons reflect access strength.\n\n\n<!-- src/entities/users/namespace/classes/UserNamespace.md -->\n# Class: UserNamespace\n\n## Constructors\n\n### Constructor\n\n> **new UserNamespace**(`client`): `UserNamespace`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`UserNamespace`\n\n## Methods\n\n### byId()\n\n> **byId**(`id`): [`User`](../../user/classes/User.md)\n\nA handle to a user by id.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `id` | `string` |\n\n#### Returns\n\n[`User`](../../user/classes/User.md)\n\n***\n\n### me()\n\n> **me**(): `Promise`\\<[`User`](../../user/classes/User.md)\\>\n\nThe current authenticated user.\n\n#### Returns\n\n`Promise`\\<[`User`](../../user/classes/User.md)\\>\n\n\n<!-- src/entities/users/user/classes/User.md -->\n# Class: User\n\nA Macro user. Identity lives in the auth service, so details like the\ndisplay name are fetched on demand. Can be dropped into a msg\ntemplate to @-mention the user.\n\n## Extends\n\n- [`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md)\\<[`UserName`](../../../../../generated/auth/types.gen/type-aliases/UserName.md)\\>\n\n## Implements\n\n- [`Mentionable`](../../../../mentions/interfaces/Mentionable.md)\n\n## Properties\n\n| Property | Modifier | Type | Default value | Description | Overrides | Inherited from |\n| ------ | ------ | ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-entitytype\"></a> `entityType` | `readonly` | `\"user\"` | `'user'` | Favorites identify users as `user`. | [`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`entityType`](../../../entity/classes/PropertiedEntity.md#property-entitytype) | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | `undefined` | - | - | [`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`id`](../../../entity/classes/PropertiedEntity.md#property-id) |\n\n## Methods\n\n### deleteProperty()\n\n> **deleteProperty**(`assignment`): `Promise`\\<`void`\\>\n\nRemove a property from this entity, given its [properties](#properties) entry.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `assignment` | [`EntityPropertyWithDefinition`](../../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`deleteProperty`](../../../entity/classes/PropertiedEntity.md#deleteproperty)\n\n***\n\n### dm()\n\n> **dm**(): `Promise`\\<[`Channel`](../../../channels/channel/classes/Channel.md)\\>\n\nOpen (or create) your direct-message channel with this user.\n\n#### Returns\n\n`Promise`\\<[`Channel`](../../../channels/channel/classes/Channel.md)\\>\n\nThe DM `Channel`.\n\n***\n\n### email()\n\n> **email**(): `string` \\| `undefined`\n\nThis user's email address. Macro user ids encode it as `macro|<email>`,\nso this reads straight off the id — no auth-service endpoint returns\nemails for arbitrary users.\n\n#### Returns\n\n`string` \\| `undefined`\n\nThe email, or `undefined` if the id is not email-derived.\n\n***\n\n### favorite()\n\n> **favorite**(): `Promise`\\<`User`\\>\n\nAdd this entity to the user's favorites. Returns this handle for chaining.\nPlain unwrap: favoriting alters the user's favorites collection, not this\nentity's own detail, so there's nothing cached to invalidate.\n\n#### Returns\n\n`Promise`\\<`User`\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`favorite`](../../../entity/classes/PropertiedEntity.md#favorite)\n\n***\n\n### name()\n\n> **name**(): `Promise`\\<`string` \\| `undefined`\\>\n\nThis user's display name, fetched from the auth service (falling back to\nyour email contacts when the Macro profile has none).\n\n#### Returns\n\n`Promise`\\<`string` \\| `undefined`\\>\n\nThe full name, or `undefined` if the user has no name on record.\n\n***\n\n### permission()\n\n> **permission**(): `Promise`\\<\\{ `permission`: [`EntityPermission`](../../../../../generated/storage/types.gen/type-aliases/EntityPermission.md); `status`: `\"access\"`; \\} \\| \\{ `status`: `\"no_access\"`; \\}\\>\n\nRead the caller's effective permission on this entity.\n\n#### Returns\n\n`Promise`\\<\\{ `permission`: [`EntityPermission`](../../../../../generated/storage/types.gen/type-aliases/EntityPermission.md); `status`: `\"access\"`; \\} \\| \\{ `status`: `\"no_access\"`; \\}\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`permission`](../../../entity/classes/PropertiedEntity.md#permission)\n\n***\n\n### properties()\n\n> **properties**(`opts?`): `Promise`\\<[`EntityPropertyWithDefinition`](../../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md)[]\\>\n\nThe properties set on this entity, each with its definition, value, and options.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts?` | \\{ `includeMetadata?`: `boolean`; \\} |\n| `opts.includeMetadata?` | `boolean` |\n\n#### Returns\n\n`Promise`\\<[`EntityPropertyWithDefinition`](../../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md)[]\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`properties`](../../../entity/classes/PropertiedEntity.md#properties)\n\n***\n\n### propertyReference()\n\n> **propertyReference**(): [`PropertyTargetReference`](../../../../../generated/properties/types.gen/type-aliases/PropertyTargetReference.md)\n\nThis entity's reference for bulk property operations.\n\n#### Returns\n\n[`PropertyTargetReference`](../../../../../generated/properties/types.gen/type-aliases/PropertyTargetReference.md)\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`propertyReference`](../../../entity/classes/PropertiedEntity.md#propertyreference)\n\n***\n\n### setProperty()\n\n> **setProperty**(`property`, `value?`): `Promise`\\<`void`\\>\n\nSet a property value on this entity, or attach the property without a\nvalue when `value` is omitted.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `property` | [`PropertyDefinition`](../../../properties/property-definition/classes/PropertyDefinition.md) |\n| `value?` | [`SetPropertyValue`](../../../../../generated/properties/types.gen/type-aliases/SetPropertyValue.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`setProperty`](../../../entity/classes/PropertiedEntity.md#setproperty)\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`UserName`](../../../../../generated/auth/types.gen/type-aliases/UserName.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`UserName`](../../../../../generated/auth/types.gen/type-aliases/UserName.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`UserName`](../../../../../generated/auth/types.gen/type-aliases/UserName.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`toJSON`](../../../entity/classes/PropertiedEntity.md#tojson)\n\n***\n\n### toMention()\n\n> **toMention**(): [`MentionPart`](../../../../mentions/interfaces/MentionPart.md)\n\n#### Returns\n\n[`MentionPart`](../../../../mentions/interfaces/MentionPart.md)\n\n#### Implementation of\n\n[`Mentionable`](../../../../mentions/interfaces/Mentionable.md).[`toMention`](../../../../mentions/interfaces/Mentionable.md#tomention)\n\n***\n\n### unfavorite()\n\n> **unfavorite**(): `Promise`\\<`User`\\>\n\nRemove this entity from the user's favorites. Returns this handle for chaining.\n\n#### Returns\n\n`Promise`\\<`User`\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`unfavorite`](../../../entity/classes/PropertiedEntity.md#unfavorite)\n\n***\n\n### updatePropertyOptions()\n\n> **updatePropertyOptions**(`changes`): `Promise`\\<[`BulkUpdateEntityPropertyOptionsResponse`](../../../../../generated/properties/types.gen/type-aliases/BulkUpdateEntityPropertyOptionsResponse.md)\\>\n\nApply multi-select option deltas atomically across this entity's properties.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `changes` | [`PropertyOptionDelta`](../../../entity/interfaces/PropertyOptionDelta.md)[] |\n\n#### Returns\n\n`Promise`\\<[`BulkUpdateEntityPropertyOptionsResponse`](../../../../../generated/properties/types.gen/type-aliases/BulkUpdateEntityPropertyOptionsResponse.md)\\>\n\n#### Inherited from\n\n[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`updatePropertyOptions`](../../../entity/classes/PropertiedEntity.md#updatepropertyoptions)\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `id`): `User`\n\nA handle to a user by id.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `id` | `string` |\n\n#### Returns\n\n`User`\n\n***\n\n### me()\n\n> `static` **me**(`client`): `Promise`\\<`User`\\>\n\nA handle to the current authenticated user.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n\n#### Returns\n\n`Promise`\\<`User`\\>\n"},{"name": "webhooks",@@ -140,7 +188,7 @@{"name": "core","description": "SDK construction, entity handles, lazy fields, search options, events and shared types.",- "overview": "<!-- src/config/interfaces/MacroOpts.md -->\n# Interface: MacroOpts\n\nOptions passed to `new Macro(opts)` and stored on `MacroClient`.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-auth\"></a> `auth?` | [`MacroAuth`](../type-aliases/MacroAuth.md) | How to authenticate. Takes precedence over `token`. Falls back to `MACRO_API_KEY` (a user API key or bearer token) or `MACRO_BOT_TOKEN` (bot). |\n| <a id=\"property-env\"></a> `env?` | [`Env`](../type-aliases/Env.md) | Which Macro environment to talk to. Falls back to the MACRO_ENV env var, then `'prod'`. |\n| <a id=\"property-hosts\"></a> `hosts?` | `Partial`\\<`Record`\\<[`ServiceName`](../type-aliases/ServiceName.md), `string`\\>\\> | Override individual service hosts (e.g. point one at localhost). |\n| <a id=\"property-onrequest\"></a> `onRequest?` | (`event`) => `void` | Optional generated API operation events; excludes arguments, URLs and response data. |\n| <a id=\"property-requestedas\"></a> `requestedAs?` | `string` | User id the bot acts for, sent as `x-macro-bot-for-macro-user-id` on every request. Bot auth only. Set via `macro.requestedAs(user)` rather than directly. |\n| <a id=\"property-token\"></a> `token?` | [`TokenSource`](../type-aliases/TokenSource.md) | Shorthand for `auth: { type: 'user', token }`. Accepts a Settings API key (`mak_…`) or a bearer token. |\n| <a id=\"property-webappurl\"></a> `webAppUrl?` | `string` | Override the web app base URL (e.g. for local frontend dev). Also reads MACRO_WEB_URL. |\n| <a id=\"property-webhooksecret\"></a> `webhookSecret?` | `string` | Signing secret for verifying incoming persisted-webhook deliveries. Required only for `macro.events.webhook()` / `macro.events.handle()`. SSE via `macro.events.listen()` uses the API token and does not need this. Falls back to MACRO_WEBHOOK_SECRET. |\n| <a id=\"property-wsverify\"></a> `wsVerify?` | `string` | - |\n\n\n<!-- src/config/type-aliases/BotScope.md -->\n# Type Alias: BotScope\n\n> **BotScope** = `\"user\"` \\| `\"team\"`\n\nAccess scope for bot-authenticated requests. `user` acts with the\nrequested-as user's access (requires `requestedAs`); `team` acts with the\nbot's owning team's access (team-owned bots only).\n\n\n<!-- src/config/type-aliases/Env.md -->\n# Type Alias: Env\n\n> **Env** = `\"dev\"` \\| `\"prod\"` \\| `\"local\"`\n\n\n<!-- src/config/type-aliases/MacroAuth.md -->\n# Type Alias: MacroAuth\n\n> **MacroAuth** = \\{ `apiKey?`: `never`; `token`: [`TokenSource`](TokenSource.md); `type`: `\"user\"`; \\} \\| \\{ `apiKey`: `string`; `token?`: `never`; `type`: `\"user\"`; \\} \\| \\{ `scope?`: [`BotScope`](BotScope.md); `token`: [`TokenSource`](TokenSource.md); `type`: `\"bot\"`; \\}\n\nHow the SDK authenticates with Macro.\n\nA user has exactly one of two credential fields.\n\n- `token`: a bearer token, or a `mak_` API key. The SDK picks the header\n from the prefix at send time.\n- `apiKey`: a Settings → API Keys key, always sent as\n `x-macro-user-api-key`. Not prefix-checked, so keys that predate the\n `mak_` prefix work here.\n\nA bot uses an `mbot_` token as `x-macro-bot-token` plus\n`x-macro-bot-scope`, defaulting to `user` when `requestedAs` is set and\n`team` otherwise.\n\n\n<!-- src/config/type-aliases/ServiceName.md -->\n# Type Alias: ServiceName\n\n> **ServiceName** = `\"agent-harness\"` \\| `\"storage\"` \\| `\"auth\"` \\| `\"email\"` \\| `\"calendar\"` \\| `\"cognition\"` \\| `\"notification\"` \\| `\"properties\"` \\| `\"search\"` \\| `\"scheduled-action\"` \\| `\"static-files\"` \\| `\"connection\"` \\| `\"contacts\"` \\| `\"unfurl\"`\n\nThe backend services the SDK talks to. Note `search` and `properties` are\nserved on the storage host, so they point there.\n\n\n<!-- src/config/type-aliases/TokenSource.md -->\n# Type Alias: TokenSource\n\n> **TokenSource** = `string` \\| (() => `string` \\| `Promise`\\<`string`\\>)\n\nA credential string, or a (possibly async) function that returns one.\n\n\n<!-- src/config/variables/HOSTS.md -->\n# Variable: HOSTS\n\n> `const` **HOSTS**: `Record`\\<[`Env`](../type-aliases/Env.md), `Record`\\<[`ServiceName`](../type-aliases/ServiceName.md), `string`\\>\\>\n\n\n<!-- src/config/variables/WEB_APP_URLS.md -->\n# Variable: WEB\\_APP\\_URLS\n\n> `const` **WEB\\_APP\\_URLS**: `Record`\\<[`Env`](../type-aliases/Env.md), `string`\\>\n\n\n<!-- src/macro/classes/Macro.md -->\n# Class: Macro\\<T\\>\n\n## Type Parameters\n\n| Type Parameter | Default type |\n| ------ | ------ |\n| <a id=\"type-parameter-t\"></a> `T` *extends* [`MacroOpts`](../../config/interfaces/MacroOpts.md) | [`MacroOpts`](../../config/interfaces/MacroOpts.md) |\n\n## Constructors\n\n### Constructor\n\n> **new Macro**\\<`T`\\>(`opts`): `Macro`\\<`T`\\>\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts` | `T` |\n\n#### Returns\n\n`Macro`\\<`T`\\>\n\n## Properties\n\n| Property | Modifier | Type | Description |\n| ------ | ------ | ------ | ------ |\n| <a id=\"property-_client\"></a> `_client` | `readonly` | `MacroClient` | Direct access to the underlying hey-api service clients. |\n| <a id=\"property-agentsessions\"></a> `agentSessions` | `readonly` | [`AgentSessionNamespace`](../../entities/agent-sessions/namespace/classes/AgentSessionNamespace.md) | - |\n| <a id=\"property-ai\"></a> `ai` | `readonly` | [`AiNamespace`](../../entities/ai/namespace/classes/AiNamespace.md) | - |\n| <a id=\"property-bots\"></a> `bots` | `readonly` | [`BotsNamespace`](../../entities/bots/namespace/classes/BotsNamespace.md) | - |\n| <a id=\"property-calendar\"></a> `calendar` | `readonly` | [`CalendarNamespace`](../../entities/calendar/namespace/classes/CalendarNamespace.md) | - |\n| <a id=\"property-calls\"></a> `calls` | `readonly` | [`CallRecordNamespace`](../../entities/calls/namespace/classes/CallRecordNamespace.md) | - |\n| <a id=\"property-channels\"></a> `channels` | `readonly` | [`ChannelNamespace`](../../entities/channels/namespace/classes/ChannelNamespace.md) | - |\n| <a id=\"property-chats\"></a> `chats` | `readonly` | [`ChatNamespace`](../../entities/chats/namespace/classes/ChatNamespace.md) | - |\n| <a id=\"property-crm\"></a> `crm` | `readonly` | [`CrmNamespace`](../../entities/crm/namespace/classes/CrmNamespace.md) | - |\n| <a id=\"property-databases\"></a> `databases` | `readonly` | [`DatabaseNamespace`](../../entities/databases/namespace/classes/DatabaseNamespace.md) | - |\n| <a id=\"property-documents\"></a> `documents` | `readonly` | [`DocumentNamespace`](../../entities/documents/namespace/classes/DocumentNamespace.md) | - |\n| <a id=\"property-email\"></a> `email` | `readonly` | [`EmailNamespace`](../../entities/email/namespace/classes/EmailNamespace.md) | - |\n| <a id=\"property-events\"></a> `events` | `readonly` | [`MacroEvents`](../../events/receiver/classes/MacroEvents.md) | - |\n| <a id=\"property-favorites\"></a> `favorites` | `readonly` | [`FavoritesNamespace`](../../entities/favorites/namespace/classes/FavoritesNamespace.md) | - |\n| <a id=\"property-foreignentities\"></a> `foreignEntities` | `readonly` | [`ForeignEntityNamespace`](../../entities/foreign/namespace/classes/ForeignEntityNamespace.md) | - |\n| <a id=\"property-forms\"></a> `forms` | `readonly` | [`FormNamespace`](../../entities/forms/namespace/classes/FormNamespace.md) | Build forms and submit answers without granting respondents database access. |\n| <a id=\"property-notifications\"></a> `notifications` | `readonly` | [`NotificationNamespace`](../../entities/notifications/namespace/classes/NotificationNamespace.md) | - |\n| <a id=\"property-pins\"></a> `pins` | `readonly` | [`PinsNamespace`](../../entities/pins/namespace/classes/PinsNamespace.md) | - |\n| <a id=\"property-projects\"></a> `projects` | `readonly` | [`ProjectNamespace`](../../entities/projects/namespace/classes/ProjectNamespace.md) | - |\n| <a id=\"property-properties\"></a> `properties` | `readonly` | [`PropertiesNamespace`](../../entities/properties/namespace/classes/PropertiesNamespace.md) | - |\n| <a id=\"property-tasks\"></a> `tasks` | `readonly` | [`TaskNamespace`](../../entities/tasks/namespace/classes/TaskNamespace.md) | - |\n| <a id=\"property-teams\"></a> `teams` | `readonly` | [`TeamNamespace`](../../entities/teams/namespace/classes/TeamNamespace.md) | - |\n| <a id=\"property-users\"></a> `users` | `readonly` | [`UserNamespace`](../../entities/users/namespace/classes/UserNamespace.md) | - |\n| <a id=\"property-webappurl\"></a> `webAppUrl` | `readonly` | `string` | Base URL of the Macro web app, used to build entity URLs. |\n| <a id=\"property-webhooks\"></a> `webhooks` | `readonly` | [`WebhooksNamespace`](../../entities/webhooks/namespace/classes/WebhooksNamespace.md) | - |\n| <a id=\"property-workspace\"></a> `workspace` | `readonly` | [`WorkspaceNamespace`](../../entities/workspace/namespace/classes/WorkspaceNamespace.md) | Browse workspace activity with type, task, time, tag and inbox filters. |\n\n## Methods\n\n### myPrincipalId()\n\n> **myPrincipalId**(): `Promise`\\<`string`\\>\n\nThe authenticated caller's mentionable principal — `bot|<uuid>` for bot\nauth, `macro|<email>` for user auth — fetched once and cached.\n\n#### Returns\n\n`Promise`\\<`string`\\>\n\n***\n\n### requestedAs()\n\n> **requestedAs**(`user`): `Macro`\\<`T`\\>\n\nClone of this SDK acting on behalf of `user` (sent as\n`x-macro-bot-for-macro-user-id`). Bot auth only — throws for user auth,\nsince a user token always acts as its own user.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `user` | [`User`](../../entities/users/user/classes/User.md) |\n\n#### Returns\n\n`Macro`\\<`T`\\>\n\n\n<!-- src/macro/type-aliases/RequestActivity.md -->\n# Type Alias: RequestActivity\n\n> **RequestActivity** = \\{ `id`: `number`; `operation`: `string`; `service`: `string`; `status`: `\"started\"` \\| `\"completed\"` \\| `\"failed\"`; \\}\n\nA generated SDK operation lifecycle. Contains no arguments, URLs or response data.\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-id\"></a> `id` | `number` |\n| <a id=\"property-operation\"></a> `operation` | `string` |\n| <a id=\"property-service\"></a> `service` | `string` |\n| <a id=\"property-status\"></a> `status` | `\"started\"` \\| `\"completed\"` \\| `\"failed\"` |\n",- "documentation": "# Macro SDK: core\n\nGenerated by TypeDoc. Paths below refer to the canonical Markdown hierarchy. Other entity handles are documented in their named section; request core for shared SDK helpers.\n\n<!-- generated/properties/types.gen/type-aliases/BulkUpdateEntityPropertyOptionsResponse.md -->\n# Type Alias: BulkUpdateEntityPropertyOptionsResponse\n\n> **BulkUpdateEntityPropertyOptionsResponse** = \\{ `properties`: [`EntityPropertyOptionSelectionResponse`](EntityPropertyOptionSelectionResponse.md)[]; \\}\n\nResponse for a bulk option update: each property's reconciled final ids.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-properties\"></a> `properties` | [`EntityPropertyOptionSelectionResponse`](EntityPropertyOptionSelectionResponse.md)[] | The final option ids per updated property. |\n\n\n<!-- generated/properties/types.gen/type-aliases/DataType.md -->\n# Type Alias: DataType\n\n> **DataType** = `\"BOOLEAN\"` \\| `\"DATE\"` \\| `\"NUMBER\"` \\| `\"STRING\"` \\| `\"SELECT_NUMBER\"` \\| `\"SELECT_STRING\"` \\| `\"TAG\"` \\| `\"ENTITY\"` \\| `\"LINK\"`\n\nData type for property values, determining storage and validation.\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityProperty.md -->\n# Type Alias: EntityProperty\n\n> **EntityProperty** = \\{ `created_at`: `string`; `entity_id`: `string`; `entity_type`: [`EntityType`](EntityType.md); `id`: `string`; `property_definition_id`: `string`; `updated_at`: `string`; \\}\n\nAssignment of a property definition to a specific entity (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-created_at\"></a> `created_at` | `string` |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` |\n| <a id=\"property-entity_type\"></a> `entity_type` | [`EntityType`](EntityType.md) |\n| <a id=\"property-id\"></a> `id` | `string` |\n| <a id=\"property-property_definition_id\"></a> `property_definition_id` | `string` |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityPropertyOptionSelectionResponse.md -->\n# Type Alias: EntityPropertyOptionSelectionResponse\n\n> **EntityPropertyOptionSelectionResponse** = \\{ `option_ids`: `string`[]; `property_id`: `string`; \\}\n\nThe reconciled final option ids stored for one property after a bulk update.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-option_ids\"></a> `option_ids` | `string`[] | The final option ids the server persisted, in stored order. |\n| <a id=\"property-property_id\"></a> `property_id` | `string` | The property definition the options belong to. |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md -->\n# Type Alias: EntityPropertyWithDefinition\n\n> **EntityPropertyWithDefinition** = \\{ `definition`: [`PropertyDefinition`](PropertyDefinition.md); `options?`: [`PropertyOption`](PropertyOption.md)[] \\| `null`; `property`: [`EntityProperty`](EntityProperty.md); `value?`: `null` \\| [`PropertyValue`](PropertyValue.md); \\}\n\nEntity property with its definition, value, and options (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-definition\"></a> `definition` | [`PropertyDefinition`](PropertyDefinition.md) |\n| <a id=\"property-options\"></a> `options?` | [`PropertyOption`](PropertyOption.md)[] \\| `null` |\n| <a id=\"property-property\"></a> `property` | [`EntityProperty`](EntityProperty.md) |\n| <a id=\"property-value\"></a> `value?` | `null` \\| [`PropertyValue`](PropertyValue.md) |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityReference.md -->\n# Type Alias: EntityReference\n\n> **EntityReference** = \\{ `entity_id`: `string`; `entity_type`: [`EntityType`](EntityType.md); `specific_message_id?`: `string` \\| `null`; \\}\n\nEntity reference for entity-type property values.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | - |\n| <a id=\"property-entity_type\"></a> `entity_type` | [`EntityType`](EntityType.md) | - |\n| <a id=\"property-specific_message_id\"></a> `specific_message_id?` | `string` \\| `null` | For CHANNEL, CHAT, THREAD entity types - optional specific message ID. This allows referencing a specific message within a thread/channel/chat. |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityType.md -->\n# Type Alias: EntityType\n\n> **EntityType** = `\"CALENDAR_EVENT\"` \\| `\"CALL_RECORD\"` \\| `\"CHANNEL\"` \\| `\"CHAT\"` \\| `\"COMPANY\"` \\| `\"DATABASE_ROW\"` \\| `\"CONTACT\"` \\| `\"DOCUMENT\"` \\| `\"INITIATIVE\"` \\| `\"PROJECT\"` \\| `\"TASK\"` \\| `\"THREAD\"` \\| `\"USER\"`\n\nType of entity that can be referenced by entity properties.\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyDefinition.md -->\n# Type Alias: PropertyDefinition\n\n> **PropertyDefinition** = \\{ `created_at`: `string`; `data_type`: [`DataType`](DataType.md); `display_name`: `string`; `id`: `string`; `is_metadata`: `boolean`; `is_multi_select`: `boolean`; `is_system`: `boolean`; `owner`: [`PropertyOwner`](PropertyOwner.md); `specific_entity_type`: `null` \\| [`EntityType`](EntityType.md); `updated_at`: `string`; \\}\n\nProperty definition model (service representation).\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | - |\n| <a id=\"property-data_type\"></a> `data_type` | [`DataType`](DataType.md) | - |\n| <a id=\"property-display_name\"></a> `display_name` | `string` | - |\n| <a id=\"property-id\"></a> `id` | `string` | - |\n| <a id=\"property-is_metadata\"></a> `is_metadata` | `boolean` | Flag to indicate if this is a system-generated metadata property. Not stored in database - computed at service layer. |\n| <a id=\"property-is_multi_select\"></a> `is_multi_select` | `boolean` | - |\n| <a id=\"property-is_system\"></a> `is_system` | `boolean` | Flag to indicate if this is a system property (stored in DB). |\n| <a id=\"property-owner\"></a> `owner` | [`PropertyOwner`](PropertyOwner.md) | - |\n| <a id=\"property-specific_entity_type\"></a> `specific_entity_type` | `null` \\| [`EntityType`](EntityType.md) | - |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` | - |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyOption.md -->\n# Type Alias: PropertyOption\n\n> **PropertyOption** = \\{ `color`: `string` \\| `null`; `created_at`: `string`; `display_order`: `number`; `id`: `string`; `property_definition_id`: `string`; `updated_at`: `string`; `value`: [`PropertyOptionValue`](PropertyOptionValue.md); \\}\n\nA selectable option for select-type properties (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-color\"></a> `color` | `string` \\| `null` |\n| <a id=\"property-created_at\"></a> `created_at` | `string` |\n| <a id=\"property-display_order\"></a> `display_order` | `number` |\n| <a id=\"property-id\"></a> `id` | `string` |\n| <a id=\"property-property_definition_id\"></a> `property_definition_id` | `string` |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` |\n| <a id=\"property-value\"></a> `value` | [`PropertyOptionValue`](PropertyOptionValue.md) |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyOptionValue.md -->\n# Type Alias: PropertyOptionValue\n\n> **PropertyOptionValue** = \\{ `type`: `\"string\"`; `value`: `string`; \\} \\| \\{ `type`: `\"number\"`; `value`: `number`; \\}\n\nThe value of a property option - either a string or a number.\n\n## Union Members\n\n### Type Literal\n\n\\{ `type`: `\"string\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"string\"` | - |\n| `value` | `string` | String value for SelectString properties |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"number\"`; `value`: `number`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"number\"` | - |\n| `value` | `number` | Number value for SelectNumber properties |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyOwner.md -->\n# Type Alias: PropertyOwner\n\n> **PropertyOwner** = \\{ `scope`: `\"user\"`; `user_id`: `string`; \\} \\| \\{ `scope`: `\"team\"`; `team_id`: `string`; \\} \\| \\{ `database_id`: `string`; `scope`: `\"database\"`; \\} \\| \\{ `scope`: `\"system\"`; \\}\n\nDefines who owns a property - user-scoped, team-scoped, database-scoped, or system.\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyTargetEntityType.md -->\n# Type Alias: PropertyTargetEntityType\n\n> **PropertyTargetEntityType** = `\"CALL_RECORD\"` \\| `\"CHANNEL\"` \\| `\"CHAT\"` \\| `\"COMPANY\"` \\| `\"DATABASE_ROW\"` \\| `\"DOCUMENT\"` \\| `\"INITIATIVE\"` \\| `\"PROJECT\"` \\| `\"THREAD\"` \\| `\"USER\"`\n\nCanonical type of an entity receiving properties.\n\nTasks are documents at API boundaries. `Task` intentionally does not exist\nhere; task classification is resolved by the properties domain from the\ndocument subtype.\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyTargetReference.md -->\n# Type Alias: PropertyTargetReference\n\n> **PropertyTargetReference** = \\{ `entity_id`: `string`; `entity_type`: [`PropertyTargetEntityType`](PropertyTargetEntityType.md); \\}\n\nCanonical reference to an entity receiving properties.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | Entity identifier. |\n| <a id=\"property-entity_type\"></a> `entity_type` | [`PropertyTargetEntityType`](PropertyTargetEntityType.md) | Canonical entity type. |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyValue.md -->\n# Type Alias: PropertyValue\n\n> **PropertyValue** = \\{ `type`: `\"Boolean\"`; `value`: `boolean`; \\} \\| \\{ `type`: `\"Number\"`; `value`: `number`; \\} \\| \\{ `type`: `\"String\"`; `value`: `string`; \\} \\| \\{ `type`: `\"Date\"`; `value`: `string`; \\} \\| \\{ `type`: `\"SelectOption\"`; `value`: `string`[]; \\} \\| \\{ `type`: `\"EntityReference\"`; `value`: [`EntityReference`](EntityReference.md)[]; \\} \\| \\{ `type`: `\"Link\"`; `value`: `string`[]; \\}\n\nProperty value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to/from JSONB in the database.\n\n## Union Members\n\n### Type Literal\n\n\\{ `type`: `\"Boolean\"`; `value`: `boolean`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Boolean\"` | - |\n| `value` | `boolean` | Boolean value Serializes as: {\"type\": \"Boolean\", \"value\": true} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"Number\"`; `value`: `number`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Number\"` | - |\n| `value` | `number` | Numeric value Serializes as: {\"type\": \"Number\", \"value\": 42.5} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"String\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"String\"` | - |\n| `value` | `string` | String value Serializes as: {\"type\": \"String\", \"value\": \"text\"} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"Date\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Date\"` | - |\n| `value` | `string` | Date/timestamp value Serializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"SelectOption\"`; `value`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"SelectOption\"` | - |\n| `value` | `string`[] | Select option(s) - always an array (check is_multi_select to determine if single or multi) Single-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1) Multi-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+) |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"EntityReference\"`; `value`: [`EntityReference`](EntityReference.md)[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"EntityReference\"` | - |\n| `value` | [`EntityReference`](EntityReference.md)[] | Entity reference(s) - always an array (check is_multi_select to determine if single or multi) Single-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1) Multi-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+) |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"Link\"`; `value`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Link\"` | - |\n| `value` | `string`[] | Link value(s) - always an array (check is_multi_select to determine if single or multi) Single-select: {\"type\": \"Link\", \"value\": [\"https://example.com\"]} (length 0 or 1) Multi-select: {\"type\": \"Link\", \"value\": [\"https://example.com\", \"https://other.com\"]} (length 0+) |\n\n\n<!-- generated/properties/types.gen/type-aliases/SetPropertyValue.md -->\n# Type Alias: SetPropertyValue\n\n> **SetPropertyValue** = \\{ `type`: `\"boolean\"`; `value`: `boolean`; \\} \\| \\{ `type`: `\"date\"`; `value`: `string`; \\} \\| \\{ `type`: `\"number\"`; `value`: `number`; \\} \\| \\{ `type`: `\"string\"`; `value`: `string`; \\} \\| \\{ `option_id`: `string`; `type`: `\"select_option\"`; \\} \\| \\{ `option_ids`: `string`[]; `type`: `\"multi_select_option\"`; \\} \\| \\{ `reference`: [`EntityReference`](EntityReference.md); `type`: `\"entity_reference\"`; \\} \\| \\{ `references`: [`EntityReference`](EntityReference.md)[]; `type`: `\"multi_entity_reference\"`; \\} \\| \\{ `type`: `\"link\"`; `url`: `string`; \\} \\| \\{ `type`: `\"multi_link\"`; `urls`: `string`[]; \\}\n\nType-safe enum for setting entity property values - provides compile-time validation.\n\n\n<!-- generated/search/types.gen/type-aliases/AgentSessionFilters.md -->\n# Type Alias: AgentSessionFilters\n\n> **AgentSessionFilters** = \\{ `ids?`: `string`[]; `include?`: `boolean`; `owners?`: `string`[]; \\}\n\nFilters for agent sessions.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-ids\"></a> `ids?` | `string`[] | Agent session ids to filter by. Empty to include all accessible sessions. |\n| <a id=\"property-include\"></a> `include?` | `boolean` | Opt this query into agent sessions at all. Agent sessions are off by default — see [`crate::ast::agent_session::AgentSessionLiteral::Include`]. Asking for specific `ids` or `owners` also opts in. |\n| <a id=\"property-owners\"></a> `owners?` | `string`[] | Filter by session owner principal — a user ('macro\\|[email protected]'), a bot ('bot\\|<uuid>'), or a team (a bare hyphenated uuid). Empty to include every owner. |\n\n\n<!-- generated/search/types.gen/type-aliases/CalendarEventFilters.md -->\n# Type Alias: CalendarEventFilters\n\n> **CalendarEventFilters** = \\{ `attendees?`: `string`[]; `calendar_event_ids?`: `string`[]; `ends_after?`: `string` \\| `null`; `organizers?`: `string`[]; `starts_before?`: `string` \\| `null`; `statuses?`: `string`[]; \\}\n\nFilters for canonical calendar-event entities.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-attendees\"></a> `attendees?` | `string`[] | Attendee email addresses. |\n| <a id=\"property-calendar_event_ids\"></a> `calendar_event_ids?` | `string`[] | Canonical event ids. |\n| <a id=\"property-ends_after\"></a> `ends_after?` | `string` \\| `null` | Include master events ending after this instant. |\n| <a id=\"property-organizers\"></a> `organizers?` | `string`[] | Organizer email addresses. |\n| <a id=\"property-starts_before\"></a> `starts_before?` | `string` \\| `null` | Include master events starting before this instant. |\n| <a id=\"property-statuses\"></a> `statuses?` | `string`[] | Event statuses such as `confirmed`, `tentative`, or `cancelled`. |\n\n\n<!-- generated/search/types.gen/type-aliases/CallFilters.md -->\n# Type Alias: CallFilters\n\n> **CallFilters** = \\{ `attended?`: `boolean` \\| `null`; `call_ids?`: `string`[]; `channel_ids?`: `string`[]; `speaker_ids?`: `string`[]; `status?`: `null` \\| [`CallStatus`](CallStatus.md); \\}\n\nFilters for call records.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-attended\"></a> `attended?` | `boolean` \\| `null` | Legacy filter by whether the requesting user attended the call. Prefer [`CallFilters::status`] for new callers. `None` = no filter, `Some(true)` = only calls the user joined, `Some(false)` = only calls the user did not join. |\n| <a id=\"property-call_ids\"></a> `call_ids?` | `string`[] | Call record IDs to filter by. Empty to include all calls. |\n| <a id=\"property-channel_ids\"></a> `channel_ids?` | `string`[] | Channel IDs to filter calls by. Empty to include all calls. |\n| <a id=\"property-speaker_ids\"></a> `speaker_ids?` | `string`[] | Speaker macro user ids. Empty to include all. |\n| <a id=\"property-status\"></a> `status?` | `null` \\| [`CallStatus`](CallStatus.md) | - |\n\n\n<!-- generated/search/types.gen/type-aliases/CallStatus.md -->\n# Type Alias: CallStatus\n\n> **CallStatus** = `\"ATTENDED\"` \\| `\"MISSED\"` \\| `\"UNATTENDED\"`\n\nViewer-relative attendance status for a call record.\nSerializes as `ATTENDED`, `MISSED`, or `UNATTENDED`.\n\n\n<!-- generated/search/types.gen/type-aliases/ChannelFilters.md -->\n# Type Alias: ChannelFilters\n\n> **ChannelFilters** = \\{ `channel_ids?`: `string`[]; `channel_types?`: `string`[]; `importance?`: `boolean` \\| `null`; `is_participant?`: `boolean` \\| `null`; `mentions?`: `string`[]; `notification_filters?`: [`NotificationFilters`](NotificationFilters.md); `org_id?`: `number` \\| `null`; `sender_ids?`: `string`[]; `team_id?`: `string` \\| `null`; `thread_ids?`: `string`[]; \\}\n\nThe channel message filters used to filter down what channel messages you search over.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-channel_ids\"></a> `channel_ids?` | `string`[] | Channel IDs to search within. Examples: ['general']. Empty to search all accessible channels. |\n| <a id=\"property-channel_types\"></a> `channel_types?` | `string`[] | Channel types to filter by. Examples: ['public'], ['direct_message', 'private']. Empty to search all channel types. |\n| <a id=\"property-importance\"></a> `importance?` | `boolean` \\| `null` | Filter by channel importance. None to ignore, true to pass through (no clause), false to short-circuit and return nothing. |\n| <a id=\"property-is_participant\"></a> `is_participant?` | `boolean` \\| `null` | Filter by whether the requesting user is an active participant of the channel. Presence of this filter also widens the candidate set to team channels of the user's teams that they have not joined, so `false` matches those channels. None to ignore (participant channels only, today's default). |\n| <a id=\"property-mentions\"></a> `mentions?` | `string`[] | Channel user mentions to search for. Examples: ['@username']. Empty if not filtering by mentions. |\n| <a id=\"property-notification_filters\"></a> `notification_filters?` | [`NotificationFilters`](NotificationFilters.md) | Filter by channel notification state. |\n| <a id=\"property-org_id\"></a> `org_id?` | `number` \\| `null` | Channel organization ID to search within. Empty to ignore organization filtering. |\n| <a id=\"property-sender_ids\"></a> `sender_ids?` | `string`[] | Sender IDs to search within. Examples: ['user1']. Empty to search all accessible senders. |\n| <a id=\"property-team_id\"></a> `team_id?` | `string` \\| `null` | Channel team ID to search within. Empty to ignore team filtering. |\n| <a id=\"property-thread_ids\"></a> `thread_ids?` | `string`[] | Channel thread IDs to search within. Examples: ['thread123']. Empty to search all threads. |\n\n\n<!-- generated/search/types.gen/type-aliases/ChannelThreadFilters.md -->\n# Type Alias: ChannelThreadFilters\n\n> **ChannelThreadFilters** = \\{ `channel_ids?`: `string`[]; `participant_ids?`: `string`[]; `root_sender_ids?`: `string`[]; `thread_ids?`: `string`[]; \\}\n\nThe channel thread filters used to filter down channel-thread entities.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-channel_ids\"></a> `channel_ids?` | `string`[] | Channel IDs containing the thread. Empty to include threads from all accessible channels. |\n| <a id=\"property-participant_ids\"></a> `participant_ids?` | `string`[] | Thread participant user IDs. A participant is the root message sender, anyone who replied in the thread, or anyone @-mentioned in the thread (group mentions like **Here** count through their per-user expansion at send time). Empty to include threads regardless of participants. |\n| <a id=\"property-root_sender_ids\"></a> `root_sender_ids?` | `string`[] | Sender IDs for the root thread message. Empty to include all root senders. |\n| <a id=\"property-thread_ids\"></a> `thread_ids?` | `string`[] | Channel thread parent message IDs to include. Empty to include all accessible threads. |\n\n\n<!-- generated/search/types.gen/type-aliases/ChatFilters.md -->\n# Type Alias: ChatFilters\n\n> **ChatFilters** = \\{ `chat_ids?`: `string`[]; `importance?`: `boolean` \\| `null`; `notification_filters?`: [`NotificationFilters`](NotificationFilters.md); `owners?`: `string`[]; `project_ids?`: `string`[]; `role?`: `string`[]; \\}\n\nThe chat filters used to filter down what chats you search over.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-chat_ids\"></a> `chat_ids?` | `string`[] | Chat ids to search over. Examples: ['chat1'], ['chat1', 'chat2']. When provided, chat search will only match results on these chats. Empty to search all accessible chats. |\n| <a id=\"property-importance\"></a> `importance?` | `boolean` \\| `null` | Filter by chat importance. None to ignore, true to pass through (no clause), false to short-circuit and return nothing. |\n| <a id=\"property-notification_filters\"></a> `notification_filters?` | [`NotificationFilters`](NotificationFilters.md) | Filter by chat notification state. |\n| <a id=\"property-owners\"></a> `owners?` | `string`[] | Filter by chat owner principal — a user ('macro\\|[email protected]'), a bot ('bot\\|<uuid>'), or a team (a bare hyphenated uuid). Examples: ['macro\\|[email protected]'], ['macro\\|[email protected]', 'bot\\|0199...']. Empty to search all owners. |\n| <a id=\"property-project_ids\"></a> `project_ids?` | `string`[] | A list of project ids to search within. Examples: ['project1']. Empty to ignore project filtering. |\n| <a id=\"property-role\"></a> `role?` | `string`[] | Chat message roles to search. Examples: ['user'], ['assistant']. Empty to search all roles. |\n\n\n<!-- generated/search/types.gen/type-aliases/CrmCompanyFilters.md -->\n# Type Alias: CrmCompanyFilters\n\n> **CrmCompanyFilters** = \\{ `company_ids?`: `string`[]; `hidden?`: `boolean` \\| `null`; \\}\n\nThe crm company filters used to narrow which CRM companies appear in soup.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-company_ids\"></a> `company_ids?` | `string`[] | CRM company ids to filter by. Examples: ['11111111-...']. Empty to include all of the team's visible CRM companies. |\n| <a id=\"property-hidden\"></a> `hidden?` | `boolean` \\| `null` | Optional `crm_companies.hidden` filter. `None` = visible only (default for back-compat with non-admin callers). `Some(false)` = visible only (explicit). `Some(true)` = hidden only — requires admin/owner team role; enforced by the CRM service from the caller's team receipt. |\n\n\n<!-- generated/search/types.gen/type-aliases/DocumentFilters.md -->\n# Type Alias: DocumentFilters\n\n> **DocumentFilters** = \\{ `document_ids?`: `string`[]; `file_types?`: `string`[]; `importance?`: `boolean` \\| `null`; `is_email_attachment?`: `boolean` \\| `null`; `notification_filters?`: [`NotificationFilters`](NotificationFilters.md); `owners?`: `string`[]; `project_ids?`: `string`[]; `sub_types?`: `string`[]; `task_filters?`: [`TaskFilters`](TaskFilters.md); \\}\n\nThe document filters used to filter down what documents you search over.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-document_ids\"></a> `document_ids?` | `string`[] | Document ids to search over. Examples: ['doc1'], ['doc1', 'doc2']. Empty to search all accessible documents. |\n| <a id=\"property-file_types\"></a> `file_types?` | `string`[] | Document file types to search. Examples: ['pdf'], ['md', 'txt']. Empty to search all file types. |\n| <a id=\"property-importance\"></a> `importance?` | `boolean` \\| `null` | Filter by document importance. None to ignore, true to pass through (no clause), false to short-circuit and return nothing. |\n| <a id=\"property-is_email_attachment\"></a> `is_email_attachment?` | `boolean` \\| `null` | Filter by email attachment status. true = only email attachments, false = only non-email attachments, None = both. |\n| <a id=\"property-notification_filters\"></a> `notification_filters?` | [`NotificationFilters`](NotificationFilters.md) | Filter by document notification state. |\n| <a id=\"property-owners\"></a> `owners?` | `string`[] | Filter by document owner principal — a user ('macro\\|[email protected]'), a bot ('bot\\|<uuid>'), or a team (a bare hyphenated uuid). Examples: ['macro\\|[email protected]'], ['macro\\|[email protected]', 'bot\\|0199...']. Empty to search all owners. |\n| <a id=\"property-project_ids\"></a> `project_ids?` | `string`[] | A list of project ids to search within. Examples: ['project1']. filtering. Empty to ignore project filtering. |\n| <a id=\"property-sub_types\"></a> `sub_types?` | `string`[] | Filter by document sub type. Examples: ['task']. Empty to search all sub types. |\n| <a id=\"property-task_filters\"></a> `task_filters?` | [`TaskFilters`](TaskFilters.md) | Task-specific filters that only apply to task subtype documents. |\n\n\n<!-- generated/search/types.gen/type-aliases/EmailFilters.md -->\n# Type Alias: EmailFilters\n\n> **EmailFilters** = \\{ `bcc?`: `string`[]; `calendar_only?`: `boolean` \\| `null`; `cc?`: `string`[]; `crm_addresses?`: `string`[]; `crm_domains?`: `string`[]; `email_thread_ids?`: `string`[]; `exclude_labels?`: `string`[]; `importance?`: `boolean` \\| `null`; `include_labels?`: `string`[]; `is_read?`: `boolean` \\| `null`; `link_ids?`: `string`[]; `notification_filters?`: [`NotificationFilters`](NotificationFilters.md); `project_ids?`: `string`[]; `recipients?`: `string`[]; `senders?`: `string`[]; `shared?`: [`SharedEmailFilter`](SharedEmailFilter.md); \\}\n\nThe email filters used to filter down what emails you search over.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-bcc\"></a> `bcc?` | `string`[] | Email BCC addresses to filter by. Examples: ['[email protected]']. Empty if not filtering by BCC. |\n| <a id=\"property-calendar_only\"></a> `calendar_only?` | `boolean` \\| `null` | When `Some(true)`, only include threads that have at least one message with an iCalendar attachment (`.ics` filename or `application/ics` mime type). `Some(false)` and `None` apply no constraint. |\n| <a id=\"property-cc\"></a> `cc?` | `string`[] | Email CC addresses to filter by. Examples: ['[email protected]']. Empty if not filtering by CC. |\n| <a id=\"property-crm_addresses\"></a> `crm_addresses?` | `string`[] | CRM-scoped address filter. When non-empty, expands visibility to every teammate's mailbox and restricts to threads involving any of these fully-qualified addresses. Each address is authorized against `crm_contacts` + `crm_companies` (contact must not be hidden, company must not be hidden, `email_sync` must be true). Mutually exclusive with `crm_domains`. |\n| <a id=\"property-crm_domains\"></a> `crm_domains?` | `string`[] | CRM-scoped domain filter. When non-empty, expands visibility to every teammate's mailbox and restricts to threads involving any of these domains (in any of sender/cc/bcc/recipient). Each domain is authorized against `crm_domains` + `crm_companies` (must exist for the caller's team, company must not be hidden, `email_sync` must be true). Mutually exclusive with `crm_addresses`. |\n| <a id=\"property-email_thread_ids\"></a> `email_thread_ids?` | `string`[] | Email thread IDs to filter by. Examples: ['thread-uuid-1']. Empty to search all threads. |\n| <a id=\"property-exclude_labels\"></a> `exclude_labels?` | `string`[] | Exclude emails that have any of these labels. Supports both Gmail system labels (e.g. \"CATEGORY_PROMOTIONS\") and user-created labels. Empty to not exclude any labels. Note: SPAM and TRASH emails are not indexed in OpenSearch, so they are already excluded by default. |\n| <a id=\"property-importance\"></a> `importance?` | `boolean` \\| `null` | Filter by email importance. None to not filter. True to show only important emails (drafts, personal, sent, or uncategorized). False to show only unimportant emails (those categorized as promotions, social, updates, or forums). |\n| <a id=\"property-include_labels\"></a> `include_labels?` | `string`[] | Only include emails that have at least one of these labels. Supports both Gmail system labels (e.g. \"INBOX\", \"CATEGORY_PROMOTIONS\") and user-created labels (e.g. \"github\"). Empty to not filter by included labels. Note: SPAM and TRASH emails are not indexed in OpenSearch, so they will never appear in results regardless of this filter. |\n| <a id=\"property-is_read\"></a> `is_read?` | `boolean` \\| `null` | Filter by the email thread's read flag, independently of notification state. |\n| <a id=\"property-link_ids\"></a> `link_ids?` | `string`[] | Restrict to specific inboxes by email_links.id. Empty means \"any inbox the caller can access\" (soup expands to the full set at the router edge). |\n| <a id=\"property-notification_filters\"></a> `notification_filters?` | [`NotificationFilters`](NotificationFilters.md) | Filter by email notification state. |\n| <a id=\"property-project_ids\"></a> `project_ids?` | `string`[] | A list of project ids to search within. Empty to ignore project filtering. |\n| <a id=\"property-recipients\"></a> `recipients?` | `string`[] | Email Recipient addresses to filter by. Examples: ['[email protected]']. Empty if not filtering by Recipient. |\n| <a id=\"property-senders\"></a> `senders?` | `string`[] | Email sender addresses to filter by. Examples: ['[email protected]']. Empty to search all senders. |\n| <a id=\"property-shared\"></a> `shared?` | [`SharedEmailFilter`](SharedEmailFilter.md) | Controls whether shared email threads are included in results. Defaults to \"exclude\" (only the user's own threads). |\n\n\n<!-- generated/search/types.gen/type-aliases/EntityFilters.md -->\n# Type Alias: EntityFilters\n\n> **EntityFilters** = \\{ `agent_session_filters?`: [`AgentSessionFilters`](AgentSessionFilters.md); `calendar_event_filters?`: [`CalendarEventFilters`](CalendarEventFilters.md); `call_filters?`: [`CallFilters`](CallFilters.md); `channel_filters?`: [`ChannelFilters`](ChannelFilters.md); `channel_thread_filters?`: [`ChannelThreadFilters`](ChannelThreadFilters.md); `chat_filters?`: [`ChatFilters`](ChatFilters.md); `crm_company_filters?`: [`CrmCompanyFilters`](CrmCompanyFilters.md); `document_filters?`: [`DocumentFilters`](DocumentFilters.md); `email_filters?`: [`EmailFilters`](EmailFilters.md); `favorites_only?`: `boolean` \\| `null`; `foreign_entity_filters?`: [`ForeignEntityFilters`](ForeignEntityFilters.md); `initiative_filters?`: [`InitiativeFilters`](InitiativeFilters.md); `project_filters?`: [`ProjectFilters`](ProjectFilters.md); `property_filters?`: [`PropertyFilter`](PropertyFilter.md)[]; `tag_filter_mode?`: [`TagFilterMode`](TagFilterMode.md); `tag_option_ids?`: `string`[]; \\}\n\na bundle of all of the filters for each entity type\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-agent_session_filters\"></a> `agent_session_filters?` | [`AgentSessionFilters`](AgentSessionFilters.md) | the bundled [AgentSessionFilters] |\n| <a id=\"property-calendar_event_filters\"></a> `calendar_event_filters?` | [`CalendarEventFilters`](CalendarEventFilters.md) | the bundled [CalendarEventFilters] |\n| <a id=\"property-call_filters\"></a> `call_filters?` | [`CallFilters`](CallFilters.md) | the bundled [CallFilters] |\n| <a id=\"property-channel_filters\"></a> `channel_filters?` | [`ChannelFilters`](ChannelFilters.md) | the bundled [ChannelFilters] |\n| <a id=\"property-channel_thread_filters\"></a> `channel_thread_filters?` | [`ChannelThreadFilters`](ChannelThreadFilters.md) | the bundled [ChannelThreadFilters] |\n| <a id=\"property-chat_filters\"></a> `chat_filters?` | [`ChatFilters`](ChatFilters.md) | the bundled [ChatFilters] |\n| <a id=\"property-crm_company_filters\"></a> `crm_company_filters?` | [`CrmCompanyFilters`](CrmCompanyFilters.md) | the bundled [CrmCompanyFilters] |\n| <a id=\"property-document_filters\"></a> `document_filters?` | [`DocumentFilters`](DocumentFilters.md) | the bundled [DocumentFilters] |\n| <a id=\"property-email_filters\"></a> `email_filters?` | [`EmailFilters`](EmailFilters.md) | the bundled [EmailFilters] |\n| <a id=\"property-favorites_only\"></a> `favorites_only?` | `boolean` \\| `null` | Restrict results to the authenticated viewer's favorites when true. |\n| <a id=\"property-foreign_entity_filters\"></a> `foreign_entity_filters?` | [`ForeignEntityFilters`](ForeignEntityFilters.md) | the bundled [ForeignEntityFilters] |\n| <a id=\"property-initiative_filters\"></a> `initiative_filters?` | [`InitiativeFilters`](InitiativeFilters.md) | Initiative filters. Initiatives are opt-in. |\n| <a id=\"property-project_filters\"></a> `project_filters?` | [`ProjectFilters`](ProjectFilters.md) | the bundled [ProjectFilters] |\n| <a id=\"property-property_filters\"></a> `property_filters?` | [`PropertyFilter`](PropertyFilter.md)[] | property-based filters applied across entity types |\n| <a id=\"property-tag_filter_mode\"></a> `tag_filter_mode?` | [`TagFilterMode`](TagFilterMode.md) | How the `tag_option_ids` combine: `any` (default) matches entities holding at least one selected tag, `all` requires every selected tag. |\n| <a id=\"property-tag_option_ids\"></a> `tag_option_ids?` | `string`[] | tag option ids matched against `properties.values`, OR'd together across all tag definitions. Option ids are globally unique, so the match ignores the owning definition id (personal and team tags combine into one OR). |\n\n\n<!-- generated/search/types.gen/type-aliases/ForeignEntityFilters.md -->\n# Type Alias: ForeignEntityFilters\n\n> **ForeignEntityFilters** = \\{ `foreign_entity_ids?`: `string`[]; `foreign_entity_sources?`: `string`[]; `ids?`: `string`[]; `includes_me?`: `boolean`; `notification_filters?`: [`NotificationFilters`](NotificationFilters.md); \\}\n\nFilters for foreign entity records.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-foreign_entity_ids\"></a> `foreign_entity_ids?` | `string`[] | External entity identifiers to filter by. Empty to include all external IDs. |\n| <a id=\"property-foreign_entity_sources\"></a> `foreign_entity_sources?` | `string`[] | External source names to filter by. Empty to include all sources. |\n| <a id=\"property-ids\"></a> `ids?` | `string`[] | Internal foreign entity record IDs to filter by. Empty to include all records. |\n| <a id=\"property-includes_me\"></a> `includes_me?` | `boolean` | When true, only return foreign entities whose metadata lists the requesting user as a participant (GitHub `involves:me` semantics for `github_pull_request` records). False or absent applies no filter. Serialized in filter ASTs as the `\"me\"` literal. |\n| <a id=\"property-notification_filters\"></a> `notification_filters?` | [`NotificationFilters`](NotificationFilters.md) | Filter by the notification state of the foreign entity (e.g. whether the requesting user's GitHub PR notification is done/seen). |\n\n\n<!-- generated/search/types.gen/type-aliases/InitiativeFilters.md -->\n# Type Alias: InitiativeFilters\n\n> **InitiativeFilters** = \\{ `due_after?`: `string` \\| `null`; `due_before?`: `string` \\| `null`; `include?`: `boolean`; `initiative_ids?`: `string`[]; `name?`: `string` \\| `null`; `owners?`: `string`[]; \\}\n\nFilters for initiatives.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-due_after\"></a> `due_after?` | `string` \\| `null` | Inclusive lower due-date bound. |\n| <a id=\"property-due_before\"></a> `due_before?` | `string` \\| `null` | Inclusive upper due-date bound. |\n| <a id=\"property-include\"></a> `include?` | `boolean` | Opt this query into initiatives at all. Initiatives are off by default — see [`crate::ast::initiative::InitiativeLiteral::Include`]. Asking for specific `initiative_ids` or `owners` also opts in. |\n| <a id=\"property-initiative_ids\"></a> `initiative_ids?` | `string`[] | Initiative ids to filter by. Empty to include all accessible initiatives. |\n| <a id=\"property-name\"></a> `name?` | `string` \\| `null` | Case-insensitive name substring. |\n| <a id=\"property-owners\"></a> `owners?` | `string`[] | Filter by initiative owner principal — a user ('macro\\|[email protected]'), a bot ('bot\\|<uuid>'), or a team (a bare hyphenated uuid). Empty to include every owner. |\n\n\n<!-- generated/search/types.gen/type-aliases/NotificationFilters.md -->\n# Type Alias: NotificationFilters\n\n> **NotificationFilters** = \\{ `states?`: [`NotificationState`](NotificationState.md)[]; \\}\n\nNotification-level filters that apply to an entity type.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-states\"></a> `states?` | [`NotificationState`](NotificationState.md)[] | Include entities with a non-deleted notification in any of these exact states. Empty means no notification restriction. Active means `[unseen, seen]`. |\n\n\n<!-- generated/search/types.gen/type-aliases/NotificationState.md -->\n# Type Alias: NotificationState\n\n> **NotificationState** = `\"unseen\"` \\| `\"seen\"` \\| `\"done\"`\n\nThe mutually exclusive lifecycle states of a user's notification.\n\n\n<!-- generated/search/types.gen/type-aliases/ProjectFilters.md -->\n# Type Alias: ProjectFilters\n\n> **ProjectFilters** = \\{ `importance?`: `boolean` \\| `null`; `include_root?`: `boolean`; `notification_filters?`: [`NotificationFilters`](NotificationFilters.md); `owners?`: `string`[]; `project_ids?`: `string`[]; \\}\n\nThe project filters used to filter down what projects you search over.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-importance\"></a> `importance?` | `boolean` \\| `null` | Filter by project importance. None to ignore, true to pass through (no clause), false to short-circuit and return nothing. |\n| <a id=\"property-include_root\"></a> `include_root?` | `boolean` | When true, `project_ids` also matches the projects themselves in addition to their children. |\n| <a id=\"property-notification_filters\"></a> `notification_filters?` | [`NotificationFilters`](NotificationFilters.md) | Filter by project notification state. |\n| <a id=\"property-owners\"></a> `owners?` | `string`[] | Filter by project owner principal — a user ('macro\\|[email protected]'), a bot ('bot\\|<uuid>'), or a team (a bare hyphenated uuid). Examples: ['macro\\|[email protected]'], ['macro\\|[email protected]', 'bot\\|0199...']. Empty to search all owners. |\n| <a id=\"property-project_ids\"></a> `project_ids?` | `string`[] | Project IDs to search within. Examples: ['project1']. Empty to search all accessible projects. By default matches children of these projects; set `include_root` to also match the projects themselves. |\n\n\n<!-- generated/search/types.gen/type-aliases/PropertyFilter.md -->\n# Type Alias: PropertyFilter\n\n> **PropertyFilter** = \\{ `entity_ids?`: `string`[]; `entity_type?`: `string` \\| `null`; `option_ids?`: `string`[]; `property_definition_id`: `string`; \\}\n\nA single property-based filter condition.\n\nEach filter targets a specific property definition on entities of a given type,\nmatching against select option UUIDs or entity reference IDs.\nMultiple values within a single filter are OR'd together.\nMultiple filters are AND'd together.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entity_ids\"></a> `entity_ids?` | `string`[] | Entity reference IDs to match. Multiple values are OR'd together. |\n| <a id=\"property-entity_type\"></a> `entity_type?` | `string` \\| `null` | The entity type for the property lookup (e.g., \"TASK\", \"DOCUMENT\", \"PROJECT\"). When None, matches across all entity types. |\n| <a id=\"property-option_ids\"></a> `option_ids?` | `string`[] | Select option UUIDs to match. Multiple values are OR'd together. |\n| <a id=\"property-property_definition_id\"></a> `property_definition_id` | `string` | The UUID of the property definition to filter on. |\n\n\n<!-- generated/search/types.gen/type-aliases/SharedEmailFilter.md -->\n# Type Alias: SharedEmailFilter\n\n> **SharedEmailFilter** = `\"exclude\"` \\| `\"include\"` \\| `\"only\"`\n\nControls whether shared email threads are included in results.\n\n\n<!-- generated/search/types.gen/type-aliases/TagFilterMode.md -->\n# Type Alias: TagFilterMode\n\n> **TagFilterMode** = `\"any\"` \\| `\"all\"`\n\nHow multiple `tag_option_ids` combine when filtering.\n\n\n<!-- generated/search/types.gen/type-aliases/TaskFilters.md -->\n# Type Alias: TaskFilters\n\n> **TaskFilters** = \\{ `include_cbm_atm_nc?`: `boolean` \\| `null`; \\}\n\nTask-only filters nested under document filters.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-include_cbm_atm_nc\"></a> `include_cbm_atm_nc?` | `boolean` \\| `null` | Include tasks that are created by me, assigned to me, and not completed, even when they do not match other document filters. |\n\n\n<!-- generated/storage/types.gen/type-aliases/FavoriteEntityRef.md -->\n# Type Alias: FavoriteEntityRef\n\n> **FavoriteEntityRef** = \\{ `entityId`: `string`; `entityType`: `\"user\"` \\| `\"chat\"` \\| `\"channel\"` \\| `\"channel_message\"` \\| `\"document\"` \\| `\"project\"` \\| `\"email_thread\"` \\| `\"calendar_event\"` \\| `\"team\"` \\| `\"call\"` \\| `\"foreign_entity\"` \\| `\"static_file\"` \\| `\"crm_company\"` \\| `\"crm_contact\"` \\| `\"crm_pipeline\"` \\| `\"reminder\"` \\| `\"skill\"` \\| `\"agent_session\"` \\| `\"scheduled_action\"` \\| `\"initiative\"` \\| `\"database\"` \\| `\"database_row\"` \\| `\"form\"`; \\}\n\nA reference to a favorited entity.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entityid\"></a> `entityId` | `string` | The id of the favorited entity. |\n| <a id=\"property-entitytype\"></a> `entityType` | `\"user\"` \\| `\"chat\"` \\| `\"channel\"` \\| `\"channel_message\"` \\| `\"document\"` \\| `\"project\"` \\| `\"email_thread\"` \\| `\"calendar_event\"` \\| `\"team\"` \\| `\"call\"` \\| `\"foreign_entity\"` \\| `\"static_file\"` \\| `\"crm_company\"` \\| `\"crm_contact\"` \\| `\"crm_pipeline\"` \\| `\"reminder\"` \\| `\"skill\"` \\| `\"agent_session\"` \\| `\"scheduled_action\"` \\| `\"initiative\"` \\| `\"database\"` \\| `\"database_row\"` \\| `\"form\"` | The type of the favorited entity. |\n\n\n<!-- generated/storage/types.gen/type-aliases/SimpleMention.md -->\n# Type Alias: SimpleMention\n\n> **SimpleMention** = \\{ `entity_id`: `string`; `entity_type`: `string`; \\}\n\nA mention tracked in a message body.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | Mentioned entity identifier. |\n| <a id=\"property-entity_type\"></a> `entity_type` | `string` | Mentioned entity type. |\n\n\n<!-- generated/storage/types.gen/type-aliases/WebhookFilter.md -->\n# Type Alias: WebhookFilter\n\n> **WebhookFilter** = \\{ `events`: `string`[]; `ids?`: `string`[] \\| `null`; \\}\n\nEvent and optional entity-id constraints used to match webhook deliveries.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-events\"></a> `events` | `string`[] | Event names matched by this filter. |\n| <a id=\"property-ids\"></a> `ids?` | `string`[] \\| `null` | Entity ids matched by this filter. When absent, the filter matches all entity ids. |\n\n\n<!-- generated/storage/types.gen/type-aliases/WebhookScope.md -->\n# Type Alias: WebhookScope\n\n> **WebhookScope** = `\"user\"` \\| `\"team\"`\n\nScope that owns a newly-created webhook.\n\nClients serialize this, so both derives are used. `Display`/`FromStr`\nspell the same names as serde, for query strings and config values.\n\n\n<!-- src/config/interfaces/MacroOpts.md -->\n# Interface: MacroOpts\n\nOptions passed to `new Macro(opts)` and stored on `MacroClient`.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-auth\"></a> `auth?` | [`MacroAuth`](../type-aliases/MacroAuth.md) | How to authenticate. Takes precedence over `token`. Falls back to `MACRO_API_KEY` (a user API key or bearer token) or `MACRO_BOT_TOKEN` (bot). |\n| <a id=\"property-env\"></a> `env?` | [`Env`](../type-aliases/Env.md) | Which Macro environment to talk to. Falls back to the MACRO_ENV env var, then `'prod'`. |\n| <a id=\"property-hosts\"></a> `hosts?` | `Partial`\\<`Record`\\<[`ServiceName`](../type-aliases/ServiceName.md), `string`\\>\\> | Override individual service hosts (e.g. point one at localhost). |\n| <a id=\"property-onrequest\"></a> `onRequest?` | (`event`) => `void` | Optional generated API operation events; excludes arguments, URLs and response data. |\n| <a id=\"property-requestedas\"></a> `requestedAs?` | `string` | User id the bot acts for, sent as `x-macro-bot-for-macro-user-id` on every request. Bot auth only. Set via `macro.requestedAs(user)` rather than directly. |\n| <a id=\"property-token\"></a> `token?` | [`TokenSource`](../type-aliases/TokenSource.md) | Shorthand for `auth: { type: 'user', token }`. Accepts a Settings API key (`mak_…`) or a bearer token. |\n| <a id=\"property-webappurl\"></a> `webAppUrl?` | `string` | Override the web app base URL (e.g. for local frontend dev). Also reads MACRO_WEB_URL. |\n| <a id=\"property-webhooksecret\"></a> `webhookSecret?` | `string` | Signing secret for verifying incoming persisted-webhook deliveries. Required only for `macro.events.webhook()` / `macro.events.handle()`. SSE via `macro.events.listen()` uses the API token and does not need this. Falls back to MACRO_WEBHOOK_SECRET. |\n| <a id=\"property-wsverify\"></a> `wsVerify?` | `string` | - |\n\n\n<!-- src/config/type-aliases/BotScope.md -->\n# Type Alias: BotScope\n\n> **BotScope** = `\"user\"` \\| `\"team\"`\n\nAccess scope for bot-authenticated requests. `user` acts with the\nrequested-as user's access (requires `requestedAs`); `team` acts with the\nbot's owning team's access (team-owned bots only).\n\n\n<!-- src/config/type-aliases/Env.md -->\n# Type Alias: Env\n\n> **Env** = `\"dev\"` \\| `\"prod\"` \\| `\"local\"`\n\n\n<!-- src/config/type-aliases/MacroAuth.md -->\n# Type Alias: MacroAuth\n\n> **MacroAuth** = \\{ `apiKey?`: `never`; `token`: [`TokenSource`](TokenSource.md); `type`: `\"user\"`; \\} \\| \\{ `apiKey`: `string`; `token?`: `never`; `type`: `\"user\"`; \\} \\| \\{ `scope?`: [`BotScope`](BotScope.md); `token`: [`TokenSource`](TokenSource.md); `type`: `\"bot\"`; \\}\n\nHow the SDK authenticates with Macro.\n\nA user has exactly one of two credential fields.\n\n- `token`: a bearer token, or a `mak_` API key. The SDK picks the header\n from the prefix at send time.\n- `apiKey`: a Settings → API Keys key, always sent as\n `x-macro-user-api-key`. Not prefix-checked, so keys that predate the\n `mak_` prefix work here.\n\nA bot uses an `mbot_` token as `x-macro-bot-token` plus\n`x-macro-bot-scope`, defaulting to `user` when `requestedAs` is set and\n`team` otherwise.\n\n\n<!-- src/config/type-aliases/ServiceName.md -->\n# Type Alias: ServiceName\n\n> **ServiceName** = `\"agent-harness\"` \\| `\"storage\"` \\| `\"auth\"` \\| `\"email\"` \\| `\"calendar\"` \\| `\"cognition\"` \\| `\"notification\"` \\| `\"properties\"` \\| `\"search\"` \\| `\"scheduled-action\"` \\| `\"static-files\"` \\| `\"connection\"` \\| `\"contacts\"` \\| `\"unfurl\"`\n\nThe backend services the SDK talks to. Note `search` and `properties` are\nserved on the storage host, so they point there.\n\n\n<!-- src/config/type-aliases/TokenSource.md -->\n# Type Alias: TokenSource\n\n> **TokenSource** = `string` \\| (() => `string` \\| `Promise`\\<`string`\\>)\n\nA credential string, or a (possibly async) function that returns one.\n\n\n<!-- src/config/variables/HOSTS.md -->\n# Variable: HOSTS\n\n> `const` **HOSTS**: `Record`\\<[`Env`](../type-aliases/Env.md), `Record`\\<[`ServiceName`](../type-aliases/ServiceName.md), `string`\\>\\>\n\n\n<!-- src/config/variables/WEB_APP_URLS.md -->\n# Variable: WEB\\_APP\\_URLS\n\n> `const` **WEB\\_APP\\_URLS**: `Record`\\<[`Env`](../type-aliases/Env.md), `string`\\>\n\n\n<!-- src/entities/entity/classes/FavoritableEntity.md -->\n# Abstract Class: FavoritableEntity\\<Detail\\>\n\nAn entity the favorites API can address, and so can be (un)favorited.\n\n## Extends\n\n- [`MacroEntity`](MacroEntity.md)\\<`Detail`\\>\n\n## Extended by\n\n- [`CallRecord`](../../calls/call-record/classes/CallRecord.md)\n- [`Message`](../../channels/message/classes/Message.md)\n- [`Contact`](../../crm/contact/classes/Contact.md)\n- [`PropertiedEntity`](PropertiedEntity.md)\n- [`ForeignEntity`](../../foreign/foreign-entity/classes/ForeignEntity.md)\n\n## Type Parameters\n\n| Type Parameter |\n| ------ |\n| <a id=\"type-parameter-detail\"></a> `Detail` |\n\n## Implements\n\n- [`Favoritable`](../interfaces/Favoritable.md)\n\n## Properties\n\n| Property | Modifier | Type | Description | Inherited from |\n| ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-entitytype\"></a> `entityType` | `abstract readonly` | `\"project\"` \\| `\"user\"` \\| `\"team\"` \\| `\"chat\"` \\| `\"channel\"` \\| `\"channel_message\"` \\| `\"document\"` \\| `\"email_thread\"` \\| `\"calendar_event\"` \\| `\"call\"` \\| `\"foreign_entity\"` \\| `\"static_file\"` \\| `\"crm_company\"` \\| `\"crm_contact\"` \\| `\"crm_pipeline\"` \\| `\"reminder\"` \\| `\"skill\"` \\| `\"agent_session\"` \\| `\"scheduled_action\"` \\| `\"initiative\"` \\| `\"database\"` \\| `\"database_row\"` \\| `\"form\"` | How the entity-addressed APIs (favorites) identify this entity's type. | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](MacroEntity.md).[`id`](MacroEntity.md#property-id) |\n\n## Methods\n\n### favorite()\n\n> **favorite**(): `Promise`\\<`FavoritableEntity`\\<`Detail`\\>\\>\n\nAdd this entity to the user's favorites. Returns this handle for chaining.\nPlain unwrap: favoriting alters the user's favorites collection, not this\nentity's own detail, so there's nothing cached to invalidate.\n\n#### Returns\n\n`Promise`\\<`FavoritableEntity`\\<`Detail`\\>\\>\n\n#### Implementation of\n\n[`Favoritable`](../interfaces/Favoritable.md).[`favorite`](../interfaces/Favoritable.md#favorite)\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: `Detail`; `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: `Detail`; `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | `Detail` |\n| `id` | `string` |\n\n#### Inherited from\n\n[`MacroEntity`](MacroEntity.md).[`toJSON`](MacroEntity.md#tojson)\n\n***\n\n### unfavorite()\n\n> **unfavorite**(): `Promise`\\<`FavoritableEntity`\\<`Detail`\\>\\>\n\nRemove this entity from the user's favorites. Returns this handle for chaining.\n\n#### Returns\n\n`Promise`\\<`FavoritableEntity`\\<`Detail`\\>\\>\n\n#### Implementation of\n\n[`Favoritable`](../interfaces/Favoritable.md).[`unfavorite`](../interfaces/Favoritable.md#unfavorite)\n\n\n<!-- src/entities/entity/classes/MacroEntity.md -->\n# Abstract Class: MacroEntity\\<Detail\\>\n\nBase for entity handles: a free-to-construct `(client, id)` pair whose\ndetail record loads lazily on first field access and is dropped after any\nmutation. Subclasses implement fetch and build their surface from\nfield and mutate.\n\n## Extended by\n\n- [`AgentSession`](../../agent-sessions/agent-session/classes/AgentSession.md)\n- [`CodeExecution`](../../agent-sessions/code-execution/classes/CodeExecution.md)\n- [`SessionReview`](../../agent-sessions/review/classes/SessionReview.md)\n- [`Calendar`](../../calendar/calendar/classes/Calendar.md)\n- [`CalendarEvent`](../../calendar/event/classes/CalendarEvent.md)\n- [`CallMessage`](../../calls/message/classes/CallMessage.md)\n- [`CrmComment`](../../crm/comment/classes/CrmComment.md)\n- [`Database`](../../databases/database/classes/Database.md)\n- [`Comment`](../../documents/comment/classes/Comment.md)\n- [`EmailAttachment`](../../email/attachment/classes/EmailAttachment.md)\n- [`Label`](../../email/label/classes/Label.md)\n- [`Link`](../../email/link/classes/Link.md)\n- [`EmailMessage`](../../email/message/classes/EmailMessage.md)\n- [`FavoritableEntity`](FavoritableEntity.md)\n- [`Form`](../../forms/form/classes/Form.md)\n- [`Notification`](../../notifications/notification/classes/Notification.md)\n- [`Team`](../../teams/team/classes/Team.md)\n- [`Webhook`](../../webhooks/webhook/classes/Webhook.md)\n\n## Type Parameters\n\n| Type Parameter |\n| ------ |\n| <a id=\"type-parameter-detail\"></a> `Detail` |\n\n## Properties\n\n| Property | Modifier | Type |\n| ------ | ------ | ------ |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` |\n\n## Methods\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: `Detail`; `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: `Detail`; `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | `Detail` |\n| `id` | `string` |\n\n\n<!-- src/entities/entity/classes/PropertiedEntity.md -->\n# Abstract Class: PropertiedEntity\\<Detail\\>\n\nA favoritable entity that also carries user-defined properties.\n\n## Extends\n\n- [`FavoritableEntity`](FavoritableEntity.md)\\<`Detail`\\>\n\n## Extended by\n\n- [`Channel`](../../channels/channel/classes/Channel.md)\n- [`Chat`](../../chats/chat/classes/Chat.md)\n- [`Company`](../../crm/company/classes/Company.md)\n- [`Document`](../../documents/document/classes/Document.md)\n- [`EmailThread`](../../email/thread/classes/EmailThread.md)\n- [`Project`](../../projects/project/classes/Project.md)\n- [`User`](../../users/user/classes/User.md)\n\n## Type Parameters\n\n| Type Parameter |\n| ------ |\n| <a id=\"type-parameter-detail\"></a> `Detail` |\n\n## Implements\n\n- [`Propertied`](../interfaces/Propertied.md)\n\n## Properties\n\n| Property | Modifier | Type | Description | Inherited from |\n| ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-entitytype\"></a> `entityType` | `abstract readonly` | `\"project\"` \\| `\"user\"` \\| `\"team\"` \\| `\"chat\"` \\| `\"channel\"` \\| `\"channel_message\"` \\| `\"document\"` \\| `\"email_thread\"` \\| `\"calendar_event\"` \\| `\"call\"` \\| `\"foreign_entity\"` \\| `\"static_file\"` \\| `\"crm_company\"` \\| `\"crm_contact\"` \\| `\"crm_pipeline\"` \\| `\"reminder\"` \\| `\"skill\"` \\| `\"agent_session\"` \\| `\"scheduled_action\"` \\| `\"initiative\"` \\| `\"database\"` \\| `\"database_row\"` \\| `\"form\"` | How the entity-addressed APIs (favorites) identify this entity's type. | [`FavoritableEntity`](FavoritableEntity.md).[`entityType`](FavoritableEntity.md#property-entitytype) |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | - | [`FavoritableEntity`](FavoritableEntity.md).[`id`](FavoritableEntity.md#property-id) |\n\n## Methods\n\n### deleteProperty()\n\n> **deleteProperty**(`assignment`): `Promise`\\<`void`\\>\n\nRemove a property from this entity, given its [properties](#properties) entry.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `assignment` | [`EntityPropertyWithDefinition`](../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n#### Implementation of\n\n[`Propertied`](../interfaces/Propertied.md).[`deleteProperty`](../interfaces/Propertied.md#deleteproperty)\n\n***\n\n### favorite()\n\n> **favorite**(): `Promise`\\<`PropertiedEntity`\\<`Detail`\\>\\>\n\nAdd this entity to the user's favorites. Returns this handle for chaining.\nPlain unwrap: favoriting alters the user's favorites collection, not this\nentity's own detail, so there's nothing cached to invalidate.\n\n#### Returns\n\n`Promise`\\<`PropertiedEntity`\\<`Detail`\\>\\>\n\n#### Implementation of\n\n[`Propertied`](../interfaces/Propertied.md).[`favorite`](../interfaces/Propertied.md#favorite)\n\n#### Inherited from\n\n[`FavoritableEntity`](FavoritableEntity.md).[`favorite`](FavoritableEntity.md#favorite)\n\n***\n\n### properties()\n\n> **properties**(`opts?`): `Promise`\\<[`EntityPropertyWithDefinition`](../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md)[]\\>\n\nThe properties set on this entity, each with its definition, value, and options.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts?` | \\{ `includeMetadata?`: `boolean`; \\} |\n| `opts.includeMetadata?` | `boolean` |\n\n#### Returns\n\n`Promise`\\<[`EntityPropertyWithDefinition`](../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md)[]\\>\n\n#### Implementation of\n\n[`Propertied`](../interfaces/Propertied.md).[`properties`](../interfaces/Propertied.md#properties)\n\n***\n\n### propertyReference()\n\n> **propertyReference**(): [`PropertyTargetReference`](../../../../generated/properties/types.gen/type-aliases/PropertyTargetReference.md)\n\nThis entity's reference for bulk property operations.\n\n#### Returns\n\n[`PropertyTargetReference`](../../../../generated/properties/types.gen/type-aliases/PropertyTargetReference.md)\n\n***\n\n### setProperty()\n\n> **setProperty**(`property`, `value?`): `Promise`\\<`void`\\>\n\nSet a property value on this entity, or attach the property without a\nvalue when `value` is omitted.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `property` | [`PropertyDefinition`](../../properties/property-definition/classes/PropertyDefinition.md) |\n| `value?` | [`SetPropertyValue`](../../../../generated/properties/types.gen/type-aliases/SetPropertyValue.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n#### Implementation of\n\n[`Propertied`](../interfaces/Propertied.md).[`setProperty`](../interfaces/Propertied.md#setproperty)\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: `Detail`; `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: `Detail`; `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | `Detail` |\n| `id` | `string` |\n\n#### Inherited from\n\n[`FavoritableEntity`](FavoritableEntity.md).[`toJSON`](FavoritableEntity.md#tojson)\n\n***\n\n### unfavorite()\n\n> **unfavorite**(): `Promise`\\<`PropertiedEntity`\\<`Detail`\\>\\>\n\nRemove this entity from the user's favorites. Returns this handle for chaining.\n\n#### Returns\n\n`Promise`\\<`PropertiedEntity`\\<`Detail`\\>\\>\n\n#### Implementation of\n\n[`Propertied`](../interfaces/Propertied.md).[`unfavorite`](../interfaces/Propertied.md#unfavorite)\n\n#### Inherited from\n\n[`FavoritableEntity`](FavoritableEntity.md).[`unfavorite`](FavoritableEntity.md#unfavorite)\n\n***\n\n### updatePropertyOptions()\n\n> **updatePropertyOptions**(`changes`): `Promise`\\<[`BulkUpdateEntityPropertyOptionsResponse`](../../../../generated/properties/types.gen/type-aliases/BulkUpdateEntityPropertyOptionsResponse.md)\\>\n\nApply multi-select option deltas atomically across this entity's properties.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `changes` | [`PropertyOptionDelta`](../interfaces/PropertyOptionDelta.md)[] |\n\n#### Returns\n\n`Promise`\\<[`BulkUpdateEntityPropertyOptionsResponse`](../../../../generated/properties/types.gen/type-aliases/BulkUpdateEntityPropertyOptionsResponse.md)\\>\n\n\n<!-- src/entities/entity/interfaces/Favoritable.md -->\n# Interface: Favoritable\n\nAn entity that can be added to and removed from the user's favorites.\n\n## Extended by\n\n- [`Propertied`](Propertied.md)\n\n## Methods\n\n### favorite()\n\n> **favorite**(): `Promise`\\<`Favoritable`\\>\n\n#### Returns\n\n`Promise`\\<`Favoritable`\\>\n\n***\n\n### unfavorite()\n\n> **unfavorite**(): `Promise`\\<`Favoritable`\\>\n\n#### Returns\n\n`Promise`\\<`Favoritable`\\>\n\n\n<!-- src/entities/entity/interfaces/Propertied.md -->\n# Interface: Propertied\n\nA favoritable entity that also carries user-defined properties.\n\n## Extends\n\n- [`Favoritable`](Favoritable.md)\n\n## Methods\n\n### deleteProperty()\n\n> **deleteProperty**(`assignment`): `Promise`\\<`void`\\>\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `assignment` | [`EntityPropertyWithDefinition`](../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### favorite()\n\n> **favorite**(): `Promise`\\<`Propertied`\\>\n\n#### Returns\n\n`Promise`\\<`Propertied`\\>\n\n#### Inherited from\n\n[`Favoritable`](Favoritable.md).[`favorite`](Favoritable.md#favorite)\n\n***\n\n### properties()\n\n> **properties**(`opts?`): `Promise`\\<[`EntityPropertyWithDefinition`](../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md)[]\\>\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts?` | \\{ `includeMetadata?`: `boolean`; \\} |\n| `opts.includeMetadata?` | `boolean` |\n\n#### Returns\n\n`Promise`\\<[`EntityPropertyWithDefinition`](../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md)[]\\>\n\n***\n\n### setProperty()\n\n> **setProperty**(`property`, `value?`): `Promise`\\<`void`\\>\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `property` | [`PropertyDefinition`](../../properties/property-definition/classes/PropertyDefinition.md) |\n| `value?` | [`SetPropertyValue`](../../../../generated/properties/types.gen/type-aliases/SetPropertyValue.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### unfavorite()\n\n> **unfavorite**(): `Promise`\\<`Propertied`\\>\n\n#### Returns\n\n`Promise`\\<`Propertied`\\>\n\n#### Inherited from\n\n[`Favoritable`](Favoritable.md).[`unfavorite`](Favoritable.md#unfavorite)\n\n\n<!-- src/entities/entity/interfaces/PropertyOptionDelta.md -->\n# Interface: PropertyOptionDelta\n\nA delta to apply to one multi-select property.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-add\"></a> `add?` | [`PropertyOption`](../../properties/property-option/classes/PropertyOption.md)[] | Options to add to the property's current selection. |\n| <a id=\"property-property\"></a> `property` | [`PropertyDefinition`](../../properties/property-definition/classes/PropertyDefinition.md) | The multi-select property definition to update. |\n| <a id=\"property-remove\"></a> `remove?` | [`PropertyOption`](../../properties/property-option/classes/PropertyOption.md)[] | Options to remove from the property's current selection. |\n\n\n<!-- src/entities/entity/type-aliases/MacroEntityType.md -->\n# Type Alias: MacroEntityType\n\n> **MacroEntityType** = [`FavoriteEntityRef`](../../../../generated/storage/types.gen/type-aliases/FavoriteEntityRef.md)\\[`\"entityType\"`\\]\n\nHow the entity-addressed APIs (favorites) identify an entity's type.\n\n\n<!-- src/entities/search/functions/entitySearch.md -->\n# Function: entitySearch()\n\n> **entitySearch**\\<`T`, `K`\\>(`opts`): (`client`, `query`, `searchOpts?`) => `AsyncGenerator`\\<`T`\\>\n\nBuild a `search(client, query, opts?)` function for one entity type: unified\nsearch hits narrowed to `type`, each mapped through `make`.\nMost relevant first, auto-paginated.\n\n## Type Parameters\n\n| Type Parameter |\n| ------ |\n| <a id=\"type-parameter-t\"></a> `T` |\n| <a id=\"type-parameter-k\"></a> `K` *extends* `\"email\"` \\| `\"project\"` \\| `\"chat\"` \\| `\"channel\"` \\| `\"document\"` \\| `\"call\"` \\| `\"company\"` \\| `\"calendarEvent\"` \\| `\"agentSession\"` \\| `\"channelMessage\"` |\n\n## Parameters\n\n| Parameter | Type | Description |\n| ------ | ------ | ------ |\n| `opts` | \\{ `filters?`: [`EntityFilters`](../../../../generated/search/types.gen/type-aliases/EntityFilters.md); `includeCrm?`: `boolean`; `make`: (`client`, `hit`) => `T`; `type`: `K`; \\} | - |\n| `opts.filters?` | [`EntityFilters`](../../../../generated/search/types.gen/type-aliases/EntityFilters.md) | - |\n| `opts.includeCrm?` | `boolean` | Opt in to CRM results (off by default server-side; required for company hits). |\n| `opts.make` | (`client`, `hit`) => `T` | - |\n| `opts.type` | `K` | - |\n\n## Returns\n\n(`client`, `query`, `searchOpts?`) => `AsyncGenerator`\\<`T`\\>\n\n\n<!-- src/entities/search/interfaces/SearchOpts.md -->\n# Interface: SearchOpts\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-pagesize\"></a> `pageSize?` | `number` |\n| <a id=\"property-searchon\"></a> `searchOn?` | [`SearchOn`](../type-aliases/SearchOn.md) |\n\n\n<!-- src/entities/search/type-aliases/SearchOn.md -->\n# Type Alias: SearchOn\n\n> **SearchOn** = `\"name\"` \\| `\"content\"` \\| `\"name_content\"`\n\n\n<!-- src/events/receiver/classes/MacroEvents.md -->\n# Class: MacroEvents\n\nPer-instance event receiver. Subscribe with [MacroEvents.on](#on), then\neither [MacroEvents.listen](#listen) (SSE, the default) or mount\n[MacroEvents.webhook](#webhook) at a persisted webhook URL.\n\nObtain via `macro.events` — do not construct directly.\n\n## Constructors\n\n### Constructor\n\n> **new MacroEvents**(`client`, `secret?`): `MacroEvents`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `secret?` | `string` |\n\n#### Returns\n\n`MacroEvents`\n\n## Methods\n\n### handle()\n\n> **handle**(`rawBody`, `headers`): `Promise`\\<`void`\\>\n\nFeed a raw webhook delivery in: verifies the signature, parses, and\ndispatches to matching handlers.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `rawBody` | `string` |\n| `headers` | `DeliveryHeaders` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n#### Throws\n\nif no signing secret was configured, or if the\n signature is missing or invalid.\n\n***\n\n### listen()\n\n> **listen**(`opts?`): `Promise`\\<() => `void`\\>\n\nOpen a live Server-Sent Events stream of matching broker events. This is\nthe default way to receive events — no public URL or signing secret\nrequired. Delivery is best-effort: events published before the\nconnection, while disconnected, or dropped for a slow subscriber are\nmissed; there is no replay.\n\nFilters default to the event names currently registered with [on](#on).\nThe stream uses those filters for its lifetime; later `.on` / unsubscribe\ncalls do not change what the server sends.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts?` | [`ListenOptions`](../interfaces/ListenOptions.md) |\n\n#### Returns\n\n`Promise`\\<() => `void`\\>\n\nA function that closes the stream.\n\n***\n\n### on()\n\n> **on**\\<`E`\\>(`event`, `handler`): () => `void`\n\nSubscribe to an event across all entities.\n\n#### Type Parameters\n\n| Type Parameter |\n| ------ |\n| <a id=\"type-parameter-e\"></a> `E` *extends* `\"agent_session.opened\"` \\| `\"agent_session.turn_started\"` \\| `\"agent_session.turn_ended\"` \\| `\"agent_session.command_rejected\"` \\| `\"agent_session.settled\"` \\| `\"agent_session.waiting_for_input\"` \\| `\"agent_session.input_received\"` \\| `\"agent_session.mentioned\"` \\| `\"agent_session.stopped\"` \\| `\"agent_session.renamed\"` \\| `\"agent_session.deleted\"` \\| `\"channel.picture_changed\"` \\| `\"channel.created\"` \\| `\"channel.updated\"` \\| `\"channel.deleted\"` \\| `\"channel.participant_added\"` \\| `\"channel.participant_removed\"` \\| `\"document.created\"` \\| `\"document.updated\"` \\| `\"document.deleted\"` \\| `\"document.content_uploaded\"` \\| `\"document.sync_content_updated\"` \\| `\"document.purged\"` \\| `\"document.copied\"` \\| `\"document.interaction\"` \\| `\"message.posted\"` \\| `\"message.patched\"` \\| `\"message.deleted\"` \\| `\"message.mentioned\"` \\| `\"message.attachment_created\"` \\| `\"message.attachment_removed\"` |\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `event` | `E` |\n| `handler` | `EventHandler`\\<`E`\\> |\n\n#### Returns\n\nAn unsubscribe function.\n\n() => `void`\n\n***\n\n### onSelfMention()\n\n> **onSelfMention**(`handler`): () => `void`\n\nSubscribe to @-mentions of the authenticated caller: `message.mentioned`\ndeliveries whose mentioned entity is this bot (bot auth) or this user\n(user auth), in channels and in document comments alike.\n\n`message.mentioned` deliveries cover every mention the stream's (or\nwebhook's) workspace can access (its `ids` filter holds channel or\ndocument ids); picking out \"me\" happens here, client-side. The caller's\nidentity is resolved lazily (once) on the first delivery.\n\nFor SSE, register this handler before [listen](#listen) so the derived\nfilters include `message.mentioned`. For persisted webhooks, register the\nwebhook separately, e.g. `macro.webhooks.create({ filters: [{ events:\n['message.mentioned'] }], … })`.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `handler` | `EventHandler`\\<`\"message.mentioned\"`\\> |\n\n#### Returns\n\nAn unsubscribe function.\n\n() => `void`\n\n***\n\n### webhook()\n\n> **webhook**(): (`req`) => `Promise`\\<`Response`\\>\n\nA Fetch-style handler to mount at your persisted webhook route.\n\nRequires `webhookSecret` (or `MACRO_WEBHOOK_SECRET`).\n\n#### Returns\n\n(`req`) => `Promise`\\<`Response`\\>\n\n#### Example\n\n```ts\napp.post('/webhook', macro.events.webhook()); // Hono\n```\n\n\n<!-- src/events/receiver/interfaces/ListenOptions.md -->\n# Interface: ListenOptions\n\nOptions for [MacroEvents.listen](../classes/MacroEvents.md#listen).\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-filters\"></a> `filters?` | [`WebhookFilter`](../../../../generated/storage/types.gen/type-aliases/WebhookFilter.md)[] | Event/entity-id filters, identical to persisted webhook `filters`. Defaults to one filter covering every event currently registered with [MacroEvents.on](../classes/MacroEvents.md#on). |\n| <a id=\"property-scope\"></a> `scope?` | [`WebhookScope`](../../../../generated/storage/types.gen/type-aliases/WebhookScope.md) | Personal or team workspace whose webhook lifecycle events are delivered. Defaults to `'user'`. |\n| <a id=\"property-signal\"></a> `signal?` | `AbortSignal` | Abort the stream. |\n\n\n<!-- src/macro/classes/Macro.md -->\n# Class: Macro\\<T\\>\n\n## Type Parameters\n\n| Type Parameter | Default type |\n| ------ | ------ |\n| <a id=\"type-parameter-t\"></a> `T` *extends* [`MacroOpts`](../../config/interfaces/MacroOpts.md) | [`MacroOpts`](../../config/interfaces/MacroOpts.md) |\n\n## Constructors\n\n### Constructor\n\n> **new Macro**\\<`T`\\>(`opts`): `Macro`\\<`T`\\>\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts` | `T` |\n\n#### Returns\n\n`Macro`\\<`T`\\>\n\n## Properties\n\n| Property | Modifier | Type | Description |\n| ------ | ------ | ------ | ------ |\n| <a id=\"property-_client\"></a> `_client` | `readonly` | `MacroClient` | Direct access to the underlying hey-api service clients. |\n| <a id=\"property-agentsessions\"></a> `agentSessions` | `readonly` | [`AgentSessionNamespace`](../../entities/agent-sessions/namespace/classes/AgentSessionNamespace.md) | - |\n| <a id=\"property-ai\"></a> `ai` | `readonly` | [`AiNamespace`](../../entities/ai/namespace/classes/AiNamespace.md) | - |\n| <a id=\"property-bots\"></a> `bots` | `readonly` | [`BotsNamespace`](../../entities/bots/namespace/classes/BotsNamespace.md) | - |\n| <a id=\"property-calendar\"></a> `calendar` | `readonly` | [`CalendarNamespace`](../../entities/calendar/namespace/classes/CalendarNamespace.md) | - |\n| <a id=\"property-calls\"></a> `calls` | `readonly` | [`CallRecordNamespace`](../../entities/calls/namespace/classes/CallRecordNamespace.md) | - |\n| <a id=\"property-channels\"></a> `channels` | `readonly` | [`ChannelNamespace`](../../entities/channels/namespace/classes/ChannelNamespace.md) | - |\n| <a id=\"property-chats\"></a> `chats` | `readonly` | [`ChatNamespace`](../../entities/chats/namespace/classes/ChatNamespace.md) | - |\n| <a id=\"property-crm\"></a> `crm` | `readonly` | [`CrmNamespace`](../../entities/crm/namespace/classes/CrmNamespace.md) | - |\n| <a id=\"property-databases\"></a> `databases` | `readonly` | [`DatabaseNamespace`](../../entities/databases/namespace/classes/DatabaseNamespace.md) | - |\n| <a id=\"property-documents\"></a> `documents` | `readonly` | [`DocumentNamespace`](../../entities/documents/namespace/classes/DocumentNamespace.md) | - |\n| <a id=\"property-email\"></a> `email` | `readonly` | [`EmailNamespace`](../../entities/email/namespace/classes/EmailNamespace.md) | - |\n| <a id=\"property-events\"></a> `events` | `readonly` | [`MacroEvents`](../../events/receiver/classes/MacroEvents.md) | - |\n| <a id=\"property-favorites\"></a> `favorites` | `readonly` | [`FavoritesNamespace`](../../entities/favorites/namespace/classes/FavoritesNamespace.md) | - |\n| <a id=\"property-foreignentities\"></a> `foreignEntities` | `readonly` | [`ForeignEntityNamespace`](../../entities/foreign/namespace/classes/ForeignEntityNamespace.md) | - |\n| <a id=\"property-forms\"></a> `forms` | `readonly` | [`FormNamespace`](../../entities/forms/namespace/classes/FormNamespace.md) | Build forms and submit answers without granting respondents database access. |\n| <a id=\"property-notifications\"></a> `notifications` | `readonly` | [`NotificationNamespace`](../../entities/notifications/namespace/classes/NotificationNamespace.md) | - |\n| <a id=\"property-pins\"></a> `pins` | `readonly` | [`PinsNamespace`](../../entities/pins/namespace/classes/PinsNamespace.md) | - |\n| <a id=\"property-projects\"></a> `projects` | `readonly` | [`ProjectNamespace`](../../entities/projects/namespace/classes/ProjectNamespace.md) | - |\n| <a id=\"property-properties\"></a> `properties` | `readonly` | [`PropertiesNamespace`](../../entities/properties/namespace/classes/PropertiesNamespace.md) | - |\n| <a id=\"property-tasks\"></a> `tasks` | `readonly` | [`TaskNamespace`](../../entities/tasks/namespace/classes/TaskNamespace.md) | - |\n| <a id=\"property-teams\"></a> `teams` | `readonly` | [`TeamNamespace`](../../entities/teams/namespace/classes/TeamNamespace.md) | - |\n| <a id=\"property-users\"></a> `users` | `readonly` | [`UserNamespace`](../../entities/users/namespace/classes/UserNamespace.md) | - |\n| <a id=\"property-webappurl\"></a> `webAppUrl` | `readonly` | `string` | Base URL of the Macro web app, used to build entity URLs. |\n| <a id=\"property-webhooks\"></a> `webhooks` | `readonly` | [`WebhooksNamespace`](../../entities/webhooks/namespace/classes/WebhooksNamespace.md) | - |\n| <a id=\"property-workspace\"></a> `workspace` | `readonly` | [`WorkspaceNamespace`](../../entities/workspace/namespace/classes/WorkspaceNamespace.md) | Browse workspace activity with type, task, time, tag and inbox filters. |\n\n## Methods\n\n### myPrincipalId()\n\n> **myPrincipalId**(): `Promise`\\<`string`\\>\n\nThe authenticated caller's mentionable principal — `bot|<uuid>` for bot\nauth, `macro|<email>` for user auth — fetched once and cached.\n\n#### Returns\n\n`Promise`\\<`string`\\>\n\n***\n\n### requestedAs()\n\n> **requestedAs**(`user`): `Macro`\\<`T`\\>\n\nClone of this SDK acting on behalf of `user` (sent as\n`x-macro-bot-for-macro-user-id`). Bot auth only — throws for user auth,\nsince a user token always acts as its own user.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `user` | [`User`](../../entities/users/user/classes/User.md) |\n\n#### Returns\n\n`Macro`\\<`T`\\>\n\n\n<!-- src/macro/type-aliases/RequestActivity.md -->\n# Type Alias: RequestActivity\n\n> **RequestActivity** = \\{ `id`: `number`; `operation`: `string`; `service`: `string`; `status`: `\"started\"` \\| `\"completed\"` \\| `\"failed\"`; \\}\n\nA generated SDK operation lifecycle. Contains no arguments, URLs or response data.\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-id\"></a> `id` | `number` |\n| <a id=\"property-operation\"></a> `operation` | `string` |\n| <a id=\"property-service\"></a> `service` | `string` |\n| <a id=\"property-status\"></a> `status` | `\"started\"` \\| `\"completed\"` \\| `\"failed\"` |\n\n\n<!-- src/mentions/functions/msg.md -->\n# Function: msg()\n\n> **msg**(`strings`, ...`values`): [`RichMessage`](../interfaces/RichMessage.md)\n\nCompose a rich message. Interpolate mentions (a User, Document,\n[here](../variables/here.md), …) or plain strings. Each mention writes its `<m-*>` tag into the\ncontent *and* adds itself to `mentions[]`, so the two can never drift; strings\nare inserted as-is, so markdown like `**bold**` passes through untouched.\n\n## Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `strings` | `TemplateStringsArray` |\n| ...`values` | [`Interpolation`](../type-aliases/Interpolation.md)[] |\n\n## Returns\n\n[`RichMessage`](../interfaces/RichMessage.md)\n\n## Example\n\n```ts\nchannel.send(msg`Hey ${user}, see ${doc}. cc ${here}`);\nchannel.send(msg`Status: ${status} — see ${doc}`);\n```\n\n\n<!-- src/mentions/functions/toBody.md -->\n# Function: toBody()\n\n> **toBody**(`body`): [`RichMessage`](../interfaces/RichMessage.md)\n\nNormalize a plain string or a [RichMessage](../interfaces/RichMessage.md) to the wire shape.\n\n## Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `body` | `string` \\| [`RichMessage`](../interfaces/RichMessage.md) |\n\n## Returns\n\n[`RichMessage`](../interfaces/RichMessage.md)\n\n\n<!-- src/mentions/functions/wrapXml.md -->\n# Function: wrapXml()\n\n> **wrapXml**(`tag`, `data`): `string`\n\nSerialize a mention node to its `<tag>{json}</tag>` wire form.\n\n## Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `tag` | `string` |\n| `data` | `unknown` |\n\n## Returns\n\n`string`\n\n\n<!-- src/mentions/interfaces/MentionPart.md -->\n# Interface: MentionPart\n\nThe two things a mentionable entity contributes to a message.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-mention\"></a> `mention` | [`SimpleMention`](../../../generated/storage/types.gen/type-aliases/SimpleMention.md) | The parallel entry the backend uses for notifications and permissions. |\n| <a id=\"property-tag\"></a> `tag` | `string` | The `<m-*>` tag written into the message content. |\n\n\n<!-- src/mentions/interfaces/Mentionable.md -->\n# Interface: Mentionable\n\nAnything that can be dropped into a [msg](../functions/msg.md) template as a mention.\n\n## Methods\n\n### toMention()\n\n> **toMention**(): [`MentionPart`](MentionPart.md)\n\n#### Returns\n\n[`MentionPart`](MentionPart.md)\n\n\n<!-- src/mentions/interfaces/RichMessage.md -->\n# Interface: RichMessage\n\nA composed message body: content with embedded tags, and the matching mentions.\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-content\"></a> `content` | `string` |\n| <a id=\"property-mentions\"></a> `mentions` | [`SimpleMention`](../../../generated/storage/types.gen/type-aliases/SimpleMention.md)[] |\n\n\n<!-- src/mentions/type-aliases/Interpolation.md -->\n# Type Alias: Interpolation\n\n> **Interpolation** = [`Mentionable`](../interfaces/Mentionable.md) \\| `string` \\| `number`\n\nWhat may be interpolated into a [msg](../functions/msg.md) template: a mention, or plain text.\n\n\n<!-- src/mentions/variables/here.md -->\n# Variable: here\n\n> `const` **here**: [`Mentionable`](../interfaces/Mentionable.md)\n\nThe `@here` group mention.\n\n\n<!-- src/utils/lazy/classes/Lazy.md -->\n# Class: Lazy\\<T\\>\n\nA value fetched on first access and cached thereafter. Powers thin entity\nhandles: construction is free, the record is loaded lazily the first time a\nfield is read, and concurrent reads share one in-flight request. Pass a\n`seed` when the record is already known (from a list or an event) to skip the\nfetch entirely.\n\n## Type Parameters\n\n| Type Parameter |\n| ------ |\n| <a id=\"type-parameter-t\"></a> `T` |\n\n## Constructors\n\n### Constructor\n\n> **new Lazy**\\<`T`\\>(`loader`, `seed?`): `Lazy`\\<`T`\\>\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `loader` | () => `Promise`\\<`T`\\> |\n| `seed?` | `T` |\n\n#### Returns\n\n`Lazy`\\<`T`\\>\n\n## Methods\n\n### clear()\n\n> **clear**(): `void`\n\nDrop the cached value so the next read refetches.\n\n#### Returns\n\n`void`\n\n***\n\n### get()\n\n> **get**(): `Promise`\\<`T`\\>\n\n#### Returns\n\n`Promise`\\<`T`\\>\n\n***\n\n### peek()\n\n> **peek**(): `T` \\| `undefined`\n\nThe cached value, if already loaded — never triggers a fetch.\n\n#### Returns\n\n`T` \\| `undefined`\n\n\n<!-- src/utils/pagination/functions/paginate.md -->\n# Function: paginate()\n\n> **paginate**\\<`T`, `Cursor`\\>(`fetchPage`): `AsyncGenerator`\\<`T`\\>\n\nAsync generator over a cursor-paginated API. Iterate with `for await`.\nCursors are plain JSON values (strings or small objects), so a page whose\nnext cursor serialises identically to the one it was fetched with means the\nserver is not advancing; the generator throws instead of looping forever.\n\n## Type Parameters\n\n| Type Parameter | Default type |\n| ------ | ------ |\n| <a id=\"type-parameter-t\"></a> `T` | - |\n| <a id=\"type-parameter-cursor\"></a> `Cursor` | `string` |\n\n## Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `fetchPage` | (`cursor?`) => `Promise`\\<[`Page`](../interfaces/Page.md)\\<`T`, `Cursor`\\>\\> |\n\n## Returns\n\n`AsyncGenerator`\\<`T`\\>\n\n\n<!-- src/utils/pagination/interfaces/Page.md -->\n# Interface: Page\\<T, Cursor\\>\n\nOne page of a cursor-paginated list.\n\n## Type Parameters\n\n| Type Parameter | Default type |\n| ------ | ------ |\n| <a id=\"type-parameter-t\"></a> `T` | - |\n| <a id=\"type-parameter-cursor\"></a> `Cursor` | `string` |\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-items\"></a> `items` | `T`[] |\n| <a id=\"property-nextcursor\"></a> `nextCursor?` | `Cursor` \\| `null` |\n\n\n<!-- src/utils/unwrap/classes/MacroApiError.md -->\n# Class: MacroApiError\n\nA non-2xx HTTP response (Macro API, or a raw fetch like presigned downloads).\n\n## Extends\n\n- [`MacroError`](MacroError.md)\n\n## Extended by\n\n- [`MacroOpRefusedError`](../../../entities/databases/database/classes/MacroOpRefusedError.md)\n\n## Constructors\n\n### Constructor\n\n> **new MacroApiError**(`status`, `data`): `MacroApiError`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `status` | `number` |\n| `data` | `unknown` |\n\n#### Returns\n\n`MacroApiError`\n\n#### Overrides\n\n[`MacroError`](MacroError.md).[`constructor`](MacroError.md#constructor)\n\n## Properties\n\n| Property | Modifier | Type |\n| ------ | ------ | ------ |\n| <a id=\"property-data\"></a> `data` | `readonly` | `unknown` |\n| <a id=\"property-status\"></a> `status` | `readonly` | `number` |\n\n\n<!-- src/utils/unwrap/classes/MacroError.md -->\n# Class: MacroError\n\nBase for every error the SDK throws.\n\n## Extends\n\n- `Error`\n\n## Extended by\n\n- [`MacroApiError`](MacroApiError.md)\n- [`MacroNotFoundError`](MacroNotFoundError.md)\n\n## Constructors\n\n### Constructor\n\n> **new MacroError**(`message`): `MacroError`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `message` | `string` |\n\n#### Returns\n\n`MacroError`\n\n#### Overrides\n\n`Error.constructor`\n\n\n<!-- src/utils/unwrap/classes/MacroNotFoundError.md -->\n# Class: MacroNotFoundError\n\nThe API succeeded but the addressed entity doesn't exist in the result.\n\n## Extends\n\n- [`MacroError`](MacroError.md)\n\n## Constructors\n\n### Constructor\n\n> **new MacroNotFoundError**(`message`): `MacroNotFoundError`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `message` | `string` |\n\n#### Returns\n\n`MacroNotFoundError`\n\n#### Overrides\n\n[`MacroError`](MacroError.md).[`constructor`](MacroError.md#constructor)\n\n\n<!-- src/utils/unwrap/functions/unwrap.md -->\n# Function: unwrap()\n\n> **unwrap**\\<`TData`, `TError`\\>(`res`): `TData`\n\nTurn a hey-api `{ data, error, response? }` result into either the success\npayload or a thrown MacroApiError.\n\n## Type Parameters\n\n| Type Parameter |\n| ------ |\n| <a id=\"type-parameter-tdata\"></a> `TData` |\n| <a id=\"type-parameter-terror\"></a> `TError` |\n\n## Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `res` | \\{ `data?`: `TData`; `error?`: `TError`; `response?`: `Response`; \\} |\n| `res.data?` | `TData` |\n| `res.error?` | `TError` |\n| `res.response?` | `Response` |\n\n## Returns\n\n`TData`\n"+ "overview": "<!-- src/config/interfaces/MacroOpts.md -->\n# Interface: MacroOpts\n\nOptions passed to `new Macro(opts)` and stored on `MacroClient`.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-auth\"></a> `auth?` | [`MacroAuth`](../type-aliases/MacroAuth.md) | How to authenticate. Takes precedence over `token`. Falls back to `MACRO_API_KEY` (a user API key or bearer token) or `MACRO_BOT_TOKEN` (bot). |\n| <a id=\"property-env\"></a> `env?` | [`Env`](../type-aliases/Env.md) | Which Macro environment to talk to. Falls back to the MACRO_ENV env var, then `'prod'`. |\n| <a id=\"property-hosts\"></a> `hosts?` | `Partial`\\<`Record`\\<[`ServiceName`](../type-aliases/ServiceName.md), `string`\\>\\> | Override individual service hosts (e.g. point one at localhost). |\n| <a id=\"property-onrequest\"></a> `onRequest?` | (`event`) => `void` | Optional generated API operation events; excludes arguments, URLs and response data. |\n| <a id=\"property-requestedas\"></a> `requestedAs?` | `string` | User id the bot acts for, sent as `x-macro-bot-for-macro-user-id` on every request. Bot auth only. Set via `macro.requestedAs(user)` rather than directly. |\n| <a id=\"property-token\"></a> `token?` | [`TokenSource`](../type-aliases/TokenSource.md) | Shorthand for `auth: { type: 'user', token }`. Accepts a Settings API key (`mak_…`) or a bearer token. |\n| <a id=\"property-webappurl\"></a> `webAppUrl?` | `string` | Override the web app base URL (e.g. for local frontend dev). Also reads MACRO_WEB_URL. |\n| <a id=\"property-webhooksecret\"></a> `webhookSecret?` | `string` | Signing secret for verifying incoming persisted-webhook deliveries. Required only for `macro.events.webhook()` / `macro.events.handle()`. SSE via `macro.events.listen()` uses the API token and does not need this. Falls back to MACRO_WEBHOOK_SECRET. |\n| <a id=\"property-wsverify\"></a> `wsVerify?` | `string` | - |\n\n\n<!-- src/config/type-aliases/BotScope.md -->\n# Type Alias: BotScope\n\n> **BotScope** = `\"user\"` \\| `\"team\"`\n\nAccess scope for bot-authenticated requests. `user` acts with the\nrequested-as user's access (requires `requestedAs`); `team` acts with the\nbot's owning team's access (team-owned bots only).\n\n\n<!-- src/config/type-aliases/Env.md -->\n# Type Alias: Env\n\n> **Env** = `\"dev\"` \\| `\"prod\"` \\| `\"local\"`\n\n\n<!-- src/config/type-aliases/MacroAuth.md -->\n# Type Alias: MacroAuth\n\n> **MacroAuth** = \\{ `apiKey?`: `never`; `token`: [`TokenSource`](TokenSource.md); `type`: `\"user\"`; \\} \\| \\{ `apiKey`: `string`; `token?`: `never`; `type`: `\"user\"`; \\} \\| \\{ `scope?`: [`BotScope`](BotScope.md); `token`: [`TokenSource`](TokenSource.md); `type`: `\"bot\"`; \\}\n\nHow the SDK authenticates with Macro.\n\nA user has exactly one of two credential fields.\n\n- `token`: a bearer token, or a `mak_` API key. The SDK picks the header\n from the prefix at send time.\n- `apiKey`: a Settings → API Keys key, always sent as\n `x-macro-user-api-key`. Not prefix-checked, so keys that predate the\n `mak_` prefix work here.\n\nA bot uses an `mbot_` token as `x-macro-bot-token` plus\n`x-macro-bot-scope`, defaulting to `user` when `requestedAs` is set and\n`team` otherwise.\n\n\n<!-- src/config/type-aliases/ServiceName.md -->\n# Type Alias: ServiceName\n\n> **ServiceName** = `\"agent-harness\"` \\| `\"storage\"` \\| `\"auth\"` \\| `\"email\"` \\| `\"calendar\"` \\| `\"cognition\"` \\| `\"notification\"` \\| `\"properties\"` \\| `\"search\"` \\| `\"scheduled-action\"` \\| `\"static-files\"` \\| `\"connection\"` \\| `\"contacts\"` \\| `\"unfurl\"`\n\nThe backend services the SDK talks to. Note `search` and `properties` are\nserved on the storage host, so they point there.\n\n\n<!-- src/config/type-aliases/TokenSource.md -->\n# Type Alias: TokenSource\n\n> **TokenSource** = `string` \\| (() => `string` \\| `Promise`\\<`string`\\>)\n\nA credential string, or a (possibly async) function that returns one.\n\n\n<!-- src/config/variables/HOSTS.md -->\n# Variable: HOSTS\n\n> `const` **HOSTS**: `Record`\\<[`Env`](../type-aliases/Env.md), `Record`\\<[`ServiceName`](../type-aliases/ServiceName.md), `string`\\>\\>\n\n\n<!-- src/config/variables/WEB_APP_URLS.md -->\n# Variable: WEB\\_APP\\_URLS\n\n> `const` **WEB\\_APP\\_URLS**: `Record`\\<[`Env`](../type-aliases/Env.md), `string`\\>\n\n\n<!-- src/macro/classes/Macro.md -->\n# Class: Macro\\<T\\>\n\n## Type Parameters\n\n| Type Parameter | Default type |\n| ------ | ------ |\n| <a id=\"type-parameter-t\"></a> `T` *extends* [`MacroOpts`](../../config/interfaces/MacroOpts.md) | [`MacroOpts`](../../config/interfaces/MacroOpts.md) |\n\n## Constructors\n\n### Constructor\n\n> **new Macro**\\<`T`\\>(`opts`): `Macro`\\<`T`\\>\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts` | `T` |\n\n#### Returns\n\n`Macro`\\<`T`\\>\n\n## Properties\n\n| Property | Modifier | Type | Description |\n| ------ | ------ | ------ | ------ |\n| <a id=\"property-_client\"></a> `_client` | `readonly` | `MacroClient` | Direct access to the underlying hey-api service clients. |\n| <a id=\"property-agents\"></a> `agents` | `readonly` | [`AgentNamespace`](../../entities/agents/namespace/classes/AgentNamespace.md) | agents resources and operations. |\n| <a id=\"property-agentsessions\"></a> `agentSessions` | `readonly` | [`AgentSessionNamespace`](../../entities/agent-sessions/namespace/classes/AgentSessionNamespace.md) | - |\n| <a id=\"property-ai\"></a> `ai` | `readonly` | [`AiNamespace`](../../entities/ai/namespace/classes/AiNamespace.md) | - |\n| <a id=\"property-apikeys\"></a> `apiKeys` | `readonly` | [`ApiKeyNamespace`](../../entities/api-keys/namespace/classes/ApiKeyNamespace.md) | apiKeys resources and operations. |\n| <a id=\"property-bots\"></a> `bots` | `readonly` | [`BotsNamespace`](../../entities/bots/namespace/classes/BotsNamespace.md) | - |\n| <a id=\"property-calendar\"></a> `calendar` | `readonly` | [`CalendarNamespace`](../../entities/calendar/namespace/classes/CalendarNamespace.md) | - |\n| <a id=\"property-calls\"></a> `calls` | `readonly` | [`CallRecordNamespace`](../../entities/calls/namespace/classes/CallRecordNamespace.md) | - |\n| <a id=\"property-channels\"></a> `channels` | `readonly` | [`ChannelNamespace`](../../entities/channels/namespace/classes/ChannelNamespace.md) | - |\n| <a id=\"property-chats\"></a> `chats` | `readonly` | [`ChatNamespace`](../../entities/chats/namespace/classes/ChatNamespace.md) | - |\n| <a id=\"property-crm\"></a> `crm` | `readonly` | [`CrmNamespace`](../../entities/crm/namespace/classes/CrmNamespace.md) | - |\n| <a id=\"property-databases\"></a> `databases` | `readonly` | [`DatabaseNamespace`](../../entities/databases/namespace/classes/DatabaseNamespace.md) | - |\n| <a id=\"property-documents\"></a> `documents` | `readonly` | [`DocumentNamespace`](../../entities/documents/namespace/classes/DocumentNamespace.md) | - |\n| <a id=\"property-email\"></a> `email` | `readonly` | [`EmailNamespace`](../../entities/email/namespace/classes/EmailNamespace.md) | - |\n| <a id=\"property-entitymentions\"></a> `entityMentions` | `readonly` | [`EntityMentionNamespace`](../../entities/entity-mentions/namespace/classes/EntityMentionNamespace.md) | entityMentions resources and operations. |\n| <a id=\"property-events\"></a> `events` | `readonly` | [`MacroEvents`](../../events/receiver/classes/MacroEvents.md) | - |\n| <a id=\"property-favorites\"></a> `favorites` | `readonly` | [`FavoritesNamespace`](../../entities/favorites/namespace/classes/FavoritesNamespace.md) | - |\n| <a id=\"property-foreignentities\"></a> `foreignEntities` | `readonly` | [`ForeignEntityNamespace`](../../entities/foreign/namespace/classes/ForeignEntityNamespace.md) | - |\n| <a id=\"property-forms\"></a> `forms` | `readonly` | [`FormNamespace`](../../entities/forms/namespace/classes/FormNamespace.md) | Build forms and submit answers without granting respondents database access. |\n| <a id=\"property-githubpullrequests\"></a> `githubPullRequests` | `readonly` | [`GithubPullRequestNamespace`](../../entities/github-pull-requests/namespace/classes/GithubPullRequestNamespace.md) | githubPullRequests resources and operations. |\n| <a id=\"property-harnesses\"></a> `harnesses` | `readonly` | [`HarnessNamespace`](../../entities/harnesses/namespace/classes/HarnessNamespace.md) | harnesses resources and operations. |\n| <a id=\"property-initiatives\"></a> `initiatives` | `readonly` | [`InitiativeNamespace`](../../entities/initiatives/namespace/classes/InitiativeNamespace.md) | initiatives resources and operations. |\n| <a id=\"property-meetings\"></a> `meetings` | `readonly` | [`MeetingNamespace`](../../entities/meetings/namespace/classes/MeetingNamespace.md) | meetings resources and operations. |\n| <a id=\"property-notifications\"></a> `notifications` | `readonly` | [`NotificationNamespace`](../../entities/notifications/namespace/classes/NotificationNamespace.md) | - |\n| <a id=\"property-pins\"></a> `pins` | `readonly` | [`PinsNamespace`](../../entities/pins/namespace/classes/PinsNamespace.md) | - |\n| <a id=\"property-projects\"></a> `projects` | `readonly` | [`ProjectNamespace`](../../entities/projects/namespace/classes/ProjectNamespace.md) | - |\n| <a id=\"property-properties\"></a> `properties` | `readonly` | [`PropertiesNamespace`](../../entities/properties/namespace/classes/PropertiesNamespace.md) | - |\n| <a id=\"property-routines\"></a> `routines` | `readonly` | [`RoutineNamespace`](../../entities/routines/namespace/classes/RoutineNamespace.md) | routines resources and operations. |\n| <a id=\"property-tasks\"></a> `tasks` | `readonly` | [`TaskNamespace`](../../entities/tasks/namespace/classes/TaskNamespace.md) | - |\n| <a id=\"property-teams\"></a> `teams` | `readonly` | [`TeamNamespace`](../../entities/teams/namespace/classes/TeamNamespace.md) | - |\n| <a id=\"property-unfurls\"></a> `unfurls` | `readonly` | [`UnfurlNamespace`](../../entities/unfurls/namespace/classes/UnfurlNamespace.md) | unfurls resources and operations. |\n| <a id=\"property-users\"></a> `users` | `readonly` | [`UserNamespace`](../../entities/users/namespace/classes/UserNamespace.md) | - |\n| <a id=\"property-webappurl\"></a> `webAppUrl` | `readonly` | `string` | Base URL of the Macro web app, used to build entity URLs. |\n| <a id=\"property-webhooks\"></a> `webhooks` | `readonly` | [`WebhooksNamespace`](../../entities/webhooks/namespace/classes/WebhooksNamespace.md) | - |\n| <a id=\"property-workspace\"></a> `workspace` | `readonly` | [`WorkspaceNamespace`](../../entities/workspace/namespace/classes/WorkspaceNamespace.md) | Browse workspace activity with type, task, time, tag and inbox filters. |\n\n## Methods\n\n### myPrincipalId()\n\n> **myPrincipalId**(): `Promise`\\<`string`\\>\n\nThe authenticated caller's mentionable principal — `bot|<uuid>` for bot\nauth, `macro|<email>` for user auth — fetched once and cached.\n\n#### Returns\n\n`Promise`\\<`string`\\>\n\n***\n\n### requestedAs()\n\n> **requestedAs**(`user`): `Macro`\\<`T`\\>\n\nClone of this SDK acting on behalf of `user` (sent as\n`x-macro-bot-for-macro-user-id`). Bot auth only — throws for user auth,\nsince a user token always acts as its own user.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `user` | [`User`](../../entities/users/user/classes/User.md) |\n\n#### Returns\n\n`Macro`\\<`T`\\>\n\n\n<!-- src/macro/type-aliases/RequestActivity.md -->\n# Type Alias: RequestActivity\n\n> **RequestActivity** = \\{ `id`: `number`; `operation`: `string`; `service`: `string`; `status`: `\"started\"` \\| `\"completed\"` \\| `\"failed\"`; \\}\n\nA generated SDK operation lifecycle. Contains no arguments, URLs or response data.\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-id\"></a> `id` | `number` |\n| <a id=\"property-operation\"></a> `operation` | `string` |\n| <a id=\"property-service\"></a> `service` | `string` |\n| <a id=\"property-status\"></a> `status` | `\"started\"` \\| `\"completed\"` \\| `\"failed\"` |\n",+ "documentation": "# Macro SDK: core\n\nGenerated by TypeDoc. Paths below refer to the canonical Markdown hierarchy. Other entity handles are documented in their named section; request core for shared SDK helpers.\n\n<!-- generated/properties/types.gen/type-aliases/BulkUpdateEntityPropertyOptionsResponse.md -->\n# Type Alias: BulkUpdateEntityPropertyOptionsResponse\n\n> **BulkUpdateEntityPropertyOptionsResponse** = \\{ `properties`: [`EntityPropertyOptionSelectionResponse`](EntityPropertyOptionSelectionResponse.md)[]; \\}\n\nResponse for a bulk option update: each property's reconciled final ids.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-properties\"></a> `properties` | [`EntityPropertyOptionSelectionResponse`](EntityPropertyOptionSelectionResponse.md)[] | The final option ids per updated property. |\n\n\n<!-- generated/properties/types.gen/type-aliases/DataType.md -->\n# Type Alias: DataType\n\n> **DataType** = `\"BOOLEAN\"` \\| `\"DATE\"` \\| `\"NUMBER\"` \\| `\"STRING\"` \\| `\"SELECT_NUMBER\"` \\| `\"SELECT_STRING\"` \\| `\"TAG\"` \\| `\"ENTITY\"` \\| `\"LINK\"`\n\nData type for property values, determining storage and validation.\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityProperty.md -->\n# Type Alias: EntityProperty\n\n> **EntityProperty** = \\{ `created_at`: `string`; `entity_id`: `string`; `entity_type`: [`EntityType`](EntityType.md); `id`: `string`; `property_definition_id`: `string`; `updated_at`: `string`; \\}\n\nAssignment of a property definition to a specific entity (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-created_at\"></a> `created_at` | `string` |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` |\n| <a id=\"property-entity_type\"></a> `entity_type` | [`EntityType`](EntityType.md) |\n| <a id=\"property-id\"></a> `id` | `string` |\n| <a id=\"property-property_definition_id\"></a> `property_definition_id` | `string` |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityPropertyOptionSelectionResponse.md -->\n# Type Alias: EntityPropertyOptionSelectionResponse\n\n> **EntityPropertyOptionSelectionResponse** = \\{ `option_ids`: `string`[]; `property_id`: `string`; \\}\n\nThe reconciled final option ids stored for one property after a bulk update.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-option_ids\"></a> `option_ids` | `string`[] | The final option ids the server persisted, in stored order. |\n| <a id=\"property-property_id\"></a> `property_id` | `string` | The property definition the options belong to. |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md -->\n# Type Alias: EntityPropertyWithDefinition\n\n> **EntityPropertyWithDefinition** = \\{ `definition`: [`PropertyDefinition`](PropertyDefinition.md); `options?`: [`PropertyOption`](PropertyOption.md)[] \\| `null`; `property`: [`EntityProperty`](EntityProperty.md); `value?`: `null` \\| [`PropertyValue`](PropertyValue.md); \\}\n\nEntity property with its definition, value, and options (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-definition\"></a> `definition` | [`PropertyDefinition`](PropertyDefinition.md) |\n| <a id=\"property-options\"></a> `options?` | [`PropertyOption`](PropertyOption.md)[] \\| `null` |\n| <a id=\"property-property\"></a> `property` | [`EntityProperty`](EntityProperty.md) |\n| <a id=\"property-value\"></a> `value?` | `null` \\| [`PropertyValue`](PropertyValue.md) |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityReference.md -->\n# Type Alias: EntityReference\n\n> **EntityReference** = \\{ `entity_id`: `string`; `entity_type`: [`EntityType`](EntityType.md); `specific_message_id?`: `string` \\| `null`; \\}\n\nEntity reference for entity-type property values.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | - |\n| <a id=\"property-entity_type\"></a> `entity_type` | [`EntityType`](EntityType.md) | - |\n| <a id=\"property-specific_message_id\"></a> `specific_message_id?` | `string` \\| `null` | For CHANNEL, CHAT, THREAD entity types - optional specific message ID. This allows referencing a specific message within a thread/channel/chat. |\n\n\n<!-- generated/properties/types.gen/type-aliases/EntityType.md -->\n# Type Alias: EntityType\n\n> **EntityType** = `\"CALENDAR_EVENT\"` \\| `\"CALL_RECORD\"` \\| `\"CHANNEL\"` \\| `\"CHAT\"` \\| `\"COMPANY\"` \\| `\"DATABASE_ROW\"` \\| `\"CONTACT\"` \\| `\"DOCUMENT\"` \\| `\"INITIATIVE\"` \\| `\"PROJECT\"` \\| `\"TASK\"` \\| `\"THREAD\"` \\| `\"USER\"`\n\nType of entity that can be referenced by entity properties.\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyDefinition.md -->\n# Type Alias: PropertyDefinition\n\n> **PropertyDefinition** = \\{ `created_at`: `string`; `data_type`: [`DataType`](DataType.md); `display_name`: `string`; `id`: `string`; `is_metadata`: `boolean`; `is_multi_select`: `boolean`; `is_system`: `boolean`; `owner`: [`PropertyOwner`](PropertyOwner.md); `specific_entity_type`: `null` \\| [`EntityType`](EntityType.md); `updated_at`: `string`; \\}\n\nProperty definition model (service representation).\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | - |\n| <a id=\"property-data_type\"></a> `data_type` | [`DataType`](DataType.md) | - |\n| <a id=\"property-display_name\"></a> `display_name` | `string` | - |\n| <a id=\"property-id\"></a> `id` | `string` | - |\n| <a id=\"property-is_metadata\"></a> `is_metadata` | `boolean` | Flag to indicate if this is a system-generated metadata property. Not stored in database - computed at service layer. |\n| <a id=\"property-is_multi_select\"></a> `is_multi_select` | `boolean` | - |\n| <a id=\"property-is_system\"></a> `is_system` | `boolean` | Flag to indicate if this is a system property (stored in DB). |\n| <a id=\"property-owner\"></a> `owner` | [`PropertyOwner`](PropertyOwner.md) | - |\n| <a id=\"property-specific_entity_type\"></a> `specific_entity_type` | `null` \\| [`EntityType`](EntityType.md) | - |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` | - |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyOption.md -->\n# Type Alias: PropertyOption\n\n> **PropertyOption** = \\{ `color`: `string` \\| `null`; `created_at`: `string`; `display_order`: `number`; `id`: `string`; `property_definition_id`: `string`; `updated_at`: `string`; `value`: [`PropertyOptionValue`](PropertyOptionValue.md); \\}\n\nA selectable option for select-type properties (service representation).\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-color\"></a> `color` | `string` \\| `null` |\n| <a id=\"property-created_at\"></a> `created_at` | `string` |\n| <a id=\"property-display_order\"></a> `display_order` | `number` |\n| <a id=\"property-id\"></a> `id` | `string` |\n| <a id=\"property-property_definition_id\"></a> `property_definition_id` | `string` |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` |\n| <a id=\"property-value\"></a> `value` | [`PropertyOptionValue`](PropertyOptionValue.md) |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyOptionValue.md -->\n# Type Alias: PropertyOptionValue\n\n> **PropertyOptionValue** = \\{ `type`: `\"string\"`; `value`: `string`; \\} \\| \\{ `type`: `\"number\"`; `value`: `number`; \\}\n\nThe value of a property option - either a string or a number.\n\n## Union Members\n\n### Type Literal\n\n\\{ `type`: `\"string\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"string\"` | - |\n| `value` | `string` | String value for SelectString properties |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"number\"`; `value`: `number`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"number\"` | - |\n| `value` | `number` | Number value for SelectNumber properties |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyOwner.md -->\n# Type Alias: PropertyOwner\n\n> **PropertyOwner** = \\{ `scope`: `\"user\"`; `user_id`: `string`; \\} \\| \\{ `scope`: `\"team\"`; `team_id`: `string`; \\} \\| \\{ `database_id`: `string`; `scope`: `\"database\"`; \\} \\| \\{ `scope`: `\"system\"`; \\}\n\nDefines who owns a property - user-scoped, team-scoped, database-scoped, or system.\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyTargetEntityType.md -->\n# Type Alias: PropertyTargetEntityType\n\n> **PropertyTargetEntityType** = `\"CALL_RECORD\"` \\| `\"CHANNEL\"` \\| `\"CHAT\"` \\| `\"COMPANY\"` \\| `\"DATABASE_ROW\"` \\| `\"DOCUMENT\"` \\| `\"INITIATIVE\"` \\| `\"PROJECT\"` \\| `\"THREAD\"` \\| `\"USER\"`\n\nCanonical type of an entity receiving properties.\n\nTasks are documents at API boundaries. `Task` intentionally does not exist\nhere; task classification is resolved by the properties domain from the\ndocument subtype.\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyTargetReference.md -->\n# Type Alias: PropertyTargetReference\n\n> **PropertyTargetReference** = \\{ `entity_id`: `string`; `entity_type`: [`PropertyTargetEntityType`](PropertyTargetEntityType.md); \\}\n\nCanonical reference to an entity receiving properties.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | Entity identifier. |\n| <a id=\"property-entity_type\"></a> `entity_type` | [`PropertyTargetEntityType`](PropertyTargetEntityType.md) | Canonical entity type. |\n\n\n<!-- generated/properties/types.gen/type-aliases/PropertyValue.md -->\n# Type Alias: PropertyValue\n\n> **PropertyValue** = \\{ `type`: `\"Boolean\"`; `value`: `boolean`; \\} \\| \\{ `type`: `\"Number\"`; `value`: `number`; \\} \\| \\{ `type`: `\"String\"`; `value`: `string`; \\} \\| \\{ `type`: `\"Date\"`; `value`: `string`; \\} \\| \\{ `type`: `\"SelectOption\"`; `value`: `string`[]; \\} \\| \\{ `type`: `\"EntityReference\"`; `value`: [`EntityReference`](EntityReference.md)[]; \\} \\| \\{ `type`: `\"Link\"`; `value`: `string`[]; \\}\n\nProperty value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to/from JSONB in the database.\n\n## Union Members\n\n### Type Literal\n\n\\{ `type`: `\"Boolean\"`; `value`: `boolean`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Boolean\"` | - |\n| `value` | `boolean` | Boolean value Serializes as: {\"type\": \"Boolean\", \"value\": true} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"Number\"`; `value`: `number`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Number\"` | - |\n| `value` | `number` | Numeric value Serializes as: {\"type\": \"Number\", \"value\": 42.5} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"String\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"String\"` | - |\n| `value` | `string` | String value Serializes as: {\"type\": \"String\", \"value\": \"text\"} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"Date\"`; `value`: `string`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Date\"` | - |\n| `value` | `string` | Date/timestamp value Serializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"} |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"SelectOption\"`; `value`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"SelectOption\"` | - |\n| `value` | `string`[] | Select option(s) - always an array (check is_multi_select to determine if single or multi) Single-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1) Multi-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+) |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"EntityReference\"`; `value`: [`EntityReference`](EntityReference.md)[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"EntityReference\"` | - |\n| `value` | [`EntityReference`](EntityReference.md)[] | Entity reference(s) - always an array (check is_multi_select to determine if single or multi) Single-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1) Multi-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+) |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"Link\"`; `value`: `string`[]; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `type` | `\"Link\"` | - |\n| `value` | `string`[] | Link value(s) - always an array (check is_multi_select to determine if single or multi) Single-select: {\"type\": \"Link\", \"value\": [\"https://example.com\"]} (length 0 or 1) Multi-select: {\"type\": \"Link\", \"value\": [\"https://example.com\", \"https://other.com\"]} (length 0+) |\n\n\n<!-- generated/properties/types.gen/type-aliases/SetPropertyValue.md -->\n# Type Alias: SetPropertyValue\n\n> **SetPropertyValue** = \\{ `type`: `\"boolean\"`; `value`: `boolean`; \\} \\| \\{ `type`: `\"date\"`; `value`: `string`; \\} \\| \\{ `type`: `\"number\"`; `value`: `number`; \\} \\| \\{ `type`: `\"string\"`; `value`: `string`; \\} \\| \\{ `option_id`: `string`; `type`: `\"select_option\"`; \\} \\| \\{ `option_ids`: `string`[]; `type`: `\"multi_select_option\"`; \\} \\| \\{ `reference`: [`EntityReference`](EntityReference.md); `type`: `\"entity_reference\"`; \\} \\| \\{ `references`: [`EntityReference`](EntityReference.md)[]; `type`: `\"multi_entity_reference\"`; \\} \\| \\{ `type`: `\"link\"`; `url`: `string`; \\} \\| \\{ `type`: `\"multi_link\"`; `urls`: `string`[]; \\}\n\nType-safe enum for setting entity property values - provides compile-time validation.\n\n\n<!-- generated/search/types.gen/type-aliases/AgentSessionFilters.md -->\n# Type Alias: AgentSessionFilters\n\n> **AgentSessionFilters** = \\{ `ids?`: `string`[]; `include?`: `boolean`; `owners?`: `string`[]; \\}\n\nFilters for agent sessions.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-ids\"></a> `ids?` | `string`[] | Agent session ids to filter by. Empty to include all accessible sessions. |\n| <a id=\"property-include\"></a> `include?` | `boolean` | Opt this query into agent sessions at all. Agent sessions are off by default — see [`crate::ast::agent_session::AgentSessionLiteral::Include`]. Asking for specific `ids` or `owners` also opts in. |\n| <a id=\"property-owners\"></a> `owners?` | `string`[] | Filter by session owner principal — a user ('macro\\|[email protected]'), a bot ('bot\\|<uuid>'), or a team (a bare hyphenated uuid). Empty to include every owner. |\n\n\n<!-- generated/search/types.gen/type-aliases/CalendarEventFilters.md -->\n# Type Alias: CalendarEventFilters\n\n> **CalendarEventFilters** = \\{ `attendees?`: `string`[]; `calendar_event_ids?`: `string`[]; `ends_after?`: `string` \\| `null`; `organizers?`: `string`[]; `starts_before?`: `string` \\| `null`; `statuses?`: `string`[]; \\}\n\nFilters for canonical calendar-event entities.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-attendees\"></a> `attendees?` | `string`[] | Attendee email addresses. |\n| <a id=\"property-calendar_event_ids\"></a> `calendar_event_ids?` | `string`[] | Canonical event ids. |\n| <a id=\"property-ends_after\"></a> `ends_after?` | `string` \\| `null` | Include master events ending after this instant. |\n| <a id=\"property-organizers\"></a> `organizers?` | `string`[] | Organizer email addresses. |\n| <a id=\"property-starts_before\"></a> `starts_before?` | `string` \\| `null` | Include master events starting before this instant. |\n| <a id=\"property-statuses\"></a> `statuses?` | `string`[] | Event statuses such as `confirmed`, `tentative`, or `cancelled`. |\n\n\n<!-- generated/search/types.gen/type-aliases/CallFilters.md -->\n# Type Alias: CallFilters\n\n> **CallFilters** = \\{ `attended?`: `boolean` \\| `null`; `call_ids?`: `string`[]; `channel_ids?`: `string`[]; `speaker_ids?`: `string`[]; `status?`: `null` \\| [`CallStatus`](CallStatus.md); \\}\n\nFilters for call records.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-attended\"></a> `attended?` | `boolean` \\| `null` | Legacy filter by whether the requesting user attended the call. Prefer [`CallFilters::status`] for new callers. `None` = no filter, `Some(true)` = only calls the user joined, `Some(false)` = only calls the user did not join. |\n| <a id=\"property-call_ids\"></a> `call_ids?` | `string`[] | Call record IDs to filter by. Empty to include all calls. |\n| <a id=\"property-channel_ids\"></a> `channel_ids?` | `string`[] | Channel IDs to filter calls by. Empty to include all calls. |\n| <a id=\"property-speaker_ids\"></a> `speaker_ids?` | `string`[] | Speaker macro user ids. Empty to include all. |\n| <a id=\"property-status\"></a> `status?` | `null` \\| [`CallStatus`](CallStatus.md) | - |\n\n\n<!-- generated/search/types.gen/type-aliases/CallStatus.md -->\n# Type Alias: CallStatus\n\n> **CallStatus** = `\"ATTENDED\"` \\| `\"MISSED\"` \\| `\"UNATTENDED\"`\n\nViewer-relative attendance status for a call record.\nSerializes as `ATTENDED`, `MISSED`, or `UNATTENDED`.\n\n\n<!-- generated/search/types.gen/type-aliases/ChannelFilters.md -->\n# Type Alias: ChannelFilters\n\n> **ChannelFilters** = \\{ `channel_ids?`: `string`[]; `channel_types?`: `string`[]; `importance?`: `boolean` \\| `null`; `is_participant?`: `boolean` \\| `null`; `mentions?`: `string`[]; `notification_filters?`: [`NotificationFilters`](NotificationFilters.md); `org_id?`: `number` \\| `null`; `sender_ids?`: `string`[]; `team_id?`: `string` \\| `null`; `thread_ids?`: `string`[]; \\}\n\nThe channel message filters used to filter down what channel messages you search over.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-channel_ids\"></a> `channel_ids?` | `string`[] | Channel IDs to search within. Examples: ['general']. Empty to search all accessible channels. |\n| <a id=\"property-channel_types\"></a> `channel_types?` | `string`[] | Channel types to filter by. Examples: ['public'], ['direct_message', 'private']. Empty to search all channel types. |\n| <a id=\"property-importance\"></a> `importance?` | `boolean` \\| `null` | Filter by channel importance. None to ignore, true to pass through (no clause), false to short-circuit and return nothing. |\n| <a id=\"property-is_participant\"></a> `is_participant?` | `boolean` \\| `null` | Filter by whether the requesting user is an active participant of the channel. Presence of this filter also widens the candidate set to team channels of the user's teams that they have not joined, so `false` matches those channels. None to ignore (participant channels only, today's default). |\n| <a id=\"property-mentions\"></a> `mentions?` | `string`[] | Channel user mentions to search for. Examples: ['@username']. Empty if not filtering by mentions. |\n| <a id=\"property-notification_filters\"></a> `notification_filters?` | [`NotificationFilters`](NotificationFilters.md) | Filter by channel notification state. |\n| <a id=\"property-org_id\"></a> `org_id?` | `number` \\| `null` | Channel organization ID to search within. Empty to ignore organization filtering. |\n| <a id=\"property-sender_ids\"></a> `sender_ids?` | `string`[] | Sender IDs to search within. Examples: ['user1']. Empty to search all accessible senders. |\n| <a id=\"property-team_id\"></a> `team_id?` | `string` \\| `null` | Channel team ID to search within. Empty to ignore team filtering. |\n| <a id=\"property-thread_ids\"></a> `thread_ids?` | `string`[] | Channel thread IDs to search within. Examples: ['thread123']. Empty to search all threads. |\n\n\n<!-- generated/search/types.gen/type-aliases/ChannelThreadFilters.md -->\n# Type Alias: ChannelThreadFilters\n\n> **ChannelThreadFilters** = \\{ `channel_ids?`: `string`[]; `participant_ids?`: `string`[]; `root_sender_ids?`: `string`[]; `thread_ids?`: `string`[]; \\}\n\nThe channel thread filters used to filter down channel-thread entities.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-channel_ids\"></a> `channel_ids?` | `string`[] | Channel IDs containing the thread. Empty to include threads from all accessible channels. |\n| <a id=\"property-participant_ids\"></a> `participant_ids?` | `string`[] | Thread participant user IDs. A participant is the root message sender, anyone who replied in the thread, or anyone @-mentioned in the thread (group mentions like **Here** count through their per-user expansion at send time). Empty to include threads regardless of participants. |\n| <a id=\"property-root_sender_ids\"></a> `root_sender_ids?` | `string`[] | Sender IDs for the root thread message. Empty to include all root senders. |\n| <a id=\"property-thread_ids\"></a> `thread_ids?` | `string`[] | Channel thread parent message IDs to include. Empty to include all accessible threads. |\n\n\n<!-- generated/search/types.gen/type-aliases/ChatFilters.md -->\n# Type Alias: ChatFilters\n\n> **ChatFilters** = \\{ `chat_ids?`: `string`[]; `importance?`: `boolean` \\| `null`; `notification_filters?`: [`NotificationFilters`](NotificationFilters.md); `owners?`: `string`[]; `project_ids?`: `string`[]; `role?`: `string`[]; \\}\n\nThe chat filters used to filter down what chats you search over.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-chat_ids\"></a> `chat_ids?` | `string`[] | Chat ids to search over. Examples: ['chat1'], ['chat1', 'chat2']. When provided, chat search will only match results on these chats. Empty to search all accessible chats. |\n| <a id=\"property-importance\"></a> `importance?` | `boolean` \\| `null` | Filter by chat importance. None to ignore, true to pass through (no clause), false to short-circuit and return nothing. |\n| <a id=\"property-notification_filters\"></a> `notification_filters?` | [`NotificationFilters`](NotificationFilters.md) | Filter by chat notification state. |\n| <a id=\"property-owners\"></a> `owners?` | `string`[] | Filter by chat owner principal — a user ('macro\\|[email protected]'), a bot ('bot\\|<uuid>'), or a team (a bare hyphenated uuid). Examples: ['macro\\|[email protected]'], ['macro\\|[email protected]', 'bot\\|0199...']. Empty to search all owners. |\n| <a id=\"property-project_ids\"></a> `project_ids?` | `string`[] | A list of project ids to search within. Examples: ['project1']. Empty to ignore project filtering. |\n| <a id=\"property-role\"></a> `role?` | `string`[] | Chat message roles to search. Examples: ['user'], ['assistant']. Empty to search all roles. |\n\n\n<!-- generated/search/types.gen/type-aliases/CrmCompanyFilters.md -->\n# Type Alias: CrmCompanyFilters\n\n> **CrmCompanyFilters** = \\{ `company_ids?`: `string`[]; `hidden?`: `boolean` \\| `null`; \\}\n\nThe crm company filters used to narrow which CRM companies appear in soup.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-company_ids\"></a> `company_ids?` | `string`[] | CRM company ids to filter by. Examples: ['11111111-...']. Empty to include all of the team's visible CRM companies. |\n| <a id=\"property-hidden\"></a> `hidden?` | `boolean` \\| `null` | Optional `crm_companies.hidden` filter. `None` = visible only (default for back-compat with non-admin callers). `Some(false)` = visible only (explicit). `Some(true)` = hidden only — requires admin/owner team role; enforced by the CRM service from the caller's team receipt. |\n\n\n<!-- generated/search/types.gen/type-aliases/DocumentFilters.md -->\n# Type Alias: DocumentFilters\n\n> **DocumentFilters** = \\{ `document_ids?`: `string`[]; `file_types?`: `string`[]; `importance?`: `boolean` \\| `null`; `is_email_attachment?`: `boolean` \\| `null`; `notification_filters?`: [`NotificationFilters`](NotificationFilters.md); `owners?`: `string`[]; `project_ids?`: `string`[]; `sub_types?`: `string`[]; `task_filters?`: [`TaskFilters`](TaskFilters.md); \\}\n\nThe document filters used to filter down what documents you search over.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-document_ids\"></a> `document_ids?` | `string`[] | Document ids to search over. Examples: ['doc1'], ['doc1', 'doc2']. Empty to search all accessible documents. |\n| <a id=\"property-file_types\"></a> `file_types?` | `string`[] | Document file types to search. Examples: ['pdf'], ['md', 'txt']. Empty to search all file types. |\n| <a id=\"property-importance\"></a> `importance?` | `boolean` \\| `null` | Filter by document importance. None to ignore, true to pass through (no clause), false to short-circuit and return nothing. |\n| <a id=\"property-is_email_attachment\"></a> `is_email_attachment?` | `boolean` \\| `null` | Filter by email attachment status. true = only email attachments, false = only non-email attachments, None = both. |\n| <a id=\"property-notification_filters\"></a> `notification_filters?` | [`NotificationFilters`](NotificationFilters.md) | Filter by document notification state. |\n| <a id=\"property-owners\"></a> `owners?` | `string`[] | Filter by document owner principal — a user ('macro\\|[email protected]'), a bot ('bot\\|<uuid>'), or a team (a bare hyphenated uuid). Examples: ['macro\\|[email protected]'], ['macro\\|[email protected]', 'bot\\|0199...']. Empty to search all owners. |\n| <a id=\"property-project_ids\"></a> `project_ids?` | `string`[] | A list of project ids to search within. Examples: ['project1']. filtering. Empty to ignore project filtering. |\n| <a id=\"property-sub_types\"></a> `sub_types?` | `string`[] | Filter by document sub type. Examples: ['task']. Empty to search all sub types. |\n| <a id=\"property-task_filters\"></a> `task_filters?` | [`TaskFilters`](TaskFilters.md) | Task-specific filters that only apply to task subtype documents. |\n\n\n<!-- generated/search/types.gen/type-aliases/EmailFilters.md -->\n# Type Alias: EmailFilters\n\n> **EmailFilters** = \\{ `bcc?`: `string`[]; `calendar_only?`: `boolean` \\| `null`; `cc?`: `string`[]; `crm_addresses?`: `string`[]; `crm_domains?`: `string`[]; `email_thread_ids?`: `string`[]; `exclude_labels?`: `string`[]; `importance?`: `boolean` \\| `null`; `include_labels?`: `string`[]; `is_read?`: `boolean` \\| `null`; `link_ids?`: `string`[]; `notification_filters?`: [`NotificationFilters`](NotificationFilters.md); `project_ids?`: `string`[]; `recipients?`: `string`[]; `senders?`: `string`[]; `shared?`: [`SharedEmailFilter`](SharedEmailFilter.md); \\}\n\nThe email filters used to filter down what emails you search over.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-bcc\"></a> `bcc?` | `string`[] | Email BCC addresses to filter by. Examples: ['[email protected]']. Empty if not filtering by BCC. |\n| <a id=\"property-calendar_only\"></a> `calendar_only?` | `boolean` \\| `null` | When `Some(true)`, only include threads that have at least one message with an iCalendar attachment (`.ics` filename or `application/ics` mime type). `Some(false)` and `None` apply no constraint. |\n| <a id=\"property-cc\"></a> `cc?` | `string`[] | Email CC addresses to filter by. Examples: ['[email protected]']. Empty if not filtering by CC. |\n| <a id=\"property-crm_addresses\"></a> `crm_addresses?` | `string`[] | CRM-scoped address filter. When non-empty, expands visibility to every teammate's mailbox and restricts to threads involving any of these fully-qualified addresses. Each address is authorized against `crm_contacts` + `crm_companies` (contact must not be hidden, company must not be hidden, `email_sync` must be true). Mutually exclusive with `crm_domains`. |\n| <a id=\"property-crm_domains\"></a> `crm_domains?` | `string`[] | CRM-scoped domain filter. When non-empty, expands visibility to every teammate's mailbox and restricts to threads involving any of these domains (in any of sender/cc/bcc/recipient). Each domain is authorized against `crm_domains` + `crm_companies` (must exist for the caller's team, company must not be hidden, `email_sync` must be true). Mutually exclusive with `crm_addresses`. |\n| <a id=\"property-email_thread_ids\"></a> `email_thread_ids?` | `string`[] | Email thread IDs to filter by. Examples: ['thread-uuid-1']. Empty to search all threads. |\n| <a id=\"property-exclude_labels\"></a> `exclude_labels?` | `string`[] | Exclude emails that have any of these labels. Supports both Gmail system labels (e.g. \"CATEGORY_PROMOTIONS\") and user-created labels. Empty to not exclude any labels. Note: SPAM and TRASH emails are not indexed in OpenSearch, so they are already excluded by default. |\n| <a id=\"property-importance\"></a> `importance?` | `boolean` \\| `null` | Filter by email importance. None to not filter. True to show only important emails (drafts, personal, sent, or uncategorized). False to show only unimportant emails (those categorized as promotions, social, updates, or forums). |\n| <a id=\"property-include_labels\"></a> `include_labels?` | `string`[] | Only include emails that have at least one of these labels. Supports both Gmail system labels (e.g. \"INBOX\", \"CATEGORY_PROMOTIONS\") and user-created labels (e.g. \"github\"). Empty to not filter by included labels. Note: SPAM and TRASH emails are not indexed in OpenSearch, so they will never appear in results regardless of this filter. |\n| <a id=\"property-is_read\"></a> `is_read?` | `boolean` \\| `null` | Filter by the email thread's read flag, independently of notification state. |\n| <a id=\"property-link_ids\"></a> `link_ids?` | `string`[] | Restrict to specific inboxes by email_links.id. Empty means \"any inbox the caller can access\" (soup expands to the full set at the router edge). |\n| <a id=\"property-notification_filters\"></a> `notification_filters?` | [`NotificationFilters`](NotificationFilters.md) | Filter by email notification state. |\n| <a id=\"property-project_ids\"></a> `project_ids?` | `string`[] | A list of project ids to search within. Empty to ignore project filtering. |\n| <a id=\"property-recipients\"></a> `recipients?` | `string`[] | Email Recipient addresses to filter by. Examples: ['[email protected]']. Empty if not filtering by Recipient. |\n| <a id=\"property-senders\"></a> `senders?` | `string`[] | Email sender addresses to filter by. Examples: ['[email protected]']. Empty to search all senders. |\n| <a id=\"property-shared\"></a> `shared?` | [`SharedEmailFilter`](SharedEmailFilter.md) | Controls whether shared email threads are included in results. Defaults to \"exclude\" (only the user's own threads). |\n\n\n<!-- generated/search/types.gen/type-aliases/EntityFilters.md -->\n# Type Alias: EntityFilters\n\n> **EntityFilters** = \\{ `agent_session_filters?`: [`AgentSessionFilters`](AgentSessionFilters.md); `calendar_event_filters?`: [`CalendarEventFilters`](CalendarEventFilters.md); `call_filters?`: [`CallFilters`](CallFilters.md); `channel_filters?`: [`ChannelFilters`](ChannelFilters.md); `channel_thread_filters?`: [`ChannelThreadFilters`](ChannelThreadFilters.md); `chat_filters?`: [`ChatFilters`](ChatFilters.md); `crm_company_filters?`: [`CrmCompanyFilters`](CrmCompanyFilters.md); `document_filters?`: [`DocumentFilters`](DocumentFilters.md); `email_filters?`: [`EmailFilters`](EmailFilters.md); `favorites_only?`: `boolean` \\| `null`; `foreign_entity_filters?`: [`ForeignEntityFilters`](ForeignEntityFilters.md); `initiative_filters?`: [`InitiativeFilters`](InitiativeFilters.md); `project_filters?`: [`ProjectFilters`](ProjectFilters.md); `property_filters?`: [`PropertyFilter`](PropertyFilter.md)[]; `tag_filter_mode?`: [`TagFilterMode`](TagFilterMode.md); `tag_option_ids?`: `string`[]; \\}\n\na bundle of all of the filters for each entity type\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-agent_session_filters\"></a> `agent_session_filters?` | [`AgentSessionFilters`](AgentSessionFilters.md) | the bundled [AgentSessionFilters] |\n| <a id=\"property-calendar_event_filters\"></a> `calendar_event_filters?` | [`CalendarEventFilters`](CalendarEventFilters.md) | the bundled [CalendarEventFilters] |\n| <a id=\"property-call_filters\"></a> `call_filters?` | [`CallFilters`](CallFilters.md) | the bundled [CallFilters] |\n| <a id=\"property-channel_filters\"></a> `channel_filters?` | [`ChannelFilters`](ChannelFilters.md) | the bundled [ChannelFilters] |\n| <a id=\"property-channel_thread_filters\"></a> `channel_thread_filters?` | [`ChannelThreadFilters`](ChannelThreadFilters.md) | the bundled [ChannelThreadFilters] |\n| <a id=\"property-chat_filters\"></a> `chat_filters?` | [`ChatFilters`](ChatFilters.md) | the bundled [ChatFilters] |\n| <a id=\"property-crm_company_filters\"></a> `crm_company_filters?` | [`CrmCompanyFilters`](CrmCompanyFilters.md) | the bundled [CrmCompanyFilters] |\n| <a id=\"property-document_filters\"></a> `document_filters?` | [`DocumentFilters`](DocumentFilters.md) | the bundled [DocumentFilters] |\n| <a id=\"property-email_filters\"></a> `email_filters?` | [`EmailFilters`](EmailFilters.md) | the bundled [EmailFilters] |\n| <a id=\"property-favorites_only\"></a> `favorites_only?` | `boolean` \\| `null` | Restrict results to the authenticated viewer's favorites when true. |\n| <a id=\"property-foreign_entity_filters\"></a> `foreign_entity_filters?` | [`ForeignEntityFilters`](ForeignEntityFilters.md) | the bundled [ForeignEntityFilters] |\n| <a id=\"property-initiative_filters\"></a> `initiative_filters?` | [`InitiativeFilters`](InitiativeFilters.md) | Initiative filters. Initiatives are opt-in. |\n| <a id=\"property-project_filters\"></a> `project_filters?` | [`ProjectFilters`](ProjectFilters.md) | the bundled [ProjectFilters] |\n| <a id=\"property-property_filters\"></a> `property_filters?` | [`PropertyFilter`](PropertyFilter.md)[] | property-based filters applied across entity types |\n| <a id=\"property-tag_filter_mode\"></a> `tag_filter_mode?` | [`TagFilterMode`](TagFilterMode.md) | How the `tag_option_ids` combine: `any` (default) matches entities holding at least one selected tag, `all` requires every selected tag. |\n| <a id=\"property-tag_option_ids\"></a> `tag_option_ids?` | `string`[] | tag option ids matched against `properties.values`, OR'd together across all tag definitions. Option ids are globally unique, so the match ignores the owning definition id (personal and team tags combine into one OR). |\n\n\n<!-- generated/search/types.gen/type-aliases/ForeignEntityFilters.md -->\n# Type Alias: ForeignEntityFilters\n\n> **ForeignEntityFilters** = \\{ `foreign_entity_ids?`: `string`[]; `foreign_entity_sources?`: `string`[]; `ids?`: `string`[]; `includes_me?`: `boolean`; `notification_filters?`: [`NotificationFilters`](NotificationFilters.md); \\}\n\nFilters for foreign entity records.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-foreign_entity_ids\"></a> `foreign_entity_ids?` | `string`[] | External entity identifiers to filter by. Empty to include all external IDs. |\n| <a id=\"property-foreign_entity_sources\"></a> `foreign_entity_sources?` | `string`[] | External source names to filter by. Empty to include all sources. |\n| <a id=\"property-ids\"></a> `ids?` | `string`[] | Internal foreign entity record IDs to filter by. Empty to include all records. |\n| <a id=\"property-includes_me\"></a> `includes_me?` | `boolean` | When true, only return foreign entities whose metadata lists the requesting user as a participant (GitHub `involves:me` semantics for `github_pull_request` records). False or absent applies no filter. Serialized in filter ASTs as the `\"me\"` literal. |\n| <a id=\"property-notification_filters\"></a> `notification_filters?` | [`NotificationFilters`](NotificationFilters.md) | Filter by the notification state of the foreign entity (e.g. whether the requesting user's GitHub PR notification is done/seen). |\n\n\n<!-- generated/search/types.gen/type-aliases/InitiativeFilters.md -->\n# Type Alias: InitiativeFilters\n\n> **InitiativeFilters** = \\{ `due_after?`: `string` \\| `null`; `due_before?`: `string` \\| `null`; `include?`: `boolean`; `initiative_ids?`: `string`[]; `name?`: `string` \\| `null`; `owners?`: `string`[]; \\}\n\nFilters for initiatives.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-due_after\"></a> `due_after?` | `string` \\| `null` | Inclusive lower due-date bound. |\n| <a id=\"property-due_before\"></a> `due_before?` | `string` \\| `null` | Inclusive upper due-date bound. |\n| <a id=\"property-include\"></a> `include?` | `boolean` | Opt this query into initiatives at all. Initiatives are off by default — see [`crate::ast::initiative::InitiativeLiteral::Include`]. Asking for specific `initiative_ids` or `owners` also opts in. |\n| <a id=\"property-initiative_ids\"></a> `initiative_ids?` | `string`[] | Initiative ids to filter by. Empty to include all accessible initiatives. |\n| <a id=\"property-name\"></a> `name?` | `string` \\| `null` | Case-insensitive name substring. |\n| <a id=\"property-owners\"></a> `owners?` | `string`[] | Filter by initiative owner principal — a user ('macro\\|[email protected]'), a bot ('bot\\|<uuid>'), or a team (a bare hyphenated uuid). Empty to include every owner. |\n\n\n<!-- generated/search/types.gen/type-aliases/NotificationFilters.md -->\n# Type Alias: NotificationFilters\n\n> **NotificationFilters** = \\{ `states?`: [`NotificationState`](NotificationState.md)[]; \\}\n\nNotification-level filters that apply to an entity type.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-states\"></a> `states?` | [`NotificationState`](NotificationState.md)[] | Include entities with a non-deleted notification in any of these exact states. Empty means no notification restriction. Active means `[unseen, seen]`. |\n\n\n<!-- generated/search/types.gen/type-aliases/NotificationState.md -->\n# Type Alias: NotificationState\n\n> **NotificationState** = `\"unseen\"` \\| `\"seen\"` \\| `\"done\"`\n\nThe mutually exclusive lifecycle states of a user's notification.\n\n\n<!-- generated/search/types.gen/type-aliases/ProjectFilters.md -->\n# Type Alias: ProjectFilters\n\n> **ProjectFilters** = \\{ `importance?`: `boolean` \\| `null`; `include_root?`: `boolean`; `notification_filters?`: [`NotificationFilters`](NotificationFilters.md); `owners?`: `string`[]; `project_ids?`: `string`[]; \\}\n\nThe project filters used to filter down what projects you search over.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-importance\"></a> `importance?` | `boolean` \\| `null` | Filter by project importance. None to ignore, true to pass through (no clause), false to short-circuit and return nothing. |\n| <a id=\"property-include_root\"></a> `include_root?` | `boolean` | When true, `project_ids` also matches the projects themselves in addition to their children. |\n| <a id=\"property-notification_filters\"></a> `notification_filters?` | [`NotificationFilters`](NotificationFilters.md) | Filter by project notification state. |\n| <a id=\"property-owners\"></a> `owners?` | `string`[] | Filter by project owner principal — a user ('macro\\|[email protected]'), a bot ('bot\\|<uuid>'), or a team (a bare hyphenated uuid). Examples: ['macro\\|[email protected]'], ['macro\\|[email protected]', 'bot\\|0199...']. Empty to search all owners. |\n| <a id=\"property-project_ids\"></a> `project_ids?` | `string`[] | Project IDs to search within. Examples: ['project1']. Empty to search all accessible projects. By default matches children of these projects; set `include_root` to also match the projects themselves. |\n\n\n<!-- generated/search/types.gen/type-aliases/PropertyFilter.md -->\n# Type Alias: PropertyFilter\n\n> **PropertyFilter** = \\{ `entity_ids?`: `string`[]; `entity_type?`: `string` \\| `null`; `option_ids?`: `string`[]; `property_definition_id`: `string`; \\}\n\nA single property-based filter condition.\n\nEach filter targets a specific property definition on entities of a given type,\nmatching against select option UUIDs or entity reference IDs.\nMultiple values within a single filter are OR'd together.\nMultiple filters are AND'd together.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entity_ids\"></a> `entity_ids?` | `string`[] | Entity reference IDs to match. Multiple values are OR'd together. |\n| <a id=\"property-entity_type\"></a> `entity_type?` | `string` \\| `null` | The entity type for the property lookup (e.g., \"TASK\", \"DOCUMENT\", \"PROJECT\"). When None, matches across all entity types. |\n| <a id=\"property-option_ids\"></a> `option_ids?` | `string`[] | Select option UUIDs to match. Multiple values are OR'd together. |\n| <a id=\"property-property_definition_id\"></a> `property_definition_id` | `string` | The UUID of the property definition to filter on. |\n\n\n<!-- generated/search/types.gen/type-aliases/SharedEmailFilter.md -->\n# Type Alias: SharedEmailFilter\n\n> **SharedEmailFilter** = `\"exclude\"` \\| `\"include\"` \\| `\"only\"`\n\nControls whether shared email threads are included in results.\n\n\n<!-- generated/search/types.gen/type-aliases/TagFilterMode.md -->\n# Type Alias: TagFilterMode\n\n> **TagFilterMode** = `\"any\"` \\| `\"all\"`\n\nHow multiple `tag_option_ids` combine when filtering.\n\n\n<!-- generated/search/types.gen/type-aliases/TaskFilters.md -->\n# Type Alias: TaskFilters\n\n> **TaskFilters** = \\{ `include_cbm_atm_nc?`: `boolean` \\| `null`; \\}\n\nTask-only filters nested under document filters.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-include_cbm_atm_nc\"></a> `include_cbm_atm_nc?` | `boolean` \\| `null` | Include tasks that are created by me, assigned to me, and not completed, even when they do not match other document filters. |\n\n\n<!-- generated/storage/types.gen/type-aliases/AccessLevel.md -->\n# Type Alias: AccessLevel\n\n> **AccessLevel** = `\"view\"` \\| `\"comment\"` \\| `\"edit\"` \\| `\"owner\"`\n\nOrdered from least to most access top -> bottom\n\n\n<!-- generated/storage/types.gen/type-aliases/AccessRequest.md -->\n# Type Alias: AccessRequest\n\n> **AccessRequest** = \\{ `createdAt`: `string`; `grantedLevel?`: `null` \\| [`AccessLevel`](AccessLevel.md); `id`: `string`; `requestedLevel`: [`AccessLevel`](AccessLevel.md); `requesterId`: `string`; `resolvedAt?`: `string` \\| `null`; `retryAfter?`: `string` \\| `null`; `revision`: `number`; `status`: [`RequestStatus`](RequestStatus.md); `updatedAt`: `string`; \\}\n\nLatest request for one person and one entity.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-createdat\"></a> `createdAt` | `string` | Start of this request attempt. |\n| <a id=\"property-grantedlevel\"></a> `grantedLevel?` | `null` \\| [`AccessLevel`](AccessLevel.md) | - |\n| <a id=\"property-id\"></a> `id` | `string` | Stable request identity across revisions. |\n| <a id=\"property-requestedlevel\"></a> `requestedLevel` | [`AccessLevel`](AccessLevel.md) | Requested upgrade. |\n| <a id=\"property-requesterid\"></a> `requesterId` | `string` | Person requesting access. |\n| <a id=\"property-resolvedat\"></a> `resolvedAt?` | `string` \\| `null` | When the request stopped being pending. |\n| <a id=\"property-retryafter\"></a> `retryAfter?` | `string` \\| `null` | Earliest next submission or level change; cancellation preserves this deadline. Submissions wait one minute, denials wait 24 hours, and approval clears it. |\n| <a id=\"property-revision\"></a> `revision` | `number` | Optimistic concurrency token. |\n| <a id=\"property-status\"></a> `status` | [`RequestStatus`](RequestStatus.md) | Current outcome. |\n| <a id=\"property-updatedat\"></a> `updatedAt` | `string` | Most recent change. |\n\n\n<!-- generated/storage/types.gen/type-aliases/EntityPermission.md -->\n# Type Alias: EntityPermission\n\n> **EntityPermission** = \\{ `access_level`: [`AccessLevel`](AccessLevel.md); `type`: `\"access_level\"`; \\} \\| \\{ `type`: `\"channel_view_only\"`; \\} \\| \\{ `role`: [`ParticipantRole`](ParticipantRole.md); `type`: `\"channel_role\"`; \\} \\| \\{ `role`: [`TeamRole`](TeamRole.md); `type`: `\"team_role\"`; \\}\n\nA user's permission for an entity, discriminated by entity kind.\n\nItems (documents, chats, projects, threads) use access levels.\nChannels use view-only permission or participant roles.\n\n## Union Members\n\n### Type Literal\n\n\\{ `access_level`: [`AccessLevel`](AccessLevel.md); `type`: `\"access_level\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `access_level` | [`AccessLevel`](AccessLevel.md) | The access level the user has. |\n| `type` | `\"access_level\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `type`: `\"channel_view_only\"`; \\}\n\n***\n\n### Type Literal\n\n\\{ `role`: [`ParticipantRole`](ParticipantRole.md); `type`: `\"channel_role\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `role` | [`ParticipantRole`](ParticipantRole.md) | The role the user has in the channel. |\n| `type` | `\"channel_role\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `role`: [`TeamRole`](TeamRole.md); `type`: `\"team_role\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `role` | [`TeamRole`](TeamRole.md) | The role the user has in the team. |\n| `type` | `\"team_role\"` | - |\n\n\n<!-- generated/storage/types.gen/type-aliases/FavoriteEntityRef.md -->\n# Type Alias: FavoriteEntityRef\n\n> **FavoriteEntityRef** = \\{ `entityId`: `string`; `entityType`: `\"user\"` \\| `\"chat\"` \\| `\"channel\"` \\| `\"channel_message\"` \\| `\"document\"` \\| `\"project\"` \\| `\"email_thread\"` \\| `\"calendar_event\"` \\| `\"team\"` \\| `\"call\"` \\| `\"foreign_entity\"` \\| `\"static_file\"` \\| `\"crm_company\"` \\| `\"crm_contact\"` \\| `\"crm_pipeline\"` \\| `\"reminder\"` \\| `\"skill\"` \\| `\"agent_session\"` \\| `\"scheduled_action\"` \\| `\"initiative\"` \\| `\"database\"` \\| `\"database_row\"` \\| `\"form\"`; \\}\n\nA reference to a favorited entity.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entityid\"></a> `entityId` | `string` | The id of the favorited entity. |\n| <a id=\"property-entitytype\"></a> `entityType` | `\"user\"` \\| `\"chat\"` \\| `\"channel\"` \\| `\"channel_message\"` \\| `\"document\"` \\| `\"project\"` \\| `\"email_thread\"` \\| `\"calendar_event\"` \\| `\"team\"` \\| `\"call\"` \\| `\"foreign_entity\"` \\| `\"static_file\"` \\| `\"crm_company\"` \\| `\"crm_contact\"` \\| `\"crm_pipeline\"` \\| `\"reminder\"` \\| `\"skill\"` \\| `\"agent_session\"` \\| `\"scheduled_action\"` \\| `\"initiative\"` \\| `\"database\"` \\| `\"database_row\"` \\| `\"form\"` | The type of the favorited entity. |\n\n\n<!-- generated/storage/types.gen/type-aliases/LinkShare.md -->\n# Type Alias: LinkShare\n\n> **LinkShare** = `\"PUBLIC\"` \\| `\"TEAM\"`\n\nDefines who can access an item through its share link.\n\n\n<!-- generated/storage/types.gen/type-aliases/MessageCursor.md -->\n# Type Alias: MessageCursor\n\n> **MessageCursor** = \\{ `created_at`: `string`; `id`: `string`; \\}\n\nCursor for a chronological parent timeline.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | Last message creation time or activity occurrence time. |\n| <a id=\"property-id\"></a> `id` | `string` | Last entry UUID, used to break timestamp ties across both sources. |\n\n\n<!-- generated/storage/types.gen/type-aliases/MessageDirection.md -->\n# Type Alias: MessageDirection\n\n> **MessageDirection** = `\"older\"` \\| `\"newer\"`\n\nDirection through a parent timeline, retaining channel cursor semantics.\n\n\n<!-- generated/storage/types.gen/type-aliases/ParticipantRole.md -->\n# Type Alias: ParticipantRole\n\n> **ParticipantRole** = `\"owner\"` \\| `\"admin\"` \\| `\"member\"`\n\nThe role a user has within a channel.\n\n\n<!-- generated/storage/types.gen/type-aliases/RequestStatus.md -->\n# Type Alias: RequestStatus\n\n> **RequestStatus** = `\"pending\"` \\| `\"granted\"` \\| `\"denied\"` \\| `\"cancelled\"`\n\nDurable outcome; reading a notification never changes it.\n\n\n<!-- generated/storage/types.gen/type-aliases/ResolveRequest.md -->\n# Type Alias: ResolveRequest\n\n> **ResolveRequest** = \\{ `grantedLevel?`: `null` \\| [`AccessLevel`](AccessLevel.md); `revision`: `number`; \\}\n\nOwner's decision; omission of a granted level means deny.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-grantedlevel\"></a> `grantedLevel?` | `null` \\| [`AccessLevel`](AccessLevel.md) | - |\n| <a id=\"property-revision\"></a> `revision` | `number` | Request revision being reviewed. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ShareEntityType.md -->\n# Type Alias: ShareEntityType\n\n> **ShareEntityType** = `\"document\"` \\| `\"chat\"` \\| `\"project\"` \\| `\"initiative\"` \\| `\"database\"` \\| `\"call\"` \\| `\"email_thread\"` \\| `\"agent_session\"`\n\nAn entity type with an existing Share surface.\n\n\n<!-- generated/storage/types.gen/type-aliases/SimpleMention.md -->\n# Type Alias: SimpleMention\n\n> **SimpleMention** = \\{ `entity_id`: `string`; `entity_type`: `string`; \\}\n\nA mention tracked in a message body.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-entity_id\"></a> `entity_id` | `string` | Mentioned entity identifier. |\n| <a id=\"property-entity_type\"></a> `entity_type` | `string` | Mentioned entity type. |\n\n\n<!-- generated/storage/types.gen/type-aliases/TeamRole.md -->\n# Type Alias: TeamRole\n\n> **TeamRole** = `\"member\"` \\| `\"admin\"` \\| `\"owner\"`\n\nThe role a user has within a team.\n\nOrdered least to most privileged so comparisons reflect access strength.\n\n\n<!-- generated/storage/types.gen/type-aliases/ThreadAnchor.md -->\n# Type Alias: ThreadAnchor\n\n> **ThreadAnchor** = \\{ `mark_id`: `string`; `marked_text?`: `string` \\| `null`; `type`: `\"markdown\"`; \\} \\| \\{ `anchor_id`: `string`; `marked_text?`: `string` \\| `null`; `type`: `\"pdf_highlight\"`; \\} \\| \\{ `anchor_id`: `string`; `type`: `\"pdf_placeable\"`; \\} \\| \\{ `range`: `string`; `sheetId`: `string`; `sheetName`: `string`; `type`: `\"spreadsheet\"`; \\} \\| \\{ `nodeId?`: `string` \\| `null`; `pageId`: `string`; `type`: `\"fig\"`; `x`: `number`; `y`: `number`; \\}\n\nA thread's location within its document. PDF geometry remains annotation-owned.\n\n## Union Members\n\n### Type Literal\n\n\\{ `mark_id`: `string`; `marked_text?`: `string` \\| `null`; `type`: `\"markdown\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `mark_id` | `string` | Mark UUID serialized in the document. |\n| `marked_text?` | `string` \\| `null` | The marked text as it read when the discussion was created, already trimmed and bounded. Absent on threads created or imported before snapshots were captured: the text a mark covers cannot be recovered from the mark id alone. |\n| `type` | `\"markdown\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `anchor_id`: `string`; `marked_text?`: `string` \\| `null`; `type`: `\"pdf_highlight\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `anchor_id` | `string` | Highlight annotation UUID. |\n| `marked_text?` | `string` \\| `null` | The text the highlight covers, trimmed and bounded like a markdown snapshot. The highlight owns it and it can be edited there, so it is read from the highlight whenever the thread is, never stored on the thread. Absent when the highlight carries no text. |\n| `type` | `\"pdf_highlight\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `anchor_id`: `string`; `type`: `\"pdf_placeable\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `anchor_id` | `string` | Placeable annotation UUID. |\n| `type` | `\"pdf_placeable\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `range`: `string`; `sheetId`: `string`; `sheetName`: `string`; `type`: `\"spreadsheet\"`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `range` | `string` | A1 cell or range, such as B4 or B4:C9. |\n| `sheetId` | `string` | Stable sheet identity within the workbook. |\n| `sheetName` | `string` | Sheet name when the discussion was created. |\n| `type` | `\"spreadsheet\"` | - |\n\n***\n\n### Type Literal\n\n\\{ `nodeId?`: `string` \\| `null`; `pageId`: `string`; `type`: `\"fig\"`; `x`: `number`; `y`: `number`; \\}\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `nodeId?` | `string` \\| `null` | Layer the pin follows; absent for a pin on the bare canvas. |\n| `pageId` | `string` | Page (canvas) the pin is on. |\n| `type` | `\"fig\"` | - |\n| `x` | `number` | Horizontal offset from the layer's origin, or the page's when the pin is on no layer, in design units. |\n| `y` | `number` | Vertical offset, measured like `x`. |\n\n\n<!-- generated/storage/types.gen/type-aliases/ThreadState.md -->\n# Type Alias: ThreadState\n\n> **ThreadState** = \\{ `anchor?`: `null` \\| [`ThreadAnchor`](ThreadAnchor.md); `created_at`: `string`; `deleted_at?`: `string` \\| `null`; `resolved`: `boolean`; `root_id`: `string`; `updated_at`: `string`; `user_id`: `string`; \\}\n\nState belonging to a whole thread, keyed by its root message.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-anchor\"></a> `anchor?` | `null` \\| [`ThreadAnchor`](ThreadAnchor.md) | - |\n| <a id=\"property-created_at\"></a> `created_at` | `string` | Creation time of the discussion. |\n| <a id=\"property-deleted_at\"></a> `deleted_at?` | `string` \\| `null` | Explicit deletion of the entire thread, distinct from root deletion. |\n| <a id=\"property-resolved\"></a> `resolved` | `boolean` | Whether this discussion has been resolved. |\n| <a id=\"property-root_id\"></a> `root_id` | `string` | Root message UUID; there is no separate thread identity. |\n| <a id=\"property-updated_at\"></a> `updated_at` | `string` | Last state change. |\n| <a id=\"property-user_id\"></a> `user_id` | `string` | User who owns this discussion, including imported discussions. |\n\n\n<!-- generated/storage/types.gen/type-aliases/UpdateChannelSharePermission.md -->\n# Type Alias: UpdateChannelSharePermission\n\n> **UpdateChannelSharePermission** = \\{ `accessLevel?`: `null` \\| [`AccessLevel`](AccessLevel.md); `channelId`: `string`; `operation`: [`UpdateOperation`](UpdateOperation.md); \\}\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-accesslevel\"></a> `accessLevel?` | `null` \\| [`AccessLevel`](AccessLevel.md) | - |\n| <a id=\"property-channelid\"></a> `channelId` | `string` | The channel id |\n| <a id=\"property-operation\"></a> `operation` | [`UpdateOperation`](UpdateOperation.md) | The type of operation to be performed on the chanel share permission You can add, remove or replace and existing permission |\n\n\n<!-- generated/storage/types.gen/type-aliases/UpdateOperation.md -->\n# Type Alias: UpdateOperation\n\n> **UpdateOperation** = `\"add\"` \\| `\"remove\"` \\| `\"replace\"`\n\n\n<!-- generated/storage/types.gen/type-aliases/UpdateSharePermissionRequestV2.md -->\n# Type Alias: UpdateSharePermissionRequestV2\n\n> **UpdateSharePermissionRequestV2** = \\{ `channelSharePermissions?`: [`UpdateChannelSharePermission`](UpdateChannelSharePermission.md)[] \\| `null`; `linkShare?`: `null` \\| [`LinkShare`](LinkShare.md); `linkShareAccessLevel?`: `null` \\| [`AccessLevel`](AccessLevel.md); `teamShareAccessLevel?`: `null` \\| [`AccessLevel`](AccessLevel.md); \\}\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-channelsharepermissions\"></a> `channelSharePermissions?` | [`UpdateChannelSharePermission`](UpdateChannelSharePermission.md)[] \\| `null` | Any channel share permissions to be created/updated/removed |\n| <a id=\"property-linkshare\"></a> `linkShare?` | `null` \\| [`LinkShare`](LinkShare.md) | - |\n| <a id=\"property-linkshareaccesslevel\"></a> `linkShareAccessLevel?` | `null` \\| [`AccessLevel`](AccessLevel.md) | - |\n| <a id=\"property-teamshareaccesslevel\"></a> `teamShareAccessLevel?` | `null` \\| [`AccessLevel`](AccessLevel.md) | - |\n\n\n<!-- generated/storage/types.gen/type-aliases/WebhookFilter.md -->\n# Type Alias: WebhookFilter\n\n> **WebhookFilter** = \\{ `events`: `string`[]; `ids?`: `string`[] \\| `null`; \\}\n\nEvent and optional entity-id constraints used to match webhook deliveries.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-events\"></a> `events` | `string`[] | Event names matched by this filter. |\n| <a id=\"property-ids\"></a> `ids?` | `string`[] \\| `null` | Entity ids matched by this filter. When absent, the filter matches all entity ids. |\n\n\n<!-- generated/storage/types.gen/type-aliases/WebhookScope.md -->\n# Type Alias: WebhookScope\n\n> **WebhookScope** = `\"user\"` \\| `\"team\"`\n\nScope that owns a newly-created webhook.\n\nClients serialize this, so both derives are used. `Display`/`FromStr`\nspell the same names as serde, for query strings and config values.\n\n\n<!-- src/config/interfaces/MacroOpts.md -->\n# Interface: MacroOpts\n\nOptions passed to `new Macro(opts)` and stored on `MacroClient`.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-auth\"></a> `auth?` | [`MacroAuth`](../type-aliases/MacroAuth.md) | How to authenticate. Takes precedence over `token`. Falls back to `MACRO_API_KEY` (a user API key or bearer token) or `MACRO_BOT_TOKEN` (bot). |\n| <a id=\"property-env\"></a> `env?` | [`Env`](../type-aliases/Env.md) | Which Macro environment to talk to. Falls back to the MACRO_ENV env var, then `'prod'`. |\n| <a id=\"property-hosts\"></a> `hosts?` | `Partial`\\<`Record`\\<[`ServiceName`](../type-aliases/ServiceName.md), `string`\\>\\> | Override individual service hosts (e.g. point one at localhost). |\n| <a id=\"property-onrequest\"></a> `onRequest?` | (`event`) => `void` | Optional generated API operation events; excludes arguments, URLs and response data. |\n| <a id=\"property-requestedas\"></a> `requestedAs?` | `string` | User id the bot acts for, sent as `x-macro-bot-for-macro-user-id` on every request. Bot auth only. Set via `macro.requestedAs(user)` rather than directly. |\n| <a id=\"property-token\"></a> `token?` | [`TokenSource`](../type-aliases/TokenSource.md) | Shorthand for `auth: { type: 'user', token }`. Accepts a Settings API key (`mak_…`) or a bearer token. |\n| <a id=\"property-webappurl\"></a> `webAppUrl?` | `string` | Override the web app base URL (e.g. for local frontend dev). Also reads MACRO_WEB_URL. |\n| <a id=\"property-webhooksecret\"></a> `webhookSecret?` | `string` | Signing secret for verifying incoming persisted-webhook deliveries. Required only for `macro.events.webhook()` / `macro.events.handle()`. SSE via `macro.events.listen()` uses the API token and does not need this. Falls back to MACRO_WEBHOOK_SECRET. |\n| <a id=\"property-wsverify\"></a> `wsVerify?` | `string` | - |\n\n\n<!-- src/config/type-aliases/BotScope.md -->\n# Type Alias: BotScope\n\n> **BotScope** = `\"user\"` \\| `\"team\"`\n\nAccess scope for bot-authenticated requests. `user` acts with the\nrequested-as user's access (requires `requestedAs`); `team` acts with the\nbot's owning team's access (team-owned bots only).\n\n\n<!-- src/config/type-aliases/Env.md -->\n# Type Alias: Env\n\n> **Env** = `\"dev\"` \\| `\"prod\"` \\| `\"local\"`\n\n\n<!-- src/config/type-aliases/MacroAuth.md -->\n# Type Alias: MacroAuth\n\n> **MacroAuth** = \\{ `apiKey?`: `never`; `token`: [`TokenSource`](TokenSource.md); `type`: `\"user\"`; \\} \\| \\{ `apiKey`: `string`; `token?`: `never`; `type`: `\"user\"`; \\} \\| \\{ `scope?`: [`BotScope`](BotScope.md); `token`: [`TokenSource`](TokenSource.md); `type`: `\"bot\"`; \\}\n\nHow the SDK authenticates with Macro.\n\nA user has exactly one of two credential fields.\n\n- `token`: a bearer token, or a `mak_` API key. The SDK picks the header\n from the prefix at send time.\n- `apiKey`: a Settings → API Keys key, always sent as\n `x-macro-user-api-key`. Not prefix-checked, so keys that predate the\n `mak_` prefix work here.\n\nA bot uses an `mbot_` token as `x-macro-bot-token` plus\n`x-macro-bot-scope`, defaulting to `user` when `requestedAs` is set and\n`team` otherwise.\n\n\n<!-- src/config/type-aliases/ServiceName.md -->\n# Type Alias: ServiceName\n\n> **ServiceName** = `\"agent-harness\"` \\| `\"storage\"` \\| `\"auth\"` \\| `\"email\"` \\| `\"calendar\"` \\| `\"cognition\"` \\| `\"notification\"` \\| `\"properties\"` \\| `\"search\"` \\| `\"scheduled-action\"` \\| `\"static-files\"` \\| `\"connection\"` \\| `\"contacts\"` \\| `\"unfurl\"`\n\nThe backend services the SDK talks to. Note `search` and `properties` are\nserved on the storage host, so they point there.\n\n\n<!-- src/config/type-aliases/TokenSource.md -->\n# Type Alias: TokenSource\n\n> **TokenSource** = `string` \\| (() => `string` \\| `Promise`\\<`string`\\>)\n\nA credential string, or a (possibly async) function that returns one.\n\n\n<!-- src/config/variables/HOSTS.md -->\n# Variable: HOSTS\n\n> `const` **HOSTS**: `Record`\\<[`Env`](../type-aliases/Env.md), `Record`\\<[`ServiceName`](../type-aliases/ServiceName.md), `string`\\>\\>\n\n\n<!-- src/config/variables/WEB_APP_URLS.md -->\n# Variable: WEB\\_APP\\_URLS\n\n> `const` **WEB\\_APP\\_URLS**: `Record`\\<[`Env`](../type-aliases/Env.md), `string`\\>\n\n\n<!-- src/entities/entity/classes/FavoritableEntity.md -->\n# Abstract Class: FavoritableEntity\\<Detail\\>\n\nAn entity the favorites API can address, and so can be (un)favorited.\n\n## Extends\n\n- [`MacroEntity`](MacroEntity.md)\\<`Detail`\\>\n\n## Extended by\n\n- [`CallRecord`](../../calls/call-record/classes/CallRecord.md)\n- [`Message`](../../channels/message/classes/Message.md)\n- [`Contact`](../../crm/contact/classes/Contact.md)\n- [`PropertiedEntity`](PropertiedEntity.md)\n- [`ForeignEntity`](../../foreign/foreign-entity/classes/ForeignEntity.md)\n\n## Type Parameters\n\n| Type Parameter |\n| ------ |\n| <a id=\"type-parameter-detail\"></a> `Detail` |\n\n## Implements\n\n- [`Favoritable`](../interfaces/Favoritable.md)\n\n## Properties\n\n| Property | Modifier | Type | Description | Inherited from |\n| ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-entitytype\"></a> `entityType` | `abstract readonly` | `\"project\"` \\| `\"user\"` \\| `\"team\"` \\| `\"chat\"` \\| `\"channel\"` \\| `\"channel_message\"` \\| `\"document\"` \\| `\"email_thread\"` \\| `\"calendar_event\"` \\| `\"call\"` \\| `\"foreign_entity\"` \\| `\"static_file\"` \\| `\"crm_company\"` \\| `\"crm_contact\"` \\| `\"crm_pipeline\"` \\| `\"reminder\"` \\| `\"skill\"` \\| `\"agent_session\"` \\| `\"scheduled_action\"` \\| `\"initiative\"` \\| `\"database\"` \\| `\"database_row\"` \\| `\"form\"` | How the entity-addressed APIs (favorites) identify this entity's type. | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](MacroEntity.md).[`id`](MacroEntity.md#property-id) |\n\n## Methods\n\n### favorite()\n\n> **favorite**(): `Promise`\\<`FavoritableEntity`\\<`Detail`\\>\\>\n\nAdd this entity to the user's favorites. Returns this handle for chaining.\nPlain unwrap: favoriting alters the user's favorites collection, not this\nentity's own detail, so there's nothing cached to invalidate.\n\n#### Returns\n\n`Promise`\\<`FavoritableEntity`\\<`Detail`\\>\\>\n\n#### Implementation of\n\n[`Favoritable`](../interfaces/Favoritable.md).[`favorite`](../interfaces/Favoritable.md#favorite)\n\n***\n\n### permission()\n\n> **permission**(): `Promise`\\<\\{ `permission`: [`EntityPermission`](../../../../generated/storage/types.gen/type-aliases/EntityPermission.md); `status`: `\"access\"`; \\} \\| \\{ `status`: `\"no_access\"`; \\}\\>\n\nRead the caller's effective permission on this entity.\n\n#### Returns\n\n`Promise`\\<\\{ `permission`: [`EntityPermission`](../../../../generated/storage/types.gen/type-aliases/EntityPermission.md); `status`: `\"access\"`; \\} \\| \\{ `status`: `\"no_access\"`; \\}\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: `Detail`; `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: `Detail`; `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | `Detail` |\n| `id` | `string` |\n\n#### Inherited from\n\n[`MacroEntity`](MacroEntity.md).[`toJSON`](MacroEntity.md#tojson)\n\n***\n\n### unfavorite()\n\n> **unfavorite**(): `Promise`\\<`FavoritableEntity`\\<`Detail`\\>\\>\n\nRemove this entity from the user's favorites. Returns this handle for chaining.\n\n#### Returns\n\n`Promise`\\<`FavoritableEntity`\\<`Detail`\\>\\>\n\n#### Implementation of\n\n[`Favoritable`](../interfaces/Favoritable.md).[`unfavorite`](../interfaces/Favoritable.md#unfavorite)\n\n\n<!-- src/entities/entity/classes/MacroEntity.md -->\n# Abstract Class: MacroEntity\\<Detail\\>\n\nBase for entity handles: a free-to-construct `(client, id)` pair whose\ndetail record loads lazily on first field access and is dropped after any\nmutation. Subclasses implement fetch and build their surface from\nfield and mutate.\n\n## Extended by\n\n- [`AgentSession`](../../agent-sessions/agent-session/classes/AgentSession.md)\n- [`CodeExecution`](../../agent-sessions/code-execution/classes/CodeExecution.md)\n- [`SessionReview`](../../agent-sessions/review/classes/SessionReview.md)\n- [`Agent`](../../agents/agent/classes/Agent.md)\n- [`UserApiKey`](../../api-keys/api-key/classes/UserApiKey.md)\n- [`Calendar`](../../calendar/calendar/classes/Calendar.md)\n- [`CalendarEvent`](../../calendar/event/classes/CalendarEvent.md)\n- [`CallMessage`](../../calls/message/classes/CallMessage.md)\n- [`ChatMessage`](../../chats/generation/classes/ChatMessage.md)\n- [`CrmComment`](../../crm/comment/classes/CrmComment.md)\n- [`CrmPipeline`](../../crm/pipeline/classes/CrmPipeline.md)\n- [`PipelineTable`](../../crm/pipeline/classes/PipelineTable.md)\n- [`PipelineRow`](../../crm/pipeline/classes/PipelineRow.md)\n- [`PipelineColumn`](../../crm/pipeline/classes/PipelineColumn.md)\n- [`Database`](../../databases/database/classes/Database.md)\n- [`DocumentAnchor`](../../documents/anchor/classes/DocumentAnchor.md)\n- [`Comment`](../../documents/comment/classes/Comment.md)\n- [`EmailAttachment`](../../email/attachment/classes/EmailAttachment.md)\n- [`EmailFilter`](../../email/filter/classes/EmailFilter.md)\n- [`Label`](../../email/label/classes/Label.md)\n- [`Link`](../../email/link/classes/Link.md)\n- [`EmailMessage`](../../email/message/classes/EmailMessage.md)\n- [`FavoritableEntity`](FavoritableEntity.md)\n- [`Form`](../../forms/form/classes/Form.md)\n- [`GithubPullRequest`](../../github-pull-requests/pull-request/classes/GithubPullRequest.md)\n- [`Harness`](../../harnesses/harness/classes/Harness.md)\n- [`HarnessPairing`](../../harnesses/pairing/classes/HarnessPairing.md)\n- [`Initiative`](../../initiatives/initiative/classes/Initiative.md)\n- [`Meeting`](../../meetings/meeting/classes/Meeting.md)\n- [`MessageThread`](../../messages/thread/classes/MessageThread.md)\n- [`Notification`](../../notifications/notification/classes/Notification.md)\n- [`Routine`](../../routines/routine/classes/Routine.md)\n- [`AccessRequest`](../../sharing/access/classes/AccessRequest.md)\n- [`Team`](../../teams/team/classes/Team.md)\n- [`Webhook`](../../webhooks/webhook/classes/Webhook.md)\n\n## Type Parameters\n\n| Type Parameter |\n| ------ |\n| <a id=\"type-parameter-detail\"></a> `Detail` |\n\n## Properties\n\n| Property | Modifier | Type |\n| ------ | ------ | ------ |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` |\n\n## Methods\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: `Detail`; `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: `Detail`; `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | `Detail` |\n| `id` | `string` |\n\n\n<!-- src/entities/entity/classes/PropertiedEntity.md -->\n# Abstract Class: PropertiedEntity\\<Detail\\>\n\nA favoritable entity that also carries user-defined properties.\n\n## Extends\n\n- [`FavoritableEntity`](FavoritableEntity.md)\\<`Detail`\\>\n\n## Extended by\n\n- [`Channel`](../../channels/channel/classes/Channel.md)\n- [`Chat`](../../chats/chat/classes/Chat.md)\n- [`Company`](../../crm/company/classes/Company.md)\n- [`Document`](../../documents/document/classes/Document.md)\n- [`EmailThread`](../../email/thread/classes/EmailThread.md)\n- [`Project`](../../projects/project/classes/Project.md)\n- [`User`](../../users/user/classes/User.md)\n\n## Type Parameters\n\n| Type Parameter |\n| ------ |\n| <a id=\"type-parameter-detail\"></a> `Detail` |\n\n## Implements\n\n- [`Propertied`](../interfaces/Propertied.md)\n\n## Properties\n\n| Property | Modifier | Type | Description | Inherited from |\n| ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-entitytype\"></a> `entityType` | `abstract readonly` | `\"project\"` \\| `\"user\"` \\| `\"team\"` \\| `\"chat\"` \\| `\"channel\"` \\| `\"channel_message\"` \\| `\"document\"` \\| `\"email_thread\"` \\| `\"calendar_event\"` \\| `\"call\"` \\| `\"foreign_entity\"` \\| `\"static_file\"` \\| `\"crm_company\"` \\| `\"crm_contact\"` \\| `\"crm_pipeline\"` \\| `\"reminder\"` \\| `\"skill\"` \\| `\"agent_session\"` \\| `\"scheduled_action\"` \\| `\"initiative\"` \\| `\"database\"` \\| `\"database_row\"` \\| `\"form\"` | How the entity-addressed APIs (favorites) identify this entity's type. | [`FavoritableEntity`](FavoritableEntity.md).[`entityType`](FavoritableEntity.md#property-entitytype) |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | - | [`FavoritableEntity`](FavoritableEntity.md).[`id`](FavoritableEntity.md#property-id) |\n\n## Methods\n\n### deleteProperty()\n\n> **deleteProperty**(`assignment`): `Promise`\\<`void`\\>\n\nRemove a property from this entity, given its [properties](#properties) entry.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `assignment` | [`EntityPropertyWithDefinition`](../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n#### Implementation of\n\n[`Propertied`](../interfaces/Propertied.md).[`deleteProperty`](../interfaces/Propertied.md#deleteproperty)\n\n***\n\n### favorite()\n\n> **favorite**(): `Promise`\\<`PropertiedEntity`\\<`Detail`\\>\\>\n\nAdd this entity to the user's favorites. Returns this handle for chaining.\nPlain unwrap: favoriting alters the user's favorites collection, not this\nentity's own detail, so there's nothing cached to invalidate.\n\n#### Returns\n\n`Promise`\\<`PropertiedEntity`\\<`Detail`\\>\\>\n\n#### Implementation of\n\n[`Propertied`](../interfaces/Propertied.md).[`favorite`](../interfaces/Propertied.md#favorite)\n\n#### Inherited from\n\n[`FavoritableEntity`](FavoritableEntity.md).[`favorite`](FavoritableEntity.md#favorite)\n\n***\n\n### permission()\n\n> **permission**(): `Promise`\\<\\{ `permission`: [`EntityPermission`](../../../../generated/storage/types.gen/type-aliases/EntityPermission.md); `status`: `\"access\"`; \\} \\| \\{ `status`: `\"no_access\"`; \\}\\>\n\nRead the caller's effective permission on this entity.\n\n#### Returns\n\n`Promise`\\<\\{ `permission`: [`EntityPermission`](../../../../generated/storage/types.gen/type-aliases/EntityPermission.md); `status`: `\"access\"`; \\} \\| \\{ `status`: `\"no_access\"`; \\}\\>\n\n#### Inherited from\n\n[`FavoritableEntity`](FavoritableEntity.md).[`permission`](FavoritableEntity.md#permission)\n\n***\n\n### properties()\n\n> **properties**(`opts?`): `Promise`\\<[`EntityPropertyWithDefinition`](../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md)[]\\>\n\nThe properties set on this entity, each with its definition, value, and options.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts?` | \\{ `includeMetadata?`: `boolean`; \\} |\n| `opts.includeMetadata?` | `boolean` |\n\n#### Returns\n\n`Promise`\\<[`EntityPropertyWithDefinition`](../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md)[]\\>\n\n#### Implementation of\n\n[`Propertied`](../interfaces/Propertied.md).[`properties`](../interfaces/Propertied.md#properties)\n\n***\n\n### propertyReference()\n\n> **propertyReference**(): [`PropertyTargetReference`](../../../../generated/properties/types.gen/type-aliases/PropertyTargetReference.md)\n\nThis entity's reference for bulk property operations.\n\n#### Returns\n\n[`PropertyTargetReference`](../../../../generated/properties/types.gen/type-aliases/PropertyTargetReference.md)\n\n***\n\n### setProperty()\n\n> **setProperty**(`property`, `value?`): `Promise`\\<`void`\\>\n\nSet a property value on this entity, or attach the property without a\nvalue when `value` is omitted.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `property` | [`PropertyDefinition`](../../properties/property-definition/classes/PropertyDefinition.md) |\n| `value?` | [`SetPropertyValue`](../../../../generated/properties/types.gen/type-aliases/SetPropertyValue.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n#### Implementation of\n\n[`Propertied`](../interfaces/Propertied.md).[`setProperty`](../interfaces/Propertied.md#setproperty)\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: `Detail`; `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: `Detail`; `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | `Detail` |\n| `id` | `string` |\n\n#### Inherited from\n\n[`FavoritableEntity`](FavoritableEntity.md).[`toJSON`](FavoritableEntity.md#tojson)\n\n***\n\n### unfavorite()\n\n> **unfavorite**(): `Promise`\\<`PropertiedEntity`\\<`Detail`\\>\\>\n\nRemove this entity from the user's favorites. Returns this handle for chaining.\n\n#### Returns\n\n`Promise`\\<`PropertiedEntity`\\<`Detail`\\>\\>\n\n#### Implementation of\n\n[`Propertied`](../interfaces/Propertied.md).[`unfavorite`](../interfaces/Propertied.md#unfavorite)\n\n#### Inherited from\n\n[`FavoritableEntity`](FavoritableEntity.md).[`unfavorite`](FavoritableEntity.md#unfavorite)\n\n***\n\n### updatePropertyOptions()\n\n> **updatePropertyOptions**(`changes`): `Promise`\\<[`BulkUpdateEntityPropertyOptionsResponse`](../../../../generated/properties/types.gen/type-aliases/BulkUpdateEntityPropertyOptionsResponse.md)\\>\n\nApply multi-select option deltas atomically across this entity's properties.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `changes` | [`PropertyOptionDelta`](../interfaces/PropertyOptionDelta.md)[] |\n\n#### Returns\n\n`Promise`\\<[`BulkUpdateEntityPropertyOptionsResponse`](../../../../generated/properties/types.gen/type-aliases/BulkUpdateEntityPropertyOptionsResponse.md)\\>\n\n\n<!-- src/entities/entity/interfaces/Favoritable.md -->\n# Interface: Favoritable\n\nAn entity that can be added to and removed from the user's favorites.\n\n## Extended by\n\n- [`Propertied`](Propertied.md)\n\n## Methods\n\n### favorite()\n\n> **favorite**(): `Promise`\\<`Favoritable`\\>\n\n#### Returns\n\n`Promise`\\<`Favoritable`\\>\n\n***\n\n### unfavorite()\n\n> **unfavorite**(): `Promise`\\<`Favoritable`\\>\n\n#### Returns\n\n`Promise`\\<`Favoritable`\\>\n\n\n<!-- src/entities/entity/interfaces/Propertied.md -->\n# Interface: Propertied\n\nA favoritable entity that also carries user-defined properties.\n\n## Extends\n\n- [`Favoritable`](Favoritable.md)\n\n## Methods\n\n### deleteProperty()\n\n> **deleteProperty**(`assignment`): `Promise`\\<`void`\\>\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `assignment` | [`EntityPropertyWithDefinition`](../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### favorite()\n\n> **favorite**(): `Promise`\\<`Propertied`\\>\n\n#### Returns\n\n`Promise`\\<`Propertied`\\>\n\n#### Inherited from\n\n[`Favoritable`](Favoritable.md).[`favorite`](Favoritable.md#favorite)\n\n***\n\n### properties()\n\n> **properties**(`opts?`): `Promise`\\<[`EntityPropertyWithDefinition`](../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md)[]\\>\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts?` | \\{ `includeMetadata?`: `boolean`; \\} |\n| `opts.includeMetadata?` | `boolean` |\n\n#### Returns\n\n`Promise`\\<[`EntityPropertyWithDefinition`](../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md)[]\\>\n\n***\n\n### setProperty()\n\n> **setProperty**(`property`, `value?`): `Promise`\\<`void`\\>\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `property` | [`PropertyDefinition`](../../properties/property-definition/classes/PropertyDefinition.md) |\n| `value?` | [`SetPropertyValue`](../../../../generated/properties/types.gen/type-aliases/SetPropertyValue.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### unfavorite()\n\n> **unfavorite**(): `Promise`\\<`Propertied`\\>\n\n#### Returns\n\n`Promise`\\<`Propertied`\\>\n\n#### Inherited from\n\n[`Favoritable`](Favoritable.md).[`unfavorite`](Favoritable.md#unfavorite)\n\n\n<!-- src/entities/entity/interfaces/PropertyOptionDelta.md -->\n# Interface: PropertyOptionDelta\n\nA delta to apply to one multi-select property.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-add\"></a> `add?` | [`PropertyOption`](../../properties/property-option/classes/PropertyOption.md)[] | Options to add to the property's current selection. |\n| <a id=\"property-property\"></a> `property` | [`PropertyDefinition`](../../properties/property-definition/classes/PropertyDefinition.md) | The multi-select property definition to update. |\n| <a id=\"property-remove\"></a> `remove?` | [`PropertyOption`](../../properties/property-option/classes/PropertyOption.md)[] | Options to remove from the property's current selection. |\n\n\n<!-- src/entities/entity/type-aliases/MacroEntityType.md -->\n# Type Alias: MacroEntityType\n\n> **MacroEntityType** = [`FavoriteEntityRef`](../../../../generated/storage/types.gen/type-aliases/FavoriteEntityRef.md)\\[`\"entityType\"`\\]\n\nHow the entity-addressed APIs (favorites) identify an entity's type.\n\n\n<!-- src/entities/messages/thread/classes/MessageThread.md -->\n# Class: MessageThread\n\nA shared message thread with resolution and deletion operations.\n\n## Extends\n\n- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\\<[`ThreadState`](../../../../../generated/storage/types.gen/type-aliases/ThreadState.md)\\>\n\n## Properties\n\n| Property | Modifier | Type | Description | Inherited from |\n| ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |\n| <a id=\"property-parent\"></a> `parent` | `readonly` | [`MessageParent`](../type-aliases/MessageParent.md) | The entity containing this thread. | - |\n| <a id=\"property-resolved\"></a> `resolved` | `readonly` | () => `Promise`\\<`boolean`\\> | Whether the thread is resolved. | - |\n\n## Methods\n\n### delete()\n\n> **delete**(`nonce?`): `Promise`\\<`void`\\>\n\nDelete the entire thread, including replies.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `nonce?` | `string` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`ThreadState`](../../../../../generated/storage/types.gen/type-aliases/ThreadState.md); `id`: `string`; `parentId`: `string`; `parentType`: `\"channel\"` \\| `\"document\"` \\| `\"call\"` \\| `\"crm_company\"` \\| `\"crm_contact\"`; \\}\n\nSerialize identity with its owning resource.\n\n#### Returns\n\n\\{ `detail?`: [`ThreadState`](../../../../../generated/storage/types.gen/type-aliases/ThreadState.md); `id`: `string`; `parentId`: `string`; `parentType`: `\"channel\"` \\| `\"document\"` \\| `\"call\"` \\| `\"crm_company\"` \\| `\"crm_contact\"`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`ThreadState`](../../../../../generated/storage/types.gen/type-aliases/ThreadState.md) |\n| `id` | `string` |\n| `parentId` | `string` |\n| `parentType` | `\"channel\"` \\| `\"document\"` \\| `\"call\"` \\| `\"crm_company\"` \\| `\"crm_contact\"` |\n\n#### Overrides\n\n[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)\n\n***\n\n### update()\n\n> **update**(`options`): `Promise`\\<`void`\\>\n\nResolve the thread or detach its annotation anchor.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | \\{ `detachAnchor?`: `boolean`; `nonce?`: `string`; `resolved?`: `boolean`; \\} |\n| `options.detachAnchor?` | `boolean` |\n| `options.nonce?` | `string` |\n| `options.resolved?` | `boolean` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### byId()\n\n> `static` **byId**(`client`, `parent`, `id`): `MessageThread`\n\nConstruct a scoped thread handle.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `parent` | [`MessageParent`](../type-aliases/MessageParent.md) |\n| `id` | `string` |\n\n#### Returns\n\n`MessageThread`\n\n\n<!-- src/entities/messages/thread/functions/timeline.md -->\n# Function: timeline()\n\n> **timeline**\\<`TMessage`\\>(`client`, `parent`, `map`, `selection?`): `Promise`\\<\\{ `entries`: (\\{ `activity`: \\{ `action`: `string`; `actor`: [`User`](../../../users/user/classes/User.md); `actor_id`: `string`; `id`: `string`; `occurred_at`: `string`; `payload?`: `unknown`; \\}; `message?`: `undefined`; `type`: `\"activity\"`; \\} \\| \\{ `activity?`: `undefined`; `message`: `TMessage`; `type`: `\"message\"`; \\})[]; `nextCursor`: [`MessageCursor`](../../../../../generated/storage/types.gen/type-aliases/MessageCursor.md) \\| `undefined`; `previousCursor`: [`MessageCursor`](../../../../../generated/storage/types.gen/type-aliases/MessageCursor.md) \\| `undefined`; \\}\\>\n\nA bounded mixed message/activity page with typed message handles.\n\n## Type Parameters\n\n| Type Parameter |\n| ------ |\n| <a id=\"type-parameter-tmessage\"></a> `TMessage` *extends* [`TimelineMessage`](../type-aliases/TimelineMessage.md) |\n\n## Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `parent` | [`MessageParent`](../type-aliases/MessageParent.md) |\n| `map` | (`record`) => `TMessage` |\n| `selection?` | [`TimelineOptions`](../interfaces/TimelineOptions.md)\\<`TMessage`\\> |\n\n## Returns\n\n`Promise`\\<\\{ `entries`: (\\{ `activity`: \\{ `action`: `string`; `actor`: [`User`](../../../users/user/classes/User.md); `actor_id`: `string`; `id`: `string`; `occurred_at`: `string`; `payload?`: `unknown`; \\}; `message?`: `undefined`; `type`: `\"activity\"`; \\} \\| \\{ `activity?`: `undefined`; `message`: `TMessage`; `type`: `\"message\"`; \\})[]; `nextCursor`: [`MessageCursor`](../../../../../generated/storage/types.gen/type-aliases/MessageCursor.md) \\| `undefined`; `previousCursor`: [`MessageCursor`](../../../../../generated/storage/types.gen/type-aliases/MessageCursor.md) \\| `undefined`; \\}\\>\n\n\n<!-- src/entities/messages/thread/interfaces/TimelineOptions.md -->\n# Interface: TimelineOptions\\<TMessage\\>\n\nTimeline selection with typed message references and camel case options.\n\n## Type Parameters\n\n| Type Parameter | Default type |\n| ------ | ------ |\n| <a id=\"type-parameter-tmessage\"></a> `TMessage` *extends* [`TimelineMessage`](../type-aliases/TimelineMessage.md) | [`TimelineMessage`](../type-aliases/TimelineMessage.md) |\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-activityafter\"></a> `activityAfter?` | `string` | Inclusive activity lower bound. |\n| <a id=\"property-activitybefore\"></a> `activityBefore?` | `string` | Exclusive activity upper bound. |\n| <a id=\"property-anchored\"></a> `anchored?` | `boolean` | Select anchored threads. |\n| <a id=\"property-around\"></a> `around?` | `TMessage` | Fetch around this message. |\n| <a id=\"property-cursor\"></a> `cursor?` | [`MessageCursor`](../../../../../generated/storage/types.gen/type-aliases/MessageCursor.md) \\| `null` | Opaque continuation cursor from a previous page. |\n| <a id=\"property-direction\"></a> `direction?` | [`MessageDirection`](../../../../../generated/storage/types.gen/type-aliases/MessageDirection.md) | Page direction. |\n| <a id=\"property-includedeletedthreads\"></a> `includeDeletedThreads?` | `boolean` | Include deleted threads. |\n| <a id=\"property-limit\"></a> `limit?` | `number` | Page size. |\n| <a id=\"property-messages\"></a> `messages?` | `TMessage`[] | Restrict selection to these messages. |\n\n\n<!-- src/entities/messages/thread/type-aliases/MessageParent.md -->\n# Type Alias: MessageParent\n\n> **MessageParent** = \\{ `entity`: [`Channel`](../../../channels/channel/classes/Channel.md); `type`: `\"channel\"`; \\} \\| \\{ `entity`: [`Document`](../../../documents/document/classes/Document.md); `type`: `\"document\"`; \\} \\| \\{ `entity`: [`Company`](../../../crm/company/classes/Company.md); `type`: `\"crm_company\"`; \\} \\| \\{ `entity`: [`Contact`](../../../crm/contact/classes/Contact.md); `type`: `\"crm_contact\"`; \\} \\| \\{ `entity`: [`CallRecord`](../../../calls/call-record/classes/CallRecord.md); `type`: `\"call\"`; \\}\n\nThe typed parent of a shared message thread.\n\n\n<!-- src/entities/messages/thread/type-aliases/TimelineMessage.md -->\n# Type Alias: TimelineMessage\n\n> **TimelineMessage** = [`Message`](../../../channels/message/classes/Message.md) \\| [`Comment`](../../../documents/comment/classes/Comment.md) \\| [`CrmComment`](../../../crm/comment/classes/CrmComment.md) \\| [`CallMessage`](../../../calls/message/classes/CallMessage.md)\n\nA message handle accepted by a mixed timeline selector.\n\n\n<!-- src/entities/reference/type-aliases/EntityReference.md -->\n# Type Alias: EntityReference\n\n> **EntityReference** = \\{ `entity`: [`User`](../../users/user/classes/User.md); `type`: `\"user\"`; \\} \\| \\{ `entity`: [`Team`](../../teams/team/classes/Team.md); `type`: `\"team\"`; \\} \\| \\{ `entity`: [`Document`](../../documents/document/classes/Document.md); `type`: `\"document\"`; \\} \\| \\{ `entity`: [`Chat`](../../chats/chat/classes/Chat.md); `type`: `\"chat\"`; \\} \\| \\{ `entity`: [`Channel`](../../channels/channel/classes/Channel.md); `type`: `\"channel\"`; \\} \\| \\{ `entity`: [`Message`](../../channels/message/classes/Message.md); `type`: `\"channel_message\"`; \\} \\| \\{ `entity`: [`Project`](../../projects/project/classes/Project.md); `type`: `\"project\"`; \\} \\| \\{ `entity`: [`EmailThread`](../../email/thread/classes/EmailThread.md); `type`: `\"email_thread\"`; \\} \\| \\{ `entity`: [`CalendarEvent`](../../calendar/event/classes/CalendarEvent.md); `type`: `\"calendar_event\"`; \\} \\| \\{ `entity`: [`CallRecord`](../../calls/call-record/classes/CallRecord.md); `type`: `\"call\"`; \\} \\| \\{ `entity`: [`ForeignEntity`](../../foreign/foreign-entity/classes/ForeignEntity.md); `type`: `\"foreign_entity\"`; \\} \\| \\{ `entity`: [`Company`](../../crm/company/classes/Company.md); `type`: `\"crm_company\"`; \\} \\| \\{ `entity`: [`Contact`](../../crm/contact/classes/Contact.md); `type`: `\"crm_contact\"`; \\} \\| \\{ `entity`: [`CrmPipeline`](../../crm/pipeline/classes/CrmPipeline.md); `type`: `\"crm_pipeline\"`; \\} \\| \\{ `entity`: [`AgentSession`](../../agent-sessions/agent-session/classes/AgentSession.md); `type`: `\"agent_session\"`; \\} \\| \\{ `entity`: [`Routine`](../../routines/routine/classes/Routine.md); `type`: `\"scheduled_action\"`; \\} \\| \\{ `entity`: [`Initiative`](../../initiatives/initiative/classes/Initiative.md); `type`: `\"initiative\"`; \\} \\| \\{ `entity`: [`Database`](../../databases/database/classes/Database.md); `type`: `\"database\"`; \\} \\| \\{ `entity`: [`DatabaseRow`](../../databases/row/classes/DatabaseRow.md); `type`: `\"database_row\"`; \\} \\| \\{ `entity`: [`Form`](../../forms/form/classes/Form.md); `type`: `\"form\"`; \\}\n\nTyped entity references accepted by cross-resource APIs.\n\n\n<!-- src/entities/search/functions/entitySearch.md -->\n# Function: entitySearch()\n\n> **entitySearch**\\<`T`, `K`\\>(`opts`): (`client`, `query`, `searchOpts?`) => `AsyncGenerator`\\<`T`\\>\n\nBuild a `search(client, query, opts?)` function for one entity type: unified\nsearch hits narrowed to `type`, each mapped through `make`.\nMost relevant first, auto-paginated.\n\n## Type Parameters\n\n| Type Parameter |\n| ------ |\n| <a id=\"type-parameter-t\"></a> `T` |\n| <a id=\"type-parameter-k\"></a> `K` *extends* `\"email\"` \\| `\"project\"` \\| `\"chat\"` \\| `\"channel\"` \\| `\"document\"` \\| `\"call\"` \\| `\"company\"` \\| `\"calendarEvent\"` \\| `\"agentSession\"` \\| `\"channelMessage\"` |\n\n## Parameters\n\n| Parameter | Type | Description |\n| ------ | ------ | ------ |\n| `opts` | \\{ `filters?`: [`EntityFilters`](../../../../generated/search/types.gen/type-aliases/EntityFilters.md); `includeCrm?`: `boolean`; `make`: (`client`, `hit`) => `T`; `type`: `K`; \\} | - |\n| `opts.filters?` | [`EntityFilters`](../../../../generated/search/types.gen/type-aliases/EntityFilters.md) | - |\n| `opts.includeCrm?` | `boolean` | Opt in to CRM results (off by default server-side; required for company hits). |\n| `opts.make` | (`client`, `hit`) => `T` | - |\n| `opts.type` | `K` | - |\n\n## Returns\n\n(`client`, `query`, `searchOpts?`) => `AsyncGenerator`\\<`T`\\>\n\n\n<!-- src/entities/search/interfaces/SearchOpts.md -->\n# Interface: SearchOpts\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-pagesize\"></a> `pageSize?` | `number` |\n| <a id=\"property-searchon\"></a> `searchOn?` | [`SearchOn`](../type-aliases/SearchOn.md) |\n\n\n<!-- src/entities/search/type-aliases/SearchOn.md -->\n# Type Alias: SearchOn\n\n> **SearchOn** = `\"name\"` \\| `\"content\"` \\| `\"name_content\"`\n\n\n<!-- src/entities/sharing/access/classes/AccessRequest.md -->\n# Class: AccessRequest\n\nOne access request; resolutions preserve optimistic concurrency.\n\n## Extends\n\n- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\\<[`AccessRequest`](../../../../../generated/storage/types.gen/type-aliases/AccessRequest.md)\\>\n\n## Properties\n\n| Property | Modifier | Type | Description | Inherited from |\n| ------ | ------ | ------ | ------ | ------ |\n| <a id=\"property-access\"></a> `access` | `readonly` | [`EntityAccess`](EntityAccess.md) | Entity access surface owning the request. | - |\n| <a id=\"property-id\"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |\n| <a id=\"property-requestedlevel\"></a> `requestedLevel` | `readonly` | () => `Promise`\\<[`AccessLevel`](../../../../../generated/storage/types.gen/type-aliases/AccessLevel.md)\\> | Requested access. | - |\n| <a id=\"property-requester\"></a> `requester` | `readonly` | () => `Promise`\\<[`User`](../../../users/user/classes/User.md)\\> | Requesting user. | - |\n| <a id=\"property-revision\"></a> `revision` | `readonly` | () => `Promise`\\<`number`\\> | Request revision. | - |\n| <a id=\"property-status\"></a> `status` | `readonly` | () => `Promise`\\<[`RequestStatus`](../../../../../generated/storage/types.gen/type-aliases/RequestStatus.md)\\> | Current request state. | - |\n\n## Methods\n\n### resolve()\n\n> **resolve**(`grantedLevel?`): `Promise`\\<`void`\\>\n\nApprove with an access level, or decline by omitting it.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `grantedLevel?` | [`AccessLevel`](../../../../../generated/storage/types.gen/type-aliases/AccessLevel.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `detail?`: [`AccessRequest`](../../../../../generated/storage/types.gen/type-aliases/AccessRequest.md); `id`: `string`; \\}\n\n#### Returns\n\n\\{ `detail?`: [`AccessRequest`](../../../../../generated/storage/types.gen/type-aliases/AccessRequest.md); `id`: `string`; \\}\n\n| Name | Type |\n| ------ | ------ |\n| `detail?` | [`AccessRequest`](../../../../../generated/storage/types.gen/type-aliases/AccessRequest.md) |\n| `id` | `string` |\n\n#### Inherited from\n\n[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)\n\n***\n\n### from()\n\n> `static` **from**(`client`, `access`, `record`): `AccessRequest`\n\nSeed a request from a state or submission response.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `access` | [`EntityAccess`](EntityAccess.md) |\n| `record` | [`AccessRequest`](../../../../../generated/storage/types.gen/type-aliases/AccessRequest.md) |\n\n#### Returns\n\n`AccessRequest`\n\n\n<!-- src/entities/sharing/access/classes/EntityAccess.md -->\n# Class: EntityAccess\n\nAccess requests and direct grants scoped to a shareable entity.\n\n## Constructors\n\n### Constructor\n\n> **new EntityAccess**(`client`, `entityType`, `entity`): `EntityAccess`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `entityType` | [`ShareEntityType`](../../../../../generated/storage/types.gen/type-aliases/ShareEntityType.md) |\n| `entity` | \\{ `id`: `string`; \\} |\n| `entity.id` | `string` |\n\n#### Returns\n\n`EntityAccess`\n\n## Methods\n\n### cancel()\n\n> **cancel**(`revision`): `Promise`\\<`void`\\>\n\nCancel the caller's own request at its observed revision.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `revision` | `number` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### direct()\n\n> **direct**(): `Promise`\\<\\{ `accessLevel`: [`AccessLevel`](../../../../../generated/storage/types.gen/type-aliases/AccessLevel.md); `user`: [`User`](../../../users/user/classes/User.md); \\}[]\\>\n\nDirect grants expressed as user handles.\n\n#### Returns\n\n`Promise`\\<\\{ `accessLevel`: [`AccessLevel`](../../../../../generated/storage/types.gen/type-aliases/AccessLevel.md); `user`: [`User`](../../../users/user/classes/User.md); \\}[]\\>\n\n***\n\n### grant()\n\n> **grant**(`user`, `accessLevel?`): `Promise`\\<`void`\\>\n\nGrant direct access, or remove it by omitting the access level.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `user` | [`User`](../../../users/user/classes/User.md) |\n| `accessLevel?` | [`AccessLevel`](../../../../../generated/storage/types.gen/type-aliases/AccessLevel.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### remove()\n\n> **remove**(`user`): `Promise`\\<`void`\\>\n\nRemove one user's direct grant.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `user` | [`User`](../../../users/user/classes/User.md) |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n***\n\n### resolve()\n\n> **resolve**(`request`, `resolution`): `Promise`\\<[`AccessRequest`](../../../../../generated/storage/types.gen/type-aliases/AccessRequest.md)\\>\n\nResolve a request belonging to this entity at an observed revision.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `request` | [`AccessRequest`](AccessRequest.md) |\n| `resolution` | [`ResolveRequest`](../../../../../generated/storage/types.gen/type-aliases/ResolveRequest.md) |\n\n#### Returns\n\n`Promise`\\<[`AccessRequest`](../../../../../generated/storage/types.gen/type-aliases/AccessRequest.md)\\>\n\n***\n\n### state()\n\n> **state**(`offset?`): `Promise`\\<\\{ `accessLevel`: [`AccessLevel`](../../../../../generated/storage/types.gen/type-aliases/AccessLevel.md) \\| `undefined`; `canReview`: `boolean`; `mine`: [`AccessRequest`](AccessRequest.md) \\| `undefined`; `nextOffset`: `number` \\| `undefined`; `owner`: [`User`](../../../users/user/classes/User.md) \\| `undefined`; `pendingCount`: `number`; `requests`: [`AccessRequest`](AccessRequest.md)[]; `supportedLevels`: [`AccessLevel`](../../../../../generated/storage/types.gen/type-aliases/AccessLevel.md)[]; \\}\\>\n\nA page of access requests, including the caller's own request and review rights.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `offset?` | `number` |\n\n#### Returns\n\n`Promise`\\<\\{ `accessLevel`: [`AccessLevel`](../../../../../generated/storage/types.gen/type-aliases/AccessLevel.md) \\| `undefined`; `canReview`: `boolean`; `mine`: [`AccessRequest`](AccessRequest.md) \\| `undefined`; `nextOffset`: `number` \\| `undefined`; `owner`: [`User`](../../../users/user/classes/User.md) \\| `undefined`; `pendingCount`: `number`; `requests`: [`AccessRequest`](AccessRequest.md)[]; `supportedLevels`: [`AccessLevel`](../../../../../generated/storage/types.gen/type-aliases/AccessLevel.md)[]; \\}\\>\n\n***\n\n### submit()\n\n> **submit**(`requestedLevel`, `revision?`): `Promise`\\<[`AccessRequest`](AccessRequest.md)\\>\n\nRequest access, optionally naming the revision of an earlier request.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `requestedLevel` | [`AccessLevel`](../../../../../generated/storage/types.gen/type-aliases/AccessLevel.md) |\n| `revision?` | `number` |\n\n#### Returns\n\n`Promise`\\<[`AccessRequest`](AccessRequest.md)\\>\n\n***\n\n### toJSON()\n\n> **toJSON**(): \\{ `entity_id`: `string`; `entity_type`: [`ShareEntityType`](../../../../../generated/storage/types.gen/type-aliases/ShareEntityType.md); \\}\n\nSerialize the entity reference without credentials.\n\n#### Returns\n\n\\{ `entity_id`: `string`; `entity_type`: [`ShareEntityType`](../../../../../generated/storage/types.gen/type-aliases/ShareEntityType.md); \\}\n\n| Name | Type |\n| ------ | ------ |\n| `entity_id` | `string` |\n| `entity_type` | [`ShareEntityType`](../../../../../generated/storage/types.gen/type-aliases/ShareEntityType.md) |\n\n\n<!-- src/entities/sharing/permissions/functions/sharePermissionBody.md -->\n# Function: sharePermissionBody()\n\n> **sharePermissionBody**(`options`): [`UpdateSharePermissionRequestV2`](../../../../../generated/storage/types.gen/type-aliases/UpdateSharePermissionRequestV2.md)\n\nConvert sharing options into the generated backend contract.\n\n## Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `options` | [`SharePermissionOptions`](../type-aliases/SharePermissionOptions.md) |\n\n## Returns\n\n[`UpdateSharePermissionRequestV2`](../../../../../generated/storage/types.gen/type-aliases/UpdateSharePermissionRequestV2.md)\n\n\n<!-- src/entities/sharing/permissions/type-aliases/SharePermissionOptions.md -->\n# Type Alias: SharePermissionOptions\n\n> **SharePermissionOptions** = `Omit`\\<[`UpdateSharePermissionRequestV2`](../../../../../generated/storage/types.gen/type-aliases/UpdateSharePermissionRequestV2.md), `\"channelSharePermissions\"`\\> & \\{ `channelSharePermissions?`: \\{ `accessLevel?`: [`AccessLevel`](../../../../../generated/storage/types.gen/type-aliases/AccessLevel.md); `channel`: [`Channel`](../../../channels/channel/classes/Channel.md); `operation`: [`UpdateChannelSharePermission`](../../../../../generated/storage/types.gen/type-aliases/UpdateChannelSharePermission.md)\\[`\"operation\"`\\]; \\}[] \\| `null`; \\}\n\nSharing updates reference channels by handle. Null clears the corresponding grant collection.\n\n## Type Declaration\n\n| Name | Type | Description |\n| ------ | ------ | ------ |\n| `channelSharePermissions?` | \\{ `accessLevel?`: [`AccessLevel`](../../../../../generated/storage/types.gen/type-aliases/AccessLevel.md); `channel`: [`Channel`](../../../channels/channel/classes/Channel.md); `operation`: [`UpdateChannelSharePermission`](../../../../../generated/storage/types.gen/type-aliases/UpdateChannelSharePermission.md)\\[`\"operation\"`\\]; \\}[] \\| `null` | Channel grants to create or replace. |\n\n\n<!-- src/events/receiver/classes/MacroEvents.md -->\n# Class: MacroEvents\n\nPer-instance event receiver. Subscribe with [MacroEvents.on](#on), then\neither [MacroEvents.listen](#listen) (SSE, the default) or mount\n[MacroEvents.webhook](#webhook) at a persisted webhook URL.\n\nObtain via `macro.events` — do not construct directly.\n\n## Constructors\n\n### Constructor\n\n> **new MacroEvents**(`client`, `secret?`): `MacroEvents`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `client` | `MacroClient` |\n| `secret?` | `string` |\n\n#### Returns\n\n`MacroEvents`\n\n## Methods\n\n### handle()\n\n> **handle**(`rawBody`, `headers`): `Promise`\\<`void`\\>\n\nFeed a raw webhook delivery in: verifies the signature, parses, and\ndispatches to matching handlers.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `rawBody` | `string` |\n| `headers` | `DeliveryHeaders` |\n\n#### Returns\n\n`Promise`\\<`void`\\>\n\n#### Throws\n\nif no signing secret was configured, or if the\n signature is missing or invalid.\n\n***\n\n### listen()\n\n> **listen**(`opts?`): `Promise`\\<() => `void`\\>\n\nOpen a live Server-Sent Events stream of matching broker events. This is\nthe default way to receive events — no public URL or signing secret\nrequired. Delivery is best-effort: events published before the\nconnection, while disconnected, or dropped for a slow subscriber are\nmissed; there is no replay.\n\nFilters default to the event names currently registered with [on](#on).\nThe stream uses those filters for its lifetime; later `.on` / unsubscribe\ncalls do not change what the server sends.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts?` | [`ListenOptions`](../interfaces/ListenOptions.md) |\n\n#### Returns\n\n`Promise`\\<() => `void`\\>\n\nA function that closes the stream.\n\n***\n\n### on()\n\n> **on**\\<`E`\\>(`event`, `handler`): () => `void`\n\nSubscribe to an event across all entities.\n\n#### Type Parameters\n\n| Type Parameter |\n| ------ |\n| <a id=\"type-parameter-e\"></a> `E` *extends* `\"agent_session.opened\"` \\| `\"agent_session.turn_started\"` \\| `\"agent_session.turn_ended\"` \\| `\"agent_session.command_rejected\"` \\| `\"agent_session.settled\"` \\| `\"agent_session.waiting_for_input\"` \\| `\"agent_session.input_received\"` \\| `\"agent_session.mentioned\"` \\| `\"agent_session.stopped\"` \\| `\"agent_session.renamed\"` \\| `\"agent_session.deleted\"` \\| `\"channel.picture_changed\"` \\| `\"channel.created\"` \\| `\"channel.updated\"` \\| `\"channel.deleted\"` \\| `\"channel.participant_added\"` \\| `\"channel.participant_removed\"` \\| `\"document.created\"` \\| `\"document.updated\"` \\| `\"document.deleted\"` \\| `\"document.content_uploaded\"` \\| `\"document.sync_content_updated\"` \\| `\"document.purged\"` \\| `\"document.copied\"` \\| `\"document.interaction\"` \\| `\"message.posted\"` \\| `\"message.patched\"` \\| `\"message.deleted\"` \\| `\"message.mentioned\"` \\| `\"message.attachment_created\"` \\| `\"message.attachment_removed\"` |\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `event` | `E` |\n| `handler` | `EventHandler`\\<`E`\\> |\n\n#### Returns\n\nAn unsubscribe function.\n\n() => `void`\n\n***\n\n### onSelfMention()\n\n> **onSelfMention**(`handler`): () => `void`\n\nSubscribe to @-mentions of the authenticated caller: `message.mentioned`\ndeliveries whose mentioned entity is this bot (bot auth) or this user\n(user auth), in channels and in document comments alike.\n\n`message.mentioned` deliveries cover every mention the stream's (or\nwebhook's) workspace can access (its `ids` filter holds channel or\ndocument ids); picking out \"me\" happens here, client-side. The caller's\nidentity is resolved lazily (once) on the first delivery.\n\nFor SSE, register this handler before [listen](#listen) so the derived\nfilters include `message.mentioned`. For persisted webhooks, register the\nwebhook separately, e.g. `macro.webhooks.create({ filters: [{ events:\n['message.mentioned'] }], … })`.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `handler` | `EventHandler`\\<`\"message.mentioned\"`\\> |\n\n#### Returns\n\nAn unsubscribe function.\n\n() => `void`\n\n***\n\n### webhook()\n\n> **webhook**(): (`req`) => `Promise`\\<`Response`\\>\n\nA Fetch-style handler to mount at your persisted webhook route.\n\nRequires `webhookSecret` (or `MACRO_WEBHOOK_SECRET`).\n\n#### Returns\n\n(`req`) => `Promise`\\<`Response`\\>\n\n#### Example\n\n```ts\napp.post('/webhook', macro.events.webhook()); // Hono\n```\n\n\n<!-- src/events/receiver/interfaces/ListenOptions.md -->\n# Interface: ListenOptions\n\nOptions for [MacroEvents.listen](../classes/MacroEvents.md#listen).\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-filters\"></a> `filters?` | [`WebhookFilter`](../../../../generated/storage/types.gen/type-aliases/WebhookFilter.md)[] | Event/entity-id filters, identical to persisted webhook `filters`. Defaults to one filter covering every event currently registered with [MacroEvents.on](../classes/MacroEvents.md#on). |\n| <a id=\"property-scope\"></a> `scope?` | [`WebhookScope`](../../../../generated/storage/types.gen/type-aliases/WebhookScope.md) | Personal or team workspace whose webhook lifecycle events are delivered. Defaults to `'user'`. |\n| <a id=\"property-signal\"></a> `signal?` | `AbortSignal` | Abort the stream. |\n\n\n<!-- src/macro/classes/Macro.md -->\n# Class: Macro\\<T\\>\n\n## Type Parameters\n\n| Type Parameter | Default type |\n| ------ | ------ |\n| <a id=\"type-parameter-t\"></a> `T` *extends* [`MacroOpts`](../../config/interfaces/MacroOpts.md) | [`MacroOpts`](../../config/interfaces/MacroOpts.md) |\n\n## Constructors\n\n### Constructor\n\n> **new Macro**\\<`T`\\>(`opts`): `Macro`\\<`T`\\>\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `opts` | `T` |\n\n#### Returns\n\n`Macro`\\<`T`\\>\n\n## Properties\n\n| Property | Modifier | Type | Description |\n| ------ | ------ | ------ | ------ |\n| <a id=\"property-_client\"></a> `_client` | `readonly` | `MacroClient` | Direct access to the underlying hey-api service clients. |\n| <a id=\"property-agents\"></a> `agents` | `readonly` | [`AgentNamespace`](../../entities/agents/namespace/classes/AgentNamespace.md) | agents resources and operations. |\n| <a id=\"property-agentsessions\"></a> `agentSessions` | `readonly` | [`AgentSessionNamespace`](../../entities/agent-sessions/namespace/classes/AgentSessionNamespace.md) | - |\n| <a id=\"property-ai\"></a> `ai` | `readonly` | [`AiNamespace`](../../entities/ai/namespace/classes/AiNamespace.md) | - |\n| <a id=\"property-apikeys\"></a> `apiKeys` | `readonly` | [`ApiKeyNamespace`](../../entities/api-keys/namespace/classes/ApiKeyNamespace.md) | apiKeys resources and operations. |\n| <a id=\"property-bots\"></a> `bots` | `readonly` | [`BotsNamespace`](../../entities/bots/namespace/classes/BotsNamespace.md) | - |\n| <a id=\"property-calendar\"></a> `calendar` | `readonly` | [`CalendarNamespace`](../../entities/calendar/namespace/classes/CalendarNamespace.md) | - |\n| <a id=\"property-calls\"></a> `calls` | `readonly` | [`CallRecordNamespace`](../../entities/calls/namespace/classes/CallRecordNamespace.md) | - |\n| <a id=\"property-channels\"></a> `channels` | `readonly` | [`ChannelNamespace`](../../entities/channels/namespace/classes/ChannelNamespace.md) | - |\n| <a id=\"property-chats\"></a> `chats` | `readonly` | [`ChatNamespace`](../../entities/chats/namespace/classes/ChatNamespace.md) | - |\n| <a id=\"property-crm\"></a> `crm` | `readonly` | [`CrmNamespace`](../../entities/crm/namespace/classes/CrmNamespace.md) | - |\n| <a id=\"property-databases\"></a> `databases` | `readonly` | [`DatabaseNamespace`](../../entities/databases/namespace/classes/DatabaseNamespace.md) | - |\n| <a id=\"property-documents\"></a> `documents` | `readonly` | [`DocumentNamespace`](../../entities/documents/namespace/classes/DocumentNamespace.md) | - |\n| <a id=\"property-email\"></a> `email` | `readonly` | [`EmailNamespace`](../../entities/email/namespace/classes/EmailNamespace.md) | - |\n| <a id=\"property-entitymentions\"></a> `entityMentions` | `readonly` | [`EntityMentionNamespace`](../../entities/entity-mentions/namespace/classes/EntityMentionNamespace.md) | entityMentions resources and operations. |\n| <a id=\"property-events\"></a> `events` | `readonly` | [`MacroEvents`](../../events/receiver/classes/MacroEvents.md) | - |\n| <a id=\"property-favorites\"></a> `favorites` | `readonly` | [`FavoritesNamespace`](../../entities/favorites/namespace/classes/FavoritesNamespace.md) | - |\n| <a id=\"property-foreignentities\"></a> `foreignEntities` | `readonly` | [`ForeignEntityNamespace`](../../entities/foreign/namespace/classes/ForeignEntityNamespace.md) | - |\n| <a id=\"property-forms\"></a> `forms` | `readonly` | [`FormNamespace`](../../entities/forms/namespace/classes/FormNamespace.md) | Build forms and submit answers without granting respondents database access. |\n| <a id=\"property-githubpullrequests\"></a> `githubPullRequests` | `readonly` | [`GithubPullRequestNamespace`](../../entities/github-pull-requests/namespace/classes/GithubPullRequestNamespace.md) | githubPullRequests resources and operations. |\n| <a id=\"property-harnesses\"></a> `harnesses` | `readonly` | [`HarnessNamespace`](../../entities/harnesses/namespace/classes/HarnessNamespace.md) | harnesses resources and operations. |\n| <a id=\"property-initiatives\"></a> `initiatives` | `readonly` | [`InitiativeNamespace`](../../entities/initiatives/namespace/classes/InitiativeNamespace.md) | initiatives resources and operations. |\n| <a id=\"property-meetings\"></a> `meetings` | `readonly` | [`MeetingNamespace`](../../entities/meetings/namespace/classes/MeetingNamespace.md) | meetings resources and operations. |\n| <a id=\"property-notifications\"></a> `notifications` | `readonly` | [`NotificationNamespace`](../../entities/notifications/namespace/classes/NotificationNamespace.md) | - |\n| <a id=\"property-pins\"></a> `pins` | `readonly` | [`PinsNamespace`](../../entities/pins/namespace/classes/PinsNamespace.md) | - |\n| <a id=\"property-projects\"></a> `projects` | `readonly` | [`ProjectNamespace`](../../entities/projects/namespace/classes/ProjectNamespace.md) | - |\n| <a id=\"property-properties\"></a> `properties` | `readonly` | [`PropertiesNamespace`](../../entities/properties/namespace/classes/PropertiesNamespace.md) | - |\n| <a id=\"property-routines\"></a> `routines` | `readonly` | [`RoutineNamespace`](../../entities/routines/namespace/classes/RoutineNamespace.md) | routines resources and operations. |\n| <a id=\"property-tasks\"></a> `tasks` | `readonly` | [`TaskNamespace`](../../entities/tasks/namespace/classes/TaskNamespace.md) | - |\n| <a id=\"property-teams\"></a> `teams` | `readonly` | [`TeamNamespace`](../../entities/teams/namespace/classes/TeamNamespace.md) | - |\n| <a id=\"property-unfurls\"></a> `unfurls` | `readonly` | [`UnfurlNamespace`](../../entities/unfurls/namespace/classes/UnfurlNamespace.md) | unfurls resources and operations. |\n| <a id=\"property-users\"></a> `users` | `readonly` | [`UserNamespace`](../../entities/users/namespace/classes/UserNamespace.md) | - |\n| <a id=\"property-webappurl\"></a> `webAppUrl` | `readonly` | `string` | Base URL of the Macro web app, used to build entity URLs. |\n| <a id=\"property-webhooks\"></a> `webhooks` | `readonly` | [`WebhooksNamespace`](../../entities/webhooks/namespace/classes/WebhooksNamespace.md) | - |\n| <a id=\"property-workspace\"></a> `workspace` | `readonly` | [`WorkspaceNamespace`](../../entities/workspace/namespace/classes/WorkspaceNamespace.md) | Browse workspace activity with type, task, time, tag and inbox filters. |\n\n## Methods\n\n### myPrincipalId()\n\n> **myPrincipalId**(): `Promise`\\<`string`\\>\n\nThe authenticated caller's mentionable principal — `bot|<uuid>` for bot\nauth, `macro|<email>` for user auth — fetched once and cached.\n\n#### Returns\n\n`Promise`\\<`string`\\>\n\n***\n\n### requestedAs()\n\n> **requestedAs**(`user`): `Macro`\\<`T`\\>\n\nClone of this SDK acting on behalf of `user` (sent as\n`x-macro-bot-for-macro-user-id`). Bot auth only — throws for user auth,\nsince a user token always acts as its own user.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `user` | [`User`](../../entities/users/user/classes/User.md) |\n\n#### Returns\n\n`Macro`\\<`T`\\>\n\n\n<!-- src/macro/type-aliases/RequestActivity.md -->\n# Type Alias: RequestActivity\n\n> **RequestActivity** = \\{ `id`: `number`; `operation`: `string`; `service`: `string`; `status`: `\"started\"` \\| `\"completed\"` \\| `\"failed\"`; \\}\n\nA generated SDK operation lifecycle. Contains no arguments, URLs or response data.\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-id\"></a> `id` | `number` |\n| <a id=\"property-operation\"></a> `operation` | `string` |\n| <a id=\"property-service\"></a> `service` | `string` |\n| <a id=\"property-status\"></a> `status` | `\"started\"` \\| `\"completed\"` \\| `\"failed\"` |\n\n\n<!-- src/mentions/functions/msg.md -->\n# Function: msg()\n\n> **msg**(`strings`, ...`values`): [`RichMessage`](../interfaces/RichMessage.md)\n\nCompose a rich message. Interpolate mentions (a User, Document,\n[here](../variables/here.md), …) or plain strings. Each mention writes its `<m-*>` tag into the\ncontent *and* adds itself to `mentions[]`, so the two can never drift; strings\nare inserted as-is, so markdown like `**bold**` passes through untouched.\n\n## Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `strings` | `TemplateStringsArray` |\n| ...`values` | [`Interpolation`](../type-aliases/Interpolation.md)[] |\n\n## Returns\n\n[`RichMessage`](../interfaces/RichMessage.md)\n\n## Example\n\n```ts\nchannel.send(msg`Hey ${user}, see ${doc}. cc ${here}`);\nchannel.send(msg`Status: ${status} — see ${doc}`);\n```\n\n\n<!-- src/mentions/functions/toBody.md -->\n# Function: toBody()\n\n> **toBody**(`body`): [`RichMessage`](../interfaces/RichMessage.md)\n\nNormalize a plain string or a [RichMessage](../interfaces/RichMessage.md) to the wire shape.\n\n## Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `body` | `string` \\| [`RichMessage`](../interfaces/RichMessage.md) |\n\n## Returns\n\n[`RichMessage`](../interfaces/RichMessage.md)\n\n\n<!-- src/mentions/functions/wrapXml.md -->\n# Function: wrapXml()\n\n> **wrapXml**(`tag`, `data`): `string`\n\nSerialize a mention node to its `<tag>{json}</tag>` wire form.\n\n## Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `tag` | `string` |\n| `data` | `unknown` |\n\n## Returns\n\n`string`\n\n\n<!-- src/mentions/interfaces/MentionPart.md -->\n# Interface: MentionPart\n\nThe two things a mentionable entity contributes to a message.\n\n## Properties\n\n| Property | Type | Description |\n| ------ | ------ | ------ |\n| <a id=\"property-mention\"></a> `mention` | [`SimpleMention`](../../../generated/storage/types.gen/type-aliases/SimpleMention.md) | The parallel entry the backend uses for notifications and permissions. |\n| <a id=\"property-tag\"></a> `tag` | `string` | The `<m-*>` tag written into the message content. |\n\n\n<!-- src/mentions/interfaces/Mentionable.md -->\n# Interface: Mentionable\n\nAnything that can be dropped into a [msg](../functions/msg.md) template as a mention.\n\n## Methods\n\n### toMention()\n\n> **toMention**(): [`MentionPart`](MentionPart.md)\n\n#### Returns\n\n[`MentionPart`](MentionPart.md)\n\n\n<!-- src/mentions/interfaces/RichMessage.md -->\n# Interface: RichMessage\n\nA composed message body: content with embedded tags, and the matching mentions.\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-content\"></a> `content` | `string` |\n| <a id=\"property-mentions\"></a> `mentions` | [`SimpleMention`](../../../generated/storage/types.gen/type-aliases/SimpleMention.md)[] |\n\n\n<!-- src/mentions/type-aliases/Interpolation.md -->\n# Type Alias: Interpolation\n\n> **Interpolation** = [`Mentionable`](../interfaces/Mentionable.md) \\| `string` \\| `number`\n\nWhat may be interpolated into a [msg](../functions/msg.md) template: a mention, or plain text.\n\n\n<!-- src/mentions/variables/here.md -->\n# Variable: here\n\n> `const` **here**: [`Mentionable`](../interfaces/Mentionable.md)\n\nThe `@here` group mention.\n\n\n<!-- src/utils/lazy/classes/Lazy.md -->\n# Class: Lazy\\<T\\>\n\nA value fetched on first access and cached thereafter. Powers thin entity\nhandles: construction is free, the record is loaded lazily the first time a\nfield is read, and concurrent reads share one in-flight request. Pass a\n`seed` when the record is already known (from a list or an event) to skip the\nfetch entirely.\n\n## Type Parameters\n\n| Type Parameter |\n| ------ |\n| <a id=\"type-parameter-t\"></a> `T` |\n\n## Constructors\n\n### Constructor\n\n> **new Lazy**\\<`T`\\>(`loader`, `seed?`): `Lazy`\\<`T`\\>\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `loader` | () => `Promise`\\<`T`\\> |\n| `seed?` | `T` |\n\n#### Returns\n\n`Lazy`\\<`T`\\>\n\n## Methods\n\n### clear()\n\n> **clear**(): `void`\n\nDrop the cached value so the next read refetches.\n\n#### Returns\n\n`void`\n\n***\n\n### get()\n\n> **get**(): `Promise`\\<`T`\\>\n\n#### Returns\n\n`Promise`\\<`T`\\>\n\n***\n\n### peek()\n\n> **peek**(): `T` \\| `undefined`\n\nThe cached value, if already loaded — never triggers a fetch.\n\n#### Returns\n\n`T` \\| `undefined`\n\n\n<!-- src/utils/pagination/functions/paginate.md -->\n# Function: paginate()\n\n> **paginate**\\<`T`, `Cursor`\\>(`fetchPage`): `AsyncGenerator`\\<`T`\\>\n\nAsync generator over a cursor-paginated API. Iterate with `for await`.\nCursors are plain JSON values (strings or small objects), so a page whose\nnext cursor serialises identically to the one it was fetched with means the\nserver is not advancing; the generator throws instead of looping forever.\n\n## Type Parameters\n\n| Type Parameter | Default type |\n| ------ | ------ |\n| <a id=\"type-parameter-t\"></a> `T` | - |\n| <a id=\"type-parameter-cursor\"></a> `Cursor` | `string` |\n\n## Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `fetchPage` | (`cursor?`) => `Promise`\\<[`Page`](../interfaces/Page.md)\\<`T`, `Cursor`\\>\\> |\n\n## Returns\n\n`AsyncGenerator`\\<`T`\\>\n\n\n<!-- src/utils/pagination/interfaces/Page.md -->\n# Interface: Page\\<T, Cursor\\>\n\nOne page of a cursor-paginated list.\n\n## Type Parameters\n\n| Type Parameter | Default type |\n| ------ | ------ |\n| <a id=\"type-parameter-t\"></a> `T` | - |\n| <a id=\"type-parameter-cursor\"></a> `Cursor` | `string` |\n\n## Properties\n\n| Property | Type |\n| ------ | ------ |\n| <a id=\"property-items\"></a> `items` | `T`[] |\n| <a id=\"property-nextcursor\"></a> `nextCursor?` | `Cursor` \\| `null` |\n\n\n<!-- src/utils/unwrap/classes/MacroApiError.md -->\n# Class: MacroApiError\n\nA non-2xx HTTP response (Macro API, or a raw fetch like presigned downloads).\n\n## Extends\n\n- [`MacroError`](MacroError.md)\n\n## Extended by\n\n- [`MacroOpRefusedError`](../../../entities/databases/database/classes/MacroOpRefusedError.md)\n\n## Constructors\n\n### Constructor\n\n> **new MacroApiError**(`status`, `data`): `MacroApiError`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `status` | `number` |\n| `data` | `unknown` |\n\n#### Returns\n\n`MacroApiError`\n\n#### Overrides\n\n[`MacroError`](MacroError.md).[`constructor`](MacroError.md#constructor)\n\n## Properties\n\n| Property | Modifier | Type |\n| ------ | ------ | ------ |\n| <a id=\"property-data\"></a> `data` | `readonly` | `unknown` |\n| <a id=\"property-status\"></a> `status` | `readonly` | `number` |\n\n\n<!-- src/utils/unwrap/classes/MacroError.md -->\n# Class: MacroError\n\nBase for every error the SDK throws.\n\n## Extends\n\n- `Error`\n\n## Extended by\n\n- [`MacroApiError`](MacroApiError.md)\n- [`MacroNotFoundError`](MacroNotFoundError.md)\n\n## Constructors\n\n### Constructor\n\n> **new MacroError**(`message`): `MacroError`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `message` | `string` |\n\n#### Returns\n\n`MacroError`\n\n#### Overrides\n\n`Error.constructor`\n\n\n<!-- src/utils/unwrap/classes/MacroNotFoundError.md -->\n# Class: MacroNotFoundError\n\nThe API succeeded but the addressed entity doesn't exist in the result.\n\n## Extends\n\n- [`MacroError`](MacroError.md)\n\n## Constructors\n\n### Constructor\n\n> **new MacroNotFoundError**(`message`): `MacroNotFoundError`\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `message` | `string` |\n\n#### Returns\n\n`MacroNotFoundError`\n\n#### Overrides\n\n[`MacroError`](MacroError.md).[`constructor`](MacroError.md#constructor)\n\n\n<!-- src/utils/unwrap/functions/unwrap.md -->\n# Function: unwrap()\n\n> **unwrap**\\<`TData`, `TError`\\>(`res`): `TData`\n\nTurn a hey-api `{ data, error, response? }` result into either the success\npayload or a thrown MacroApiError.\n\n## Type Parameters\n\n| Type Parameter |\n| ------ |\n| <a id=\"type-parameter-tdata\"></a> `TData` |\n| <a id=\"type-parameter-terror\"></a> `TError` |\n\n## Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `res` | \\{ `data?`: `TData`; `error?`: `TError`; `response?`: `Response`; \\} |\n| `res.data?` | `TData` |\n| `res.error?` | `TError` |\n| `res.response?` | `Response` |\n\n## Returns\n\n`TData`\n"}]diff --git a/crates/agent_code_mode/src/domain/operations.json b/crates/agent_code_mode/src/domain/operations.jsonindex c22ec9e13b..89ddce9b59 100644--- a/crates/agent_code_mode/src/domain/operations.json+++ b/crates/agent_code_mode/src/domain/operations.json@@ -297,6 +297,18 @@"properties.promoteTag": "Promote Tag","search.unifiedSearch": "Search workspace","search.simpleUnifiedSearch": "Search workspace",+ "scheduled-action.scheduledActionHealth": "Scheduled Action Health",+ "scheduled-action.listScheduledActions": "List Scheduled Actions",+ "scheduled-action.createScheduledAction": "Create Scheduled Action",+ "scheduled-action.deleteScheduledAction": "Delete Scheduled Action",+ "scheduled-action.getScheduledAction": "Get Scheduled Action",+ "scheduled-action.updateScheduledAction": "Update Scheduled Action",+ "scheduled-action.setScheduledActionEnabled": "Set Scheduled Action Enabled",+ "scheduled-action.executeScheduledActionNow": "Execute Scheduled Action Now",+ "scheduled-action.listScheduledActionHistory": "List Scheduled Action History",+ "unfurl.proxyRequestHandler": "Proxy Request",+ "unfurl.getUnfurl": "Get Unfurl",+ "unfurl.getUnfurlBulk": "Get Unfurl Bulk","storage.listAgents": "List Agents","storage.createAgent": "Create Agent","storage.updateAgent": "Update Agent",@@ -412,6 +424,7 @@"storage.createDatabase": "Create Database","storage.saveDatabaseQuery": "Save Database Query","storage.getDatabaseQuery": "Get Database Query",+ "storage.queryDatabases": "Query Databases","storage.ensureStarterHandler": "Ensure Starter","storage.deliverDatabaseWebhook": "Deliver Database Webhook","storage.getDatabase": "Get Database",diff --git a/crates/code_execution/src/outbound/deno/sdk.mjs b/crates/code_execution/src/outbound/deno/sdk.mjsindex 60e66d9667..077252014f 100644--- a/crates/code_execution/src/outbound/deno/sdk.mjs+++ b/crates/code_execution/src/outbound/deno/sdk.mjs@@ -1,52 +1,62 @@// Generated by packages/code-mode-sdk/scripts/generate.ts.-async function VO($,O,x){if(!Number.isInteger(O)||O<1)throw RangeError(`concurrency limit must be a positive integer, got ${O}`);let j=Array($.length),S=0,K=async()=>{while(S<$.length){let Z=S;S+=1,j[Z]=await x($[Z])}},G=Array.from({length:Math.min(O,$.length)},K);return await Promise.all(G),j}class M${loader;value;inflight;constructor($,O){this.loader=$;this.value=O}get(){if(this.value!==void 0)return Promise.resolve(this.value);return this.inflight??=this.loader().then(($)=>{return this.value=$,$}),this.inflight}peek(){return this.value}clear(){this.value=void 0,this.inflight=void 0}}async function*s($){let O;do{let x=await $(O),j=x.nextCursor??void 0;if(O!==void 0&&j!==void 0&&JSON.stringify(j)===JSON.stringify(O))throw Error("Pagination cursor did not advance");yield*x.items,O=j}while(O!==void 0)}class w extends Error{constructor($){super($);this.name="MacroError"}}class a$ extends w{status;data;constructor($,O){super(`Macro API error ${$}`);this.status=$;this.data=O;this.name="MacroApiError"}}class m extends w{constructor($){super($);this.name="MacroNotFoundError"}}function J($){if($.error!==void 0)throw new a$($.response?.status??0,$.error);return $.data}class q{client;id;detail;constructor($,O,x){this.client=$;this.id=O;this.detail=new M$(()=>this.fetch(),x)}field($){return async()=>(await this.detail.get())[$]??void 0}mappedField($,O){return async()=>O((await this.detail.get())[$]??void 0)}toJSON(){let $=this.detail.peek();return $===void 0?{id:this.id}:{id:this.id,detail:$}}async mutate($){let O=J(await $(this.client));return this.detail.clear(),O}}class N$ extends q{async favorite(){return J(await this.client.storage.addFavorite({body:{entityId:this.id,entityType:this.entityType}})),this}async unfavorite(){return J(await this.client.storage.removeFavoriteByEntity({path:{entity_type:this.entityType,entity_id:this.id}})),this}}class x$ extends N${propertyReference(){return{entity_type:this.propertyEntityType,entity_id:this.id}}async properties($){let{properties:O}=J(await this.client.properties.getEntityProperties({path:{entity_type:this.propertyEntityType,entity_id:this.id},query:$?.includeMetadata!==void 0?{include_metadata:$.includeMetadata}:void 0}));return O}async setProperty($,O){J(await this.client.properties.setEntityProperty({path:{...this.propertyReference(),property_id:$.id},body:{value:O??null}}))}async updatePropertyOptions($){return J(await this.client.properties.bulkUpdateEntityPropertyOptions({path:this.propertyReference(),body:{properties:$.map((O)=>({property_id:O.property.id,...O.add?{add_option_ids:O.add.map((x)=>x.id)}:{},...O.remove?{remove_option_ids:O.remove.map((x)=>x.id)}:{}}))}}))}async deleteProperty($){J(await this.client.properties.deleteEntityProperty({path:{entity_property_id:$.property.id}}))}}function b$($,O){return`<${$}>${JSON.stringify(O)}</${$}>`}function yS($){return typeof $==="object"&&$!==null&&typeof $.toMention==="function"}var hS={toMention:()=>({tag:b$("m-group-mention",{groupAlias:"here"}),mention:{entity_type:"group",entity_id:"here"}})};function vS($,...O){let x="",j=[];for(let[S,K]of $.entries()){x+=K;let G=O[S];if(G===void 0)continue;if(yS(G)){let Z=G.toMention();x+=Z.tag,j.push(Z.mention)}else x+=String(G)}return{content:x,mentions:mS(j)}}function mS($){let O=new Set;return $.filter((x)=>{let j=`${x.entity_type}:${x.entity_id}`;if(O.has(j))return!1;return O.add(j),!0})}function e($){return typeof $==="string"?{content:$,mentions:[]}:$}var cS=50;function o($){let{filters:O,type:x,make:j,includeCrm:S}=$;return(K,G,Z)=>{let X=Z?.searchOn??"name_content",L=Z?.pageSize??cS;return s(async(Y)=>{let{results:Q,next_cursor:T}=J(await K.search.unifiedSearch({body:{query:G,match_type:"partial",search_on:X,...O?{filters:O}:{},...S?{include_crm:!0}:{}},query:{page_size:L,...Y?{cursor:Y}:{}}}));return{items:Q.filter((W)=>W.type===x).map((W)=>j(K,W)),nextCursor:T}})}}async function EO($,O,x){let{channelId:j,thread:S}=dS(O);if(await uS($)){let{id:G}=J(await $.storage.entityMessageCreate({path:{parent_type:"channel",parent_id:j},body:{content:x.content,mentions:x.mentions,attachments:[],thread_id:S?.rootId??null,nonce:crypto.randomUUID()}}));return G}if(S)throw new w("a user-owned bot can only post via the channel webhook endpoint, which "+"does not support threads — use a team-owned bot, or requestedAs(user), "+"to reply in a thread");let{message_id:K}=J(await $.storage.postChannelBotWebhook({path:{channel_id:j},body:{content:x.content},headers:{"x-macro-bot-scope":"user"}}));return K}function dS($){return"rootId"in $?{channelId:$.channelId,thread:$}:{channelId:$.id}}async function uS($){if($.authConfig.type!=="bot"||$.hasActingUser())return!0;let{owner:O}=await $.selfBot();return O?.type==="team"}class P${client;channelId;rootId;constructor($,O,x){this.client=$;this.channelId=O;this.rootId=x}toJSON(){return{channelId:this.channelId,rootId:this.rootId}}channel(){return f.byId(this.client,this.channelId)}root(){return j$.byId(this.client,this.channelId,this.rootId)}async replies(){let{replies:$}=J(await this.client.storage.entityMessageGetThread({path:{parent_type:"channel",parent_id:this.channelId,id:this.rootId}}));return $.map((O)=>j$.from(this.client,this.channelId,O))}async reply($){let O=await EO(this.client,this,e($));return j$.byId(this.client,this.channelId,O)}}class j$ extends N${channelId;mentions;entityType="channel_message";constructor($,O,x,j=[],S){super($,x,S);this.channelId=O;this.mentions=j}get path(){return{parent_type:"channel",parent_id:this.channelId,id:this.id}}async fetch(){return J(await this.client.storage.entityMessageGetMessage({path:this.path}))}static byId($,O,x,j=[]){return new j$($,O,x,j)}static from($,O,x){return new j$($,O,x.id,x.mentions,x)}content=this.field("content");createdAt=this.field("created_at");editedAt=this.field("edited_at");updatedAt=this.field("updated_at");async author(){return M.byId(this.client,(await this.detail.get()).sender_id)}channel(){return f.byId(this.client,this.channelId)}thread(){return new P$(this.client,this.channelId,this.id)}async react($){return await this.mutate((O)=>O.storage.entityMessageReact({path:this.path,body:{add:!0,emoji:$}})),this}async unreact($){return await this.mutate((O)=>O.storage.entityMessageReact({path:this.path,body:{add:!1,emoji:$}})),this}async edit($){let{content:O,mentions:x}=e($);return await this.mutate((j)=>j.storage.entityMessageEdit({path:this.path,body:{content:O,mentions:x}})),this}async delete(){await this.mutate(($)=>$.storage.entityMessageDeleteMessage({path:this.path}))}async reply($){return this.thread().reply($)}}class f extends x${entityType="channel";propertyEntityType="CHANNEL";async fetch(){return J(await this.client.storage.getChannel({path:{channel_id:this.id}}))}static byId($,O){return new f($,O)}static async dm($,O){let{channel_id:x}=J(await $.storage.getOrCreateDm({body:{recipient_id:O.id}}));return new f($,x)}static async private($,O){let{channel_id:x}=J(await $.storage.getOrCreatePrivate({body:{recipients:O.map((j)=>j.id)}}));return new f($,x)}static async create($,O){let{id:x}=J(await $.storage.createChannel({body:{channel_type:O.type,name:O.name??null,participants:(O.participants??[]).map((j)=>j.id),team_id:O.team?.id??null}}));return new f($,x)}name=this.field("channel_name");type=this.field("channel_type");async send($,O){let x=await EO(this.client,O?.thread??this,e($));return j$.byId(this.client,this.id,x)}messages($){return this.timeline({limit:$?.pageSize})}messagesAfter($,O){return this.timeline({activity_after:$ instanceof Date?$.toISOString():$,limit:O?.pageSize})}timeline($){return s(async(O)=>{let x=J(await this.client.storage.messageTimeline({path:{parent_type:"channel",parent_id:this.id},query:{selection:JSON.stringify({...$,cursor:O})}}));return{items:x.items.map((j)=>j$.from(this.client,this.id,j)),nextCursor:x.next_cursor}})}message($){return j$.byId(this.client,this.id,$)}async rename($){await this.mutate((O)=>O.storage.patchChannel({path:{channel_id:this.id},body:{channel_name:$}}))}async delete(){await this.mutate(($)=>$.storage.deleteChannel({path:{channel_id:this.id}}))}async join(){await this.mutate(($)=>$.storage.joinChannel({path:{channel_id:this.id}}))}async joinCode(){let{join_code:$}=J(await this.client.storage.getChannelJoinLink({path:{channel_id:this.id}}));return $}async leave(){await this.mutate(($)=>$.storage.leaveChannel({path:{channel_id:this.id}}))}async participants(){return J(await this.client.storage.getChannelParticipants({path:{channel_id:this.id}}))}async addParticipants($){await this.mutate((O)=>O.storage.addParticipants({path:{channel_id:this.id},body:{participants:$.map((x)=>x.id)}}))}async removeParticipants($){await this.mutate((O)=>O.storage.removeParticipants({path:{channel_id:this.id},body:{participants:$.map((x)=>x.id)}}))}async typing($,O){J(await this.client.storage.entityMessageTyping({path:{parent_type:"channel",parent_id:this.id},body:{active:$==="start",thread_id:O?.thread?.rootId??null}}))}attachments($){return s(async(O)=>{let x=J(await this.client.storage.getChannelAttachments({path:{channel_id:this.id},query:{...$?.pageSize?{limit:$.pageSize}:{},...$?.type?{attachment_type:$.type}:{},...O?{cursor:O}:{}}}));return{items:x.items,nextCursor:x.next_cursor}})}webUrl(){return`${this.client.webAppUrl}/app/channel/${this.id}`}static search=o({type:"channel",make:($,O)=>new f($,O.channel_id)})}class M extends x${entityType="user";propertyEntityType="USER";async fetch(){let{names:$}=J(await this.client.auth.getUserNamesWithEmail({body:{user_ids:[this.id]}})),O=$.find((x)=>x.id===this.id);if(!O)throw new m(`user ${this.id} not found`);return O}static byId($,O){return new M($,O)}static async me($){let{user_id:O}=J(await $.auth.getUserInfo());return new M($,O)}async name(){let $=await this.detail.get();return[$.first_name,$.last_name].filter(Boolean).join(" ")||void 0}email(){let $=this.id.startsWith("macro|")?this.id.slice(6):void 0;return $?.includes("@")?$:void 0}dm(){return f.dm(this.client,this)}toMention(){return{tag:b$("m-user-mention",{userId:this.id}),mention:{entity_type:"user",entity_id:this.id}}}}class Z$ extends q{parent;constructor($,O,x,j){super($,x,j);this.parent=O}static byId($,O,x){return new Z$($,O,x)}static fromRecord($,O,x){return new Z$($,O,x.id,x)}static async create($,O,x){return Z$.createForSession($,O.session(),x,O)}static async createForSession($,O,x,j){let S=J(await $.agentHarness.createSessionReview({path:{session_id:O.id},body:{...x,executionId:j?.id??null}}));return Z$.fromRecord($,O,S)}static async list($,O){return J(await $.agentHarness.listExecutionReviews({path:{session_id:O.session().id,execution_id:O.id}})).map((j)=>Z$.fromRecord($,O.session(),j))}async fetch(){return J(await this.client.agentHarness.getSessionReview({path:{session_id:this.parent.id,review_id:this.id}}))}title=this.field("title");kind=this.field("kind");session(){return this.parent}async reference(){return{kind:await this.kind(),id:this.id}}async items(){return(await this.detail.get()).items.map(($)=>new vx($,{edit:(O)=>this.decide({action:"edit",item:$.id,draft:O}),submit:()=>this.decide({action:"submit",items:[$.id]}),dismiss:()=>this.decide({action:"dismiss",items:[$.id]})}))}async refresh(){return this.detail.clear(),await this.detail.get(),this}async submitAll(){await this.decide({action:"submit",items:[]})}async dismissAll(){await this.decide({action:"dismiss",items:[]})}async decide($){let O=(await this.detail.get()).revision;await this.mutate((x)=>x.agentHarness.decideSessionReview({path:{session_id:this.parent.id,review_id:this.id},body:{...$,revision:O}}))}}class vx{snapshot;actions;constructor($,O){this.snapshot=$;this.actions=O}get id(){return this.snapshot.id}get status(){return this.snapshot.status}get draft(){return this.snapshot.draft}get result(){return this.snapshot.result}async edit($){await this.actions.edit($)}async submit(){await this.actions.submit()}async dismiss(){await this.actions.dismiss()}}class WO extends q{parent;constructor($,O,x){super($,O);this.parent=x}static byId($,O,x){return new WO($,x,O)}async fetch(){return J(await this.client.agentHarness.getCodeExecution({path:{session_id:this.parent.id,execution_id:this.id}}))}reviews={create:($)=>Z$.create(this.client,this,$),list:()=>Z$.list(this.client,this)};session(){return this.parent}status=this.field("status");source=this.field("source");calls=this.field("calls");error=this.field("error");async result(){return(await this.detail.get()).result}async refresh(){return this.detail.clear(),await this.detail.get(),this}}class wO{client;sessionId;dto;constructor($,O,x){this.client=$;this.sessionId=O;this.dto=x}static from($,O,x){return new wO($,O,x)}get actionId(){return this.dto.actionId}get kind(){return this.dto.kind}get prompt(){return this.dto.prompt??void 0}get attachments(){return this.dto.attachments??[]}get actorUserId(){return this.dto.actorUserId??void 0}get createdAt(){return this.dto.createdAt}async edit($){return J(await this.client.agentHarness.editQueuedAction({path:{session_id:this.sessionId,action_id:this.actionId},body:{prompt:$}})),this.dto={...this.dto,prompt:$},this}async steer(){J(await this.client.agentHarness.steerQueuedAction({path:{session_id:this.sessionId,action_id:this.actionId}}))}async remove(){J(await this.client.agentHarness.removeQueuedAction({path:{session_id:this.sessionId,action_id:this.actionId}}))}}class $$ extends q{static byId($,O){return new $$($,O)}static async createManaged($,O){let{session:x}=J(await $.agentHarness.createAgentSession({body:{prompt:O?.prompt,instructions:O?.instructions,model:O?.model,repoUrl:O?.repoUrl,repoBranch:O?.repoBranch}}));return new $$($,x.id,x)}static async repositories($){let{repositories:O}=J(await $.agentHarness.listAgentRepositories());return O.map((x)=>({url:x.url,defaultBranch:x.defaultBranch??void 0}))}static async repositoryBranches($,O){let{branches:x}=J(await $.agentHarness.listAgentRepositoryBranches({query:{repoUrl:O}}));return x}async fetch(){return J(await this.client.agentHarness.getAgentSession({path:{session_id:this.id}}))}name=this.field("name");isArchived=this.field("isArchived");model=this.field("model");harness=this.field("harness");repoUrl=this.field("repoUrl");workspace=this.field("workspace");instructions=this.field("instructions");status=this.field("status");sandboxSize=this.field("sandboxSize");createdAt=this.field("createdAt");modifiedAt=this.field("modifiedAt");static async forPullRequest($,O){let{sessionIds:x}=J(await $.agentHarness.agentSessionsForPullRequest({body:{url:O}}));return x.map((j)=>$$.byId($,j))}async pullRequests(){let{pullRequests:$}=J(await this.client.agentHarness.listAgentSessionPullRequests({path:{session_id:this.id}}));return $.map((O)=>({githubKey:O.githubKey,url:O.url,source:O.source,linkedBy:O.linkedBy?M.byId(this.client,O.linkedBy):void 0,createdAt:O.createdAt}))}async linkPullRequest($){J(await this.client.agentHarness.linkAgentSessionPullRequest({path:{session_id:this.id},body:{url:$}}))}async unlinkPullRequest($){J(await this.client.agentHarness.unlinkAgentSessionPullRequest({path:{session_id:this.id},query:{url:$}}))}async rename($){await this.mutate((O)=>O.agentHarness.renameAgentSession({path:{session_id:this.id},body:{name:$}}))}async archive(){await this.setArchived(!0)}async unarchive(){await this.setArchived(!1)}async setArchived($){await this.mutate((O)=>O.agentHarness.setAgentSessionArchived({path:{session_id:this.id},body:{isArchived:$}}))}async setSandboxSize($){let{size:O}=await this.mutate((x)=>x.agentHarness.putAgentSessionSandboxSize({path:{session_id:this.id},body:{size:$}}));return O}static async defaultSandboxSize($){return J(await $.agentHarness.getAgentSandboxSize()).size}static async setDefaultSandboxSize($,O){return J(await $.agentHarness.putAgentSandboxSize({body:{size:O}})).size}static async codingPreferences($){return J(await $.agentHarness.getAgentCodingPreferences())}static async setCodingPreferences($,O){return J(await $.agentHarness.putAgentCodingPreferences({body:O}))}async control($){return this.mutate((O)=>O.agentHarness.controlAgentSession({path:{session_id:this.id},body:$}))}prompt($,O){return this.control({type:"prompt",prompt:$,...O&&O.length>0?{attachments:O}:{}})}async queue(){let{entries:$}=J(await this.client.agentHarness.getAgentSessionQueue({path:{session_id:this.id}}));return $.map((O)=>wO.from(this.client,this.id,O))}async changes(){return J(await this.client.agentHarness.getAgentSessionChanges({path:{session_id:this.id}}))}async changesPatch(){return J(await this.client.agentHarness.getAgentSessionChangesPatch({path:{session_id:this.id}})).patch}async refreshChanges(){return this.mutate(($)=>$.agentHarness.refreshAgentSessionChanges({path:{session_id:this.id}}))}async log(){return J(await this.client.agentHarness.getAgentSessionLog({path:{session_id:this.id}}))}reviews={create:($)=>Z$.createForSession(this.client,this,$),byId:($)=>Z$.byId(this.client,this,$)};codeExecutions={byId:($)=>WO.byId(this.client,this,$)};async delete(){await this.mutate(($)=>$.agentHarness.deleteAgentSession({path:{session_id:this.id}}))}}class mx{client;constructor($){this.client=$}byId($){return $$.byId(this.client,$)}createManaged($){return $$.createManaged(this.client,$)}repositories(){return $$.repositories(this.client)}repositoryBranches($){return $$.repositoryBranches(this.client,$)}forPullRequest($){return $$.forPullRequest(this.client,$)}defaultSandboxSize(){return $$.defaultSandboxSize(this.client)}setDefaultSandboxSize($){return $$.setDefaultSandboxSize(this.client,$)}codingPreferences(){return $$.codingPreferences(this.client)}setCodingPreferences($){return $$.setCodingPreferences(this.client,$)}}class cx{client;constructor($){this.client=$}async structuredCompletion($){return J(await this.client.cognition.structuredCompletion({body:$}))}async decide($){return J(await this.client.cognition.decisions({body:$}))}}class BO{client;constructor($){this.client=$}async me(){if(this.client.authConfig.type!=="bot")throw new w("bots.me() requires bot auth — a user API key has no bot identity");return J(await this.client.storage.getSelfBot())}async channels(){if(this.client.authConfig.type!=="bot")throw new w("bots.channels() requires bot auth — a user API key has no bot identity");let $=await this.me();return J(await this.client.storage.listBotChannels({path:{bot_id:$.id}}))}async myPrincipalId(){if(this.client.authConfig.type!=="bot")throw new w("bots.myPrincipalId() requires bot auth — a user API key has no bot identity");return this.client.myPrincipalId()}}class X$ extends q{async fetch(){let{links:$}=J(await this.client.email.listLinks()),O=$.find((x)=>x.id===this.id);if(!O)throw new m(`email link ${this.id} not found`);return O}static byId($,O){return new X$($,O)}static async list($){let{links:O}=J(await $.email.listLinks());return O.map((x)=>new X$($,x.id,x))}emailAddress=this.field("email_address");provider=this.field("provider");isPrimary=this.field("is_primary");isSyncActive=this.field("is_sync_active");syncStatus=this.field("sync_status");needsReauth=this.field("needs_reauth");photoUrl=this.field("photo_url");async settingsOperations(){return J(await this.client.email.mailboxSettingsOperations({headers:{"X-Email-Link-Id":this.id}}))}}class g$ extends q{async fetch(){let{calendars:$}=J(await this.client.calendar.listCalendars()),O=$.find((x)=>x.id===this.id);if(!O)throw new m(`calendar ${this.id} not found`);return O}static byId($,O){return new g$($,O)}static async list($){let{calendars:O}=J(await $.calendar.listCalendars());return O.map((x)=>new g$($,x.id,x))}name=this.field("name");emailAddress=this.field("emailAddress");isPrimary=this.field("isPrimary");isWritable=this.field("isWritable");isSubscription=this.field("isSubscription");color=this.field("color");syncError=this.field("syncError");emailLink=this.mappedField("emailLinkId",($)=>X$.byId(this.client,$))}class LO{client;id;constructor($,O){this.client=$;this.id=O}async status(){return J(await this.client.calendar.calendarReplacementStatus({path:{operation_id:this.id}}))}async confirm(){return J(await this.client.calendar.confirmCalendarReplacement({path:{operation_id:this.id}}))}async discard(){J(await this.client.calendar.discardCalendarReplacement({path:{operation_id:this.id}}))}}class U$ extends q{async fetch(){throw new w(`calendar event ${this.id} has no fetch-by-id endpoint; read the record returned by calendar.createEvent / event.update / event.rsvp instead`)}static byId($,O){return new U$($,O)}static fromRecord($,O){return new U$($,O.id,O)}title=this.field("title");description=this.field("description");location=this.field("location");time=this.field("time");status=this.field("status");attendees=this.field("attendees");transparency=this.field("transparency");isReadOnly=this.field("isReadOnly");recurrenceLines=this.field("recurrenceLines");calendar=this.mappedField("calendarId",($)=>$?g$.byId(this.client,$):void 0);record(){return this.detail.get()}async update($){let O=await this.mutate((x)=>x.calendar.updateCalendarEvent({path:{event_id:this.id},body:lS($)}));return U$.fromRecord(this.client,O)}async delete($={}){await this.mutate((O)=>O.calendar.deleteCalendarEvent({path:{event_id:this.id},query:{calendarId:$.calendar?.id,scope:$.scope,recurrenceId:$.recurrenceId}}))}async prepareReplacement($){let O=J(await this.client.calendar.prepareCalendarReplacement({path:{event_id:this.id},body:{removeConference:$.removeConference,recurrenceId:$.recurrenceId,calendarId:$.calendar?.id}}));return new LO(this.client,O.operationId)}async providerUrl($={}){return J(await this.client.calendar.calendarEventProviderUrl({path:{event_id:this.id},query:{recurrenceId:$.recurrenceId,calendarId:$.calendar?.id}})).url??void 0}async rsvp($){let O=await this.mutate((x)=>x.calendar.rsvpCalendarEvent({path:{event_id:this.id},body:{response:$.response,scope:$.scope,recurrenceId:$.recurrenceId,calendarId:$.calendar?.id}}));return U$.fromRecord(this.client,O)}}function lS($){return{title:$.title,description:$.description,location:$.location,time:$.time,attendees:$.attendees,recurrenceLines:$.recurrenceLines,visibility:$.visibility,transparency:$.transparency,reminders:$.reminders,conference:$.conference,outOfOffice:$.outOfOffice,scope:$.scope,recurrenceId:$.recurrenceId,calendarId:$.calendar?.id}}class dx{client;constructor($){this.client=$}calendars(){return g$.list(this.client)}calendar($){return g$.byId(this.client,$)}event($){return U$.byId(this.client,$)}replacement($){return new LO(this.client,$)}async createEvent($){let O=J(await this.client.calendar.createCalendarEvent({body:rS($)}));return U$.fromRecord(this.client,O)}}function rS($){return{title:$.title,time:$.time,description:$.description,location:$.location,attendees:$.attendees,recurrenceLines:$.recurrenceLines,visibility:$.visibility,transparency:$.transparency,reminders:$.reminders,conference:$.conference,macroCall:$.macroCall,outOfOffice:$.outOfOffice,calendarId:$.calendar?.id,emailLinkId:$.emailLink?.id}}class k$ extends q{callId;constructor($,O,x,j){super($,x,j);this.callId=O}get path(){return{parent_type:"call",parent_id:this.callId,id:this.id}}async fetch(){return J(await this.client.storage.entityMessageGetMessage({path:this.path}))}static byId($,O,x){return new k$($,O,x)}static from($,O,x){return new k$($,O,x.id,x)}content=this.field("content");createdAt=this.field("created_at");updatedAt=this.field("updated_at");call(){return K$.byId(this.client,this.callId)}async author(){return M.byId(this.client,(await this.detail.get()).sender_id)}async reply($){let O=J(await this.client.storage.entityMessageCreate({path:{parent_type:"call",parent_id:this.callId},body:{...e($),thread_id:this.callId}}));return k$.from(this.client,this.callId,O)}async edit($){let{content:O,mentions:x}=e($);return await this.mutate((j)=>j.storage.entityMessageEdit({path:this.path,body:{content:O,mentions:x}})),this}async delete(){await this.mutate(($)=>$.storage.entityMessageDeleteMessage({path:this.path}))}}class K$ extends N${entityType="call";async fetch(){return J(await this.client.storage.getCallRecord({path:{call_id:this.id}}))}static byId($,O){return new K$($,O)}message($){return k$.byId(this.client,this.id,$)}name=this.field("customName");channel=this.mappedField("channelId",($)=>$?f.byId(this.client,$):void 0);channelName=this.field("channelName");creator=this.mappedField("createdBy",($)=>M.byId(this.client,$));isActive=this.field("isActive");status=this.field("status");roomName=this.field("roomName");startedAt=this.field("startedAt");endedAt=this.field("endedAt");durationMs=this.field("durationMs");summary=this.field("summary");transcript=this.field("transcript");participants=this.field("participants");guests=this.field("guests");teamShareAccessLevel=this.field("teamShareAccessLevel");shareWithTeam=this.field("shareWithTeam");recordingUrl=this.field("recordingUrl");recordingPreviewUrl=this.field("recordingPreviewUrl");recordingStartedAt=this.field("recordingStartedAt");async rename($){await this.mutate((O)=>O.storage.editCallRecord({path:{call_id:this.id},body:{customName:$??""}}))}async setTeamShare($){await this.mutate((O)=>O.storage.editCallRecord({path:{call_id:this.id},body:{sharePermission:{teamShareAccessLevel:$?"view":null}}}))}async delete(){await this.mutate(($)=>$.storage.deleteCallRecord({path:{call_id:this.id}}))}static search=o({filters:{call_filters:{}},type:"call",make:($,O)=>new K$($,O.call_id)})}class ux{client;constructor($){this.client=$}byId($){return K$.byId(this.client,$)}search($,O){return K$.search(this.client,$,O)}}class lx{client;constructor($){this.client=$}async list(){let{labels:$}=J(await this.client.storage.listChannelLabels());return $}async create($,O=[]){return J(await this.client.storage.createChannelLabel({body:{name:$,channelIds:O.map((x)=>x.id)}}))}async createSmartTag($,O){return J(await this.client.storage.createChannelLabel({body:{name:$,rule:O}}))}async previewSmartTag($){return J(await this.client.storage.previewSmartTag({body:$}))}async updateSmartTag($,O,x){return J(await this.client.storage.renameChannelLabel({path:{label_id:$.id},body:{name:O,rule:x}}))}async rename($,O){return J(await this.client.storage.renameChannelLabel({path:{label_id:$.id},body:{name:O}}))}async delete($){J(await this.client.storage.deleteChannelLabel({path:{label_id:$.id}}))}async setLabel($,O){J(await this.client.storage.setChannelLabel({path:{channel_id:$.id},body:{labelId:O?.id??null}}))}}class rx{client;labels;constructor($){this.client=$;this.labels=new lx($)}byId($){return f.byId(this.client,$)}async dm($){return f.dm(this.client,$)}async private($){return f.private(this.client,$)}async create($){return f.create(this.client,$)}async list(){let{items:$}=J(await this.client.storage.getChannels());return $.map((O)=>f.byId(this.client,O.id.toString()))}async*search($,O){if(!O?.searchOn||O.searchOn==="name"){let{items:x}=J(await this.client.storage.getChannels()),j=$.toLowerCase();for(let S of x)if(S.name?.toLowerCase().includes(j))yield f.byId(this.client,S.id.toString())}else yield*f.search(this.client,$,O)}}class u extends x${entityType="project";propertyEntityType="PROJECT";async fetch(){let{data:$}=J(await this.client.storage.getProjectHandler({path:{id:this.id}}));return $.projectMetadata}static byId($,O){return new u($,O)}static async create($,O){let{data:x}=J(await $.storage.createProjectHandler({body:{name:O.name,projectParentId:O.parent?.id??null}}));return new u($,x.id,x)}name=this.field("name");parent=this.mappedField("parentId",($)=>$?u.byId(this.client,$):void 0);createdAt=this.field("createdAt");async items(){let{data:$}=J(await this.client.storage.getProjectContentHandler({path:{id:this.id}}));return $.map((O)=>O.item)}async rename($){await this.mutate((O)=>O.storage.editProjectV2({path:{id:this.id},body:{name:$}}))}async delete($){await this.mutate((O)=>$?.permanent?O.storage.permanentlyDeleteProject({path:{id:this.id}}):O.storage.deleteProjectHandler({path:{id:this.id}}))}async restore(){await this.mutate(($)=>$.storage.revertDeleteProject({path:{id:this.id}}))}static search=o({filters:{project_filters:{}},type:"project",make:($,O)=>new u($,O.id)})}class V$ extends x${entityType="chat";propertyEntityType="CHAT";async fetch(){let{chat:$}=J(await this.client.cognition.getChat({path:{chat_id:this.id}}));return $}static byId($,O){return new V$($,O)}static async create($,O){let{id:x}=J(await $.cognition.createChat({body:{name:O?.name??null,projectId:O?.project?.id??null}}));return new V$($,x)}name=this.field("name");model=this.field("model");project=this.mappedField("projectId",($)=>$?u.byId(this.client,$):void 0);createdAt=this.field("createdAt");updatedAt=this.field("updatedAt");messages=this.field("messages");async rename($){await this.mutate((O)=>O.cognition.patchChat({path:{chat_id:this.id},body:{name:$}}))}async delete($){await this.mutate((O)=>$?.permanent?O.cognition.permanentlyDeleteChat({path:{chat_id:this.id}}):O.cognition.deleteChat({path:{chat_id:this.id}}))}async copy(){let{id:$}=await this.mutate((O)=>O.cognition.copyChat({path:{chat_id:this.id}}));return new V$(this.client,$)}async restore(){await this.mutate(($)=>$.cognition.revertDeleteChat({path:{chat_id:this.id}}))}async history(){let{conversation:$}=J(await this.client.cognition.getChatHistoryHandler({path:{chat_id:this.id}}));return $}webUrl(){return`${this.client.webAppUrl}/app/chat/${this.id}`}static search=o({filters:{chat_filters:{}},type:"chat",make:($,O)=>new V$($,O.chat_id)});toMention(){return{tag:b$("m-document-mention",{documentId:this.id,documentName:this.detail.peek()?.name??"",blockName:"chat",blockParams:{}}),mention:{entity_type:"chat",entity_id:this.id}}}}class px{client;constructor($){this.client=$}byId($){return V$.byId(this.client,$)}create($){return V$.create(this.client,$)}search($,O){return V$.search(this.client,$,O)}}class z$ extends q{async fetch(){let O=J(await this.client.auth.getUserTeams()).find((x)=>x.id===this.id);if(!O)throw new m(`team ${this.id} not found`);return O}static byId($,O){return new z$($,O)}static async current($){let O=J(await $.auth.getTeam());if(!O)throw new m("caller has no current team");return new z$($,O.team.id,O.team)}static async list($){return J(await $.auth.getUserTeams()).map((x)=>new z$($,x.id,x))}name=this.field("name");slug=this.field("slug");defaultLinkShare=this.field("default_link_share");owner=this.mappedField("owner_id",($)=>M.byId(this.client,$));async members(){let $=J(await this.client.auth.getTeam());if(!$||$.team.id!==this.id)throw new w("members are only available for the current team (see Team.current)");return $.members.map((O)=>({user:M.byId(this.client,O.user_id),role:O.role}))}}var pS=8;class _$ extends q{parent;constructor($,O,x,j){super($,x,j);this.parent=O}get path(){return{parent_type:this.parent.type,parent_id:this.parent.id,id:this.id}}async fetch(){return J(await this.client.storage.entityMessageGetMessage({path:this.path}))}static byId($,O,x){return new _$($,O,x)}static from($,O,x){return new _$($,O,x.id,x)}text=this.field("content");createdAt=this.field("created_at");updatedAt=this.field("updated_at");deletedAt=this.field("deleted_at");async threadId(){return(await this.detail.get()).thread_id??this.id}async author(){return M.byId(this.client,(await this.detail.get()).sender_id)}async reply($){return NO(this.client,this.parent,$,{threadId:await this.threadId()})}async edit($){let{content:O,mentions:x}=e($);return await this.mutate((j)=>j.storage.entityMessageEdit({path:this.path,body:{content:O,mentions:x}})),this}async delete(){await this.mutate(($)=>$.storage.entityMessageDeleteMessage({path:this.path}))}}async function qO($,O){let x={parent_type:O.type,parent_id:O.id},j=s(async(K)=>{let G=J(await $.storage.messageTimeline({path:x,query:{selection:JSON.stringify({limit:100,cursor:K})}}));return{items:G.items,nextCursor:G.next_cursor}}),S=[];for await(let K of j)S.push(K);return VO(S,pS,async(K)=>{let{state:G,root:Z,replies:X}=J(await $.storage.entityMessageGetThread({path:{...x,id:K.id}}));return{thread:G,comments:[Z,...X].map((L)=>_$.from($,O,L))}})}async function NO($,O,x,j){let S=J(await $.storage.entityMessageCreate({path:{parent_type:O.type,parent_id:O.id},body:{...e(x),thread_id:j?.threadId??null}}));return _$.from($,O,S)}class I$ extends N${entityType="crm_contact";async fetch(){return J(await this.client.storage.getContact({path:{contact_id:this.id}}))}static byId($,O){return new I$($,O)}static from($,O){return new I$($,O.id,O)}name=this.field("name");email=this.field("email");company=this.mappedField("companyId",($)=>T$.byId(this.client,$));hidden=this.field("hidden");createdAt=this.field("createdAt");updatedAt=this.field("updatedAt");firstInteraction=this.field("firstInteraction");lastInteraction=this.field("lastInteraction");async hide(){await this.setHidden(!0)}async unhide(){await this.setHidden(!1)}async setHidden($){await this.mutate((O)=>O.storage.setContactHidden({path:{contact_id:this.id},body:{hidden:$}}))}async rename($){await this.mutate((O)=>O.storage.setCrmContactName({path:{contact_id:this.id},body:{name:$}}))}get commentParent(){return{type:"crm_contact",id:this.id}}async comments(){return qO(this.client,this.commentParent)}async comment($,O){return NO(this.client,this.commentParent,$,O)}commentById($){return _$.byId(this.client,this.commentParent,$)}}class T$ extends x${entityType="crm_company";propertyEntityType="COMPANY";async fetch(){return J(await this.client.storage.getCompany({path:{company_id:this.id}}))}static byId($,O){return new T$($,O)}static from($,O){return new T$($,O.id,O)}name=this.field("name");description=this.field("description");hidden=this.field("hidden");emailSync=this.field("emailSync");team=this.mappedField("teamId",($)=>z$.byId(this.client,$));createdAt=this.field("createdAt");updatedAt=this.field("updatedAt");async domain(){let{domains:$}=await this.detail.get();return $[0]?.domain}async domains(){let{domains:$}=await this.detail.get();return $.map((O)=>O.domain)}async contacts(){return J(await this.client.storage.listCompanyContacts({path:{company_id:this.id}})).map((O)=>I$.from(this.client,O))}static search=o({filters:{crm_company_filters:{}},type:"company",includeCrm:!0,make:($,O)=>new T$($,O.id)});async hide(){await this.setHidden(!0)}async unhide(){await this.setHidden(!1)}async setHidden($){await this.mutate((O)=>O.storage.setCompanyHidden({path:{company_id:this.id},body:{hidden:$}}))}async setEmailSync($){await this.mutate((O)=>O.storage.setEmailSync({path:{company_id:this.id},body:{email_sync:$}}))}async rename($){await this.mutate((O)=>O.storage.setCrmCompanyName({path:{company_id:this.id},body:{name:$}}))}async createContact($){let O=await this.mutate((x)=>x.storage.createCrmContact({path:{company_id:this.id},body:$}));return I$.from(this.client,O)}get commentParent(){return{type:"crm_company",id:this.id}}async comments(){return qO(this.client,this.commentParent)}async comment($,O){return NO(this.client,this.commentParent,$,O)}commentById($){return _$.byId(this.client,this.commentParent,$)}}class ax{client;constructor($){this.client=$}companyById($){return T$.byId(this.client,$)}contactById($){return I$.byId(this.client,$)}async contactByEmail($){let{contact:O}=J(await this.client.storage.getContactByEmail({query:{email:$}}));return O?I$.from(this.client,O):void 0}async searchContacts($,O={}){let{contacts:x}=J(await this.client.storage.searchContacts({query:{query:$,limit:O.limit}}));return x.map((j)=>I$.from(this.client,j))}async createCompany($){return T$.from(this.client,J(await this.client.storage.createCrmCompany({body:$})))}async settings(){return J(await this.client.storage.getCrmTeamSettings())}async updateSettings($){return J(await this.client.storage.putCrmTeamSettings({body:$}))}async setStages($){return J(await this.client.storage.putCrmTeamStages({body:$}))}async resetStages(){J(await this.client.storage.resetCrmTeamStages())}searchCompanies($){return T$.search(this.client,$)}}var G$=Symbol.for("@ts-pattern/matcher"),V0=Symbol.for("@ts-pattern/isVariadic");var ix=($)=>Boolean($&&typeof $=="object"),fO=($)=>$&&!!$[G$],l=($,O,x)=>{if(fO($)){let j=$[G$](),{matched:S,selections:K}=j.match(O);return S&&K&&Object.keys(K).forEach((G)=>x(G,K[G])),S}if(ix($)){if(!ix(O))return!1;if(Array.isArray($)){if(!Array.isArray(O))return!1;let j=[],S=[],K=[];for(let G of $.keys()){let Z=$[G];fO(Z)&&Z[V0]?K.push(Z):K.length?S.push(Z):j.push(Z)}if(K.length){if(K.length>1)throw Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(O.length<j.length+S.length)return!1;let G=O.slice(0,j.length),Z=S.length===0?[]:O.slice(-S.length),X=O.slice(j.length,S.length===0?1/0:-S.length);return j.every((L,Y)=>l(L,G[Y],x))&&S.every((L,Y)=>l(L,Z[Y],x))&&(K.length===0||l(K[0],X,x))}return $.length===O.length&&$.every((G,Z)=>l(G,O[Z],x))}return Reflect.ownKeys($).every((j)=>{let S=$[j];return((j in O)||fO(K=S)&&K[G$]().matcherType==="optional")&&l(S,O[j],x);var K})}return Object.is(O,$)},S$=($)=>{var O,x,j;return ix($)?fO($)?(O=(x=(j=$[G$]()).getSelectionKeys)==null?void 0:x.call(j))!=null?O:[]:Array.isArray($)?UO($,S$):UO(Object.values($),S$):[]},UO=($,O)=>$.reduce((x,j)=>x.concat(O(j)),[]);function aS(...$){if($.length===1){let[O]=$;return(x)=>l(O,x,()=>{})}if($.length===2){let[O,x]=$;return l(O,x,()=>{})}throw Error(`isMatching wasn't given the right number of arguments: expected 1 or 2, received ${$.length}.`)}function n($){return Object.assign($,{optional:()=>ex($),and:(O)=>c($,O),or:(O)=>W0($,O),select:(O)=>O===void 0?zO($):zO(O,$)})}function nx($){return Object.assign(((O)=>Object.assign(O,{[Symbol.iterator](){let x=0,j=[{value:Object.assign(O,{[V0]:!0}),done:!1},{done:!0,value:void 0}];return{next:()=>{var S;return(S=j[x++])!=null?S:j.at(-1)}}}}))($),{optional:()=>nx(ex($)),select:(O)=>nx(O===void 0?zO($):zO(O,$))})}function ex($){return n({[G$]:()=>({match:(O)=>{let x={},j=(S,K)=>{x[S]=K};return O===void 0?(S$($).forEach((S)=>j(S,void 0)),{matched:!0,selections:x}):{matched:l($,O,j),selections:x}},getSelectionKeys:()=>S$($),matcherType:"optional"})})}var iS=($,O)=>{for(let x of $)if(!O(x))return!1;return!0},nS=($,O)=>{for(let[x,j]of $.entries())if(!O(j,x))return!1;return!0},sS=($,O)=>{let x=Reflect.ownKeys($);for(let j of x)if(!O(j,$[j]))return!1;return!0};function c(...$){return n({[G$]:()=>({match:(O)=>{let x={},j=(S,K)=>{x[S]=K};return{matched:$.every((S)=>l(S,O,j)),selections:x}},getSelectionKeys:()=>UO($,S$),matcherType:"and"})})}function W0(...$){return n({[G$]:()=>({match:(O)=>{let x={},j=(S,K)=>{x[S]=K};return UO($,S$).forEach((S)=>j(S,void 0)),{matched:$.some((S)=>l(S,O,j)),selections:x}},getSelectionKeys:()=>UO($,S$),matcherType:"or"})})}function b($){return{[G$]:()=>({match:(O)=>({matched:Boolean($(O))})})}}function zO(...$){let O=typeof $[0]=="string"?$[0]:void 0,x=$.length===2?$[1]:typeof $[0]=="string"?void 0:$[0];return n({[G$]:()=>({match:(j)=>{let S={[O!=null?O:"@ts-pattern/anonymous-select-key"]:j};return{matched:x===void 0||l(x,j,(K,G)=>{S[K]=G}),selections:S}},getSelectionKeys:()=>[O!=null?O:"@ts-pattern/anonymous-select-key"].concat(x===void 0?[]:S$(x))})})}function B0($){return!0}function H$($){return typeof $=="number"}function y$($){return typeof $=="string"}function h$($){return typeof $=="bigint"}var L0=n(b(B0)),eS=n(b(B0)),tS=L0,v$=($)=>Object.assign(n($),{startsWith:(O)=>{return v$(c($,(x=O,b((j)=>y$(j)&&j.startsWith(x)))));var x},endsWith:(O)=>{return v$(c($,(x=O,b((j)=>y$(j)&&j.endsWith(x)))));var x},minLength:(O)=>v$(c($,((x)=>b((j)=>y$(j)&&j.length>=x))(O))),length:(O)=>v$(c($,((x)=>b((j)=>y$(j)&&j.length===x))(O))),maxLength:(O)=>v$(c($,((x)=>b((j)=>y$(j)&&j.length<=x))(O))),includes:(O)=>{return v$(c($,(x=O,b((j)=>y$(j)&&j.includes(x)))));var x},regex:(O)=>{return v$(c($,(x=O,b((j)=>y$(j)&&Boolean(j.match(x))))));var x}}),J0=v$(b(y$)),R$=($)=>Object.assign(n($),{between:(O,x)=>R$(c($,((j,S)=>b((K)=>H$(K)&&j<=K&&S>=K))(O,x))),lt:(O)=>R$(c($,((x)=>b((j)=>H$(j)&&j<x))(O))),gt:(O)=>R$(c($,((x)=>b((j)=>H$(j)&&j>x))(O))),lte:(O)=>R$(c($,((x)=>b((j)=>H$(j)&&j<=x))(O))),gte:(O)=>R$(c($,((x)=>b((j)=>H$(j)&&j>=x))(O))),int:()=>R$(c($,b((O)=>H$(O)&&Number.isInteger(O)))),finite:()=>R$(c($,b((O)=>H$(O)&&Number.isFinite(O)))),positive:()=>R$(c($,b((O)=>H$(O)&&O>0))),negative:()=>R$(c($,b((O)=>H$(O)&&O<0)))}),oS=R$(b(H$)),m$=($)=>Object.assign(n($),{between:(O,x)=>m$(c($,((j,S)=>b((K)=>h$(K)&&j<=K&&S>=K))(O,x))),lt:(O)=>m$(c($,((x)=>b((j)=>h$(j)&&j<x))(O))),gt:(O)=>m$(c($,((x)=>b((j)=>h$(j)&&j>x))(O))),lte:(O)=>m$(c($,((x)=>b((j)=>h$(j)&&j<=x))(O))),gte:(O)=>m$(c($,((x)=>b((j)=>h$(j)&&j>=x))(O))),positive:()=>m$(c($,b((O)=>h$(O)&&O>0))),negative:()=>m$(c($,b((O)=>h$(O)&&O<0)))}),$2=m$(b(h$)),O2=n(b(function($){return typeof $=="boolean"})),x2=n(b(function($){return typeof $=="symbol"})),j2=n(b(function($){return $==null})),S2=n(b(function($){return $!=null})),O$={__proto__:null,matcher:G$,optional:ex,array:function(...$){return nx({[G$]:()=>({match:(O)=>{if(!Array.isArray(O))return{matched:!1};if($.length===0)return{matched:!0};let x=$[0],j={};if(O.length===0)return S$(x).forEach((K)=>{j[K]=[]}),{matched:!0,selections:j};let S=(K,G)=>{j[K]=(j[K]||[]).concat([G])};return{matched:O.every((K)=>l(x,K,S)),selections:j}},getSelectionKeys:()=>$.length===0?[]:S$($[0])})})},set:function(...$){return n({[G$]:()=>({match:(O)=>{if(!(O instanceof Set))return{matched:!1};let x={};if(O.size===0)return{matched:!0,selections:x};if($.length===0)return{matched:!0};let j=(K,G)=>{x[K]=(x[K]||[]).concat([G])},S=$[0];return{matched:iS(O,(K)=>l(S,K,j)),selections:x}},getSelectionKeys:()=>$.length===0?[]:S$($[0])})})},map:function(...$){return n({[G$]:()=>({match:(O)=>{if(!(O instanceof Map))return{matched:!1};let x={};if(O.size===0)return{matched:!0,selections:x};let j=(Z,X)=>{x[Z]=(x[Z]||[]).concat([X])};if($.length===0)return{matched:!0};var S;if($.length===1)throw Error(`\`P.map\` wasn't given enough arguments. Expected (key, value), received ${(S=$[0])==null?void 0:S.toString()}`);let[K,G]=$;return{matched:nS(O,(Z,X)=>{let L=l(K,X,j),Y=l(G,Z,j);return L&&Y}),selections:x}},getSelectionKeys:()=>$.length===0?[]:[...S$($[0]),...S$($[1])]})})},record:function(...$){return n({[G$]:()=>({match:(O)=>{if(O===null||typeof O!="object"||Array.isArray(O))return{matched:!1};var x;if($.length===0)throw Error(`\`P.record\` wasn't given enough arguments. Expected (value) or (key, value), received ${(x=$[0])==null?void 0:x.toString()}`);let j={},S=(Z,X)=>{j[Z]=(j[Z]||[]).concat([X])},[K,G]=$.length===1?[J0,$[0]]:$;return{matched:sS(O,(Z,X)=>{let L=typeof Z!="string"||Number.isNaN(Number(Z))?null:Number(Z),Y=L!==null&&l(K,L,S),Q=l(K,Z,S),T=l(G,X,S);return(Q||Y)&&T}),selections:j}},getSelectionKeys:()=>$.length===0?[]:[...S$($[0]),...S$($[1])]})})},intersection:c,union:W0,not:function($){return n({[G$]:()=>({match:(O)=>({matched:!l($,O,()=>{})}),getSelectionKeys:()=>[],matcherType:"not"})})},when:b,select:zO,any:L0,unknown:eS,_:tS,string:J0,number:oS,bigint:$2,boolean:O2,symbol:x2,nullish:j2,nonNullable:S2,instanceOf:function($){return n(b(function(O){return(x)=>x instanceof O}($)))},shape:function($){return n(b(aS($)))}};class N0 extends Error{constructor($){let O;try{O=JSON.stringify($)}catch(x){O=$}super(`Pattern matching error: no pattern matches value ${O}`),this.input=void 0,this.input=$}}var sx={matched:!1,value:void 0};function d($){return new bO($,sx)}class bO{constructor($,O){this.input=void 0,this.state=void 0,this.input=$,this.state=O}with(...$){if(this.state.matched)return this;let O=$[$.length-1],x=[$[0]],j;$.length===3&&typeof $[1]=="function"?j=$[1]:$.length>2&&x.push(...$.slice(1,$.length-1));let S=!1,K={},G=(X,L)=>{S=!0,K[X]=L},Z=!x.some((X)=>l(X,this.input,G))||j&&!Boolean(j(this.input))?sx:{matched:!0,value:O(S?"@ts-pattern/anonymous-select-key"in K?K["@ts-pattern/anonymous-select-key"]:K:this.input,this.input)};return new bO(this.input,Z)}when($,O){if(this.state.matched)return this;let x=Boolean($(this.input));return new bO(this.input,x?{matched:!0,value:O(this.input,this.input)}:sx)}otherwise($){return this.state.matched?this.state.value:$(this.input)}exhaustive($=G2){return this.state.matched?this.state.value:$(this.input)}run(){return this.exhaustive()}returnType(){return this}narrow(){return this}}function G2($){throw new N0($)}var tx,Z2=new Uint8Array(16);function gO(){if(!tx){if(typeof crypto>"u"||!crypto.getRandomValues)throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");tx=crypto.getRandomValues.bind(crypto)}return tx(Z2)}var t=[];for(let $=0;$<256;++$)t.push(($+256).toString(16).slice(1));function U0($,O=0){return(t[$[O+0]]+t[$[O+1]]+t[$[O+2]]+t[$[O+3]]+"-"+t[$[O+4]]+t[$[O+5]]+"-"+t[$[O+6]]+t[$[O+7]]+"-"+t[$[O+8]]+t[$[O+9]]+"-"+t[$[O+10]]+t[$[O+11]]+t[$[O+12]]+t[$[O+13]]+t[$[O+14]]+t[$[O+15]]).toLowerCase()}var ox={};function X2($,O,x){let j;if($)j=z0($.random??$.rng?.()??gO(),$.msecs,$.seq,O,x);else{let S=Date.now(),K=gO();K2(ox,S,K),j=z0(K,ox.msecs,ox.seq,O,x)}return O??U0(j)}function K2($,O,x){if($.msecs??=-1/0,$.seq??=0,O>$.msecs)$.seq=x[6]<<23|x[7]<<16|x[8]<<8|x[9],$.msecs=O;else if($.seq=$.seq+1|0,$.seq===0)$.msecs++;return $}function z0($,O,x,j,S=0){if($.length<16)throw Error("Random bytes length must be >= 16");if(!j)j=new Uint8Array(16),S=0;else if(S<0||S+16>j.length)throw RangeError(`UUID byte range ${S}:${S+15} is out of buffer bounds`);return O??=Date.now(),x??=$[6]*127<<24|$[7]<<16|$[8]<<8|$[9],j[S++]=O/1099511627776&255,j[S++]=O/4294967296&255,j[S++]=O/16777216&255,j[S++]=O/65536&255,j[S++]=O/256&255,j[S++]=O&255,j[S++]=112|x>>>28&15,j[S++]=x>>>20&255,j[S++]=128|x>>>14&63,j[S++]=x>>>6&255,j[S++]=x<<2&255|$[10]&3,j[S++]=$[11],j[S++]=$[12],j[S++]=$[13],j[S++]=$[14],j[S++]=$[15],j}var F$=X2;class E${table;id;constructor($,O){this.table=$;this.id=O}static byId($,O){return new E$($,O)}async detail(){let{columns:$}=await this.table.detail(),O=$.find((x)=>x.column.id===this.id);if(!O)throw new m(`column ${this.id} is not on table ${this.table.id}`);return O}async name(){let $=await this.detail();return $.column.display_name??$.definition.definition.display_name}async rename($){return await this.table.database.renameColumn(this,$),this}async inferType($){return await this.table.database.inferColumnType(this,$),this}changeType($){return this.table.database.changeColumnType(this,$)}convertIntoNewColumn($){return this.table.database.convertColumnIntoNewColumn(this,$)}casts(){return this.table.database.columnCasts(this)}async delete(){await this.table.database.deleteColumn(this)}async dataType(){return(await this.detail()).definition.definition.data_type}async isMultiSelect(){return(await this.detail()).definition.definition.is_multi_select}async position(){return(await this.detail()).column.position}async definition(){return(await this.detail()).definition}async config(){return(await this.detail()).column.config??void 0}async addOptions($){return await this.table.database.addColumnOptions(this,$),this}toJSON(){return{id:this.id,tableId:this.table.id}}}class c${table;id;constructor($,O){this.table=$;this.id=O}static byId($,O){return new c$($,O)}history(){return this.table.database.rowHistory(this)}toJSON(){return{id:this.id,tableId:this.table.id}}}class kO{table;id;constructor($,O){this.table=$;this.id=O}static byId($,O){return new kO($,O)}async detail(){let{views:$}=await this.table.detail(),O=$.find((x)=>x.id===this.id);if(!O)throw new m(`view ${this.id} is not on table ${this.table.id}`);return O}async name(){return(await this.detail()).name}async position(){return(await this.detail()).position}async layout(){return(await this.detail()).layout}async query(){return(await this.detail()).query}positions(){return this.table.database.viewPositions(this)}toJSON(){return{id:this.id,tableId:this.table.id}}}class Y${database;id;constructor($,O){this.database=$;this.id=O}static byId($,O){return new Y$($,O)}async detail(){let{tables:$}=await this.database.schema(),O=$.find((x)=>x.table.id===this.id);if(!O)throw new m(`table ${this.id} is not in database ${this.database.id}`);return O}async name(){return(await this.detail()).table.name}async rename($){return await this.database.renameTable(this,$),this}async version(){return(await this.detail()).table.version}async position(){return(await this.detail()).table.position}async columns(){let{columns:$}=await this.detail();return $.map((O)=>E$.byId(this,O.column.id))}addColumn($){return this.database.addColumn(this,$)}async reorderColumns($){return await this.database.reorderColumns(this,$),this}row($){return c$.byId(this,$)}async views(){let{views:$}=await this.detail();return $.map((O)=>kO.byId(this,O.id))}createWebhook(){return this.database.createWebhook(this)}async delete(){await this.database.deleteTable(this)}toJSON(){return{id:this.id,databaseId:this.database.id}}}class yO{table;id;createdBy;record;constructor($,O,x,j){this.table=$;this.id=O;this.createdBy=x;this.record=j}static fromRecord($,O,x){return new yO($,x.id,O,x)}get tokenPrefix(){return this.record.tokenPrefix}get createdAt(){return this.record.createdAt}delete(){return this.table.database.deleteWebhook(this)}toJSON(){return{id:this.id,tableId:this.table.id,tokenPrefix:this.tokenPrefix}}}class xj extends a${op;row;column;taken;constructor($,O){super($,O);this.name="MacroOpRefusedError",this.message=O.message,this.op=O.op,this.row=O.row,this.column=O.column,this.taken=O.taken}}function hO($){return d($).with({type:"relation"},({table:O})=>({type:"relation",database:O.database.id,table:O.id})).with({type:O$.not("relation")},(O)=>O).exhaustive()}var Y2={USER:"People",DOCUMENT:"Documents",TASK:"Tasks",COMPANY:"Companies",CONTACT:"Contacts",CALL_RECORD:"Calls",CHANNEL:"Channels",CHAT:"Chats",PROJECT:"Projects",THREAD:"Emails",CALENDAR_EVENT:"Events",INITIATIVE:"Initiatives"};function Q2($){return d($).with({type:"text"},()=>"Text").with({type:"number"},()=>"Number").with({type:"boolean"},()=>"Checkbox").with({type:"date"},()=>"Date").with({type:"link"},()=>"URL").with({type:"select",multi:!0},()=>"Multi-select").with({type:"select",multi:!1},()=>"Select").with({type:"select_number",multi:!0},()=>"Multi-number select").with({type:"select_number",multi:!1},()=>"Number select").with({type:"tag"},()=>"Tag").with({type:"entity"},({target:O})=>Y2[O]).with({type:"relation"},()=>"Relation").exhaustive()}function $j($){return $.map((O)=>({id:F$(),label:O}))}function I0($,O,x){return $?.kind===O&&"change"in $&&$.change.kind===x}function Oj($){return d($).with({kind:"reorder_tables"},({kind:O})=>O).with({kind:O$.union("table","column","rows","view")},({kind:O,change:x})=>`${O}.${x.kind}`).exhaustive()}function w$($,O,x){let[j]=$;if($.length!==1||!I0(j,O,x))throw new w(`expected one ${O}.${x} result, got ${$.map(Oj).join(", ")||"none"}`);return j}class Q$ extends q{async fetch(){return J(await this.client.storage.getDatabase({path:{id:this.id}}))}assertOwns($,O){if(O.id!==this.id)throw new w(`${$} does not belong to database ${this.id}`)}static byId($,O){return new Q$($,O)}static async create($,O){let x=J(await $.storage.createDatabase({body:{name:O.name}}));return new Q$($,x.id)}static async list($){return J(await $.storage.listDatabases()).map((x)=>new Q$($,x.database.id))}schema(){return this.detail.get()}name=this.mappedField("database",($)=>$.name);owner=this.mappedField("database",($)=>M.byId(this.client,$.owner_id));createdAt=this.mappedField("database",($)=>$.created_at);trashedAt=this.mappedField("database",($)=>$.trashed_at??void 0);grant=this.field("grant");tables=this.mappedField("tables",($)=>$.map((O)=>Y$.byId(this,O.table.id)));async table($){let{tables:O}=await this.schema(),x=O.find((j)=>j.table.name===$);return x?Y$.byId(this,x.table.id):void 0}async createTable($){let{table:O}=w$(await this.applyOps([{kind:"table",table:F$(),change:{kind:"create",name:$.name}}]),"table","created");return Y$.byId(this,O)}async applyOps($,O={}){let x={ops:$};if(O.baseVersions!==void 0){for(let{table:S}of O.baseVersions)this.assertOwns(`table ${S.id}`,S.database);x.baseVersions=Object.fromEntries(O.baseVersions.map(({table:S,version:K})=>[S.id,K]))}let{results:j}=await this.mutate(async(S)=>{let K=await S.storage.applyDatabaseOps({path:{id:this.id},body:x});if(K.error!==void 0&&"op"in K.error)throw new xj(K.response?.status??0,K.error);return K});return j}async reorderTables($){for(let j of $)this.assertOwns(`table ${j.id}`,j.database);let O=await this.applyOps([{kind:"reorder_tables",order:$.map((j)=>j.id)}]),[x]=O;if(O.length!==1||x?.kind!=="reorder_tables")throw new w(`expected one reorder_tables result, got ${O.map(Oj).join(", ")||"none"}`);return x.tables.map(({table:j})=>Y$.byId(this,j))}async deleteTable($){this.assertOwns(`table ${$.id}`,$.database),w$(await this.applyOps([{kind:"table",table:$.id,change:{kind:"delete"}}]),"table","deleted")}async columnCasts($){return this.assertOwns(`column ${$.id}`,$.table.database),J(await this.client.storage.listDatabaseColumnCasts({path:{id:this.id,table_id:$.table.id,column_id:$.id}}))}async viewPositions($){this.assertOwns(`view ${$.id}`,$.table.database);let{positions:O}=J(await this.client.storage.getDatabaseViewPositions({path:{id:this.id,view_id:$.id}}));return O}async rowHistory($){this.assertOwns(`row ${$.id}`,$.table.database);let{changes:O}=J(await this.client.storage.getDatabaseRowHistory({path:{id:this.id,table_id:$.table.id,row_id:$.id}}));return O}async importTable($){let O=await this.mutate((x)=>x.storage.importDatabaseTable({path:{id:this.id},body:$}));return Y$.byId(this,O.id)}webhookOf($){return yO.fromRecord(Y$.byId(this,$.tableId),M.byId(this.client,$.createdBy),$)}async webhooks(){let{webhooks:$}=J(await this.client.storage.listDatabaseWebhooks({path:{id:this.id}}));return $.map((O)=>this.webhookOf(O))}async createWebhook($){this.assertOwns("table",$.database);let O=J(await this.client.storage.createDatabaseWebhook({path:{id:this.id},body:{tableId:$.id}}));return{webhook:this.webhookOf(O.webhook),token:O.token}}async deleteWebhook($){this.assertOwns("webhook",$.table.database),J(await this.client.storage.deleteDatabaseWebhook({path:{id:this.id,webhook_id:$.id}}))}async sharePermissions(){return J(await this.client.storage.getDatabasePermissions({path:{id:this.id}}))}updateSharePermissions($){return this.mutate((O)=>O.storage.updateDatabasePermissions({path:{id:this.id},body:$}))}async changeColumnType($,O){this.assertOwns(`column ${$.id}`,$.table.database);let x=await $.table.version();return w$(await this.applyOps([{kind:"column",table:$.table.id,column:$.id,change:{kind:"change_type",to:hO(O.to)}}],{baseVersions:[{table:$.table,version:x}]}),"column","type_changed")}async columnConversion($,O){return this.assertOwns(`column ${$.id}`,$.table.database),J(await this.client.storage.convertDatabaseColumn({path:{id:this.id,table_id:$.table.id,column_id:$.id},body:{to:hO(O)}}))}async convertColumnIntoNewColumn($,O){let x=await this.columnConversion($,O.to),j=O.name??`${await $.name()} (${Q2(O.to)})`,S=F$(),K=[{kind:"column",table:$.table.id,column:S,change:{kind:"create",definition:{source:"new",name:j,type:hO(O.to),options:$j(x.options)},after:$.id}}];if(x.cells.length>0)K.push({kind:"rows",table:$.table.id,change:{kind:"update",changes:{kind:"per_row",rows:x.cells.map(({row:Z,value:X})=>({row:Z,cells:[{column:S,value:X}]}))}}});let[G]=await this.applyOps(K,{baseVersions:[{table:$.table,version:x.tableVersion}]});if(!I0(G,"column","created"))throw new w(`expected a column.created result, got ${G?Oj(G):"none"}`);return E$.byId($.table,G.column)}async deleteColumn($){this.assertOwns(`column ${$.id}`,$.table.database);let O=await $.table.version(),{tableVersion:x}=w$(await this.applyOps([{kind:"column",table:$.table.id,column:$.id,change:{kind:"delete"}}],{baseVersions:[{table:$.table,version:O}]}),"column","deleted");return x}async reorderColumns($,O){this.assertOwns(`table ${$.id}`,$.database);for(let S of O)if(S.table.id!==$.id)throw new w(`column ${S.id} does not belong to table ${$.id}`);let x=await $.version(),{tableVersion:j}=w$(await this.applyOps([{kind:"table",table:$.id,change:{kind:"reorder_columns",order:O.map((S)=>S.id)}}],{baseVersions:[{table:$,version:x}]}),"table","columns_reordered");if(j===void 0)throw new w(`table ${$.id} reordered its columns without a version`);return j}async renameTable($,O){this.assertOwns(`table ${$.id}`,$.database);let x=await $.name(),{tableVersion:j}=w$(await this.applyOps([{kind:"table",table:$.id,change:{kind:"rename",name:O,previousName:x}}]),"table","renamed");if(j===void 0)throw new w(`table ${$.id} was renamed without a version`);return j}async renameColumn($,O){this.assertOwns(`column ${$.id}`,$.table.database);let x=await $.name(),{tableVersion:j}=w$(await this.applyOps([{kind:"column",table:$.table.id,column:$.id,change:{kind:"rename",name:O,previousName:x}}]),"column","renamed");return j}async inferColumnType($,O){return this.assertOwns(`column ${$.id}`,$.table.database),this.mutate((x)=>x.storage.inferDatabaseColumnType({path:{id:this.id,table_id:$.table.id,column_id:$.id},body:{dataType:O.dataType,baseVersion:O.baseVersion,...O.specificEntityType!==void 0?{specificEntityType:O.specificEntityType}:{}}}))}async addColumn($,O){if(this.assertOwns(`table ${$.id}`,$.database),O.after!==void 0&&O.after.table.id!==$.id)throw new w(`column ${O.after.id} does not belong to table ${$.id}`);let x="property"in O?{source:"existing",property:O.property.id}:{source:"new",name:O.name,type:hO(O.type),...O.options!==void 0?{options:$j(O.options)}:{},...O.inferType!==void 0?{inferType:O.inferType}:{}},{column:j}=w$(await this.applyOps([{kind:"column",table:$.id,column:F$(),change:{kind:"create",definition:x,...O.after!==void 0?{after:O.after.id}:{}}}]),"column","created");return E$.byId($,j)}async addColumnOptions($,O){return this.assertOwns(`column ${$.id}`,$.table.database),w$(await this.applyOps([{kind:"column",table:$.table.id,column:$.id,change:{kind:"add_options",options:$j(O)}}]),"column","options_added")}}class jj{client;constructor($){this.client=$}byId($){return Q$.byId(this.client,$)}create($){return Q$.create(this.client,$)}list(){return Q$.list(this.client)}}class d$ extends q{documentId;constructor($,O,x,j){super($,x,j);this.documentId=O}get path(){return{parent_type:"document",parent_id:this.documentId,id:this.id}}async fetch(){return J(await this.client.storage.entityMessageGetMessage({path:this.path}))}static byId($,O,x){return new d$($,O,x)}static from($,O,x){return new d$($,O,x.id,x)}text=this.field("content");createdAt=this.field("created_at");updatedAt=this.field("updated_at");async threadId(){return(await this.detail.get()).thread_id??this.id}document(){return E.byId(this.client,this.documentId)}async author(){return M.byId(this.client,(await this.detail.get()).sender_id)}async reply($){return this.document().comment($,{threadId:await this.threadId()})}async edit($){let{content:O,mentions:x}=e($);return await this.mutate((j)=>j.storage.entityMessageEdit({path:this.path,body:{content:O,mentions:x}})),this}async delete(){await this.mutate(($)=>$.storage.entityMessageDeleteMessage({path:this.path}))}}var J2=8;class E extends x${async fetch(){let{data:$}=J(await this.client.storage.getDocument({path:{document_id:this.id}}));return $.documentMetadata}static byId($,O){return new E($,O)}static async create($,O){let{documentId:x}=J(await $.storage.createMarkdownHandler({body:{documentName:O.name,markdown:O.markdown??null,projectId:O.project?.id??null}}));return new E($,x)}static async createSnippet($,O){let{documentId:x}=J(await $.storage.createSnippetHandler({body:{snippetName:O.name,markdown:O.markdown??null,projectId:O.project?.id??null}}));return new E($,x)}static async createSkill($,O){let{documentId:x}=J(await $.storage.createSkillHandler({body:{skillName:O.name,markdown:O.markdown??null,projectId:O.project?.id??null}}));return new E($,x)}static recent($,O){let x=O?.pageSize??50;return s(async(j)=>{let S=J(await $.storage.getUserDocumentsHandler({query:{limit:x,offset:j?Number(j):0,...O?.fileType!==void 0?{file_type:O.fileType}:{}}})),K=S.data?.next_offset;return{items:(S.data?.documents??[]).map((G)=>new E($,G.documentId)),nextCursor:K!=null?String(K):null}})}static async recentlyDeleted($){let{data:O}=J(await $.storage.recentlyDeleted({}));return O.items.filter((x)=>x.type==="document").map((x)=>new E($,x.id))}entityType="document";propertyEntityType="DOCUMENT";name=this.field("documentName");fileType=this.field("fileType");project=this.mappedField("projectId",($)=>$?u.byId(this.client,$):void 0);owner=this.mappedField("owner",($)=>M.byId(this.client,$));branchedFrom=this.mappedField("branchedFromId",($)=>$?E.byId(this.client,$):void 0);createdAt=this.field("createdAt");updatedAt=this.field("updatedAt");deletedAt=this.field("deletedAt");async content(){let{text:$}=J(await this.client.storage.getDocumentTextContent({path:{document_id:this.id}}));if($!==null)return $;let{presigned_url:O}=J(await this.client.storage.exportDocument({path:{document_id:this.id}})),x=await fetch(O);if(!x.ok)throw new a$(x.status,{message:"failed to download document content"});return x.text()}async rename($){await this.mutate((O)=>O.storage.editDocument({path:{document_id:this.id},body:{documentName:$}}))}async move($){await this.mutate((O)=>O.storage.editDocument({path:{document_id:this.id},body:{projectId:$?.id??""}}))}async delete($){await this.mutate((O)=>$?.permanent?O.storage.permanentlyDeleteDocument({path:{document_id:this.id}}):O.storage.deleteDocument({path:{document_id:this.id}}))}async restore(){await this.mutate(($)=>$.storage.revertDeleteDocument({path:{document_id:this.id}}))}async copy($){let{data:O}=J(await this.client.storage.copyDocument({path:{document_id:this.id},query:$.versionId!==void 0?{version_id:$.versionId}:void 0,body:{documentName:$.name}}));return new E(this.client,O.documentMetadata.documentId)}async comments(){let $={parent_type:"document",parent_id:this.id},O=s(async(j)=>{let S=J(await this.client.storage.messageTimeline({path:$,query:{selection:JSON.stringify({limit:100,cursor:j})}}));return{items:S.items,nextCursor:S.next_cursor}}),x=[];for await(let j of O)x.push(j);return VO(x,J2,async(j)=>{let{state:S,root:K,replies:G}=J(await this.client.storage.entityMessageGetThread({path:{...$,id:j.id}}));return{thread:S,comments:[K,...G].map((Z)=>d$.from(this.client,this.id,Z))}})}async comment($,O){let x=await this.mutate((j)=>j.storage.entityMessageCreate({path:{parent_type:"document",parent_id:this.id},body:{...e($),thread_id:O?.threadId??null}}));return d$.from(this.client,this.id,x)}async shortId(){return J(await this.client.storage.getDocumentShortId({path:{document_id:this.id}}))}async teamShare(){return J(await this.client.storage.getDocumentTeamShare({path:{document_id:this.id}}))}async setTeamShare($){await this.mutate((O)=>O.storage.setDocumentTeamShare({path:{document_id:this.id},body:{shareWithTeam:$}}))}async githubPullRequests(){let{pullRequests:$}=J(await this.client.storage.getDocumentGithubPullRequests({path:{document_id:this.id}}));return $}async branchName(){let{branchName:$}=J(await this.client.storage.getDocumentBranchName({path:{document_id:this.id}}));return $}webUrl(){return`${this.client.webAppUrl}/app/md/${this.id}`}static search=o({filters:{document_filters:{}},type:"document",make:($,O)=>new E($,O.document_id)});toMention(){let $=this.detail.peek();return{tag:b$("m-document-mention",{documentId:this.id,documentName:$?.documentName??"",blockName:$?.fileType??"md"}),mention:{entity_type:"document",entity_id:this.id}}}}class vO{id;name;constructor($,O){this.id=$;this.name=O}static async list($){let{skills:O}=J(await $.storage.getSystemSkillsHandler());return O.map((x)=>new vO(x.id,x.name))}}class Sj{client;constructor($){this.client=$}byId($){return E.byId(this.client,$)}create($){return E.create(this.client,$)}createSnippet($){return E.createSnippet(this.client,$)}createSkill($){return E.createSkill(this.client,$)}systemSkills(){return vO.list(this.client)}search($,O){return E.search(this.client,$,O)}recent($){return E.recent(this.client,$)}recentlyDeleted(){return E.recentlyDeleted(this.client)}}class i$ extends q{async fetch(){let{attachment:$}=J(await this.client.email.getAttachment({path:{id:this.id}}));return $}static byId($,O){return new i$($,O)}static from($,O){return new i$($,O.db_id,O)}filename=this.field("filename");mimeType=this.field("mime_type");size=this.field("size_bytes");dataUrl=this.field("data_url");sfsId=this.field("sfs_id");contentId=this.field("content_id");async toDocument(){let{document_id:$}=J(await this.client.email.getAttachmentDocumentId({path:{id:this.id}}));return E.byId(this.client,$)}}class u$ extends q{async fetch(){let{labels:$}=J(await this.client.email.listLabels()),O=$.find((x)=>x.id===this.id);if(!O)throw new m(`label ${this.id} not found`);return O}static byId($,O){return new u$($,O)}static async list($){let{labels:O}=J(await $.email.listLabels());return O.map((x)=>new u$($,x.id,x))}static async create($,O){let{label:x}=J(await $.email.createLabel({body:{label_name:O}}));if(!x.id)throw new w("created label has no id");return new u$($,x.id)}async delete(){J(await this.client.email.deleteLabel({path:{id:this.id}}))}name=this.field("name");linkId=this.field("linkId");type=this.field("type");createdAt=this.field("createdAt");labelListVisibility=this.field("labelListVisibility");messageListVisibility=this.field("messageListVisibility")}class W$ extends x${entityType="email_thread";propertyEntityType="THREAD";async fetch(){let{thread:$}=J(await this.client.email.getThread({path:{thread_id:this.id},query:{limit:100}}));return $}static byId($,O){return new W$($,O)}createdAt=this.field("created_at");updatedAt=this.field("updated_at");isRead=this.field("is_read");inboxVisible=this.field("inbox_visible");accessLevel=this.field("access_level");providerId=this.field("provider_id");link=this.mappedField("link_id",($)=>X$.byId(this.client,$));project=this.mappedField("project_id",($)=>$?u.byId(this.client,$):void 0);latestInboundAt=this.field("latest_inbound_message_ts");latestOutboundAt=this.field("latest_outbound_message_ts");latestNonSpamAt=this.field("latest_non_spam_message_ts");async subject(){let{messages:$}=await this.detail.get();for(let O of $)if(O.subject)return O.subject;return}async participants(){let{messages:$}=await this.detail.get(),O=new Map;for(let x of $)for(let j of[x.from,...x.to,...x.cc,...x.bcc])if(j&&!O.has(j.email))O.set(j.email,j);return[...O.values()]}async messages($){return J(await this.client.email.getThreadMessagesHandler({path:{id:this.id},query:{...$?.since?{since:$.since}:{},...$?.limit?{limit:$.limit}:{}}})).map((x)=>A$.from(this.client,x))}async attachments(){let{messages:$}=await this.detail.get();return $.flatMap((O)=>O.attachments.map((x)=>i$.from(this.client,x)))}async reply($){let O=$.subject??await this.subject()??"",{message:x}=await this.mutate((j)=>j.email.sendMessage({body:{message:{thread_db_id:this.id,replying_to_id:$.replyingTo?.id??null,to:$.to,cc:$.cc??null,bcc:$.bcc??null,subject:O,body_text:$.bodyText}}}));return x.db_id?A$.byId(this.client,x.db_id):void 0}async archive($=!0){await this.mutate((O)=>O.email.archiveThread({path:{id:this.id},body:{value:$}}))}async updateState($){await this.mutate((O)=>O.email.updateThreadState({path:{id:this.id},body:$}))}async operations(){return J(await this.client.email.threadOperations({path:{id:this.id}}))}async markSeen(){await this.mutate(($)=>$.email.threadSeen({path:{id:this.id}}))}async addLabel($){await this.mutate((O)=>O.email.addRemoveThreadLabel({path:{id:this.id},body:{label_id:$.id,value:!0}}))}async removeLabel($){await this.mutate((O)=>O.email.addRemoveThreadLabel({path:{id:this.id},body:{label_id:$.id,value:!1}}))}async moveToProject($){await this.mutate((O)=>O.email.updateThreadProject({path:{thread_id:this.id},body:{projectId:$?.id??null}}))}static search=o({filters:{email_filters:{}},type:"email",make:($,O)=>new W$($,O.thread_id)})}class A$ extends q{async fetch(){return J(await this.client.email.getMessage({path:{id:this.id}}))}static byId($,O){return new A$($,O)}static from($,O){return new A$($,O.db_id,O)}static async send($,O){let{message:x}=J(await $.email.sendMessage({body:{message:{to:O.to,cc:O.cc??null,bcc:O.bcc??null,subject:O.subject,body_text:O.bodyText}}}));return x.db_id?A$.byId($,x.db_id):void 0}subject=this.field("subject");from=this.field("from");to=this.field("to");cc=this.field("cc");bcc=this.field("bcc");body=this.field("body_parsed");sentAt=this.field("internal_date_ts");labels=this.field("labels");link=this.mappedField("link_id",($)=>X$.byId(this.client,$));async operationStatus(){return J(await this.client.email.messageOperationStatus({path:{id:this.id}}))}async resolveOperation($){await this.mutate((O)=>O.email.resolveMessageOperation({path:{id:this.id},body:$}))}async completeDraftAttachment($){let O=await this.link();await this.mutate((x)=>x.email.completeDraftAttachment({path:{id:this.id,attachment_id:$},headers:{"X-Email-Link-Id":O.id}}))}async transferDraft($){let O=await this.link();return this.mutate((x)=>x.email.transferDraft({path:{id:this.id},body:$,headers:{"X-Email-Link-Id":O.id}}))}async addLabel($){await this.mutate((O)=>O.email.addRemoveLabel({body:{label_id:$.id,message_ids:[this.id],value:!0}}))}async removeLabel($){await this.mutate((O)=>O.email.addRemoveLabel({body:{label_id:$.id,message_ids:[this.id],value:!1}}))}async thread(){return W$.byId(this.client,(await this.detail.get()).thread_db_id)}}class Gj{client;constructor($){this.client=$}byId($){return W$.byId(this.client,$)}message($){return A$.byId(this.client,$)}attachment($){return i$.byId(this.client,$)}link($){return X$.byId(this.client,$)}links(){return X$.list(this.client)}async connectionProviders(){return J(await this.client.auth.emailConnectionProviders())}async recoverDraftTransfer($){return J(await this.client.email.recoverDraftTransfer({path:{id:$}}))}send($){return A$.send(this.client,$)}search($,O){return W$.search(this.client,$,O)}inbox($){return s(async(O)=>{let x=J(await this.client.email.previewsInboxCursor({path:{view:"inbox"},query:{...$?.pageSize?{limit:$.pageSize}:{},...$?.sort?{sort_method:$.sort}:{},...O?{cursor:O}:{}}}));return{items:x.items.map((j)=>W$.byId(this.client,j.id)),nextCursor:x.next_cursor}})}label($){return u$.byId(this.client,$)}labels(){return u$.list(this.client)}createLabel($){return u$.create(this.client,$)}async deleteLabel($){J(await this.client.email.deleteLabel({path:{id:$.id}}))}async blockSender($){J(await this.client.email.blockSender({body:{email_address:$}}))}async unblockSender($){J(await this.client.email.unblockSender({body:{email_address:$}}))}async blockedSenders(){return J(await this.client.email.listBlockedSenders()).blocked_emails}}class Zj{client;constructor($){this.client=$}async list($={}){let{favorites:O}=J(await this.client.storage.listFavorites({query:{entityType:$.entityTypes,entityId:$.entityIds}}));return O}async add($){return J(await this.client.storage.addFavorite({body:{entityId:$.id,entityType:$.entityType}}))}async remove($){J(await this.client.storage.removeFavoriteByEntity({path:{entity_type:$.entityType,entity_id:$.id}}))}async reorder($){J(await this.client.storage.reorderFavorites({body:{favorites:$}}))}}class l$ extends N${entityType="foreign_entity";async fetch(){return J(await this.client.storage.getForeignEntity({path:{id:this.id}}))}static byId($,O){return new l$($,O)}static fromRecord($,O){return new l$($,O.id,O)}foreignEntityId=this.field("foreignEntityId");source=this.field("foreignEntitySource");storedForId=this.field("storedForId");storedForAuthEntity=this.field("storedForAuthEntity");createdAt=this.field("createdAt");updatedAt=this.field("updatedAt");async metadata(){return(await this.detail.get()).metadata}}function T0({login:$,...O}){return{...O,login:$??void 0}}class Xj{client;constructor($){this.client=$}byId($){return l$.byId(this.client,$)}async bySource($,O){return l$.fromRecord(this.client,J(await this.client.storage.getForeignEntityBySource({path:{source:$,foreign_entity_id:O}})))}async githubPullRequestFacets(){let{repositories:$,authors:O,assignees:x,labels:j}=J(await this.client.storage.getGithubPullRequestFacets());return{repositories:$,authors:O.map(T0),assignees:x.map(T0),labels:j.map(({color:S,...K})=>({...K,color:S??void 0}))}}}class q${form;id;constructor($,O){this.form=$;this.id=O}static byId($,O){return new q$($,O)}async detail(){let O=(await this.form.schema()).sections.flatMap((x)=>x.kind==="questions"?x.questions:[]).find((x)=>x.id===this.id);if(!O)throw new m(`question ${this.id} is not on form ${this.form.id}`);return O}async title(){return(await this.detail()).title}async column(){return E$.byId(await this.form.table(),(await this.detail()).column)}async options(){return(await this.detail()).options.map(($)=>n$.byId(this,$.id))}}class n${question;id;constructor($,O){this.question=$;this.id=O}static byId($,O){return new n$($,O)}async detail(){let $=(await this.question.detail()).options.find((O)=>O.id===this.id);if(!$)throw new m(`option ${this.id} is not on question ${this.question.id}`);return $}async label(){return(await this.detail()).label}async color(){return(await this.detail()).color??void 0}}class e${form;id;detail;constructor($,O,x){this.form=$;this.id=O;this.detail=new M$(()=>this.load(),x)}async load(){let $=await this.form.myResponse();if($.response.id!==this.id)throw new m(`response ${this.id} is not your current response`);return $}static byId($,O,x){return new e$($,O,x)}async status(){return(await this.detail.get()).status}async row(){return(await this.detail.get()).row}async answers(){return(await this.detail.get()).answers}async booking(){return(await this.detail.get()).booking}async refresh(){let $=await this.load();return this.detail=new M$(()=>this.load(),$),this}}class f${form;id;constructor($,O){this.form=$;this.id=O}static byId($,O){return new f$($,O)}async detail(){let $=(await this.form.schema()).sections.find((O)=>O.id===this.id);if(!$)throw new m(`section ${this.id} is not on form ${this.form.id}`);return $}async title(){return(await this.detail()).title}async questions(){let $=await this.detail();return $.kind==="questions"?$.questions.map((O)=>q$.byId(this.form,O.id)):[]}}class mO{entityType;id;constructor($,O){this.entityType=$;this.id=O}static byId($,O){return new mO($,O)}}class D$ extends q{async fetch(){return J(await this.client.storage.getForm({path:{id:this.id}}))}static byId($,O){return new D$($,O)}static async create($,O){let x=J(await $.storage.createForm({body:{name:O.name,source:O.table?{kind:"table",databaseId:O.table.database.id,tableId:O.table.id}:{kind:"new"}}}));return new D$($,x.form.id,x)}static async list($,O){if(!O)return J(await $.storage.listAccessibleForms()).map(({form:S})=>new D$($,S.id));return J(await $.storage.listForms({query:{databaseId:O.id}})).map((j)=>new D$($,j.id))}schema(){return this.detail.get()}name=this.mappedField("form",($)=>$.name);description=this.mappedField("form",($)=>$.description);owner=this.mappedField("form",($)=>M.byId(this.client,$.ownerId));database=this.mappedField("form",($)=>Q$.byId(this.client,$.databaseId));table=this.mappedField("form",($)=>Y$.byId(Q$.byId(this.client,$.databaseId),$.tableId));audience=this.mappedField("form",($)=>$.audience);status=this.mappedField("form",($)=>$.status);closesAt=this.mappedField("form",($)=>$.closesAt??void 0);access=this.field("access");async sections(){return(await this.detail.get()).sections.map(($)=>f$.byId(this,$.id))}async questions(){return(await this.detail.get()).sections.flatMap(($)=>$.kind==="questions"?$.questions.map((O)=>q$.byId(this,O.id)):[])}async update($){return await this.mutate((O)=>O.storage.updateForm({path:{id:this.id},body:$})),this}assertOwns($){if($.form.id!==this.id)throw new w(`question or section does not belong to form ${this.id}`)}async replaceLayout($){let O=await this.table(),x=(G)=>{if(G.table.id!==O.id||G.table.database.id!==O.database.id)throw new w(`column does not belong to form ${this.id}'s table`);return G.id},j=(G)=>({conjunction:G.conjunction,conditions:G.conditions.map((Z)=>d(Z).with({kind:"group"},(X)=>({kind:"group",...j(X)})).with({kind:"condition"},(X)=>({kind:"condition",column:x(X.column),test:d(X.test).with({kind:"options"},(L)=>({...L,options:L.options.map((Y)=>Y.id)})).with({kind:"entities"},(L)=>({...L,entities:L.entities.map((Y)=>Y.id)})).with({kind:O$.union("presence","text","number","date","checkbox")},(L)=>L).exhaustive()})).exhaustive())}),S={sections:$.map((G)=>{if(G.section)this.assertOwns(G.section);let Z={id:G.section?.id??F$(),title:G.title,description:G.description??""};return d(G).with({kind:"booking"},(X)=>({...Z,kind:"booking",target:X.target})).with({kind:"gate"},(X)=>({...Z,kind:"gate",rules:j(X.rules),message:X.message})).with({kind:"questions"},(X)=>({...Z,kind:"questions",questions:X.questions.map((L)=>{if(L.question)this.assertOwns(L.question);return{id:L.question?.id??F$(),column:x(L.column),helpText:L.helpText??"",required:L.required??!1,widget:L.widget??null}})})).exhaustive()})},K=await this.mutate((G)=>G.storage.putFormLayout({path:{id:this.id},body:S}));return{form:this,publicationError:K.publicationError}}wireAnswers($){return $.map(({question:O,value:x})=>{this.assertOwns(O);let j=d(x).with({type:"rows"},(S)=>({type:"rows",value:S.value.map((K)=>K.id)})).with({type:"options"},(S)=>({type:"options",value:S.value.map((K)=>{if(K.question.id!==O.id||K.question.form.id!==this.id)throw new w("option does not belong to the answered question");return{id:K.id}})})).with({type:"entities"},(S)=>({type:"entities",value:S.value.map(({entityType:K,entity:G})=>({entityType:K,entityId:G.id}))})).with({type:O$.union("text","number","boolean","date","link","clear")},(S)=>S).exhaustive();return{question:O.id,value:j}})}unlockedBooking($){return $?{...$,section:f$.byId(this,$.section)}:void 0}async outcome($,O){return d($).with({outcome:"stopped"},(x)=>({...x,section:f$.byId(this,x.section)})).with({outcome:"submitted"},async(x)=>{let j=c$.byId(await this.table(),x.row),S=this.unlockedBooking(x.booking);return{outcome:"submitted",response:e$.byId(this,x.response,{status:"submitted",row:j,answers:O,booking:S}),row:j,...S?{booking:S}:{}}}).exhaustive()}async submit($){let O={answers:this.wireAnswers($)};return this.outcome(J(await this.client.storage.submitFormResponse({path:{id:this.id},body:O})),$)}async editResponse($){let O={answers:this.wireAnswers($)};return this.outcome(J(await this.client.storage.editMyFormResponse({path:{id:this.id},body:O})),$)}async myResponse(){let $=J(await this.client.storage.getMyFormResponse({path:{id:this.id}})),O=await this.table(),x=await Promise.all($.answers.map(async(K)=>{let G=q$.byId(this,K.question),Z=await d(K.value).with({type:"options"},(X)=>({type:"options",value:X.value.map((L)=>{if(!("id"in L))throw new w("stored form answers must reference options by id");return n$.byId(G,L.id)})})).with({type:"entities"},(X)=>({type:"entities",value:X.value.map((L)=>({entityType:L.entityType,entity:mO.byId(L.entityType,L.entityId)}))})).with({type:"rows"},async(X)=>{let L=await G.detail();if(L.kind.type!=="relation")throw new w("row answer requires a relation question");let Y=Y$.byId(Q$.byId(this.client,L.kind.database),L.kind.table);return{type:"rows",value:X.value.map((Q)=>c$.byId(Y,Q))}}).with({type:O$.union("text","number","boolean","date","link","clear")},(X)=>X).exhaustive();return{question:G,value:Z}})),j=$.response.row?c$.byId(O,$.response.row):void 0,S=this.unlockedBooking($.booking);return{...S?{booking:S}:{},response:e$.byId(this,$.response.id,{status:$.response.status,row:j,answers:x,booking:S}),status:$.response.status,stoppedAtSection:$.response.stoppedAtSection?f$.byId(this,$.response.stoppedAtSection):void 0,row:j,submittedAt:$.response.submittedAt,updatedAt:$.response.updatedAt,answers:x}}async responseSummary(){let $=J(await this.client.storage.getFormResponseSummary({path:{id:this.id}}));return{...$,stoppedBySection:$.stoppedBySection.map((O)=>({section:f$.byId(this,O.section),count:O.count}))}}async tally(){return J(await this.client.storage.getFormTally({path:{id:this.id}})).questions.map((O)=>{let x=q$.byId(this,O.question);return{question:x,responses:O.responses,buckets:O.buckets.map((j)=>({count:j.count,value:d(j.value).with({kind:"option"},(S)=>({kind:"option",option:n$.byId(x,S.option)})).with({kind:"checkbox"},(S)=>S).exhaustive()}))}})}async sharePermissions(){return J(await this.client.storage.getFormPermissions({path:{id:this.id}}))}updateSharePermissions($){return this.mutate((O)=>O.storage.updateFormPermissions({path:{id:this.id},body:$}))}webUrl(){return`${this.client.webAppUrl}/app/form/${this.id}`}respondUrl(){return`${this.client.webAppUrl}/app/form/${this.id}/respond`}}class Kj{client;constructor($){this.client=$}byId($){return D$.byId(this.client,$)}create($){return D$.create(this.client,$)}list($){return D$.list(this.client,$)}}class s$ extends q{async fetch(){return J(await this.client.notification.getTypedNotificationById({path:{notification_id:this.id}}))}static byId($,O){return new s$($,O)}static from($,O){return new s$($,O.id,O)}static list($,O){return s(async(x)=>{let j=J(await $.notification.listTypedNotifications({query:{...O?.pageSize?{limit:O.pageSize}:{},...O?.states!==void 0?{states:O.states.join(",")}:{},...x?{cursor:x}:{}}}));return{items:j.items.map((S)=>s$.from($,S)),nextCursor:j.next_cursor}})}type=this.field("notification_event_type");createdAt=this.field("created_at");updatedAt=this.field("updated_at");state=this.field("state");done=this.mappedField("state",($)=>$==="done");sent=this.field("sent");viewedAt=this.field("viewed_at");deletedAt=this.field("deleted_at");owner=this.mappedField("owner_id",($)=>M.byId(this.client,$));sender=this.mappedField("sender_id",($)=>$?M.byId(this.client,$):void 0);metadata=this.field("notification_metadata");async seen(){return await this.state()!=="unseen"}async markSeen(){await this.mutate(($)=>$.notification.bulkMarkNotificationsSeen({body:{notificationIds:[this.id]}}))}async markDone(){await this.mutate(($)=>$.notification.bulkMarkNotificationsDone({body:{notificationIds:[this.id]}}))}async markUndone(){await this.mutate(($)=>$.notification.bulkMarkNotificationsUndone({body:{notificationIds:[this.id]}}))}async delete(){await this.mutate(($)=>$.notification.deleteUserNotificationV2({path:{notification_id:this.id}}))}}class Yj{client;constructor($){this.client=$}byId($){return s$.byId(this.client,$)}list($){return s$.list(this.client,$)}async markSeen($){J(await this.client.notification.bulkMarkNotificationsSeen({body:{notificationIds:$}}))}async markDone($){J(await this.client.notification.bulkMarkNotificationsDone({body:{notificationIds:$}}))}async delete($){J(await this.client.notification.bulkDeleteUserNotificationsV2({body:{notificationIds:$}}))}async preferences(){return J(await this.client.notification.getNotificationTypePreferences())}async enableType($){J(await this.client.notification.enableNotificationType({path:{notification_event_type:$}}))}async disableType($){J(await this.client.notification.disableNotificationType({path:{notification_event_type:$}}))}}class Qj{client;constructor($){this.client=$}async list(){let{data:$}=J(await this.client.storage.getPinsHandler({}));return $?.recent??[]}async add($,O){J(await this.client.storage.addPinHandler({path:{pinned_item_id:$.id},body:{pinType:$.entityType,pinIndex:O.index}}))}async remove($){J(await this.client.storage.removePinHandler({path:{pinned_item_id:$.id},body:{pinType:$.entityType}}))}async reorder($){J(await this.client.storage.reorderPinsHandler({body:$}))}}class Jj{client;constructor($){this.client=$}byId($){return u.byId(this.client,$)}create($){return u.create(this.client,$)}search($,O){return u.search(this.client,$,O)}}class t${client;definitionId;id;record;constructor($,O,x,j){this.client=$;this.definitionId=O;this.id=x;this.record=j}static from($,O,x){return new t$($,O,x.id,x)}get value(){return this.record.value}get color(){return this.record.color??void 0}get displayOrder(){return this.record.display_order}get createdAt(){return this.record.created_at}get updatedAt(){return this.record.updated_at}async update($){return this.record=J(await this.client.properties.updatePropertyOption({path:{definition_id:this.definitionId,option_id:this.id},body:$})),this}async delete(){J(await this.client.properties.deletePropertyOption({path:{definition_id:this.definitionId,option_id:this.id}}))}}class r${client;id;detail;constructor($,O,x){this.client=$;this.id=O;this.detail=new M$(()=>this.fetch(),x)}async fetch(){return J(await this.client.properties.getPropertyDefinition({path:{definition_id:this.id}}))}static async create($,O){let x=J(await $.properties.createPropertyDefinition({body:{display_name:O.displayName,scope:O.scope,data_type:O.dataType}}));return new r$($,x.id,x)}static byId($,O){return new r$($,O)}static fromRecord($,O){return new r$($,O.id,O)}get displayName(){return this.detail.get().then(($)=>$.display_name)}get dataType(){return this.detail.get().then(($)=>$.data_type)}get owner(){return this.detail.get().then(($)=>$.owner)}get isSystem(){return this.detail.get().then(($)=>$.is_system)}get isMultiSelect(){return this.detail.get().then(($)=>$.is_multi_select)}get createdAt(){return this.detail.get().then(($)=>$.created_at)}get updatedAt(){return this.detail.get().then(($)=>$.updated_at)}async delete(){return J(await this.client.properties.deletePropertyDefinition({path:{definition_id:this.id}}))}async options(){return J(await this.client.properties.getPropertyOptions({path:{definition_id:this.id}})).map((O)=>t$.from(this.client,this.id,O))}async addOption($){let O=J(await this.client.properties.addPropertyOption({path:{definition_id:this.id},body:$}));return t$.from(this.client,this.id,O)}async updateOption($,O){let x=J(await this.client.properties.updatePropertyOption({path:{definition_id:this.id,option_id:$.id},body:O}));return t$.from(this.client,this.id,x)}async deleteOption($){return J(await this.client.properties.deletePropertyOption({path:{definition_id:this.id,option_id:$.id}}))}}class Vj{client;constructor($){this.client=$}async list($){return J(await this.client.properties.listProperties({query:{scope:$?.scope??"all",...$?.forEntityType!==void 0?{for_entity_type:$.forEntityType}:{}}})).map((x)=>{let j="definition"in x?x.definition:x;return r$.fromRecord(this.client,j)})}create($){return r$.create(this.client,$)}definition($){return r$.byId(this.client,$)}async bulkEntityProperties($){return J(await this.client.properties.getBulkEntityProperties({body:$}))}async updateEntityPropertyOptions($,O){return J(await this.client.properties.bulkUpdateEntitiesPropertyOptions({body:{entities:$.map((j)=>j.propertyReference()),property_id:O.property.id,...O.add?{add_option_ids:O.add.map((j)=>j.id)}:{},...O.remove?{remove_option_ids:O.remove.map((j)=>j.id)}:{}}})).results}async addEntityPropertyOption($){return J(await this.client.properties.addEntityPropertyOption({path:{...$.entity.propertyReference(),property_id:$.property.id,option_id:$.option.id}}))}async removeEntityPropertyOption($){return J(await this.client.properties.removeEntityPropertyOption({path:{...$.entity.propertyReference(),property_id:$.property.id,option_id:$.option.id}}))}async tags(){return J(await this.client.properties.listTags({}))}}var V2="00000001-0000-0000-0000-000000000002",W2="00000001-0000-0000-0002-000000000004";function B2($){let O=$.match(/^https:\/\/github\.com\/([^/]+)\/([^/]+)\/pull\/([1-9][0-9]*)\/?(?:[?#].*)?$/i);if(!O)throw Error(`Expected a GitHub pull request URL like https://github.com/owner/repo/pull/1, got ${$}`);return`${O[1]}/${O[2]}/pull/${O[3]}`}class C$ extends E{static byId($,O){return new C$($,O)}static async create($,O){let{documentId:x}=J(await $.storage.createTaskHandler({body:{taskName:O.name,markdown:O.markdown??null,projectId:O.project?.id??null,teamId:O.team?.id??null,shareWithTeam:O.shareWithTeam??!0}}));return new C$($,x)}static async forPullRequest($,O){let x=B2(O),{pullRequests:j}=J(await $.storage.getGithubPullRequestTasks({body:{githubKeys:[x]}}));return(j[0]?.taskIds??[]).map((S)=>new C$($,S))}async completed(){let{subType:$}=await this.detail.get();if($!=="task")return;let x=(await this.properties()).find((j)=>j.definition.id===V2)?.value;return x?.type==="SelectOption"&&x.value.includes(W2)}webUrl(){return`${this.client.webAppUrl}/app/task/${this.id}`}static search=o({filters:{document_filters:{sub_types:["task"],task_filters:{}}},type:"document",make:($,O)=>new C$($,O.document_id)})}class Wj{client;constructor($){this.client=$}byId($){return C$.byId(this.client,$)}create($){return C$.create(this.client,$)}forPullRequest($){return C$.forPullRequest(this.client,$)}search($,O){return C$.search(this.client,$,O)}}class Bj{client;constructor($){this.client=$}byId($){return z$.byId(this.client,$)}current(){return z$.current(this.client)}list(){return z$.list(this.client)}}class Lj{client;constructor($){this.client=$}byId($){return M.byId(this.client,$)}me(){return M.me(this.client)}}class p$ extends q{signingSecret;constructor($,O,x,j){super($,O,x);this.signingSecret=j}async fetch(){return J(await this.client.storage.getWebhook({path:{webhook_id:this.id}}))}static async create($,O){let x=J(await $.storage.createWebhook({body:{endpoint_url:O.url,namespace:O.namespace,name:O.name,filters:O.filters,scope:O.scope??"user",...O.headers!==void 0?{headers:O.headers}:{}}}));return new p$($,x.id,x,x.signing_secret)}static byId($,O){return new p$($,O)}static fromRecord($,O){return new p$($,O.id,O)}name=this.field("name");namespace=this.field("namespace");endpointUrl=this.field("endpoint_url");status=this.field("status");isValid=this.field("is_valid");filters=this.field("filters");createdAt=this.field("created_at");workspaceId=this.field("workspace_id");createdBy=this.mappedField("created_by_user_id",($)=>M.byId(this.client,$));async scope(){let $=await this.detail.get();return $.workspace_id===$.created_by_user_id?"user":"team"}async update($){await this.mutate((O)=>O.storage.patchWebhook({path:{webhook_id:this.id},body:$}))}async rename($){await this.update({name:$})}async setUrl($){await this.update({endpoint_url:$})}async setFilters($){await this.update({filters:$})}async pause(){await this.update({status:"paused"})}async resume(){await this.update({status:"active"})}async delete(){await this.mutate(($)=>$.storage.deleteWebhook({path:{webhook_id:this.id}}))}async validate(){return this.mutate(($)=>$.storage.validateWebhook({path:{webhook_id:this.id}}))}}class Nj{client;constructor($){this.client=$}create($){return p$.create(this.client,$)}byId($){return p$.byId(this.client,$)}async list(){let{webhooks:$}=J(await this.client.storage.listWebhooks());return $.map((O)=>p$.fromRecord(this.client,O))}}function Uj($){if("properties"in $.data)return $.data.properties;if($.tag==="calendarEvent")return $.data.extra.properties;return[]}function H0($,O,x){let j=[];for(let S of Uj(O)){if(S.definition.data_type!=="TAG"||S.value?.type!=="SelectOption")continue;for(let K of S.value.value){let G=x.get(K);if(G&&!j.some((Z)=>Z.label===G.label&&Z.scope===G.scope))j.push(G)}}switch(O.tag){case"document":return{type:"document",id:O.data.id,entity:E.byId($,O.data.id),snapshot:O,tags:j,name:O.data.name,fileType:O.data.fileType,subType:O.data.subType?.type};case"chat":return{type:"ai_chat",id:O.data.id,entity:V$.byId($,O.data.id),snapshot:O,tags:j,name:O.data.name};case"project":return{type:"project",id:O.data.id,entity:u.byId($,O.data.id),snapshot:O,tags:j,name:O.data.name};case"emailThread":return{type:"email",id:O.data.id,entity:W$.byId($,O.data.id),snapshot:O,tags:j,subject:O.data.name,snippet:O.data.snippet,senderName:O.data.senderName,senderEmail:O.data.senderEmail,inboxVisible:O.data.inboxVisible,isRead:O.data.isRead,isDraft:O.data.isDraft};case"channel":return{type:"channel",id:O.data.channel.id,entity:f.byId($,O.data.channel.id),snapshot:O,tags:j,name:O.data.channel.name};case"channelThread":return{type:"channel_thread",id:O.data.id,entity:new P$($,O.data.channel_id,O.data.id),snapshot:O,tags:j,channelId:O.data.channel_id};case"call":return{type:"call",id:O.data.callId,entity:K$.byId($,O.data.callId),snapshot:O,tags:j,createdBy:O.data.createdBy};case"calendarEvent":return{type:"calendar_event",id:O.data.id,entity:U$.byId($,O.data.id),snapshot:O,tags:j,title:O.data.title,status:O.data.status,location:O.data.location,conferenceUrl:O.data.conferenceUrl,conferenceProvider:O.data.conferenceProvider,time:O.data.time};case"foreignEntity":return{type:"foreign_entity",id:O.data.id,entity:l$.byId($,O.data.id),snapshot:O,tags:j,foreignEntityId:O.data.foreignEntityId,foreignEntitySource:O.data.foreignEntitySource,metadata:O.data.metadata};default:throw Error(`Unexpected workspace entity type: ${O.tag}`)}}var R0="00000000-0000-0000-0000-000000000000",zj={document:["df","id"],project:["pf","pid"],ai_chat:["cf","cid"],email:["ef","ThreadId"],channel:["chanf","ChannelId"],channel_thread:["cthf","ThreadId"],call:["callf","CallId"],calendar_event:["calf","id"],foreign_entity:["fef","id"]},cO=($)=>$.replace(/[A-Z]/g,(O)=>O.toLowerCase()),A0=($,O)=>$==null?O:{"&":[$,O]};function Ij($,O){if(!$||typeof $!=="object"||Array.isArray($))throw Error(`Invalid workspace ${O}: expected a filter expression.`);let x=Object.entries($),j=x[0];if(x.length!==1||j===void 0)throw Error(`Invalid workspace ${O}: use exactly one of l, &, |, !.`);let[S,K]=j;if(S==="l")return;if(S==="!"){Ij(K,`${O}.!`);return}if(S!=="&"&&S!=="|")throw Error(`Invalid workspace ${O}: use l, &, | or !.`);if(!Array.isArray(K)||K.length!==2)throw Error(`Invalid workspace ${O}.${S}: expected exactly two expressions. Use {l: {...}} for a single condition; nest binary operators for three or more.`);K.forEach((G,Z)=>{Ij(G,`${O}.${S}[${Z}]`)})}class dO{client;tagSets;constructor($){this.client=$}sets(){return this.tagSets??=this.client.properties.listTags({}).then(J),this.tagSets}async tagMap(){let $=new Map;for(let O of await this.sets())for(let x of O.options)if(x.value.type==="string")$.set(x.id,{label:x.value.value,scope:O.scope==="user"?"personal":"team"});return $}async body($){for(let[S,K,G]of[["sortBy",$.sortBy,["recently_viewed","recently_updated","recently_created"]],["emailPreset",$.emailPreset,["signal"]],["tagsMatch",$.tagsMatch,["any","all"]]])if(K!==void 0&&!G.includes(K))throw Error(`Invalid workspace ${S}: ${K}`);if($.includeTypes!==void 0&&(!Array.isArray($.includeTypes)||$.includeTypes.some((S)=>!Object.hasOwn(zj,S))))throw Error(`Invalid workspace includeTypes. Supported values: ${Object.keys(zj).join(", ")}. Tasks use document with df: {l: {dst: 'task'}}.`);for(let S of["df","pf","cf","ef","chanf","cthf","callf","fef","calf","propf"])if($[S]!=null)Ij($[S],S);if($.tags?.some((S)=>S.scope!==void 0&&S.scope!=="personal"&&S.scope!=="team"))throw Error("Invalid workspace tag scope");if($.limit!==void 0&&!Number.isFinite($.limit))throw Error("Workspace limit must be finite");let O={df:$.df,pf:$.pf,cf:$.cf,ef:$.ef,chanf:$.chanf,cthf:$.cthf,callf:$.callf,fef:$.fef,calf:$.calf,propf:$.propf,ccf:{l:{id:R0}},favorites_only:$.favoritesOnly,expand:!0,limit:Math.max(1,Math.min(500,Math.trunc($.limit??50))),sort_method:$.sortBy==="recently_viewed"?"viewed_at":$.sortBy==="recently_created"?"created_at":"updated_at",sort_direction:"desc",emailView:$.emailView??"inbox"};if($.emailPreset==="signal")O.ef={"&":[{l:{Importance:!0}},{l:{Shared:"exclude"}}]};let x=$.inbox?.trim();if(x){let{links:S}=J(await this.client.email.listLinks()),K=S.filter((Z)=>cO(Z.email_address)===cO(x)),G=K[0];if(!G)throw Error(`No connected inbox matches "${x}". Connected inboxes: ${S.map((Z)=>Z.email_address).join(", ")}.`);if(K.length>1)throw Error(`Multiple connected inboxes match "${x}"; cannot pick one.`);O.ef=A0(O.ef,{l:{Owner:G.id}})}let j=$.includeTypes??($.emailPreset==="signal"?["email"]:void 0);if(j?.length){for(let[S,[K,G]]of Object.entries(zj))if(!j.includes(S))O[K]={l:{[G]:R0}}}if($.tags?.length){let S=(await this.sets()).flatMap((X)=>{let L=X.definition;if(!L)return[];return X.options.flatMap((Y)=>Y.value.type==="string"?[{id:Y.id,definitionId:L.id,label:Y.value.value,scope:X.scope==="user"?"personal":"team"}]:[])}),K=new Map;for(let X of $.tags){let L=S.filter((Y)=>cO(Y.label)===cO(X.label.trim())&&(!X.scope||Y.scope===X.scope));if(!L.length)throw Error(`Unknown tag "${X.label}". Available tags: ${S.map((Y)=>`${Y.label} (${Y.scope})`).join(", ")}.`);if($.tagsMatch==="all"&&L.length>1)throw Error(`Tag "${X.label}" is ambiguous; specify personal or team scope.`);for(let Y of L)K.set(Y.id,Y)}let Z=[...K.values()].map((X)=>({l:{pd:X.definitionId,v:{so:X.id}}})).reduce((X,L)=>X===void 0?L:{[$.tagsMatch==="all"?"&":"|"]:[X,L]},void 0);O.propf=A0(O.propf,Z)}return O}}class Tj{client;constructor($){this.client=$}async page($={}){let O=new dO(this.client);return this.fetch(O,await O.body($),$.cursor)}async*list($={}){let O=new dO(this.client),x=await O.body($);yield*s((j)=>this.fetch(O,x,j))}async fetch($,O,x){let j=J(await this.client.storage.postItemsSoupAst({body:O,query:x?{cursor:x}:void 0})),K=j.items.some((G)=>Uj(G).some((Z)=>Z.definition.data_type==="TAG"))?await $.tagMap():new Map;return{items:j.items.map((G)=>H0(this.client,G,K)),nextCursor:j.next_cursor,hasMore:j.next_cursor!=null}}}function D0({onRequest:$,onSseError:O,onSseEvent:x,responseTransformer:j,responseValidator:S,sseDefaultRetryDelay:K,sseMaxRetryAttempts:G,sseMaxRetryDelay:Z,sseSleepFn:X,url:L,...Y}){let Q,T=X??((V)=>new Promise((B)=>setTimeout(B,V)));return{stream:async function*(){let V=K??3000,B=0,I=Y.signal??new AbortController().signal;while(!0){if(I.aborted)break;B++;let P=Y.headers instanceof Headers?Y.headers:new Headers(Y.headers);if(Q!==void 0)P.set("Last-Event-ID",Q);try{let A={redirect:"follow",...Y,body:Y.serializedBody,headers:P,signal:I},D=new Request(L,A);if($)D=await $(L,A);let N=await(Y.fetch??globalThis.fetch)(D);if(!N.ok)throw Error(`SSE failed: ${N.status} ${N.statusText}`);if(!N.body)throw Error("No body in SSE response");let H=N.body.pipeThrough(new TextDecoderStream).getReader(),U="",g=()=>{try{H.cancel()}catch{}};I.addEventListener("abort",g);try{while(!0){let{done:r,value:p}=await H.read();if(r)break;U+=p,U=U.replace(/\r\n?/g,`-`);let k=U.split(`--`);U=k.pop()??"";for(let a of k){let i=a.split(`-`),_=[],y;for(let R of i)if(R.startsWith("data:"))_.push(R.replace(/^data:\s*/,""));else if(R.startsWith("event:"))y=R.replace(/^event:\s*/,"");else if(R.startsWith("id:"))Q=R.replace(/^id:\s*/,"");else if(R.startsWith("retry:")){let v=Number.parseInt(R.replace(/^retry:\s*/,""),10);if(!Number.isNaN(v))V=v}let C,h=!1;if(_.length){let R=_.join(`-`);try{C=JSON.parse(R),h=!0}catch{C=R}}if(h){if(S)await S(C);if(j)C=await j(C)}if(x?.({data:C,event:y,id:Q,retry:V}),_.length)yield C}}}finally{I.removeEventListener("abort",g),H.releaseLock()}break}catch(A){if(O?.(A),G!==void 0&&B>=G)break;let D=Math.min(V*2**(B-1),Z??30000);await T(D)}}}()}}var L2=($)=>{switch($){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},N2=($)=>{switch($){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},U2=($)=>{switch($){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},uO=({allowReserved:$,explode:O,name:x,style:j,value:S})=>{if(!O){let Z=($?S:S.map((X)=>encodeURIComponent(X))).join(N2(j));switch(j){case"label":return`.${Z}`;case"matrix":return`;${x}=${Z}`;case"simple":return Z;default:return`${x}=${Z}`}}let K=L2(j),G=S.map((Z)=>{if(j==="label"||j==="simple")return $?Z:encodeURIComponent(Z);return o$({allowReserved:$,name:x,value:Z})}).join(K);return j==="label"||j==="matrix"?K+G:G},o$=({allowReserved:$,name:O,value:x})=>{if(x===void 0||x===null)return"";if(typeof x==="object")throw Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${O}=${$?x:encodeURIComponent(x)}`},lO=({allowReserved:$,explode:O,name:x,style:j,value:S,valueOnly:K})=>{if(S instanceof Date)return K?S.toISOString():`${x}=${S.toISOString()}`;if(j!=="deepObject"&&!O){let X=[];Object.entries(S).forEach(([Y,Q])=>{X=[...X,Y,$?Q:encodeURIComponent(Q)]});let L=X.join(",");switch(j){case"form":return`${x}=${L}`;case"label":return`.${L}`;case"matrix":return`;${x}=${L}`;default:return L}}let G=U2(j),Z=Object.entries(S).map(([X,L])=>o$({allowReserved:$,name:j==="deepObject"?`${x}[${X}]`:X,value:L})).join(G);return j==="label"||j==="matrix"?G+Z:Z};var z2=/\{[^{}]+\}/g,I2=({path:$,url:O})=>{let x=O,j=O.match(z2);if(j)for(let S of j){let K=!1,G=S.substring(1,S.length-1),Z="simple";if(G.endsWith("*"))K=!0,G=G.substring(0,G.length-1);if(G.startsWith("."))G=G.substring(1),Z="label";else if(G.startsWith(";"))G=G.substring(1),Z="matrix";let X=$[G];if(X===void 0||X===null)continue;if(Array.isArray(X)){x=x.replace(S,uO({explode:K,name:G,style:Z,value:X}));continue}if(typeof X==="object"){x=x.replace(S,lO({explode:K,name:G,style:Z,value:X,valueOnly:!0}));continue}if(Z==="matrix"){x=x.replace(S,`;${o$({name:G,value:X})}`);continue}let L=encodeURIComponent(Z==="label"?`.${X}`:X);x=x.replace(S,L)}return x},C0=({baseUrl:$,path:O,query:x,querySerializer:j,url:S})=>{let K=S.startsWith("/")?S:`/${S}`,G=($??"")+K;if(O)G=I2({path:O,url:G});let Z=x?j(x):"";if(Z.startsWith("?"))Z=Z.substring(1);if(Z)G+=`?${Z}`;return G};function Hj($){let O=$.body!==void 0;if(O&&$.bodySerializer){if("serializedBody"in $)return $.serializedBody!==void 0&&$.serializedBody!==""?$.serializedBody:null;return $.body!==""?$.body:null}if(O)return $.body;return}var M0=async($,O)=>{let x=typeof O==="function"?await O($):O;if(!x)return;if($.scheme==="bearer")return`Bearer ${x}`;if($.scheme==="basic")return`Basic ${btoa(x)}`;return x};var P0={bodySerializer:($)=>JSON.stringify($,(O,x)=>typeof x==="bigint"?x.toString():x)};var _0=({parameters:$={},...O}={})=>{return(j)=>{let S=[];if(j&&typeof j==="object")for(let K in j){let G=j[K];if(G===void 0||G===null)continue;let Z=$[K]||O;if(Array.isArray(G)){let X=uO({allowReserved:Z.allowReserved,explode:!0,name:K,style:"form",value:G,...Z.array});if(X)S.push(X)}else if(typeof G==="object"){let X=lO({allowReserved:Z.allowReserved,explode:!0,name:K,style:"deepObject",value:G,...Z.object});if(X)S.push(X)}else{let X=o$({allowReserved:Z.allowReserved,name:K,value:G});if(X)S.push(X)}}return S.join("&")}},F0=($)=>{if(!$)return"stream";let O=$.split(";")[0]?.trim();if(!O)return;if(O.startsWith("application/json")||O.endsWith("+json"))return"json";if(O==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some((x)=>O.startsWith(x)))return"blob";if(O.startsWith("text/"))return"text";return},T2=($,O)=>{if(!O)return!1;if($.headers.has(O)||$.query?.[O]||$.headers.get("Cookie")?.includes(`${O}=`))return!0;return!1};async function E0($){for(let O of $.security??[]){if(T2($,O.name))continue;let x=await M0(O,$.auth);if(!x)continue;let j=O.name??"Authorization";switch(O.in){case"query":if(!$.query)$.query={};$.query[j]=x;break;case"cookie":$.headers.append("Cookie",`${j}=${x}`);break;case"header":default:$.headers.set(j,x);break}}}var Rj=($)=>C0({baseUrl:$.baseUrl,path:$.path,query:$.query,querySerializer:typeof $.querySerializer==="function"?$.querySerializer:_0($.querySerializer),url:$.url}),Aj=($,O)=>{let x={...$,...O};if(x.baseUrl?.endsWith("/"))x.baseUrl=x.baseUrl.substring(0,x.baseUrl.length-1);return x.headers=pO($.headers,O.headers),x},H2=($)=>{let O=[];return $.forEach((x,j)=>{O.push([j,x])}),O},pO=(...$)=>{let O=new Headers;for(let x of $){if(!x)continue;let j=x instanceof Headers?H2(x):Object.entries(x);for(let[S,K]of j)if(K===null)O.delete(S);else if(Array.isArray(K))for(let G of K)O.append(S,G);else if(K!==void 0)O.set(S,typeof K==="object"?JSON.stringify(K):K)}return O};class rO{fns=[];clear(){this.fns=[]}eject($){let O=this.getInterceptorIndex($);if(this.fns[O])this.fns[O]=null}exists($){let O=this.getInterceptorIndex($);return Boolean(this.fns[O])}getInterceptorIndex($){if(typeof $==="number")return this.fns[$]?$:-1;return this.fns.indexOf($)}update($,O){let x=this.getInterceptorIndex($);if(this.fns[x])return this.fns[x]=O,$;return!1}use($){return this.fns.push($),this.fns.length-1}}var w0=()=>({error:new rO,request:new rO,response:new rO}),R2=_0({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),A2={"Content-Type":"application/json"},IO=($={})=>({...P0,headers:A2,parseAs:"auto",querySerializer:R2,...$});var Dj=($={})=>{let O=Aj(IO(),$),x=()=>({...O}),j=(Y)=>{return O=Aj(O,Y),x()},S=w0(),K=async(Y)=>{let Q={...O,...Y,fetch:Y.fetch??O.fetch??globalThis.fetch,headers:pO(O.headers,Y.headers),serializedBody:void 0};if(Q.security)await E0(Q);if(Q.requestValidator)await Q.requestValidator(Q);if(Q.body!==void 0&&Q.bodySerializer)Q.serializedBody=Q.bodySerializer(Q.body);if(Q.body===void 0||Q.serializedBody==="")Q.headers.delete("Content-Type");let T=Q,z=Rj(T);return{opts:T,url:z}},G=async(Y)=>{let Q=Y.throwOnError??O.throwOnError,T=Y.responseStyle??O.responseStyle,z,W;try{let{opts:V,url:B}=await K(Y),I={redirect:"follow",...V,body:Hj(V)};z=new Request(B,I);for(let N of S.request.fns)if(N)z=await N(z,V);let P=V.fetch;W=await P(z);for(let N of S.response.fns)if(N)W=await N(W,z,V);let A={request:z,response:W};if(W.ok){let N=(V.parseAs==="auto"?F0(W.headers.get("Content-Type")):V.parseAs)??"json";if(W.status===204||W.headers.get("Content-Length")==="0"){let U;switch(N){case"arrayBuffer":case"blob":case"text":U=await W[N]();break;case"formData":U=new FormData;break;case"stream":U=W.body;break;case"json":default:U={};break}return V.responseStyle==="data"?U:{data:U,...A}}let H;switch(N){case"arrayBuffer":case"blob":case"formData":case"text":H=await W[N]();break;case"json":{let U=await W.text();H=U?JSON.parse(U):{};break}case"stream":return V.responseStyle==="data"?W.body:{data:W.body,...A}}if(N==="json"){if(V.responseValidator)await V.responseValidator(H);if(V.responseTransformer)H=await V.responseTransformer(H)}return V.responseStyle==="data"?H:{data:H,...A}}let D=await W.text(),F;try{F=JSON.parse(D)}catch{}throw F??D}catch(V){let B=V;for(let I of S.error.fns)if(I)B=await I(B,W,z,Y);if(B=B||{},Q)throw B;return T==="data"?void 0:{error:B,request:z,response:W}}},Z=(Y)=>(Q)=>G({...Q,method:Y}),X=(Y)=>async(Q)=>{let{opts:T,url:z}=await K(Q);return D0({...T,body:T.body,method:Y,onRequest:async(W,V)=>{let B=new Request(W,V);for(let I of S.request.fns)if(I)B=await I(B,T);return B},serializedBody:Hj(T),url:z})};return{buildUrl:(Y)=>Rj({...O,...Y}),connect:Z("CONNECT"),delete:Z("DELETE"),get:Z("GET"),getConfig:x,head:Z("HEAD"),interceptors:S,options:Z("OPTIONS"),patch:Z("PATCH"),post:Z("POST"),put:Z("PUT"),request:G,setConfig:j,sse:{connect:X("CONNECT"),delete:X("DELETE"),get:X("GET"),head:X("HEAD"),options:X("OPTIONS"),patch:X("PATCH"),post:X("POST"),put:X("PUT"),trace:X("TRACE")},trace:Z("TRACE")}};var q0=Dj(IO());class f0{client;constructor($){this.client=$?.client??q0}}class b0{defaultKey="default";instances=new Map;get($){let O=this.instances.get($??this.defaultKey);if(!O)throw Error('No SDK client found. Create one with "new Sdk()" to fix this error.');return O}set($,O){this.instances.set(O??this.defaultKey,$)}}class aO extends f0{static __registry=new b0;constructor($){super($);aO.__registry.set(this,$?.key)}discoverAgentCapabilitiesHandler($){return($.client??this.client).post({security:[{scheme:"bearer",type:"http"}],url:"/agent-capabilities/discover",...$,headers:{"Content-Type":"application/json",...$.headers}})}getAgentCodingPreferences($){return($?.client??this.client).get({url:"/agent-coding-preferences",...$})}putAgentCodingPreferences($){return($.client??this.client).put({url:"/agent-coding-preferences",...$,headers:{"Content-Type":"application/json",...$.headers}})}listAgentConversations($){return($.client??this.client).get({security:[{scheme:"bearer",type:"http"}],url:"/agent-conversations/{channel_id}",...$})}startFreshAgentConversation($){return($.client??this.client).post({security:[{scheme:"bearer",type:"http"}],url:"/agent-conversations/{channel_id}/{bot_id}/start-fresh",...$,headers:{"Content-Type":"application/json",...$.headers}})}retryAgentConversationTurn($){return($.client??this.client).post({security:[{scheme:"bearer",type:"http"}],url:"/agent-conversations/{channel_id}/{bot_id}/turns/{source}/retry",...$,headers:{"Content-Type":"application/json",...$.headers}})}loadAgentModelsHandler($){return($.client??this.client).post({security:[{scheme:"bearer",type:"http"}],url:"/agent-models/load",...$,headers:{"Content-Type":"application/json",...$.headers}})}listAgentRepositories($){return($?.client??this.client).get({security:[{scheme:"bearer",type:"http"}],url:"/agent-repositories",...$})}listAgentRepositoryBranches($){return($.client??this.client).get({security:[{scheme:"bearer",type:"http"}],url:"/agent-repositories/branches",...$})}getAgentSandboxSize($){return($?.client??this.client).get({url:"/agent-sandbox-size",...$})}putAgentSandboxSize($){return($.client??this.client).put({url:"/agent-sandbox-size",...$,headers:{"Content-Type":"application/json",...$.headers}})}createAgentSession($){return($.client??this.client).post({url:"/agent-sessions",...$,headers:{"Content-Type":"application/json",...$.headers}})}agentSessionsForPullRequest($){return($.client??this.client).post({url:"/agent-sessions/by-pull-request",...$,headers:{"Content-Type":"application/json",...$.headers}})}agentSessionsForPullRequests($){return($.client??this.client).post({url:"/agent-sessions/by-pull-requests",...$,headers:{"Content-Type":"application/json",...$.headers}})}previewAgentSessions($){return($.client??this.client).post({url:"/agent-sessions/preview",...$,headers:{"Content-Type":"application/json",...$.headers}})}warmAgentSessionHandler($){return($.client??this.client).post({url:"/agent-sessions/warm",...$,headers:{"Content-Type":"application/json",...$.headers}})}deleteAgentSession($){return($.client??this.client).delete({url:"/agent-sessions/{session_id}",...$})}getAgentSession($){return($.client??this.client).get({url:"/agent-sessions/{session_id}",...$})}setAgentSessionArchived($){return($.client??this.client).put({url:"/agent-sessions/{session_id}/archived",...$,headers:{"Content-Type":"application/json",...$.headers}})}getAgentSessionChanges($){return($.client??this.client).get({url:"/agent-sessions/{session_id}/changes",...$})}getAgentSessionChangesPatch($){return($.client??this.client).get({url:"/agent-sessions/{session_id}/changes/patch",...$})}refreshAgentSessionChanges($){return($.client??this.client).post({url:"/agent-sessions/{session_id}/changes/refresh",...$})}getCodeExecution($){return($.client??this.client).get({url:"/agent-sessions/{session_id}/code-executions/{execution_id}",...$})}listExecutionReviews($){return($.client??this.client).get({url:"/agent-sessions/{session_id}/code-executions/{execution_id}/reviews",...$})}controlAgentSession($){return($.client??this.client).post({url:"/agent-sessions/{session_id}/control",...$,headers:{"Content-Type":"application/json",...$.headers}})}getAgentSessionLog($){return($.client??this.client).get({url:"/agent-sessions/{session_id}/log",...$})}renameAgentSession($){return($.client??this.client).put({url:"/agent-sessions/{session_id}/name",...$,headers:{"Content-Type":"application/json",...$.headers}})}getAgentSessionPermissions($){return($.client??this.client).get({url:"/agent-sessions/{session_id}/permissions",...$})}updateAgentSessionPermissions($){return($.client??this.client).patch({url:"/agent-sessions/{session_id}/permissions",...$,headers:{"Content-Type":"application/json",...$.headers}})}unlinkAgentSessionPullRequest($){return($.client??this.client).delete({url:"/agent-sessions/{session_id}/pull-requests",...$})}listAgentSessionPullRequests($){return($.client??this.client).get({url:"/agent-sessions/{session_id}/pull-requests",...$})}linkAgentSessionPullRequest($){return($.client??this.client).put({url:"/agent-sessions/{session_id}/pull-requests",...$,headers:{"Content-Type":"application/json",...$.headers}})}getAgentSessionQueue($){return($.client??this.client).get({url:"/agent-sessions/{session_id}/queue",...$})}removeQueuedAction($){return($.client??this.client).delete({url:"/agent-sessions/{session_id}/queue/{action_id}",...$})}editQueuedAction($){return($.client??this.client).put({url:"/agent-sessions/{session_id}/queue/{action_id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}steerQueuedAction($){return($.client??this.client).post({url:"/agent-sessions/{session_id}/queue/{action_id}/steer",...$})}createSessionReview($){return($.client??this.client).post({url:"/agent-sessions/{session_id}/reviews",...$,headers:{"Content-Type":"application/json",...$.headers}})}getSessionReview($){return($.client??this.client).get({url:"/agent-sessions/{session_id}/reviews/{review_id}",...$})}decideSessionReview($){return($.client??this.client).post({url:"/agent-sessions/{session_id}/reviews/{review_id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}putAgentSessionSandboxSize($){return($.client??this.client).put({url:"/agent-sessions/{session_id}/sandbox-size",...$,headers:{"Content-Type":"application/json",...$.headers}})}answerAgentSessionToolApproval($){return($.client??this.client).post({url:"/agent-sessions/{session_id}/tool-approvals/{approval_id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}disconnect($){return($.client??this.client).delete({security:[{scheme:"bearer",type:"http"}],url:"/claude-auth",...$,headers:{"Content-Type":"application/json",...$.headers}})}status($){return($?.client??this.client).get({security:[{scheme:"bearer",type:"http"}],url:"/claude-auth",...$})}complete($){return($.client??this.client).post({security:[{scheme:"bearer",type:"http"}],url:"/claude-auth/complete",...$,headers:{"Content-Type":"application/json",...$.headers}})}start($){return($.client??this.client).post({security:[{scheme:"bearer",type:"http"}],url:"/claude-auth/start",...$,headers:{"Content-Type":"application/json",...$.headers}})}}function g0({onRequest:$,onSseError:O,onSseEvent:x,responseTransformer:j,responseValidator:S,sseDefaultRetryDelay:K,sseMaxRetryAttempts:G,sseMaxRetryDelay:Z,sseSleepFn:X,url:L,...Y}){let Q,T=X??((V)=>new Promise((B)=>setTimeout(B,V)));return{stream:async function*(){let V=K??3000,B=0,I=Y.signal??new AbortController().signal;while(!0){if(I.aborted)break;B++;let P=Y.headers instanceof Headers?Y.headers:new Headers(Y.headers);if(Q!==void 0)P.set("Last-Event-ID",Q);try{let A={redirect:"follow",...Y,body:Y.serializedBody,headers:P,signal:I},D=new Request(L,A);if($)D=await $(L,A);let N=await(Y.fetch??globalThis.fetch)(D);if(!N.ok)throw Error(`SSE failed: ${N.status} ${N.statusText}`);if(!N.body)throw Error("No body in SSE response");let H=N.body.pipeThrough(new TextDecoderStream).getReader(),U="",g=()=>{try{H.cancel()}catch{}};I.addEventListener("abort",g);try{while(!0){let{done:r,value:p}=await H.read();if(r)break;U+=p,U=U.replace(/\r\n?/g,`-`);let k=U.split(`--`);U=k.pop()??"";for(let a of k){let i=a.split(`-`),_=[],y;for(let R of i)if(R.startsWith("data:"))_.push(R.replace(/^data:\s*/,""));else if(R.startsWith("event:"))y=R.replace(/^event:\s*/,"");else if(R.startsWith("id:"))Q=R.replace(/^id:\s*/,"");else if(R.startsWith("retry:")){let v=Number.parseInt(R.replace(/^retry:\s*/,""),10);if(!Number.isNaN(v))V=v}let C,h=!1;if(_.length){let R=_.join(`-`);try{C=JSON.parse(R),h=!0}catch{C=R}}if(h){if(S)await S(C);if(j)C=await j(C)}if(x?.({data:C,event:y,id:Q,retry:V}),_.length)yield C}}}finally{I.removeEventListener("abort",g),H.releaseLock()}break}catch(A){if(O?.(A),G!==void 0&&B>=G)break;let D=Math.min(V*2**(B-1),Z??30000);await T(D)}}}()}}var D2=($)=>{switch($){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},C2=($)=>{switch($){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},M2=($)=>{switch($){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},iO=({allowReserved:$,explode:O,name:x,style:j,value:S})=>{if(!O){let Z=($?S:S.map((X)=>encodeURIComponent(X))).join(C2(j));switch(j){case"label":return`.${Z}`;case"matrix":return`;${x}=${Z}`;case"simple":return Z;default:return`${x}=${Z}`}}let K=D2(j),G=S.map((Z)=>{if(j==="label"||j==="simple")return $?Z:encodeURIComponent(Z);return $O({allowReserved:$,name:x,value:Z})}).join(K);return j==="label"||j==="matrix"?K+G:G},$O=({allowReserved:$,name:O,value:x})=>{if(x===void 0||x===null)return"";if(typeof x==="object")throw Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${O}=${$?x:encodeURIComponent(x)}`},nO=({allowReserved:$,explode:O,name:x,style:j,value:S,valueOnly:K})=>{if(S instanceof Date)return K?S.toISOString():`${x}=${S.toISOString()}`;if(j!=="deepObject"&&!O){let X=[];Object.entries(S).forEach(([Y,Q])=>{X=[...X,Y,$?Q:encodeURIComponent(Q)]});let L=X.join(",");switch(j){case"form":return`${x}=${L}`;case"label":return`.${L}`;case"matrix":return`;${x}=${L}`;default:return L}}let G=M2(j),Z=Object.entries(S).map(([X,L])=>$O({allowReserved:$,name:j==="deepObject"?`${x}[${X}]`:X,value:L})).join(G);return j==="label"||j==="matrix"?G+Z:Z};var P2=/\{[^{}]+\}/g,_2=({path:$,url:O})=>{let x=O,j=O.match(P2);if(j)for(let S of j){let K=!1,G=S.substring(1,S.length-1),Z="simple";if(G.endsWith("*"))K=!0,G=G.substring(0,G.length-1);if(G.startsWith("."))G=G.substring(1),Z="label";else if(G.startsWith(";"))G=G.substring(1),Z="matrix";let X=$[G];if(X===void 0||X===null)continue;if(Array.isArray(X)){x=x.replace(S,iO({explode:K,name:G,style:Z,value:X}));continue}if(typeof X==="object"){x=x.replace(S,nO({explode:K,name:G,style:Z,value:X,valueOnly:!0}));continue}if(Z==="matrix"){x=x.replace(S,`;${$O({name:G,value:X})}`);continue}let L=encodeURIComponent(Z==="label"?`.${X}`:X);x=x.replace(S,L)}return x},k0=({baseUrl:$,path:O,query:x,querySerializer:j,url:S})=>{let K=S.startsWith("/")?S:`/${S}`,G=($??"")+K;if(O)G=_2({path:O,url:G});let Z=x?j(x):"";if(Z.startsWith("?"))Z=Z.substring(1);if(Z)G+=`?${Z}`;return G};function Cj($){let O=$.body!==void 0;if(O&&$.bodySerializer){if("serializedBody"in $)return $.serializedBody!==void 0&&$.serializedBody!==""?$.serializedBody:null;return $.body!==""?$.body:null}if(O)return $.body;return}var y0=async($,O)=>{let x=typeof O==="function"?await O($):O;if(!x)return;if($.scheme==="bearer")return`Bearer ${x}`;if($.scheme==="basic")return`Basic ${btoa(x)}`;return x};var h0={bodySerializer:($)=>JSON.stringify($,(O,x)=>typeof x==="bigint"?x.toString():x)};var v0=({parameters:$={},...O}={})=>{return(j)=>{let S=[];if(j&&typeof j==="object")for(let K in j){let G=j[K];if(G===void 0||G===null)continue;let Z=$[K]||O;if(Array.isArray(G)){let X=iO({allowReserved:Z.allowReserved,explode:!0,name:K,style:"form",value:G,...Z.array});if(X)S.push(X)}else if(typeof G==="object"){let X=nO({allowReserved:Z.allowReserved,explode:!0,name:K,style:"deepObject",value:G,...Z.object});if(X)S.push(X)}else{let X=$O({allowReserved:Z.allowReserved,name:K,value:G});if(X)S.push(X)}}return S.join("&")}},m0=($)=>{if(!$)return"stream";let O=$.split(";")[0]?.trim();if(!O)return;if(O.startsWith("application/json")||O.endsWith("+json"))return"json";if(O==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some((x)=>O.startsWith(x)))return"blob";if(O.startsWith("text/"))return"text";return},F2=($,O)=>{if(!O)return!1;if($.headers.has(O)||$.query?.[O]||$.headers.get("Cookie")?.includes(`${O}=`))return!0;return!1};async function c0($){for(let O of $.security??[]){if(F2($,O.name))continue;let x=await y0(O,$.auth);if(!x)continue;let j=O.name??"Authorization";switch(O.in){case"query":if(!$.query)$.query={};$.query[j]=x;break;case"cookie":$.headers.append("Cookie",`${j}=${x}`);break;case"header":default:$.headers.set(j,x);break}}}var Mj=($)=>k0({baseUrl:$.baseUrl,path:$.path,query:$.query,querySerializer:typeof $.querySerializer==="function"?$.querySerializer:v0($.querySerializer),url:$.url}),Pj=($,O)=>{let x={...$,...O};if(x.baseUrl?.endsWith("/"))x.baseUrl=x.baseUrl.substring(0,x.baseUrl.length-1);return x.headers=eO($.headers,O.headers),x},E2=($)=>{let O=[];return $.forEach((x,j)=>{O.push([j,x])}),O},eO=(...$)=>{let O=new Headers;for(let x of $){if(!x)continue;let j=x instanceof Headers?E2(x):Object.entries(x);for(let[S,K]of j)if(K===null)O.delete(S);else if(Array.isArray(K))for(let G of K)O.append(S,G);else if(K!==void 0)O.set(S,typeof K==="object"?JSON.stringify(K):K)}return O};class sO{fns=[];clear(){this.fns=[]}eject($){let O=this.getInterceptorIndex($);if(this.fns[O])this.fns[O]=null}exists($){let O=this.getInterceptorIndex($);return Boolean(this.fns[O])}getInterceptorIndex($){if(typeof $==="number")return this.fns[$]?$:-1;return this.fns.indexOf($)}update($,O){let x=this.getInterceptorIndex($);if(this.fns[x])return this.fns[x]=O,$;return!1}use($){return this.fns.push($),this.fns.length-1}}var d0=()=>({error:new sO,request:new sO,response:new sO}),w2=v0({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),q2={"Content-Type":"application/json"},TO=($={})=>({...h0,headers:q2,parseAs:"auto",querySerializer:w2,...$});var _j=($={})=>{let O=Pj(TO(),$),x=()=>({...O}),j=(Y)=>{return O=Pj(O,Y),x()},S=d0(),K=async(Y)=>{let Q={...O,...Y,fetch:Y.fetch??O.fetch??globalThis.fetch,headers:eO(O.headers,Y.headers),serializedBody:void 0};if(Q.security)await c0(Q);if(Q.requestValidator)await Q.requestValidator(Q);if(Q.body!==void 0&&Q.bodySerializer)Q.serializedBody=Q.bodySerializer(Q.body);if(Q.body===void 0||Q.serializedBody==="")Q.headers.delete("Content-Type");let T=Q,z=Mj(T);return{opts:T,url:z}},G=async(Y)=>{let Q=Y.throwOnError??O.throwOnError,T=Y.responseStyle??O.responseStyle,z,W;try{let{opts:V,url:B}=await K(Y),I={redirect:"follow",...V,body:Cj(V)};z=new Request(B,I);for(let N of S.request.fns)if(N)z=await N(z,V);let P=V.fetch;W=await P(z);for(let N of S.response.fns)if(N)W=await N(W,z,V);let A={request:z,response:W};if(W.ok){let N=(V.parseAs==="auto"?m0(W.headers.get("Content-Type")):V.parseAs)??"json";if(W.status===204||W.headers.get("Content-Length")==="0"){let U;switch(N){case"arrayBuffer":case"blob":case"text":U=await W[N]();break;case"formData":U=new FormData;break;case"stream":U=W.body;break;case"json":default:U={};break}return V.responseStyle==="data"?U:{data:U,...A}}let H;switch(N){case"arrayBuffer":case"blob":case"formData":case"text":H=await W[N]();break;case"json":{let U=await W.text();H=U?JSON.parse(U):{};break}case"stream":return V.responseStyle==="data"?W.body:{data:W.body,...A}}if(N==="json"){if(V.responseValidator)await V.responseValidator(H);if(V.responseTransformer)H=await V.responseTransformer(H)}return V.responseStyle==="data"?H:{data:H,...A}}let D=await W.text(),F;try{F=JSON.parse(D)}catch{}throw F??D}catch(V){let B=V;for(let I of S.error.fns)if(I)B=await I(B,W,z,Y);if(B=B||{},Q)throw B;return T==="data"?void 0:{error:B,request:z,response:W}}},Z=(Y)=>(Q)=>G({...Q,method:Y}),X=(Y)=>async(Q)=>{let{opts:T,url:z}=await K(Q);return g0({...T,body:T.body,method:Y,onRequest:async(W,V)=>{let B=new Request(W,V);for(let I of S.request.fns)if(I)B=await I(B,T);return B},serializedBody:Cj(T),url:z})};return{buildUrl:(Y)=>Mj({...O,...Y}),connect:Z("CONNECT"),delete:Z("DELETE"),get:Z("GET"),getConfig:x,head:Z("HEAD"),interceptors:S,options:Z("OPTIONS"),patch:Z("PATCH"),post:Z("POST"),put:Z("PUT"),request:G,setConfig:j,sse:{connect:X("CONNECT"),delete:X("DELETE"),get:X("GET"),head:X("HEAD"),options:X("OPTIONS"),patch:X("PATCH"),post:X("POST"),put:X("PUT"),trace:X("TRACE")},trace:Z("TRACE")}};var u0=_j(TO());class l0{client;constructor($){this.client=$?.client??u0}}class r0{defaultKey="default";instances=new Map;get($){let O=this.instances.get($??this.defaultKey);if(!O)throw Error('No SDK client found. Create one with "new Sdk()" to fix this error.');return O}set($,O){this.instances.set(O??this.defaultKey,$)}}class tO extends l0{static __registry=new r0;constructor($){super($);tO.__registry.set(this,$?.key)}updateAiBillingAutoReload($){return($.client??this.client).patch({url:"/ai-billing/auto-reload",...$,headers:{"Content-Type":"application/json",...$.headers}})}createAiCreditCheckout($){return($.client??this.client).post({url:"/ai-billing/credits/checkout",...$,headers:{"Content-Type":"application/json",...$.headers}})}updateAiBillingOverage($){return($.client??this.client).patch({url:"/ai-billing/overage",...$,headers:{"Content-Type":"application/json",...$.headers}})}getAiBillingPlans($){return($?.client??this.client).get({url:"/ai-billing/plans",...$})}getAiBillingSummary($){return($?.client??this.client).get({url:"/ai-billing/summary",...$})}disconnectCodex($){return($?.client??this.client).delete({url:"/codex",...$})}getCodexConnection($){return($?.client??this.client).get({url:"/codex",...$})}configureCodex($){return($.client??this.client).put({url:"/codex/config",...$,headers:{"Content-Type":"application/json",...$.headers}})}listCodexEnvironments($){return($?.client??this.client).get({url:"/codex/environments",...$})}startCodexLogin($){return($?.client??this.client).post({url:"/codex/login",...$})}cancelCodexLogin($){return($.client??this.client).delete({url:"/codex/login/{attempt_id}",...$})}pollCodexLogin($){return($.client??this.client).get({url:"/codex/login/{attempt_id}",...$})}deleteCursorApiKey($){return($?.client??this.client).delete({url:"/cursor-api-key",...$})}getCursorApiKey($){return($?.client??this.client).get({url:"/cursor-api-key",...$})}putCursorApiKey($){return($.client??this.client).put({url:"/cursor-api-key",...$,headers:{"Content-Type":"application/json",...$.headers}})}putCursorDefaultModel($){return($.client??this.client).put({url:"/cursor-api-key/default-model",...$,headers:{"Content-Type":"application/json",...$.headers}})}listCursorModels($){return($?.client??this.client).get({url:"/cursor-api-key/models",...$})}verifyFusionauthUserEmail($){return($.client??this.client).get({url:"/email/fusionauth/verify/{verification_id}",...$})}resendFusionauthVerifyUserEmail($){return($.client??this.client).post({url:"/email/fusionauth_resend",...$,headers:{"Content-Type":"application/json",...$.headers}})}generateEmailLink($){return($.client??this.client).post({url:"/email/generate/link",...$,headers:{"Content-Type":"application/json",...$.headers}})}verifyEmailLink($){return($.client??this.client).get({url:"/email/verify/{verification_id}",...$})}setGithubPullRequestDraft($){return($.client??this.client).post({url:"/github_pull_requests/draft",...$,headers:{"Content-Type":"application/json",...$.headers}})}enrichGithubPullRequests($){return($.client??this.client).post({url:"/github_pull_requests/enrich",...$,headers:{"Content-Type":"application/json",...$.headers}})}mergeGithubPullRequest($){return($.client??this.client).post({url:"/github_pull_requests/merge",...$,headers:{"Content-Type":"application/json",...$.headers}})}getGithubPullRequestMergeability($){return($.client??this.client).post({url:"/github_pull_requests/mergeability",...$,headers:{"Content-Type":"application/json",...$.headers}})}listGtmInviteLinks($){return($?.client??this.client).get({url:"/gtm-invite/links",...$})}createGtmInviteLink($){return($.client??this.client).post({url:"/gtm-invite/links",...$,headers:{"Content-Type":"application/json",...$.headers}})}revokeGtmInviteLink($){return($.client??this.client).delete({url:"/gtm-invite/links/{id}",...$})}getGtmInviteOffer($){return($?.client??this.client).get({url:"/gtm-invite/offer",...$})}resolveGtmInviteLink($){return($.client??this.client).get({url:"/gtm-invite/public/{token}",...$})}redeemGtmInviteLink($){return($.client??this.client).post({url:"/gtm-invite/redeem",...$,headers:{"Content-Type":"application/json",...$.headers}})}healthHandler($){return($?.client??this.client).get({url:"/health",...$})}macroApiToken($){return($.client??this.client).get({url:"/jwt/macro_api_token",...$})}refresh($){return($?.client??this.client).post({url:"/jwt/refresh",...$})}createInProgressLink($){return($?.client??this.client).post({url:"/link",...$})}emailConnectionProviders($){return($?.client??this.client).get({url:"/link/email/providers",...$})}deleteGithubLink($){return($?.client??this.client).delete({url:"/link/github",...$})}initGithubLink($){return($.client??this.client).post({url:"/link/github",...$})}checkGithubLinkStatus($){return($?.client??this.client).get({url:"/link/github/status",...$})}initGmailLink($){return($.client??this.client).post({url:"/link/gmail",...$})}checkGmailLinkStatus($){return($?.client??this.client).get({url:"/link/gmail/status",...$})}initOutlookLink($){return($?.client??this.client).post({url:"/link/outlook",...$})}appleLogin($){return($.client??this.client).post({url:"/login/apple",...$,headers:{"Content-Type":"application/json",...$.headers}})}passwordLogin($){return($.client??this.client).post({url:"/login/password",...$,headers:{"Content-Type":"application/json",...$.headers}})}passwordlessLogin($){return($.client??this.client).post({url:"/login/passwordless",...$,headers:{"Content-Type":"application/json",...$.headers}})}ssoLogin($){return($.client??this.client).get({url:"/login/sso",...$})}logout($){return($?.client??this.client).post({url:"/logout",...$})}createMergeRequest($){return($.client??this.client).post({url:"/merge",...$,headers:{"Content-Type":"application/json",...$.headers}})}verifyMergeRequest($){return($.client??this.client).get({url:"/merge/verify/{code}",...$})}sendMobileWelcomeEmail($){return($.client??this.client).post({url:"/mobile-welcome-email",...$,headers:{"Content-Type":"application/json",...$.headers}})}passwordlessCallback($){return($.client??this.client).get({url:"/oauth/passwordless/{code}",...$})}oauthRedirect($){return($?.client??this.client).get({url:"/oauth/redirect",...$})}oauth2Callback($){return($.client??this.client).get({url:"/oauth2/{provider}/callback",...$})}getPermissions($){return($?.client??this.client).get({url:"/permissions",...$})}getUserPermissions($){return($?.client??this.client).get({url:"/permissions/me",...$})}getReferralCode($){return($?.client??this.client).get({url:"/referral/code",...$})}sendReferralCode($){return($.client??this.client).post({url:"/referral/send",...$,headers:{"Content-Type":"application/json",...$.headers}})}sessionCreation($){return($?.client??this.client).post({url:"/session",...$})}sessionLogin($){return($.client??this.client).get({url:"/session/login/{session_code}",...$})}deleteTeam($){return($?.client??this.client).delete({url:"/team",...$})}getTeam($){return($?.client??this.client).get({url:"/team",...$})}patchTeam($){return($.client??this.client).patch({url:"/team",...$,headers:{"Content-Type":"application/json",...$.headers}})}createTeam($){return($.client??this.client).post({url:"/team",...$,headers:{"Content-Type":"application/json",...$.headers}})}toggleTeamAutoJoinDomain($){return($?.client??this.client).post({url:"/team/auto-join-domain/toggle",...$})}patchTeamCrmSettings($){return($.client??this.client).patch({url:"/team/crm",...$,headers:{"Content-Type":"application/json",...$.headers}})}inviteToTeam($){return($.client??this.client).post({url:"/team/invite",...$,headers:{"Content-Type":"application/json",...$.headers}})}deleteTeamInviteHandler($){return($.client??this.client).delete({url:"/team/invite/{team_invite_id}",...$})}getTeamInvites($){return($?.client??this.client).get({url:"/team/invites",...$})}rejectInvitation($){return($.client??this.client).delete({url:"/team/join/{team_invite_id}",...$})}joinTeam($){return($.client??this.client).get({url:"/team/join/{team_invite_id}",...$})}patchTeamMemberPlan($){return($.client??this.client).patch({url:"/team/members/{member_user_id}/plan",...$,headers:{"Content-Type":"application/json",...$.headers}})}toggleTeamNonAdminInvites($){return($?.client??this.client).post({url:"/team/non-admin-invites/toggle",...$})}removeUserFromTeam($){return($.client??this.client).delete({url:"/team/remove/{remove_user_id}",...$})}getUserTeams($){return($?.client??this.client).get({url:"/team/user",...$})}getUserInvites($){return($?.client??this.client).get({url:"/team/user/invites",...$})}getUserNames($){return($.client??this.client).post({url:"/user/get_names",...$,headers:{"Content-Type":"application/json",...$.headers}})}getUserNamesWithEmail($){return($.client??this.client).post({url:"/user/get_names_with_email",...$,headers:{"Content-Type":"application/json",...$.headers}})}patchUserGroup($){return($.client??this.client).patch({url:"/user/group",...$,headers:{"Content-Type":"application/json",...$.headers}})}getLegacyUserPermissions($){return($?.client??this.client).get({url:"/user/legacy_user_permissions",...$})}getUserLinkExists($){return($.client??this.client).get({url:"/user/link_exists",...$})}deleteUser($){return($?.client??this.client).delete({url:"/user/me",...$})}getUserInfo($){return($?.client??this.client).get({url:"/user/me",...$})}getUserName($){return($?.client??this.client).get({url:"/user/name",...$})}putUserName($){return($?.client??this.client).put({url:"/user/name",...$})}patchUserOnboarding($){return($.client??this.client).patch({url:"/user/onboarding",...$,headers:{"Content-Type":"application/json",...$.headers}})}getUserOrganization($){return($?.client??this.client).get({url:"/user/organization",...$})}putProfilePicture($){return($.client??this.client).put({url:"/user/profile_picture",...$})}postProfilePictures($){return($.client??this.client).post({url:"/user/profile_pictures",...$,headers:{"Content-Type":"application/json",...$.headers}})}getUserQuota($){return($?.client??this.client).get({url:"/user/quota",...$})}createCheckoutSessionV2($){return($.client??this.client).post({url:"/user/stripe/checkoutv2",...$,headers:{"Content-Type":"application/json",...$.headers}})}getSubscriptionStatus($){return($?.client??this.client).get({url:"/user/stripe/plan",...$})}changePlan($){return($.client??this.client).post({url:"/user/stripe/plan",...$,headers:{"Content-Type":"application/json",...$.headers}})}createPortalSession($){return($.client??this.client).post({url:"/user/stripe/portal",...$,headers:{"Content-Type":"application/json",...$.headers}})}getTrialEligibility($){return($?.client??this.client).get({url:"/user/stripe/trial_eligibility",...$})}patchUserTutorial($){return($.client??this.client).patch({url:"/user/tutorial",...$,headers:{"Content-Type":"application/json",...$.headers}})}}function p0({onRequest:$,onSseError:O,onSseEvent:x,responseTransformer:j,responseValidator:S,sseDefaultRetryDelay:K,sseMaxRetryAttempts:G,sseMaxRetryDelay:Z,sseSleepFn:X,url:L,...Y}){let Q,T=X??((V)=>new Promise((B)=>setTimeout(B,V)));return{stream:async function*(){let V=K??3000,B=0,I=Y.signal??new AbortController().signal;while(!0){if(I.aborted)break;B++;let P=Y.headers instanceof Headers?Y.headers:new Headers(Y.headers);if(Q!==void 0)P.set("Last-Event-ID",Q);try{let A={redirect:"follow",...Y,body:Y.serializedBody,headers:P,signal:I},D=new Request(L,A);if($)D=await $(L,A);let N=await(Y.fetch??globalThis.fetch)(D);if(!N.ok)throw Error(`SSE failed: ${N.status} ${N.statusText}`);if(!N.body)throw Error("No body in SSE response");let H=N.body.pipeThrough(new TextDecoderStream).getReader(),U="",g=()=>{try{H.cancel()}catch{}};I.addEventListener("abort",g);try{while(!0){let{done:r,value:p}=await H.read();if(r)break;U+=p,U=U.replace(/\r\n?/g,`-`);let k=U.split(`--`);U=k.pop()??"";for(let a of k){let i=a.split(`-`),_=[],y;for(let R of i)if(R.startsWith("data:"))_.push(R.replace(/^data:\s*/,""));else if(R.startsWith("event:"))y=R.replace(/^event:\s*/,"");else if(R.startsWith("id:"))Q=R.replace(/^id:\s*/,"");else if(R.startsWith("retry:")){let v=Number.parseInt(R.replace(/^retry:\s*/,""),10);if(!Number.isNaN(v))V=v}let C,h=!1;if(_.length){let R=_.join(`-`);try{C=JSON.parse(R),h=!0}catch{C=R}}if(h){if(S)await S(C);if(j)C=await j(C)}if(x?.({data:C,event:y,id:Q,retry:V}),_.length)yield C}}}finally{I.removeEventListener("abort",g),H.releaseLock()}break}catch(A){if(O?.(A),G!==void 0&&B>=G)break;let D=Math.min(V*2**(B-1),Z??30000);await T(D)}}}()}}var f2=($)=>{switch($){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},b2=($)=>{switch($){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},g2=($)=>{switch($){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},oO=({allowReserved:$,explode:O,name:x,style:j,value:S})=>{if(!O){let Z=($?S:S.map((X)=>encodeURIComponent(X))).join(b2(j));switch(j){case"label":return`.${Z}`;case"matrix":return`;${x}=${Z}`;case"simple":return Z;default:return`${x}=${Z}`}}let K=f2(j),G=S.map((Z)=>{if(j==="label"||j==="simple")return $?Z:encodeURIComponent(Z);return OO({allowReserved:$,name:x,value:Z})}).join(K);return j==="label"||j==="matrix"?K+G:G},OO=({allowReserved:$,name:O,value:x})=>{if(x===void 0||x===null)return"";if(typeof x==="object")throw Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${O}=${$?x:encodeURIComponent(x)}`},$x=({allowReserved:$,explode:O,name:x,style:j,value:S,valueOnly:K})=>{if(S instanceof Date)return K?S.toISOString():`${x}=${S.toISOString()}`;if(j!=="deepObject"&&!O){let X=[];Object.entries(S).forEach(([Y,Q])=>{X=[...X,Y,$?Q:encodeURIComponent(Q)]});let L=X.join(",");switch(j){case"form":return`${x}=${L}`;case"label":return`.${L}`;case"matrix":return`;${x}=${L}`;default:return L}}let G=g2(j),Z=Object.entries(S).map(([X,L])=>OO({allowReserved:$,name:j==="deepObject"?`${x}[${X}]`:X,value:L})).join(G);return j==="label"||j==="matrix"?G+Z:Z};var k2=/\{[^{}]+\}/g,y2=({path:$,url:O})=>{let x=O,j=O.match(k2);if(j)for(let S of j){let K=!1,G=S.substring(1,S.length-1),Z="simple";if(G.endsWith("*"))K=!0,G=G.substring(0,G.length-1);if(G.startsWith("."))G=G.substring(1),Z="label";else if(G.startsWith(";"))G=G.substring(1),Z="matrix";let X=$[G];if(X===void 0||X===null)continue;if(Array.isArray(X)){x=x.replace(S,oO({explode:K,name:G,style:Z,value:X}));continue}if(typeof X==="object"){x=x.replace(S,$x({explode:K,name:G,style:Z,value:X,valueOnly:!0}));continue}if(Z==="matrix"){x=x.replace(S,`;${OO({name:G,value:X})}`);continue}let L=encodeURIComponent(Z==="label"?`.${X}`:X);x=x.replace(S,L)}return x},a0=({baseUrl:$,path:O,query:x,querySerializer:j,url:S})=>{let K=S.startsWith("/")?S:`/${S}`,G=($??"")+K;if(O)G=y2({path:O,url:G});let Z=x?j(x):"";if(Z.startsWith("?"))Z=Z.substring(1);if(Z)G+=`?${Z}`;return G};function Fj($){let O=$.body!==void 0;if(O&&$.bodySerializer){if("serializedBody"in $)return $.serializedBody!==void 0&&$.serializedBody!==""?$.serializedBody:null;return $.body!==""?$.body:null}if(O)return $.body;return}var i0=async($,O)=>{let x=typeof O==="function"?await O($):O;if(!x)return;if($.scheme==="bearer")return`Bearer ${x}`;if($.scheme==="basic")return`Basic ${btoa(x)}`;return x};var n0={bodySerializer:($)=>JSON.stringify($,(O,x)=>typeof x==="bigint"?x.toString():x)};var s0=({parameters:$={},...O}={})=>{return(j)=>{let S=[];if(j&&typeof j==="object")for(let K in j){let G=j[K];if(G===void 0||G===null)continue;let Z=$[K]||O;if(Array.isArray(G)){let X=oO({allowReserved:Z.allowReserved,explode:!0,name:K,style:"form",value:G,...Z.array});if(X)S.push(X)}else if(typeof G==="object"){let X=$x({allowReserved:Z.allowReserved,explode:!0,name:K,style:"deepObject",value:G,...Z.object});if(X)S.push(X)}else{let X=OO({allowReserved:Z.allowReserved,name:K,value:G});if(X)S.push(X)}}return S.join("&")}},e0=($)=>{if(!$)return"stream";let O=$.split(";")[0]?.trim();if(!O)return;if(O.startsWith("application/json")||O.endsWith("+json"))return"json";if(O==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some((x)=>O.startsWith(x)))return"blob";if(O.startsWith("text/"))return"text";return},h2=($,O)=>{if(!O)return!1;if($.headers.has(O)||$.query?.[O]||$.headers.get("Cookie")?.includes(`${O}=`))return!0;return!1};async function t0($){for(let O of $.security??[]){if(h2($,O.name))continue;let x=await i0(O,$.auth);if(!x)continue;let j=O.name??"Authorization";switch(O.in){case"query":if(!$.query)$.query={};$.query[j]=x;break;case"cookie":$.headers.append("Cookie",`${j}=${x}`);break;case"header":default:$.headers.set(j,x);break}}}var Ej=($)=>a0({baseUrl:$.baseUrl,path:$.path,query:$.query,querySerializer:typeof $.querySerializer==="function"?$.querySerializer:s0($.querySerializer),url:$.url}),wj=($,O)=>{let x={...$,...O};if(x.baseUrl?.endsWith("/"))x.baseUrl=x.baseUrl.substring(0,x.baseUrl.length-1);return x.headers=xx($.headers,O.headers),x},v2=($)=>{let O=[];return $.forEach((x,j)=>{O.push([j,x])}),O},xx=(...$)=>{let O=new Headers;for(let x of $){if(!x)continue;let j=x instanceof Headers?v2(x):Object.entries(x);for(let[S,K]of j)if(K===null)O.delete(S);else if(Array.isArray(K))for(let G of K)O.append(S,G);else if(K!==void 0)O.set(S,typeof K==="object"?JSON.stringify(K):K)}return O};class Ox{fns=[];clear(){this.fns=[]}eject($){let O=this.getInterceptorIndex($);if(this.fns[O])this.fns[O]=null}exists($){let O=this.getInterceptorIndex($);return Boolean(this.fns[O])}getInterceptorIndex($){if(typeof $==="number")return this.fns[$]?$:-1;return this.fns.indexOf($)}update($,O){let x=this.getInterceptorIndex($);if(this.fns[x])return this.fns[x]=O,$;return!1}use($){return this.fns.push($),this.fns.length-1}}var o0=()=>({error:new Ox,request:new Ox,response:new Ox}),m2=s0({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),c2={"Content-Type":"application/json"},HO=($={})=>({...n0,headers:c2,parseAs:"auto",querySerializer:m2,...$});var qj=($={})=>{let O=wj(HO(),$),x=()=>({...O}),j=(Y)=>{return O=wj(O,Y),x()},S=o0(),K=async(Y)=>{let Q={...O,...Y,fetch:Y.fetch??O.fetch??globalThis.fetch,headers:xx(O.headers,Y.headers),serializedBody:void 0};if(Q.security)await t0(Q);if(Q.requestValidator)await Q.requestValidator(Q);if(Q.body!==void 0&&Q.bodySerializer)Q.serializedBody=Q.bodySerializer(Q.body);if(Q.body===void 0||Q.serializedBody==="")Q.headers.delete("Content-Type");let T=Q,z=Ej(T);return{opts:T,url:z}},G=async(Y)=>{let Q=Y.throwOnError??O.throwOnError,T=Y.responseStyle??O.responseStyle,z,W;try{let{opts:V,url:B}=await K(Y),I={redirect:"follow",...V,body:Fj(V)};z=new Request(B,I);for(let N of S.request.fns)if(N)z=await N(z,V);let P=V.fetch;W=await P(z);for(let N of S.response.fns)if(N)W=await N(W,z,V);let A={request:z,response:W};if(W.ok){let N=(V.parseAs==="auto"?e0(W.headers.get("Content-Type")):V.parseAs)??"json";if(W.status===204||W.headers.get("Content-Length")==="0"){let U;switch(N){case"arrayBuffer":case"blob":case"text":U=await W[N]();break;case"formData":U=new FormData;break;case"stream":U=W.body;break;case"json":default:U={};break}return V.responseStyle==="data"?U:{data:U,...A}}let H;switch(N){case"arrayBuffer":case"blob":case"formData":case"text":H=await W[N]();break;case"json":{let U=await W.text();H=U?JSON.parse(U):{};break}case"stream":return V.responseStyle==="data"?W.body:{data:W.body,...A}}if(N==="json"){if(V.responseValidator)await V.responseValidator(H);if(V.responseTransformer)H=await V.responseTransformer(H)}return V.responseStyle==="data"?H:{data:H,...A}}let D=await W.text(),F;try{F=JSON.parse(D)}catch{}throw F??D}catch(V){let B=V;for(let I of S.error.fns)if(I)B=await I(B,W,z,Y);if(B=B||{},Q)throw B;return T==="data"?void 0:{error:B,request:z,response:W}}},Z=(Y)=>(Q)=>G({...Q,method:Y}),X=(Y)=>async(Q)=>{let{opts:T,url:z}=await K(Q);return p0({...T,body:T.body,method:Y,onRequest:async(W,V)=>{let B=new Request(W,V);for(let I of S.request.fns)if(I)B=await I(B,T);return B},serializedBody:Fj(T),url:z})};return{buildUrl:(Y)=>Ej({...O,...Y}),connect:Z("CONNECT"),delete:Z("DELETE"),get:Z("GET"),getConfig:x,head:Z("HEAD"),interceptors:S,options:Z("OPTIONS"),patch:Z("PATCH"),post:Z("POST"),put:Z("PUT"),request:G,setConfig:j,sse:{connect:X("CONNECT"),delete:X("DELETE"),get:X("GET"),head:X("HEAD"),options:X("OPTIONS"),patch:X("PATCH"),post:X("POST"),put:X("PUT"),trace:X("TRACE")},trace:Z("TRACE")}};var $1=qj(HO());class O1{client;constructor($){this.client=$?.client??$1}}class x1{defaultKey="default";instances=new Map;get($){let O=this.instances.get($??this.defaultKey);if(!O)throw Error('No SDK client found. Create one with "new Sdk()" to fix this error.');return O}set($,O){this.instances.set(O??this.defaultKey,$)}}class jx extends O1{static __registry=new x1;constructor($){super($);jx.__registry.set(this,$?.key)}getAvailabilityCalendars($){return($?.client??this.client).get({url:"/availability-calendars",...$})}setAvailabilityCalendar($){return($.client??this.client).put({url:"/availability-calendars/{calendar_id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}listCalendars($){return($?.client??this.client).get({url:"/calendars",...$})}createCalendarEvent($){return($.client??this.client).post({url:"/events",...$,headers:{"Content-Type":"application/json",...$.headers}})}deleteCalendarEvent($){return($.client??this.client).delete({url:"/events/{event_id}",...$})}updateCalendarEvent($){return($.client??this.client).patch({url:"/events/{event_id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}calendarEventProviderUrl($){return($.client??this.client).get({url:"/events/{event_id}/provider-url",...$})}prepareCalendarReplacement($){return($.client??this.client).post({url:"/events/{event_id}/replacement",...$,headers:{"Content-Type":"application/json",...$.headers}})}rsvpCalendarEvent($){return($.client??this.client).put({url:"/events/{event_id}/rsvp",...$,headers:{"Content-Type":"application/json",...$.headers}})}healthHandler($){return($?.client??this.client).get({url:"/health",...$})}discardCalendarReplacement($){return($.client??this.client).delete({url:"/replacements/{operation_id}",...$})}calendarReplacementStatus($){return($.client??this.client).get({url:"/replacements/{operation_id}",...$})}confirmCalendarReplacement($){return($.client??this.client).post({url:"/replacements/{operation_id}/confirm",...$})}getTeamSharing($){return($?.client??this.client).get({url:"/team-sharing",...$})}setTeamSharing($){return($.client??this.client).put({url:"/team-sharing",...$,headers:{"Content-Type":"application/json",...$.headers}})}}function j1({onRequest:$,onSseError:O,onSseEvent:x,responseTransformer:j,responseValidator:S,sseDefaultRetryDelay:K,sseMaxRetryAttempts:G,sseMaxRetryDelay:Z,sseSleepFn:X,url:L,...Y}){let Q,T=X??((V)=>new Promise((B)=>setTimeout(B,V)));return{stream:async function*(){let V=K??3000,B=0,I=Y.signal??new AbortController().signal;while(!0){if(I.aborted)break;B++;let P=Y.headers instanceof Headers?Y.headers:new Headers(Y.headers);if(Q!==void 0)P.set("Last-Event-ID",Q);try{let A={redirect:"follow",...Y,body:Y.serializedBody,headers:P,signal:I},D=new Request(L,A);if($)D=await $(L,A);let N=await(Y.fetch??globalThis.fetch)(D);if(!N.ok)throw Error(`SSE failed: ${N.status} ${N.statusText}`);if(!N.body)throw Error("No body in SSE response");let H=N.body.pipeThrough(new TextDecoderStream).getReader(),U="",g=()=>{try{H.cancel()}catch{}};I.addEventListener("abort",g);try{while(!0){let{done:r,value:p}=await H.read();if(r)break;U+=p,U=U.replace(/\r\n?/g,`-`);let k=U.split(`--`);U=k.pop()??"";for(let a of k){let i=a.split(`-`),_=[],y;for(let R of i)if(R.startsWith("data:"))_.push(R.replace(/^data:\s*/,""));else if(R.startsWith("event:"))y=R.replace(/^event:\s*/,"");else if(R.startsWith("id:"))Q=R.replace(/^id:\s*/,"");else if(R.startsWith("retry:")){let v=Number.parseInt(R.replace(/^retry:\s*/,""),10);if(!Number.isNaN(v))V=v}let C,h=!1;if(_.length){let R=_.join(`-`);try{C=JSON.parse(R),h=!0}catch{C=R}}if(h){if(S)await S(C);if(j)C=await j(C)}if(x?.({data:C,event:y,id:Q,retry:V}),_.length)yield C}}}finally{I.removeEventListener("abort",g),H.releaseLock()}break}catch(A){if(O?.(A),G!==void 0&&B>=G)break;let D=Math.min(V*2**(B-1),Z??30000);await T(D)}}}()}}var d2=($)=>{switch($){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},u2=($)=>{switch($){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},l2=($)=>{switch($){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},Sx=({allowReserved:$,explode:O,name:x,style:j,value:S})=>{if(!O){let Z=($?S:S.map((X)=>encodeURIComponent(X))).join(u2(j));switch(j){case"label":return`.${Z}`;case"matrix":return`;${x}=${Z}`;case"simple":return Z;default:return`${x}=${Z}`}}let K=d2(j),G=S.map((Z)=>{if(j==="label"||j==="simple")return $?Z:encodeURIComponent(Z);return xO({allowReserved:$,name:x,value:Z})}).join(K);return j==="label"||j==="matrix"?K+G:G},xO=({allowReserved:$,name:O,value:x})=>{if(x===void 0||x===null)return"";if(typeof x==="object")throw Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${O}=${$?x:encodeURIComponent(x)}`},Gx=({allowReserved:$,explode:O,name:x,style:j,value:S,valueOnly:K})=>{if(S instanceof Date)return K?S.toISOString():`${x}=${S.toISOString()}`;if(j!=="deepObject"&&!O){let X=[];Object.entries(S).forEach(([Y,Q])=>{X=[...X,Y,$?Q:encodeURIComponent(Q)]});let L=X.join(",");switch(j){case"form":return`${x}=${L}`;case"label":return`.${L}`;case"matrix":return`;${x}=${L}`;default:return L}}let G=l2(j),Z=Object.entries(S).map(([X,L])=>xO({allowReserved:$,name:j==="deepObject"?`${x}[${X}]`:X,value:L})).join(G);return j==="label"||j==="matrix"?G+Z:Z};var r2=/\{[^{}]+\}/g,p2=({path:$,url:O})=>{let x=O,j=O.match(r2);if(j)for(let S of j){let K=!1,G=S.substring(1,S.length-1),Z="simple";if(G.endsWith("*"))K=!0,G=G.substring(0,G.length-1);if(G.startsWith("."))G=G.substring(1),Z="label";else if(G.startsWith(";"))G=G.substring(1),Z="matrix";let X=$[G];if(X===void 0||X===null)continue;if(Array.isArray(X)){x=x.replace(S,Sx({explode:K,name:G,style:Z,value:X}));continue}if(typeof X==="object"){x=x.replace(S,Gx({explode:K,name:G,style:Z,value:X,valueOnly:!0}));continue}if(Z==="matrix"){x=x.replace(S,`;${xO({name:G,value:X})}`);continue}let L=encodeURIComponent(Z==="label"?`.${X}`:X);x=x.replace(S,L)}return x},S1=({baseUrl:$,path:O,query:x,querySerializer:j,url:S})=>{let K=S.startsWith("/")?S:`/${S}`,G=($??"")+K;if(O)G=p2({path:O,url:G});let Z=x?j(x):"";if(Z.startsWith("?"))Z=Z.substring(1);if(Z)G+=`?${Z}`;return G};function fj($){let O=$.body!==void 0;if(O&&$.bodySerializer){if("serializedBody"in $)return $.serializedBody!==void 0&&$.serializedBody!==""?$.serializedBody:null;return $.body!==""?$.body:null}if(O)return $.body;return}var G1=async($,O)=>{let x=typeof O==="function"?await O($):O;if(!x)return;if($.scheme==="bearer")return`Bearer ${x}`;if($.scheme==="basic")return`Basic ${btoa(x)}`;return x};var Z1={bodySerializer:($)=>JSON.stringify($,(O,x)=>typeof x==="bigint"?x.toString():x)};var X1=({parameters:$={},...O}={})=>{return(j)=>{let S=[];if(j&&typeof j==="object")for(let K in j){let G=j[K];if(G===void 0||G===null)continue;let Z=$[K]||O;if(Array.isArray(G)){let X=Sx({allowReserved:Z.allowReserved,explode:!0,name:K,style:"form",value:G,...Z.array});if(X)S.push(X)}else if(typeof G==="object"){let X=Gx({allowReserved:Z.allowReserved,explode:!0,name:K,style:"deepObject",value:G,...Z.object});if(X)S.push(X)}else{let X=xO({allowReserved:Z.allowReserved,name:K,value:G});if(X)S.push(X)}}return S.join("&")}},K1=($)=>{if(!$)return"stream";let O=$.split(";")[0]?.trim();if(!O)return;if(O.startsWith("application/json")||O.endsWith("+json"))return"json";if(O==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some((x)=>O.startsWith(x)))return"blob";if(O.startsWith("text/"))return"text";return},a2=($,O)=>{if(!O)return!1;if($.headers.has(O)||$.query?.[O]||$.headers.get("Cookie")?.includes(`${O}=`))return!0;return!1};async function Y1($){for(let O of $.security??[]){if(a2($,O.name))continue;let x=await G1(O,$.auth);if(!x)continue;let j=O.name??"Authorization";switch(O.in){case"query":if(!$.query)$.query={};$.query[j]=x;break;case"cookie":$.headers.append("Cookie",`${j}=${x}`);break;case"header":default:$.headers.set(j,x);break}}}var bj=($)=>S1({baseUrl:$.baseUrl,path:$.path,query:$.query,querySerializer:typeof $.querySerializer==="function"?$.querySerializer:X1($.querySerializer),url:$.url}),gj=($,O)=>{let x={...$,...O};if(x.baseUrl?.endsWith("/"))x.baseUrl=x.baseUrl.substring(0,x.baseUrl.length-1);return x.headers=Xx($.headers,O.headers),x},i2=($)=>{let O=[];return $.forEach((x,j)=>{O.push([j,x])}),O},Xx=(...$)=>{let O=new Headers;for(let x of $){if(!x)continue;let j=x instanceof Headers?i2(x):Object.entries(x);for(let[S,K]of j)if(K===null)O.delete(S);else if(Array.isArray(K))for(let G of K)O.append(S,G);else if(K!==void 0)O.set(S,typeof K==="object"?JSON.stringify(K):K)}return O};class Zx{fns=[];clear(){this.fns=[]}eject($){let O=this.getInterceptorIndex($);if(this.fns[O])this.fns[O]=null}exists($){let O=this.getInterceptorIndex($);return Boolean(this.fns[O])}getInterceptorIndex($){if(typeof $==="number")return this.fns[$]?$:-1;return this.fns.indexOf($)}update($,O){let x=this.getInterceptorIndex($);if(this.fns[x])return this.fns[x]=O,$;return!1}use($){return this.fns.push($),this.fns.length-1}}var Q1=()=>({error:new Zx,request:new Zx,response:new Zx}),n2=X1({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),s2={"Content-Type":"application/json"},RO=($={})=>({...Z1,headers:s2,parseAs:"auto",querySerializer:n2,...$});var kj=($={})=>{let O=gj(RO(),$),x=()=>({...O}),j=(Y)=>{return O=gj(O,Y),x()},S=Q1(),K=async(Y)=>{let Q={...O,...Y,fetch:Y.fetch??O.fetch??globalThis.fetch,headers:Xx(O.headers,Y.headers),serializedBody:void 0};if(Q.security)await Y1(Q);if(Q.requestValidator)await Q.requestValidator(Q);if(Q.body!==void 0&&Q.bodySerializer)Q.serializedBody=Q.bodySerializer(Q.body);if(Q.body===void 0||Q.serializedBody==="")Q.headers.delete("Content-Type");let T=Q,z=bj(T);return{opts:T,url:z}},G=async(Y)=>{let Q=Y.throwOnError??O.throwOnError,T=Y.responseStyle??O.responseStyle,z,W;try{let{opts:V,url:B}=await K(Y),I={redirect:"follow",...V,body:fj(V)};z=new Request(B,I);for(let N of S.request.fns)if(N)z=await N(z,V);let P=V.fetch;W=await P(z);for(let N of S.response.fns)if(N)W=await N(W,z,V);let A={request:z,response:W};if(W.ok){let N=(V.parseAs==="auto"?K1(W.headers.get("Content-Type")):V.parseAs)??"json";if(W.status===204||W.headers.get("Content-Length")==="0"){let U;switch(N){case"arrayBuffer":case"blob":case"text":U=await W[N]();break;case"formData":U=new FormData;break;case"stream":U=W.body;break;case"json":default:U={};break}return V.responseStyle==="data"?U:{data:U,...A}}let H;switch(N){case"arrayBuffer":case"blob":case"formData":case"text":H=await W[N]();break;case"json":{let U=await W.text();H=U?JSON.parse(U):{};break}case"stream":return V.responseStyle==="data"?W.body:{data:W.body,...A}}if(N==="json"){if(V.responseValidator)await V.responseValidator(H);if(V.responseTransformer)H=await V.responseTransformer(H)}return V.responseStyle==="data"?H:{data:H,...A}}let D=await W.text(),F;try{F=JSON.parse(D)}catch{}throw F??D}catch(V){let B=V;for(let I of S.error.fns)if(I)B=await I(B,W,z,Y);if(B=B||{},Q)throw B;return T==="data"?void 0:{error:B,request:z,response:W}}},Z=(Y)=>(Q)=>G({...Q,method:Y}),X=(Y)=>async(Q)=>{let{opts:T,url:z}=await K(Q);return j1({...T,body:T.body,method:Y,onRequest:async(W,V)=>{let B=new Request(W,V);for(let I of S.request.fns)if(I)B=await I(B,T);return B},serializedBody:fj(T),url:z})};return{buildUrl:(Y)=>bj({...O,...Y}),connect:Z("CONNECT"),delete:Z("DELETE"),get:Z("GET"),getConfig:x,head:Z("HEAD"),interceptors:S,options:Z("OPTIONS"),patch:Z("PATCH"),post:Z("POST"),put:Z("PUT"),request:G,setConfig:j,sse:{connect:X("CONNECT"),delete:X("DELETE"),get:X("GET"),head:X("HEAD"),options:X("OPTIONS"),patch:X("PATCH"),post:X("POST"),put:X("PUT"),trace:X("TRACE")},trace:Z("TRACE")}};var J1=kj(RO());class V1{client;constructor($){this.client=$?.client??J1}}class W1{defaultKey="default";instances=new Map;get($){let O=this.instances.get($??this.defaultKey);if(!O)throw Error('No SDK client found. Create one with "new Sdk()" to fix this error.');return O}set($,O){this.instances.set(O??this.defaultKey,$)}}class Kx extends V1{static __registry=new W1;constructor($){super($);Kx.__registry.set(this,$?.key)}setPricingHandler($){return($.client??this.client).post({url:"/ai-cost/pricing",...$,headers:{"Content-Type":"application/json",...$.headers}})}getUsageHandler($){return($.client??this.client).post({url:"/ai-cost/usage",...$,headers:{"Content-Type":"application/json",...$.headers}})}upsertAiProjection($){return($.client??this.client).post({url:"/ai-projections",...$,headers:{"Content-Type":"application/json",...$.headers}})}getChatsForAttachmentHandler($){return($.client??this.client).get({url:"/attachments/{attachment_id}/chats",...$})}deleteChat($){return($.client??this.client).delete({url:"/chat/{chat_id}",...$})}patchChat($){return($.client??this.client).patch({url:"/chat/{chat_id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}permanentlyDeleteChat($){return($.client??this.client).delete({url:"/chat/{chat_id}/permanent",...$})}createChat($){return($.client??this.client).post({url:"/chats",...$,headers:{"Content-Type":"application/json",...$.headers}})}getChatHistoryHandler($){return($.client??this.client).get({url:"/chats/history/{chat_id}",...$})}getChatHistoryBatchMessagesHandler($){return($.client??this.client).post({url:"/chats/history_batch_messages",...$,headers:{"Content-Type":"application/json",...$.headers}})}getChat($){return($.client??this.client).get({url:"/chats/{chat_id}",...$})}copyChat($){return($.client??this.client).post({url:"/chats/{chat_id}/copy",...$})}getChatPermissions($){return($.client??this.client).get({url:"/chats/{chat_id}/permissions",...$})}revertDeleteChat($){return($.client??this.client).put({url:"/chats/{chat_id}/revert_delete",...$})}callTool($){return($.client??this.client).post({url:"/chats/{chat_id}/tool/call",...$,headers:{"Content-Type":"application/json",...$.headers}})}rejectToolCall($){return($.client??this.client).post({url:"/chats/{chat_id}/tool/reject",...$,headers:{"Content-Type":"application/json",...$.headers}})}updateToolResponse($){return($.client??this.client).post({url:"/chats/{chat_id}/tool/response/update",...$,headers:{"Content-Type":"application/json",...$.headers}})}updateToolCall($){return($.client??this.client).post({url:"/chats/{chat_id}/tool/update",...$,headers:{"Content-Type":"application/json",...$.headers}})}getCitationHandler($){return($.client??this.client).get({url:"/citations/{id}",...$})}decisions($){return($.client??this.client).post({url:"/decisions",...$,headers:{"Content-Type":"application/json",...$.headers}})}healthHandler($){return($?.client??this.client).get({url:"/health",...$})}runImportHandler($){return($.client??this.client).post({url:"/import/run",...$,headers:{"Content-Type":"application/json",...$.headers}})}discoverHandler($){return($.client??this.client).post({url:"/import/runs/{source}/discover",...$})}dismissRunHandler($){return($.client??this.client).post({url:"/import/runs/{source}/dismiss",...$})}retryGatherHandler($){return($.client??this.client).post({url:"/import/runs/{source}/retry",...$})}getStateHandler($){return($?.client??this.client).get({url:"/import/state",...$})}deleteMcpServer($){return($.client??this.client).delete({url:"/mcp/servers",...$})}listMcpServers($){return($?.client??this.client).get({url:"/mcp/servers",...$})}addMcpServer($){return($.client??this.client).post({url:"/mcp/servers",...$,headers:{"Content-Type":"application/json",...$.headers}})}updateMcpServer($){return($.client??this.client).put({url:"/mcp/servers",...$,headers:{"Content-Type":"application/json",...$.headers}})}mcpAuthCallback($){return($?.client??this.client).get({url:"/mcp/servers/auth/callback",...$})}mcpOauthClientMetadata($){return($?.client??this.client).get({url:"/mcp/servers/auth/client-metadata",...$})}startMcpAuth($){return($.client??this.client).post({url:"/mcp/servers/auth/start",...$,headers:{"Content-Type":"application/json",...$.headers}})}getMemoryHandler($){return($?.client??this.client).get({url:"/memory",...$})}getStateHandler2($){return($?.client??this.client).get({url:"/onboarding",...$})}completeHandler($){return($.client??this.client).post({url:"/onboarding/complete",...$,headers:{"Content-Type":"application/json",...$.headers}})}browsePipedreamMcpCatalog($){return($?.client??this.client).get({url:"/pipedream/mcp/catalog",...$})}completePipedreamMcpConnection($){return($.client??this.client).post({url:"/pipedream/mcp/complete",...$,headers:{"Content-Type":"application/json",...$.headers}})}deletePipedreamMcpConnection($){return($.client??this.client).delete({url:"/pipedream/mcp/connections",...$})}listPipedreamMcpConnections($){return($?.client??this.client).get({url:"/pipedream/mcp/connections",...$})}updatePipedreamMcpConnection($){return($.client??this.client).put({url:"/pipedream/mcp/connections",...$,headers:{"Content-Type":"application/json",...$.headers}})}createPipedreamMcpToken($){return($?.client??this.client).post({url:"/pipedream/mcp/token",...$})}getBatchPreview($){return($.client??this.client).post({url:"/preview",...$,headers:{"Content-Type":"application/json",...$.headers}})}sendChatMessage($){return($.client??this.client).post({url:"/stream/chat/message",...$,headers:{"Content-Type":"application/json",...$.headers}})}stopChatStream($){return($.client??this.client).post({url:"/stream/chat/message/stop",...$,headers:{"Content-Type":"application/json",...$.headers}})}structuredCompletion($){return($.client??this.client).post({url:"/structured-completion",...$,headers:{"Content-Type":"application/json",...$.headers}})}}function B1({onRequest:$,onSseError:O,onSseEvent:x,responseTransformer:j,responseValidator:S,sseDefaultRetryDelay:K,sseMaxRetryAttempts:G,sseMaxRetryDelay:Z,sseSleepFn:X,url:L,...Y}){let Q,T=X??((V)=>new Promise((B)=>setTimeout(B,V)));return{stream:async function*(){let V=K??3000,B=0,I=Y.signal??new AbortController().signal;while(!0){if(I.aborted)break;B++;let P=Y.headers instanceof Headers?Y.headers:new Headers(Y.headers);if(Q!==void 0)P.set("Last-Event-ID",Q);try{let A={redirect:"follow",...Y,body:Y.serializedBody,headers:P,signal:I},D=new Request(L,A);if($)D=await $(L,A);let N=await(Y.fetch??globalThis.fetch)(D);if(!N.ok)throw Error(`SSE failed: ${N.status} ${N.statusText}`);if(!N.body)throw Error("No body in SSE response");let H=N.body.pipeThrough(new TextDecoderStream).getReader(),U="",g=()=>{try{H.cancel()}catch{}};I.addEventListener("abort",g);try{while(!0){let{done:r,value:p}=await H.read();if(r)break;U+=p,U=U.replace(/\r\n?/g,`-`);let k=U.split(`--`);U=k.pop()??"";for(let a of k){let i=a.split(`-`),_=[],y;for(let R of i)if(R.startsWith("data:"))_.push(R.replace(/^data:\s*/,""));else if(R.startsWith("event:"))y=R.replace(/^event:\s*/,"");else if(R.startsWith("id:"))Q=R.replace(/^id:\s*/,"");else if(R.startsWith("retry:")){let v=Number.parseInt(R.replace(/^retry:\s*/,""),10);if(!Number.isNaN(v))V=v}let C,h=!1;if(_.length){let R=_.join(`-`);try{C=JSON.parse(R),h=!0}catch{C=R}}if(h){if(S)await S(C);if(j)C=await j(C)}if(x?.({data:C,event:y,id:Q,retry:V}),_.length)yield C}}}finally{I.removeEventListener("abort",g),H.releaseLock()}break}catch(A){if(O?.(A),G!==void 0&&B>=G)break;let D=Math.min(V*2**(B-1),Z??30000);await T(D)}}}()}}var e2=($)=>{switch($){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},t2=($)=>{switch($){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},o2=($)=>{switch($){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},Yx=({allowReserved:$,explode:O,name:x,style:j,value:S})=>{if(!O){let Z=($?S:S.map((X)=>encodeURIComponent(X))).join(t2(j));switch(j){case"label":return`.${Z}`;case"matrix":return`;${x}=${Z}`;case"simple":return Z;default:return`${x}=${Z}`}}let K=e2(j),G=S.map((Z)=>{if(j==="label"||j==="simple")return $?Z:encodeURIComponent(Z);return jO({allowReserved:$,name:x,value:Z})}).join(K);return j==="label"||j==="matrix"?K+G:G},jO=({allowReserved:$,name:O,value:x})=>{if(x===void 0||x===null)return"";if(typeof x==="object")throw Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${O}=${$?x:encodeURIComponent(x)}`},Qx=({allowReserved:$,explode:O,name:x,style:j,value:S,valueOnly:K})=>{if(S instanceof Date)return K?S.toISOString():`${x}=${S.toISOString()}`;if(j!=="deepObject"&&!O){let X=[];Object.entries(S).forEach(([Y,Q])=>{X=[...X,Y,$?Q:encodeURIComponent(Q)]});let L=X.join(",");switch(j){case"form":return`${x}=${L}`;case"label":return`.${L}`;case"matrix":return`;${x}=${L}`;default:return L}}let G=o2(j),Z=Object.entries(S).map(([X,L])=>jO({allowReserved:$,name:j==="deepObject"?`${x}[${X}]`:X,value:L})).join(G);return j==="label"||j==="matrix"?G+Z:Z};var $6=/\{[^{}]+\}/g,O6=({path:$,url:O})=>{let x=O,j=O.match($6);if(j)for(let S of j){let K=!1,G=S.substring(1,S.length-1),Z="simple";if(G.endsWith("*"))K=!0,G=G.substring(0,G.length-1);if(G.startsWith("."))G=G.substring(1),Z="label";else if(G.startsWith(";"))G=G.substring(1),Z="matrix";let X=$[G];if(X===void 0||X===null)continue;if(Array.isArray(X)){x=x.replace(S,Yx({explode:K,name:G,style:Z,value:X}));continue}if(typeof X==="object"){x=x.replace(S,Qx({explode:K,name:G,style:Z,value:X,valueOnly:!0}));continue}if(Z==="matrix"){x=x.replace(S,`;${jO({name:G,value:X})}`);continue}let L=encodeURIComponent(Z==="label"?`.${X}`:X);x=x.replace(S,L)}return x},L1=({baseUrl:$,path:O,query:x,querySerializer:j,url:S})=>{let K=S.startsWith("/")?S:`/${S}`,G=($??"")+K;if(O)G=O6({path:O,url:G});let Z=x?j(x):"";if(Z.startsWith("?"))Z=Z.substring(1);if(Z)G+=`?${Z}`;return G};function yj($){let O=$.body!==void 0;if(O&&$.bodySerializer){if("serializedBody"in $)return $.serializedBody!==void 0&&$.serializedBody!==""?$.serializedBody:null;return $.body!==""?$.body:null}if(O)return $.body;return}var N1=async($,O)=>{let x=typeof O==="function"?await O($):O;if(!x)return;if($.scheme==="bearer")return`Bearer ${x}`;if($.scheme==="basic")return`Basic ${btoa(x)}`;return x};var U1={bodySerializer:($)=>JSON.stringify($,(O,x)=>typeof x==="bigint"?x.toString():x)};var z1=({parameters:$={},...O}={})=>{return(j)=>{let S=[];if(j&&typeof j==="object")for(let K in j){let G=j[K];if(G===void 0||G===null)continue;let Z=$[K]||O;if(Array.isArray(G)){let X=Yx({allowReserved:Z.allowReserved,explode:!0,name:K,style:"form",value:G,...Z.array});if(X)S.push(X)}else if(typeof G==="object"){let X=Qx({allowReserved:Z.allowReserved,explode:!0,name:K,style:"deepObject",value:G,...Z.object});if(X)S.push(X)}else{let X=jO({allowReserved:Z.allowReserved,name:K,value:G});if(X)S.push(X)}}return S.join("&")}},I1=($)=>{if(!$)return"stream";let O=$.split(";")[0]?.trim();if(!O)return;if(O.startsWith("application/json")||O.endsWith("+json"))return"json";if(O==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some((x)=>O.startsWith(x)))return"blob";if(O.startsWith("text/"))return"text";return},x6=($,O)=>{if(!O)return!1;if($.headers.has(O)||$.query?.[O]||$.headers.get("Cookie")?.includes(`${O}=`))return!0;return!1};async function T1($){for(let O of $.security??[]){if(x6($,O.name))continue;let x=await N1(O,$.auth);if(!x)continue;let j=O.name??"Authorization";switch(O.in){case"query":if(!$.query)$.query={};$.query[j]=x;break;case"cookie":$.headers.append("Cookie",`${j}=${x}`);break;case"header":default:$.headers.set(j,x);break}}}var hj=($)=>L1({baseUrl:$.baseUrl,path:$.path,query:$.query,querySerializer:typeof $.querySerializer==="function"?$.querySerializer:z1($.querySerializer),url:$.url}),vj=($,O)=>{let x={...$,...O};if(x.baseUrl?.endsWith("/"))x.baseUrl=x.baseUrl.substring(0,x.baseUrl.length-1);return x.headers=Vx($.headers,O.headers),x},j6=($)=>{let O=[];return $.forEach((x,j)=>{O.push([j,x])}),O},Vx=(...$)=>{let O=new Headers;for(let x of $){if(!x)continue;let j=x instanceof Headers?j6(x):Object.entries(x);for(let[S,K]of j)if(K===null)O.delete(S);else if(Array.isArray(K))for(let G of K)O.append(S,G);else if(K!==void 0)O.set(S,typeof K==="object"?JSON.stringify(K):K)}return O};class Jx{fns=[];clear(){this.fns=[]}eject($){let O=this.getInterceptorIndex($);if(this.fns[O])this.fns[O]=null}exists($){let O=this.getInterceptorIndex($);return Boolean(this.fns[O])}getInterceptorIndex($){if(typeof $==="number")return this.fns[$]?$:-1;return this.fns.indexOf($)}update($,O){let x=this.getInterceptorIndex($);if(this.fns[x])return this.fns[x]=O,$;return!1}use($){return this.fns.push($),this.fns.length-1}}var H1=()=>({error:new Jx,request:new Jx,response:new Jx}),S6=z1({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),G6={"Content-Type":"application/json"},AO=($={})=>({...U1,headers:G6,parseAs:"auto",querySerializer:S6,...$});var mj=($={})=>{let O=vj(AO(),$),x=()=>({...O}),j=(Y)=>{return O=vj(O,Y),x()},S=H1(),K=async(Y)=>{let Q={...O,...Y,fetch:Y.fetch??O.fetch??globalThis.fetch,headers:Vx(O.headers,Y.headers),serializedBody:void 0};if(Q.security)await T1(Q);if(Q.requestValidator)await Q.requestValidator(Q);if(Q.body!==void 0&&Q.bodySerializer)Q.serializedBody=Q.bodySerializer(Q.body);if(Q.body===void 0||Q.serializedBody==="")Q.headers.delete("Content-Type");let T=Q,z=hj(T);return{opts:T,url:z}},G=async(Y)=>{let Q=Y.throwOnError??O.throwOnError,T=Y.responseStyle??O.responseStyle,z,W;try{let{opts:V,url:B}=await K(Y),I={redirect:"follow",...V,body:yj(V)};z=new Request(B,I);for(let N of S.request.fns)if(N)z=await N(z,V);let P=V.fetch;W=await P(z);for(let N of S.response.fns)if(N)W=await N(W,z,V);let A={request:z,response:W};if(W.ok){let N=(V.parseAs==="auto"?I1(W.headers.get("Content-Type")):V.parseAs)??"json";if(W.status===204||W.headers.get("Content-Length")==="0"){let U;switch(N){case"arrayBuffer":case"blob":case"text":U=await W[N]();break;case"formData":U=new FormData;break;case"stream":U=W.body;break;case"json":default:U={};break}return V.responseStyle==="data"?U:{data:U,...A}}let H;switch(N){case"arrayBuffer":case"blob":case"formData":case"text":H=await W[N]();break;case"json":{let U=await W.text();H=U?JSON.parse(U):{};break}case"stream":return V.responseStyle==="data"?W.body:{data:W.body,...A}}if(N==="json"){if(V.responseValidator)await V.responseValidator(H);if(V.responseTransformer)H=await V.responseTransformer(H)}return V.responseStyle==="data"?H:{data:H,...A}}let D=await W.text(),F;try{F=JSON.parse(D)}catch{}throw F??D}catch(V){let B=V;for(let I of S.error.fns)if(I)B=await I(B,W,z,Y);if(B=B||{},Q)throw B;return T==="data"?void 0:{error:B,request:z,response:W}}},Z=(Y)=>(Q)=>G({...Q,method:Y}),X=(Y)=>async(Q)=>{let{opts:T,url:z}=await K(Q);return B1({...T,body:T.body,method:Y,onRequest:async(W,V)=>{let B=new Request(W,V);for(let I of S.request.fns)if(I)B=await I(B,T);return B},serializedBody:yj(T),url:z})};return{buildUrl:(Y)=>hj({...O,...Y}),connect:Z("CONNECT"),delete:Z("DELETE"),get:Z("GET"),getConfig:x,head:Z("HEAD"),interceptors:S,options:Z("OPTIONS"),patch:Z("PATCH"),post:Z("POST"),put:Z("PUT"),request:G,setConfig:j,sse:{connect:X("CONNECT"),delete:X("DELETE"),get:X("GET"),head:X("HEAD"),options:X("OPTIONS"),patch:X("PATCH"),post:X("POST"),put:X("PUT"),trace:X("TRACE")},trace:Z("TRACE")}};var R1=mj(AO());class A1{client;constructor($){this.client=$?.client??R1}}class D1{defaultKey="default";instances=new Map;get($){let O=this.instances.get($??this.defaultKey);if(!O)throw Error('No SDK client found. Create one with "new Sdk()" to fix this error.');return O}set($,O){this.instances.set(O??this.defaultKey,$)}}class Wx extends A1{static __registry=new D1;constructor($){super($);Wx.__registry.set(this,$?.key)}getContacts($){return($?.client??this.client).get({url:"/contacts",...$})}addContact($){return($.client??this.client).post({url:"/contacts",...$,headers:{"Content-Type":"application/json",...$.headers}})}}function C1({onRequest:$,onSseError:O,onSseEvent:x,responseTransformer:j,responseValidator:S,sseDefaultRetryDelay:K,sseMaxRetryAttempts:G,sseMaxRetryDelay:Z,sseSleepFn:X,url:L,...Y}){let Q,T=X??((V)=>new Promise((B)=>setTimeout(B,V)));return{stream:async function*(){let V=K??3000,B=0,I=Y.signal??new AbortController().signal;while(!0){if(I.aborted)break;B++;let P=Y.headers instanceof Headers?Y.headers:new Headers(Y.headers);if(Q!==void 0)P.set("Last-Event-ID",Q);try{let A={redirect:"follow",...Y,body:Y.serializedBody,headers:P,signal:I},D=new Request(L,A);if($)D=await $(L,A);let N=await(Y.fetch??globalThis.fetch)(D);if(!N.ok)throw Error(`SSE failed: ${N.status} ${N.statusText}`);if(!N.body)throw Error("No body in SSE response");let H=N.body.pipeThrough(new TextDecoderStream).getReader(),U="",g=()=>{try{H.cancel()}catch{}};I.addEventListener("abort",g);try{while(!0){let{done:r,value:p}=await H.read();if(r)break;U+=p,U=U.replace(/\r\n?/g,`-`);let k=U.split(`--`);U=k.pop()??"";for(let a of k){let i=a.split(`-`),_=[],y;for(let R of i)if(R.startsWith("data:"))_.push(R.replace(/^data:\s*/,""));else if(R.startsWith("event:"))y=R.replace(/^event:\s*/,"");else if(R.startsWith("id:"))Q=R.replace(/^id:\s*/,"");else if(R.startsWith("retry:")){let v=Number.parseInt(R.replace(/^retry:\s*/,""),10);if(!Number.isNaN(v))V=v}let C,h=!1;if(_.length){let R=_.join(`-`);try{C=JSON.parse(R),h=!0}catch{C=R}}if(h){if(S)await S(C);if(j)C=await j(C)}if(x?.({data:C,event:y,id:Q,retry:V}),_.length)yield C}}}finally{I.removeEventListener("abort",g),H.releaseLock()}break}catch(A){if(O?.(A),G!==void 0&&B>=G)break;let D=Math.min(V*2**(B-1),Z??30000);await T(D)}}}()}}var Z6=($)=>{switch($){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},X6=($)=>{switch($){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},K6=($)=>{switch($){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},Bx=({allowReserved:$,explode:O,name:x,style:j,value:S})=>{if(!O){let Z=($?S:S.map((X)=>encodeURIComponent(X))).join(X6(j));switch(j){case"label":return`.${Z}`;case"matrix":return`;${x}=${Z}`;case"simple":return Z;default:return`${x}=${Z}`}}let K=Z6(j),G=S.map((Z)=>{if(j==="label"||j==="simple")return $?Z:encodeURIComponent(Z);return SO({allowReserved:$,name:x,value:Z})}).join(K);return j==="label"||j==="matrix"?K+G:G},SO=({allowReserved:$,name:O,value:x})=>{if(x===void 0||x===null)return"";if(typeof x==="object")throw Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${O}=${$?x:encodeURIComponent(x)}`},Lx=({allowReserved:$,explode:O,name:x,style:j,value:S,valueOnly:K})=>{if(S instanceof Date)return K?S.toISOString():`${x}=${S.toISOString()}`;if(j!=="deepObject"&&!O){let X=[];Object.entries(S).forEach(([Y,Q])=>{X=[...X,Y,$?Q:encodeURIComponent(Q)]});let L=X.join(",");switch(j){case"form":return`${x}=${L}`;case"label":return`.${L}`;case"matrix":return`;${x}=${L}`;default:return L}}let G=K6(j),Z=Object.entries(S).map(([X,L])=>SO({allowReserved:$,name:j==="deepObject"?`${x}[${X}]`:X,value:L})).join(G);return j==="label"||j==="matrix"?G+Z:Z};var Y6=/\{[^{}]+\}/g,Q6=({path:$,url:O})=>{let x=O,j=O.match(Y6);if(j)for(let S of j){let K=!1,G=S.substring(1,S.length-1),Z="simple";if(G.endsWith("*"))K=!0,G=G.substring(0,G.length-1);if(G.startsWith("."))G=G.substring(1),Z="label";else if(G.startsWith(";"))G=G.substring(1),Z="matrix";let X=$[G];if(X===void 0||X===null)continue;if(Array.isArray(X)){x=x.replace(S,Bx({explode:K,name:G,style:Z,value:X}));continue}if(typeof X==="object"){x=x.replace(S,Lx({explode:K,name:G,style:Z,value:X,valueOnly:!0}));continue}if(Z==="matrix"){x=x.replace(S,`;${SO({name:G,value:X})}`);continue}let L=encodeURIComponent(Z==="label"?`.${X}`:X);x=x.replace(S,L)}return x},M1=({baseUrl:$,path:O,query:x,querySerializer:j,url:S})=>{let K=S.startsWith("/")?S:`/${S}`,G=($??"")+K;if(O)G=Q6({path:O,url:G});let Z=x?j(x):"";if(Z.startsWith("?"))Z=Z.substring(1);if(Z)G+=`?${Z}`;return G};function cj($){let O=$.body!==void 0;if(O&&$.bodySerializer){if("serializedBody"in $)return $.serializedBody!==void 0&&$.serializedBody!==""?$.serializedBody:null;return $.body!==""?$.body:null}if(O)return $.body;return}var P1=async($,O)=>{let x=typeof O==="function"?await O($):O;if(!x)return;if($.scheme==="bearer")return`Bearer ${x}`;if($.scheme==="basic")return`Basic ${btoa(x)}`;return x};var _1={bodySerializer:($)=>JSON.stringify($,(O,x)=>typeof x==="bigint"?x.toString():x)};var F1=({parameters:$={},...O}={})=>{return(j)=>{let S=[];if(j&&typeof j==="object")for(let K in j){let G=j[K];if(G===void 0||G===null)continue;let Z=$[K]||O;if(Array.isArray(G)){let X=Bx({allowReserved:Z.allowReserved,explode:!0,name:K,style:"form",value:G,...Z.array});if(X)S.push(X)}else if(typeof G==="object"){let X=Lx({allowReserved:Z.allowReserved,explode:!0,name:K,style:"deepObject",value:G,...Z.object});if(X)S.push(X)}else{let X=SO({allowReserved:Z.allowReserved,name:K,value:G});if(X)S.push(X)}}return S.join("&")}},E1=($)=>{if(!$)return"stream";let O=$.split(";")[0]?.trim();if(!O)return;if(O.startsWith("application/json")||O.endsWith("+json"))return"json";if(O==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some((x)=>O.startsWith(x)))return"blob";if(O.startsWith("text/"))return"text";return},J6=($,O)=>{if(!O)return!1;if($.headers.has(O)||$.query?.[O]||$.headers.get("Cookie")?.includes(`${O}=`))return!0;return!1};async function w1($){for(let O of $.security??[]){if(J6($,O.name))continue;let x=await P1(O,$.auth);if(!x)continue;let j=O.name??"Authorization";switch(O.in){case"query":if(!$.query)$.query={};$.query[j]=x;break;case"cookie":$.headers.append("Cookie",`${j}=${x}`);break;case"header":default:$.headers.set(j,x);break}}}var dj=($)=>M1({baseUrl:$.baseUrl,path:$.path,query:$.query,querySerializer:typeof $.querySerializer==="function"?$.querySerializer:F1($.querySerializer),url:$.url}),uj=($,O)=>{let x={...$,...O};if(x.baseUrl?.endsWith("/"))x.baseUrl=x.baseUrl.substring(0,x.baseUrl.length-1);return x.headers=Ux($.headers,O.headers),x},V6=($)=>{let O=[];return $.forEach((x,j)=>{O.push([j,x])}),O},Ux=(...$)=>{let O=new Headers;for(let x of $){if(!x)continue;let j=x instanceof Headers?V6(x):Object.entries(x);for(let[S,K]of j)if(K===null)O.delete(S);else if(Array.isArray(K))for(let G of K)O.append(S,G);else if(K!==void 0)O.set(S,typeof K==="object"?JSON.stringify(K):K)}return O};class Nx{fns=[];clear(){this.fns=[]}eject($){let O=this.getInterceptorIndex($);if(this.fns[O])this.fns[O]=null}exists($){let O=this.getInterceptorIndex($);return Boolean(this.fns[O])}getInterceptorIndex($){if(typeof $==="number")return this.fns[$]?$:-1;return this.fns.indexOf($)}update($,O){let x=this.getInterceptorIndex($);if(this.fns[x])return this.fns[x]=O,$;return!1}use($){return this.fns.push($),this.fns.length-1}}var q1=()=>({error:new Nx,request:new Nx,response:new Nx}),W6=F1({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),B6={"Content-Type":"application/json"},DO=($={})=>({..._1,headers:B6,parseAs:"auto",querySerializer:W6,...$});var lj=($={})=>{let O=uj(DO(),$),x=()=>({...O}),j=(Y)=>{return O=uj(O,Y),x()},S=q1(),K=async(Y)=>{let Q={...O,...Y,fetch:Y.fetch??O.fetch??globalThis.fetch,headers:Ux(O.headers,Y.headers),serializedBody:void 0};if(Q.security)await w1(Q);if(Q.requestValidator)await Q.requestValidator(Q);if(Q.body!==void 0&&Q.bodySerializer)Q.serializedBody=Q.bodySerializer(Q.body);if(Q.body===void 0||Q.serializedBody==="")Q.headers.delete("Content-Type");let T=Q,z=dj(T);return{opts:T,url:z}},G=async(Y)=>{let Q=Y.throwOnError??O.throwOnError,T=Y.responseStyle??O.responseStyle,z,W;try{let{opts:V,url:B}=await K(Y),I={redirect:"follow",...V,body:cj(V)};z=new Request(B,I);for(let N of S.request.fns)if(N)z=await N(z,V);let P=V.fetch;W=await P(z);for(let N of S.response.fns)if(N)W=await N(W,z,V);let A={request:z,response:W};if(W.ok){let N=(V.parseAs==="auto"?E1(W.headers.get("Content-Type")):V.parseAs)??"json";if(W.status===204||W.headers.get("Content-Length")==="0"){let U;switch(N){case"arrayBuffer":case"blob":case"text":U=await W[N]();break;case"formData":U=new FormData;break;case"stream":U=W.body;break;case"json":default:U={};break}return V.responseStyle==="data"?U:{data:U,...A}}let H;switch(N){case"arrayBuffer":case"blob":case"formData":case"text":H=await W[N]();break;case"json":{let U=await W.text();H=U?JSON.parse(U):{};break}case"stream":return V.responseStyle==="data"?W.body:{data:W.body,...A}}if(N==="json"){if(V.responseValidator)await V.responseValidator(H);if(V.responseTransformer)H=await V.responseTransformer(H)}return V.responseStyle==="data"?H:{data:H,...A}}let D=await W.text(),F;try{F=JSON.parse(D)}catch{}throw F??D}catch(V){let B=V;for(let I of S.error.fns)if(I)B=await I(B,W,z,Y);if(B=B||{},Q)throw B;return T==="data"?void 0:{error:B,request:z,response:W}}},Z=(Y)=>(Q)=>G({...Q,method:Y}),X=(Y)=>async(Q)=>{let{opts:T,url:z}=await K(Q);return C1({...T,body:T.body,method:Y,onRequest:async(W,V)=>{let B=new Request(W,V);for(let I of S.request.fns)if(I)B=await I(B,T);return B},serializedBody:cj(T),url:z})};return{buildUrl:(Y)=>dj({...O,...Y}),connect:Z("CONNECT"),delete:Z("DELETE"),get:Z("GET"),getConfig:x,head:Z("HEAD"),interceptors:S,options:Z("OPTIONS"),patch:Z("PATCH"),post:Z("POST"),put:Z("PUT"),request:G,setConfig:j,sse:{connect:X("CONNECT"),delete:X("DELETE"),get:X("GET"),head:X("HEAD"),options:X("OPTIONS"),patch:X("PATCH"),post:X("POST"),put:X("PUT"),trace:X("TRACE")},trace:Z("TRACE")}};var f1=lj(DO());class b1{client;constructor($){this.client=$?.client??f1}}class g1{defaultKey="default";instances=new Map;get($){let O=this.instances.get($??this.defaultKey);if(!O)throw Error('No SDK client found. Create one with "new Sdk()" to fix this error.');return O}set($,O){this.instances.set(O??this.defaultKey,$)}}class zx extends b1{static __registry=new g1;constructor($){super($);zx.__registry.set(this,$?.key)}getAttachment($){return($.client??this.client).get({url:"/email/attachments/{id}",...$})}getAttachmentDocumentId($){return($.client??this.client).get({url:"/email/attachments/{id}/document_id",...$})}cancelBackfillGmail($){return($.client??this.client).delete({url:"/email/backfill/gmail",...$,headers:{"Content-Type":"application/json",...$.headers}})}listBackfillGmail($){return($?.client??this.client).get({url:"/email/backfill/gmail",...$})}getBackfillGmailActive($){return($?.client??this.client).get({url:"/email/backfill/gmail/active",...$})}getBackfillGmail($){return($.client??this.client).get({url:"/email/backfill/gmail/{id}",...$})}listContacts($){return($?.client??this.client).get({url:"/email/contacts",...$})}blockSender($){return($.client??this.client).post({url:"/email/contacts/block",...$,headers:{"Content-Type":"application/json",...$.headers}})}listBlockedSenders($){return($?.client??this.client).get({url:"/email/contacts/blocked",...$})}unblockSender($){return($.client??this.client).post({url:"/email/contacts/unblock",...$,headers:{"Content-Type":"application/json",...$.headers}})}recoverDraftTransfer($){return($.client??this.client).post({url:"/email/draft-transfers/{id}/recover",...$})}createDraft($){return($.client??this.client).post({url:"/email/drafts",...$,headers:{"Content-Type":"application/json",...$.headers}})}getScheduledMessages($){return($?.client??this.client).get({url:"/email/drafts/scheduled",...$})}upsertScheduledMessage($){return($.client??this.client).put({url:"/email/drafts/scheduled/{id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}deleteScheduledDraft($){return($.client??this.client).delete({url:"/email/drafts/scheduled/{message_id}",...$})}deleteDraft($){return($.client??this.client).delete({url:"/email/drafts/{id}",...$})}addDraftAttachment($){return($.client??this.client).post({url:"/email/drafts/{id}/attachments",...$,headers:{"Content-Type":"application/json",...$.headers}})}removeDraftAttachment($){return($.client??this.client).delete({url:"/email/drafts/{id}/attachments/{attachment_id}",...$})}completeDraftAttachment($){return($.client??this.client).post({url:"/email/drafts/{id}/attachments/{attachment_id}/complete",...$})}addForwardedAttachment($){return($.client??this.client).post({url:"/email/drafts/{id}/forwarded-attachments",...$,headers:{"Content-Type":"application/json",...$.headers}})}removeForwardedAttachment($){return($.client??this.client).delete({url:"/email/drafts/{id}/forwarded-attachments/{attachment_id}",...$})}messageOperationStatus($){return($.client??this.client).get({url:"/email/drafts/{id}/operation",...$})}resolveMessageOperation($){return($.client??this.client).post({url:"/email/drafts/{id}/resolve",...$,headers:{"Content-Type":"application/json",...$.headers}})}transferDraft($){return($.client??this.client).post({url:"/email/drafts/{id}/transfer",...$,headers:{"Content-Type":"application/json",...$.headers}})}listEmailFilters($){return($?.client??this.client).get({url:"/email/filters",...$})}upsertEmailFilter($){return($.client??this.client).put({url:"/email/filters",...$,headers:{"Content-Type":"application/json",...$.headers}})}deleteEmailFilter($){return($.client??this.client).delete({url:"/email/filters/{id}",...$})}initUser($){return($?.client??this.client).post({url:"/email/init",...$})}listLabels($){return($?.client??this.client).get({url:"/email/labels",...$})}createLabel($){return($.client??this.client).post({url:"/email/labels",...$,headers:{"Content-Type":"application/json",...$.headers}})}deleteLabel($){return($.client??this.client).delete({url:"/email/labels/{id}",...$})}listLinks($){return($?.client??this.client).get({url:"/email/links",...$})}healthCheckLinks($){return($?.client??this.client).post({url:"/email/links/health-check",...$})}deleteLink($){return($.client??this.client).delete({url:"/email/links/{link_id}",...$})}disableLinkCalendar($){return($.client??this.client).delete({url:"/email/links/{link_id}/calendar",...$})}resyncLink($){return($.client??this.client).post({url:"/email/links/{link_id}/resync",...$})}sendMessage($){return($.client??this.client).post({url:"/email/messages",...$,headers:{"Content-Type":"application/json",...$.headers}})}getMessagesBatch($){return($.client??this.client).post({url:"/email/messages/batch",...$,headers:{"Content-Type":"application/json",...$.headers}})}addRemoveLabel($){return($.client??this.client).patch({url:"/email/messages/labels",...$,headers:{"Content-Type":"application/json",...$.headers}})}getMessage($){return($.client??this.client).get({url:"/email/messages/{id}",...$})}patchSettings($){return($.client??this.client).patch({url:"/email/settings",...$,headers:{"Content-Type":"application/json",...$.headers}})}mailboxSettingsOperations($){return($?.client??this.client).get({url:"/email/settings/operations",...$})}disableSync($){return($?.client??this.client).delete({url:"/email/sync",...$})}previewsInboxCursor($){return($.client??this.client).get({url:"/email/threads/previews/cursor/{view}",...$})}archiveThread($){return($.client??this.client).patch({url:"/email/threads/{id}/archived",...$,headers:{"Content-Type":"application/json",...$.headers}})}addRemoveThreadLabel($){return($.client??this.client).patch({url:"/email/threads/{id}/labels",...$,headers:{"Content-Type":"application/json",...$.headers}})}getThreadMessagesHandler($){return($.client??this.client).get({url:"/email/threads/{id}/messages",...$})}threadOperations($){return($.client??this.client).get({url:"/email/threads/{id}/operations",...$})}threadSeen($){return($.client??this.client).post({url:"/email/threads/{id}/seen",...$})}updateThreadState($){return($.client??this.client).patch({url:"/email/threads/{id}/state",...$,headers:{"Content-Type":"application/json",...$.headers}})}getThread($){return($.client??this.client).get({url:"/email/threads/{thread_id}",...$})}getThreadCalendarInvitations($){return($.client??this.client).get({url:"/email/threads/{thread_id}/calendar-invitations",...$})}updateThreadProject($){return($.client??this.client).patch({url:"/email/threads/{thread_id}/project",...$,headers:{"Content-Type":"application/json",...$.headers}})}healthHandler($){return($?.client??this.client).get({url:"/health",...$})}}function k1({onRequest:$,onSseError:O,onSseEvent:x,responseTransformer:j,responseValidator:S,sseDefaultRetryDelay:K,sseMaxRetryAttempts:G,sseMaxRetryDelay:Z,sseSleepFn:X,url:L,...Y}){let Q,T=X??((V)=>new Promise((B)=>setTimeout(B,V)));return{stream:async function*(){let V=K??3000,B=0,I=Y.signal??new AbortController().signal;while(!0){if(I.aborted)break;B++;let P=Y.headers instanceof Headers?Y.headers:new Headers(Y.headers);if(Q!==void 0)P.set("Last-Event-ID",Q);try{let A={redirect:"follow",...Y,body:Y.serializedBody,headers:P,signal:I},D=new Request(L,A);if($)D=await $(L,A);let N=await(Y.fetch??globalThis.fetch)(D);if(!N.ok)throw Error(`SSE failed: ${N.status} ${N.statusText}`);if(!N.body)throw Error("No body in SSE response");let H=N.body.pipeThrough(new TextDecoderStream).getReader(),U="",g=()=>{try{H.cancel()}catch{}};I.addEventListener("abort",g);try{while(!0){let{done:r,value:p}=await H.read();if(r)break;U+=p,U=U.replace(/\r\n?/g,`-`);let k=U.split(`--`);U=k.pop()??"";for(let a of k){let i=a.split(`-`),_=[],y;for(let R of i)if(R.startsWith("data:"))_.push(R.replace(/^data:\s*/,""));else if(R.startsWith("event:"))y=R.replace(/^event:\s*/,"");else if(R.startsWith("id:"))Q=R.replace(/^id:\s*/,"");else if(R.startsWith("retry:")){let v=Number.parseInt(R.replace(/^retry:\s*/,""),10);if(!Number.isNaN(v))V=v}let C,h=!1;if(_.length){let R=_.join(`-`);try{C=JSON.parse(R),h=!0}catch{C=R}}if(h){if(S)await S(C);if(j)C=await j(C)}if(x?.({data:C,event:y,id:Q,retry:V}),_.length)yield C}}}finally{I.removeEventListener("abort",g),H.releaseLock()}break}catch(A){if(O?.(A),G!==void 0&&B>=G)break;let D=Math.min(V*2**(B-1),Z??30000);await T(D)}}}()}}var L6=($)=>{switch($){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},N6=($)=>{switch($){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},U6=($)=>{switch($){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},Ix=({allowReserved:$,explode:O,name:x,style:j,value:S})=>{if(!O){let Z=($?S:S.map((X)=>encodeURIComponent(X))).join(N6(j));switch(j){case"label":return`.${Z}`;case"matrix":return`;${x}=${Z}`;case"simple":return Z;default:return`${x}=${Z}`}}let K=L6(j),G=S.map((Z)=>{if(j==="label"||j==="simple")return $?Z:encodeURIComponent(Z);return GO({allowReserved:$,name:x,value:Z})}).join(K);return j==="label"||j==="matrix"?K+G:G},GO=({allowReserved:$,name:O,value:x})=>{if(x===void 0||x===null)return"";if(typeof x==="object")throw Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${O}=${$?x:encodeURIComponent(x)}`},Tx=({allowReserved:$,explode:O,name:x,style:j,value:S,valueOnly:K})=>{if(S instanceof Date)return K?S.toISOString():`${x}=${S.toISOString()}`;if(j!=="deepObject"&&!O){let X=[];Object.entries(S).forEach(([Y,Q])=>{X=[...X,Y,$?Q:encodeURIComponent(Q)]});let L=X.join(",");switch(j){case"form":return`${x}=${L}`;case"label":return`.${L}`;case"matrix":return`;${x}=${L}`;default:return L}}let G=U6(j),Z=Object.entries(S).map(([X,L])=>GO({allowReserved:$,name:j==="deepObject"?`${x}[${X}]`:X,value:L})).join(G);return j==="label"||j==="matrix"?G+Z:Z};var z6=/\{[^{}]+\}/g,I6=({path:$,url:O})=>{let x=O,j=O.match(z6);if(j)for(let S of j){let K=!1,G=S.substring(1,S.length-1),Z="simple";if(G.endsWith("*"))K=!0,G=G.substring(0,G.length-1);if(G.startsWith("."))G=G.substring(1),Z="label";else if(G.startsWith(";"))G=G.substring(1),Z="matrix";let X=$[G];if(X===void 0||X===null)continue;if(Array.isArray(X)){x=x.replace(S,Ix({explode:K,name:G,style:Z,value:X}));continue}if(typeof X==="object"){x=x.replace(S,Tx({explode:K,name:G,style:Z,value:X,valueOnly:!0}));continue}if(Z==="matrix"){x=x.replace(S,`;${GO({name:G,value:X})}`);continue}let L=encodeURIComponent(Z==="label"?`.${X}`:X);x=x.replace(S,L)}return x},y1=({baseUrl:$,path:O,query:x,querySerializer:j,url:S})=>{let K=S.startsWith("/")?S:`/${S}`,G=($??"")+K;if(O)G=I6({path:O,url:G});let Z=x?j(x):"";if(Z.startsWith("?"))Z=Z.substring(1);if(Z)G+=`?${Z}`;return G};function rj($){let O=$.body!==void 0;if(O&&$.bodySerializer){if("serializedBody"in $)return $.serializedBody!==void 0&&$.serializedBody!==""?$.serializedBody:null;return $.body!==""?$.body:null}if(O)return $.body;return}var h1=async($,O)=>{let x=typeof O==="function"?await O($):O;if(!x)return;if($.scheme==="bearer")return`Bearer ${x}`;if($.scheme==="basic")return`Basic ${btoa(x)}`;return x};var v1={bodySerializer:($)=>JSON.stringify($,(O,x)=>typeof x==="bigint"?x.toString():x)};var m1=({parameters:$={},...O}={})=>{return(j)=>{let S=[];if(j&&typeof j==="object")for(let K in j){let G=j[K];if(G===void 0||G===null)continue;let Z=$[K]||O;if(Array.isArray(G)){let X=Ix({allowReserved:Z.allowReserved,explode:!0,name:K,style:"form",value:G,...Z.array});if(X)S.push(X)}else if(typeof G==="object"){let X=Tx({allowReserved:Z.allowReserved,explode:!0,name:K,style:"deepObject",value:G,...Z.object});if(X)S.push(X)}else{let X=GO({allowReserved:Z.allowReserved,name:K,value:G});if(X)S.push(X)}}return S.join("&")}},c1=($)=>{if(!$)return"stream";let O=$.split(";")[0]?.trim();if(!O)return;if(O.startsWith("application/json")||O.endsWith("+json"))return"json";if(O==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some((x)=>O.startsWith(x)))return"blob";if(O.startsWith("text/"))return"text";return},T6=($,O)=>{if(!O)return!1;if($.headers.has(O)||$.query?.[O]||$.headers.get("Cookie")?.includes(`${O}=`))return!0;return!1};async function d1($){for(let O of $.security??[]){if(T6($,O.name))continue;let x=await h1(O,$.auth);if(!x)continue;let j=O.name??"Authorization";switch(O.in){case"query":if(!$.query)$.query={};$.query[j]=x;break;case"cookie":$.headers.append("Cookie",`${j}=${x}`);break;case"header":default:$.headers.set(j,x);break}}}var pj=($)=>y1({baseUrl:$.baseUrl,path:$.path,query:$.query,querySerializer:typeof $.querySerializer==="function"?$.querySerializer:m1($.querySerializer),url:$.url}),aj=($,O)=>{let x={...$,...O};if(x.baseUrl?.endsWith("/"))x.baseUrl=x.baseUrl.substring(0,x.baseUrl.length-1);return x.headers=Rx($.headers,O.headers),x},H6=($)=>{let O=[];return $.forEach((x,j)=>{O.push([j,x])}),O},Rx=(...$)=>{let O=new Headers;for(let x of $){if(!x)continue;let j=x instanceof Headers?H6(x):Object.entries(x);for(let[S,K]of j)if(K===null)O.delete(S);else if(Array.isArray(K))for(let G of K)O.append(S,G);else if(K!==void 0)O.set(S,typeof K==="object"?JSON.stringify(K):K)}return O};class Hx{fns=[];clear(){this.fns=[]}eject($){let O=this.getInterceptorIndex($);if(this.fns[O])this.fns[O]=null}exists($){let O=this.getInterceptorIndex($);return Boolean(this.fns[O])}getInterceptorIndex($){if(typeof $==="number")return this.fns[$]?$:-1;return this.fns.indexOf($)}update($,O){let x=this.getInterceptorIndex($);if(this.fns[x])return this.fns[x]=O,$;return!1}use($){return this.fns.push($),this.fns.length-1}}var u1=()=>({error:new Hx,request:new Hx,response:new Hx}),R6=m1({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),A6={"Content-Type":"application/json"},CO=($={})=>({...v1,headers:A6,parseAs:"auto",querySerializer:R6,...$});var ij=($={})=>{let O=aj(CO(),$),x=()=>({...O}),j=(Y)=>{return O=aj(O,Y),x()},S=u1(),K=async(Y)=>{let Q={...O,...Y,fetch:Y.fetch??O.fetch??globalThis.fetch,headers:Rx(O.headers,Y.headers),serializedBody:void 0};if(Q.security)await d1(Q);if(Q.requestValidator)await Q.requestValidator(Q);if(Q.body!==void 0&&Q.bodySerializer)Q.serializedBody=Q.bodySerializer(Q.body);if(Q.body===void 0||Q.serializedBody==="")Q.headers.delete("Content-Type");let T=Q,z=pj(T);return{opts:T,url:z}},G=async(Y)=>{let Q=Y.throwOnError??O.throwOnError,T=Y.responseStyle??O.responseStyle,z,W;try{let{opts:V,url:B}=await K(Y),I={redirect:"follow",...V,body:rj(V)};z=new Request(B,I);for(let N of S.request.fns)if(N)z=await N(z,V);let P=V.fetch;W=await P(z);for(let N of S.response.fns)if(N)W=await N(W,z,V);let A={request:z,response:W};if(W.ok){let N=(V.parseAs==="auto"?c1(W.headers.get("Content-Type")):V.parseAs)??"json";if(W.status===204||W.headers.get("Content-Length")==="0"){let U;switch(N){case"arrayBuffer":case"blob":case"text":U=await W[N]();break;case"formData":U=new FormData;break;case"stream":U=W.body;break;case"json":default:U={};break}return V.responseStyle==="data"?U:{data:U,...A}}let H;switch(N){case"arrayBuffer":case"blob":case"formData":case"text":H=await W[N]();break;case"json":{let U=await W.text();H=U?JSON.parse(U):{};break}case"stream":return V.responseStyle==="data"?W.body:{data:W.body,...A}}if(N==="json"){if(V.responseValidator)await V.responseValidator(H);if(V.responseTransformer)H=await V.responseTransformer(H)}return V.responseStyle==="data"?H:{data:H,...A}}let D=await W.text(),F;try{F=JSON.parse(D)}catch{}throw F??D}catch(V){let B=V;for(let I of S.error.fns)if(I)B=await I(B,W,z,Y);if(B=B||{},Q)throw B;return T==="data"?void 0:{error:B,request:z,response:W}}},Z=(Y)=>(Q)=>G({...Q,method:Y}),X=(Y)=>async(Q)=>{let{opts:T,url:z}=await K(Q);return k1({...T,body:T.body,method:Y,onRequest:async(W,V)=>{let B=new Request(W,V);for(let I of S.request.fns)if(I)B=await I(B,T);return B},serializedBody:rj(T),url:z})};return{buildUrl:(Y)=>pj({...O,...Y}),connect:Z("CONNECT"),delete:Z("DELETE"),get:Z("GET"),getConfig:x,head:Z("HEAD"),interceptors:S,options:Z("OPTIONS"),patch:Z("PATCH"),post:Z("POST"),put:Z("PUT"),request:G,setConfig:j,sse:{connect:X("CONNECT"),delete:X("DELETE"),get:X("GET"),head:X("HEAD"),options:X("OPTIONS"),patch:X("PATCH"),post:X("POST"),put:X("PUT"),trace:X("TRACE")},trace:Z("TRACE")}};var l1=ij(CO());class r1{client;constructor($){this.client=$?.client??l1}}class p1{defaultKey="default";instances=new Map;get($){let O=this.instances.get($??this.defaultKey);if(!O)throw Error('No SDK client found. Create one with "new Sdk()" to fix this error.');return O}set($,O){this.instances.set(O??this.defaultKey,$)}}class Ax extends r1{static __registry=new p1;constructor($){super($);Ax.__registry.set(this,$?.key)}healthHandler($){return($?.client??this.client).get({url:"/health",...$})}getUnsubscribes($){return($?.client??this.client).get({url:"/unsubscribe",...$})}unsubscribeEmail($){return($?.client??this.client).post({url:"/unsubscribe/email",...$})}removeUnsubscribeItem($){return($.client??this.client).delete({url:"/unsubscribe/item/{item_type}/{item_id}",...$})}unsubscribeItem($){return($.client??this.client).post({url:"/unsubscribe/item/{item_type}/{item_id}",...$})}removeUnsubscribeAll($){return($?.client??this.client).delete({url:"/unsubscribe/mute",...$})}unsubscribeAll($){return($?.client??this.client).post({url:"/unsubscribe/mute",...$})}listTypedNotifications($){return($?.client??this.client).get({url:"/v1/user_notifications",...$})}bulkGetTypedNotificationsByEventItemIds($){return($.client??this.client).post({url:"/v1/user_notifications/item/bulk",...$,headers:{"Content-Type":"application/json",...$.headers}})}getTypedNotificationsByEventItemId($){return($.client??this.client).get({url:"/v1/user_notifications/item/{event_item_id}",...$})}getNotificationTypePreferences($){return($?.client??this.client).get({url:"/v1/user_notifications/preferences",...$})}disableNotificationType($){return($.client??this.client).put({url:"/v1/user_notifications/preferences/{notification_event_type}/disable",...$})}enableNotificationType($){return($.client??this.client).put({url:"/v1/user_notifications/preferences/{notification_event_type}/enable",...$})}getTypedNotificationById($){return($.client??this.client).get({url:"/v1/user_notifications/{notification_id}",...$})}bulkDeleteUserNotificationsV2($){return($.client??this.client).delete({url:"/v2/user_notifications/bulk",...$,headers:{"Content-Type":"application/json",...$.headers}})}bulkMarkNotificationsDone($){return($.client??this.client).patch({url:"/v2/user_notifications/bulk/done",...$,headers:{"Content-Type":"application/json",...$.headers}})}bulkMarkNotificationsSeen($){return($.client??this.client).patch({url:"/v2/user_notifications/bulk/seen",...$,headers:{"Content-Type":"application/json",...$.headers}})}bulkMarkNotificationsUndone($){return($.client??this.client).patch({url:"/v2/user_notifications/bulk/undone",...$,headers:{"Content-Type":"application/json",...$.headers}})}deleteUserNotificationV2($){return($.client??this.client).delete({url:"/v2/user_notifications/{notification_id}",...$})}}function a1({onRequest:$,onSseError:O,onSseEvent:x,responseTransformer:j,responseValidator:S,sseDefaultRetryDelay:K,sseMaxRetryAttempts:G,sseMaxRetryDelay:Z,sseSleepFn:X,url:L,...Y}){let Q,T=X??((V)=>new Promise((B)=>setTimeout(B,V)));return{stream:async function*(){let V=K??3000,B=0,I=Y.signal??new AbortController().signal;while(!0){if(I.aborted)break;B++;let P=Y.headers instanceof Headers?Y.headers:new Headers(Y.headers);if(Q!==void 0)P.set("Last-Event-ID",Q);try{let A={redirect:"follow",...Y,body:Y.serializedBody,headers:P,signal:I},D=new Request(L,A);if($)D=await $(L,A);let N=await(Y.fetch??globalThis.fetch)(D);if(!N.ok)throw Error(`SSE failed: ${N.status} ${N.statusText}`);if(!N.body)throw Error("No body in SSE response");let H=N.body.pipeThrough(new TextDecoderStream).getReader(),U="",g=()=>{try{H.cancel()}catch{}};I.addEventListener("abort",g);try{while(!0){let{done:r,value:p}=await H.read();if(r)break;U+=p,U=U.replace(/\r\n?/g,`-`);let k=U.split(`--`);U=k.pop()??"";for(let a of k){let i=a.split(`-`),_=[],y;for(let R of i)if(R.startsWith("data:"))_.push(R.replace(/^data:\s*/,""));else if(R.startsWith("event:"))y=R.replace(/^event:\s*/,"");else if(R.startsWith("id:"))Q=R.replace(/^id:\s*/,"");else if(R.startsWith("retry:")){let v=Number.parseInt(R.replace(/^retry:\s*/,""),10);if(!Number.isNaN(v))V=v}let C,h=!1;if(_.length){let R=_.join(`-`);try{C=JSON.parse(R),h=!0}catch{C=R}}if(h){if(S)await S(C);if(j)C=await j(C)}if(x?.({data:C,event:y,id:Q,retry:V}),_.length)yield C}}}finally{I.removeEventListener("abort",g),H.releaseLock()}break}catch(A){if(O?.(A),G!==void 0&&B>=G)break;let D=Math.min(V*2**(B-1),Z??30000);await T(D)}}}()}}var D6=($)=>{switch($){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},C6=($)=>{switch($){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},M6=($)=>{switch($){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},Dx=({allowReserved:$,explode:O,name:x,style:j,value:S})=>{if(!O){let Z=($?S:S.map((X)=>encodeURIComponent(X))).join(C6(j));switch(j){case"label":return`.${Z}`;case"matrix":return`;${x}=${Z}`;case"simple":return Z;default:return`${x}=${Z}`}}let K=D6(j),G=S.map((Z)=>{if(j==="label"||j==="simple")return $?Z:encodeURIComponent(Z);return ZO({allowReserved:$,name:x,value:Z})}).join(K);return j==="label"||j==="matrix"?K+G:G},ZO=({allowReserved:$,name:O,value:x})=>{if(x===void 0||x===null)return"";if(typeof x==="object")throw Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${O}=${$?x:encodeURIComponent(x)}`},Cx=({allowReserved:$,explode:O,name:x,style:j,value:S,valueOnly:K})=>{if(S instanceof Date)return K?S.toISOString():`${x}=${S.toISOString()}`;if(j!=="deepObject"&&!O){let X=[];Object.entries(S).forEach(([Y,Q])=>{X=[...X,Y,$?Q:encodeURIComponent(Q)]});let L=X.join(",");switch(j){case"form":return`${x}=${L}`;case"label":return`.${L}`;case"matrix":return`;${x}=${L}`;default:return L}}let G=M6(j),Z=Object.entries(S).map(([X,L])=>ZO({allowReserved:$,name:j==="deepObject"?`${x}[${X}]`:X,value:L})).join(G);return j==="label"||j==="matrix"?G+Z:Z};var P6=/\{[^{}]+\}/g,_6=({path:$,url:O})=>{let x=O,j=O.match(P6);if(j)for(let S of j){let K=!1,G=S.substring(1,S.length-1),Z="simple";if(G.endsWith("*"))K=!0,G=G.substring(0,G.length-1);if(G.startsWith("."))G=G.substring(1),Z="label";else if(G.startsWith(";"))G=G.substring(1),Z="matrix";let X=$[G];if(X===void 0||X===null)continue;if(Array.isArray(X)){x=x.replace(S,Dx({explode:K,name:G,style:Z,value:X}));continue}if(typeof X==="object"){x=x.replace(S,Cx({explode:K,name:G,style:Z,value:X,valueOnly:!0}));continue}if(Z==="matrix"){x=x.replace(S,`;${ZO({name:G,value:X})}`);continue}let L=encodeURIComponent(Z==="label"?`.${X}`:X);x=x.replace(S,L)}return x},i1=({baseUrl:$,path:O,query:x,querySerializer:j,url:S})=>{let K=S.startsWith("/")?S:`/${S}`,G=($??"")+K;if(O)G=_6({path:O,url:G});let Z=x?j(x):"";if(Z.startsWith("?"))Z=Z.substring(1);if(Z)G+=`?${Z}`;return G};function nj($){let O=$.body!==void 0;if(O&&$.bodySerializer){if("serializedBody"in $)return $.serializedBody!==void 0&&$.serializedBody!==""?$.serializedBody:null;return $.body!==""?$.body:null}if(O)return $.body;return}var n1=async($,O)=>{let x=typeof O==="function"?await O($):O;if(!x)return;if($.scheme==="bearer")return`Bearer ${x}`;if($.scheme==="basic")return`Basic ${btoa(x)}`;return x};var s1={bodySerializer:($)=>JSON.stringify($,(O,x)=>typeof x==="bigint"?x.toString():x)};var e1=({parameters:$={},...O}={})=>{return(j)=>{let S=[];if(j&&typeof j==="object")for(let K in j){let G=j[K];if(G===void 0||G===null)continue;let Z=$[K]||O;if(Array.isArray(G)){let X=Dx({allowReserved:Z.allowReserved,explode:!0,name:K,style:"form",value:G,...Z.array});if(X)S.push(X)}else if(typeof G==="object"){let X=Cx({allowReserved:Z.allowReserved,explode:!0,name:K,style:"deepObject",value:G,...Z.object});if(X)S.push(X)}else{let X=ZO({allowReserved:Z.allowReserved,name:K,value:G});if(X)S.push(X)}}return S.join("&")}},t1=($)=>{if(!$)return"stream";let O=$.split(";")[0]?.trim();if(!O)return;if(O.startsWith("application/json")||O.endsWith("+json"))return"json";if(O==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some((x)=>O.startsWith(x)))return"blob";if(O.startsWith("text/"))return"text";return},F6=($,O)=>{if(!O)return!1;if($.headers.has(O)||$.query?.[O]||$.headers.get("Cookie")?.includes(`${O}=`))return!0;return!1};async function o1($){for(let O of $.security??[]){if(F6($,O.name))continue;let x=await n1(O,$.auth);if(!x)continue;let j=O.name??"Authorization";switch(O.in){case"query":if(!$.query)$.query={};$.query[j]=x;break;case"cookie":$.headers.append("Cookie",`${j}=${x}`);break;case"header":default:$.headers.set(j,x);break}}}var sj=($)=>i1({baseUrl:$.baseUrl,path:$.path,query:$.query,querySerializer:typeof $.querySerializer==="function"?$.querySerializer:e1($.querySerializer),url:$.url}),ej=($,O)=>{let x={...$,...O};if(x.baseUrl?.endsWith("/"))x.baseUrl=x.baseUrl.substring(0,x.baseUrl.length-1);return x.headers=Px($.headers,O.headers),x},E6=($)=>{let O=[];return $.forEach((x,j)=>{O.push([j,x])}),O},Px=(...$)=>{let O=new Headers;for(let x of $){if(!x)continue;let j=x instanceof Headers?E6(x):Object.entries(x);for(let[S,K]of j)if(K===null)O.delete(S);else if(Array.isArray(K))for(let G of K)O.append(S,G);else if(K!==void 0)O.set(S,typeof K==="object"?JSON.stringify(K):K)}return O};class Mx{fns=[];clear(){this.fns=[]}eject($){let O=this.getInterceptorIndex($);if(this.fns[O])this.fns[O]=null}exists($){let O=this.getInterceptorIndex($);return Boolean(this.fns[O])}getInterceptorIndex($){if(typeof $==="number")return this.fns[$]?$:-1;return this.fns.indexOf($)}update($,O){let x=this.getInterceptorIndex($);if(this.fns[x])return this.fns[x]=O,$;return!1}use($){return this.fns.push($),this.fns.length-1}}var $S=()=>({error:new Mx,request:new Mx,response:new Mx}),w6=e1({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),q6={"Content-Type":"application/json"},MO=($={})=>({...s1,headers:q6,parseAs:"auto",querySerializer:w6,...$});var tj=($={})=>{let O=ej(MO(),$),x=()=>({...O}),j=(Y)=>{return O=ej(O,Y),x()},S=$S(),K=async(Y)=>{let Q={...O,...Y,fetch:Y.fetch??O.fetch??globalThis.fetch,headers:Px(O.headers,Y.headers),serializedBody:void 0};if(Q.security)await o1(Q);if(Q.requestValidator)await Q.requestValidator(Q);if(Q.body!==void 0&&Q.bodySerializer)Q.serializedBody=Q.bodySerializer(Q.body);if(Q.body===void 0||Q.serializedBody==="")Q.headers.delete("Content-Type");let T=Q,z=sj(T);return{opts:T,url:z}},G=async(Y)=>{let Q=Y.throwOnError??O.throwOnError,T=Y.responseStyle??O.responseStyle,z,W;try{let{opts:V,url:B}=await K(Y),I={redirect:"follow",...V,body:nj(V)};z=new Request(B,I);for(let N of S.request.fns)if(N)z=await N(z,V);let P=V.fetch;W=await P(z);for(let N of S.response.fns)if(N)W=await N(W,z,V);let A={request:z,response:W};if(W.ok){let N=(V.parseAs==="auto"?t1(W.headers.get("Content-Type")):V.parseAs)??"json";if(W.status===204||W.headers.get("Content-Length")==="0"){let U;switch(N){case"arrayBuffer":case"blob":case"text":U=await W[N]();break;case"formData":U=new FormData;break;case"stream":U=W.body;break;case"json":default:U={};break}return V.responseStyle==="data"?U:{data:U,...A}}let H;switch(N){case"arrayBuffer":case"blob":case"formData":case"text":H=await W[N]();break;case"json":{let U=await W.text();H=U?JSON.parse(U):{};break}case"stream":return V.responseStyle==="data"?W.body:{data:W.body,...A}}if(N==="json"){if(V.responseValidator)await V.responseValidator(H);if(V.responseTransformer)H=await V.responseTransformer(H)}return V.responseStyle==="data"?H:{data:H,...A}}let D=await W.text(),F;try{F=JSON.parse(D)}catch{}throw F??D}catch(V){let B=V;for(let I of S.error.fns)if(I)B=await I(B,W,z,Y);if(B=B||{},Q)throw B;return T==="data"?void 0:{error:B,request:z,response:W}}},Z=(Y)=>(Q)=>G({...Q,method:Y}),X=(Y)=>async(Q)=>{let{opts:T,url:z}=await K(Q);return a1({...T,body:T.body,method:Y,onRequest:async(W,V)=>{let B=new Request(W,V);for(let I of S.request.fns)if(I)B=await I(B,T);return B},serializedBody:nj(T),url:z})};return{buildUrl:(Y)=>sj({...O,...Y}),connect:Z("CONNECT"),delete:Z("DELETE"),get:Z("GET"),getConfig:x,head:Z("HEAD"),interceptors:S,options:Z("OPTIONS"),patch:Z("PATCH"),post:Z("POST"),put:Z("PUT"),request:G,setConfig:j,sse:{connect:X("CONNECT"),delete:X("DELETE"),get:X("GET"),head:X("HEAD"),options:X("OPTIONS"),patch:X("PATCH"),post:X("POST"),put:X("PUT"),trace:X("TRACE")},trace:Z("TRACE")}};var OS=tj(MO());class xS{client;constructor($){this.client=$?.client??OS}}class jS{defaultKey="default";instances=new Map;get($){let O=this.instances.get($??this.defaultKey);if(!O)throw Error('No SDK client found. Create one with "new Sdk()" to fix this error.');return O}set($,O){this.instances.set(O??this.defaultKey,$)}}class _x extends xS{static __registry=new jS;constructor($){super($);_x.__registry.set(this,$?.key)}listProperties($){return($.client??this.client).get({url:"/properties/definitions",...$})}createPropertyDefinition($){return($.client??this.client).post({url:"/properties/definitions",...$,headers:{"Content-Type":"application/json",...$.headers}})}deletePropertyDefinition($){return($.client??this.client).delete({url:"/properties/definitions/{definition_id}",...$})}getPropertyDefinition($){return($.client??this.client).get({url:"/properties/definitions/{definition_id}",...$})}getPropertyOptions($){return($.client??this.client).get({url:"/properties/definitions/{definition_id}/options",...$})}addPropertyOption($){return($.client??this.client).post({url:"/properties/definitions/{definition_id}/options",...$,headers:{"Content-Type":"application/json",...$.headers}})}deletePropertyOption($){return($.client??this.client).delete({url:"/properties/definitions/{definition_id}/options/{option_id}",...$})}updatePropertyOption($){return($.client??this.client).patch({url:"/properties/definitions/{definition_id}/options/{option_id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}getBulkEntityProperties($){return($.client??this.client).post({url:"/properties/entities/bulk",...$,headers:{"Content-Type":"application/json",...$.headers}})}getEntityProperties($){return($.client??this.client).get({url:"/properties/entities/{entity_type}/{entity_id}",...$})}bulkUpdateEntityPropertyOptions($){return($.client??this.client).post({url:"/properties/entities/{entity_type}/{entity_id}/options/bulk",...$,headers:{"Content-Type":"application/json",...$.headers}})}setEntityProperty($){return($.client??this.client).put({url:"/properties/entities/{entity_type}/{entity_id}/{property_id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}removeEntityPropertyOption($){return($.client??this.client).delete({url:"/properties/entities/{entity_type}/{entity_id}/{property_id}/options/{option_id}",...$})}addEntityPropertyOption($){return($.client??this.client).post({url:"/properties/entities/{entity_type}/{entity_id}/{property_id}/options/{option_id}",...$})}deleteEntityProperty($){return($.client??this.client).delete({url:"/properties/entity_properties/{entity_property_id}",...$})}bulkUpdateEntitiesPropertyOptions($){return($.client??this.client).post({url:"/properties/options/bulk",...$,headers:{"Content-Type":"application/json",...$.headers}})}listTags($){return($?.client??this.client).get({url:"/properties/tags",...$})}ensureTagSet($){return($.client??this.client).post({url:"/properties/tags",...$,headers:{"Content-Type":"application/json",...$.headers}})}mergeTag($){return($.client??this.client).post({url:"/properties/tags/merge",...$,headers:{"Content-Type":"application/json",...$.headers}})}promoteTag($){return($.client??this.client).post({url:"/properties/tags/promote",...$,headers:{"Content-Type":"application/json",...$.headers}})}}function SS({onRequest:$,onSseError:O,onSseEvent:x,responseTransformer:j,responseValidator:S,sseDefaultRetryDelay:K,sseMaxRetryAttempts:G,sseMaxRetryDelay:Z,sseSleepFn:X,url:L,...Y}){let Q,T=X??((V)=>new Promise((B)=>setTimeout(B,V)));return{stream:async function*(){let V=K??3000,B=0,I=Y.signal??new AbortController().signal;while(!0){if(I.aborted)break;B++;let P=Y.headers instanceof Headers?Y.headers:new Headers(Y.headers);if(Q!==void 0)P.set("Last-Event-ID",Q);try{let A={redirect:"follow",...Y,body:Y.serializedBody,headers:P,signal:I},D=new Request(L,A);if($)D=await $(L,A);let N=await(Y.fetch??globalThis.fetch)(D);if(!N.ok)throw Error(`SSE failed: ${N.status} ${N.statusText}`);if(!N.body)throw Error("No body in SSE response");let H=N.body.pipeThrough(new TextDecoderStream).getReader(),U="",g=()=>{try{H.cancel()}catch{}};I.addEventListener("abort",g);try{while(!0){let{done:r,value:p}=await H.read();if(r)break;U+=p,U=U.replace(/\r\n?/g,`-`);let k=U.split(`--`);U=k.pop()??"";for(let a of k){let i=a.split(`-`),_=[],y;for(let R of i)if(R.startsWith("data:"))_.push(R.replace(/^data:\s*/,""));else if(R.startsWith("event:"))y=R.replace(/^event:\s*/,"");else if(R.startsWith("id:"))Q=R.replace(/^id:\s*/,"");else if(R.startsWith("retry:")){let v=Number.parseInt(R.replace(/^retry:\s*/,""),10);if(!Number.isNaN(v))V=v}let C,h=!1;if(_.length){let R=_.join(`-`);try{C=JSON.parse(R),h=!0}catch{C=R}}if(h){if(S)await S(C);if(j)C=await j(C)}if(x?.({data:C,event:y,id:Q,retry:V}),_.length)yield C}}}finally{I.removeEventListener("abort",g),H.releaseLock()}break}catch(A){if(O?.(A),G!==void 0&&B>=G)break;let D=Math.min(V*2**(B-1),Z??30000);await T(D)}}}()}}var f6=($)=>{switch($){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},b6=($)=>{switch($){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},g6=($)=>{switch($){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},Fx=({allowReserved:$,explode:O,name:x,style:j,value:S})=>{if(!O){let Z=($?S:S.map((X)=>encodeURIComponent(X))).join(b6(j));switch(j){case"label":return`.${Z}`;case"matrix":return`;${x}=${Z}`;case"simple":return Z;default:return`${x}=${Z}`}}let K=f6(j),G=S.map((Z)=>{if(j==="label"||j==="simple")return $?Z:encodeURIComponent(Z);return XO({allowReserved:$,name:x,value:Z})}).join(K);return j==="label"||j==="matrix"?K+G:G},XO=({allowReserved:$,name:O,value:x})=>{if(x===void 0||x===null)return"";if(typeof x==="object")throw Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${O}=${$?x:encodeURIComponent(x)}`},Ex=({allowReserved:$,explode:O,name:x,style:j,value:S,valueOnly:K})=>{if(S instanceof Date)return K?S.toISOString():`${x}=${S.toISOString()}`;if(j!=="deepObject"&&!O){let X=[];Object.entries(S).forEach(([Y,Q])=>{X=[...X,Y,$?Q:encodeURIComponent(Q)]});let L=X.join(",");switch(j){case"form":return`${x}=${L}`;case"label":return`.${L}`;case"matrix":return`;${x}=${L}`;default:return L}}let G=g6(j),Z=Object.entries(S).map(([X,L])=>XO({allowReserved:$,name:j==="deepObject"?`${x}[${X}]`:X,value:L})).join(G);return j==="label"||j==="matrix"?G+Z:Z};var k6=/\{[^{}]+\}/g,y6=({path:$,url:O})=>{let x=O,j=O.match(k6);if(j)for(let S of j){let K=!1,G=S.substring(1,S.length-1),Z="simple";if(G.endsWith("*"))K=!0,G=G.substring(0,G.length-1);if(G.startsWith("."))G=G.substring(1),Z="label";else if(G.startsWith(";"))G=G.substring(1),Z="matrix";let X=$[G];if(X===void 0||X===null)continue;if(Array.isArray(X)){x=x.replace(S,Fx({explode:K,name:G,style:Z,value:X}));continue}if(typeof X==="object"){x=x.replace(S,Ex({explode:K,name:G,style:Z,value:X,valueOnly:!0}));continue}if(Z==="matrix"){x=x.replace(S,`;${XO({name:G,value:X})}`);continue}let L=encodeURIComponent(Z==="label"?`.${X}`:X);x=x.replace(S,L)}return x},GS=({baseUrl:$,path:O,query:x,querySerializer:j,url:S})=>{let K=S.startsWith("/")?S:`/${S}`,G=($??"")+K;if(O)G=y6({path:O,url:G});let Z=x?j(x):"";if(Z.startsWith("?"))Z=Z.substring(1);if(Z)G+=`?${Z}`;return G};function oj($){let O=$.body!==void 0;if(O&&$.bodySerializer){if("serializedBody"in $)return $.serializedBody!==void 0&&$.serializedBody!==""?$.serializedBody:null;return $.body!==""?$.body:null}if(O)return $.body;return}var ZS=async($,O)=>{let x=typeof O==="function"?await O($):O;if(!x)return;if($.scheme==="bearer")return`Bearer ${x}`;if($.scheme==="basic")return`Basic ${btoa(x)}`;return x};var XS={bodySerializer:($)=>JSON.stringify($,(O,x)=>typeof x==="bigint"?x.toString():x)};var KS=({parameters:$={},...O}={})=>{return(j)=>{let S=[];if(j&&typeof j==="object")for(let K in j){let G=j[K];if(G===void 0||G===null)continue;let Z=$[K]||O;if(Array.isArray(G)){let X=Fx({allowReserved:Z.allowReserved,explode:!0,name:K,style:"form",value:G,...Z.array});if(X)S.push(X)}else if(typeof G==="object"){let X=Ex({allowReserved:Z.allowReserved,explode:!0,name:K,style:"deepObject",value:G,...Z.object});if(X)S.push(X)}else{let X=XO({allowReserved:Z.allowReserved,name:K,value:G});if(X)S.push(X)}}return S.join("&")}},YS=($)=>{if(!$)return"stream";let O=$.split(";")[0]?.trim();if(!O)return;if(O.startsWith("application/json")||O.endsWith("+json"))return"json";if(O==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some((x)=>O.startsWith(x)))return"blob";if(O.startsWith("text/"))return"text";return},h6=($,O)=>{if(!O)return!1;if($.headers.has(O)||$.query?.[O]||$.headers.get("Cookie")?.includes(`${O}=`))return!0;return!1};async function QS($){for(let O of $.security??[]){if(h6($,O.name))continue;let x=await ZS(O,$.auth);if(!x)continue;let j=O.name??"Authorization";switch(O.in){case"query":if(!$.query)$.query={};$.query[j]=x;break;case"cookie":$.headers.append("Cookie",`${j}=${x}`);break;case"header":default:$.headers.set(j,x);break}}}var $0=($)=>GS({baseUrl:$.baseUrl,path:$.path,query:$.query,querySerializer:typeof $.querySerializer==="function"?$.querySerializer:KS($.querySerializer),url:$.url}),O0=($,O)=>{let x={...$,...O};if(x.baseUrl?.endsWith("/"))x.baseUrl=x.baseUrl.substring(0,x.baseUrl.length-1);return x.headers=qx($.headers,O.headers),x},v6=($)=>{let O=[];return $.forEach((x,j)=>{O.push([j,x])}),O},qx=(...$)=>{let O=new Headers;for(let x of $){if(!x)continue;let j=x instanceof Headers?v6(x):Object.entries(x);for(let[S,K]of j)if(K===null)O.delete(S);else if(Array.isArray(K))for(let G of K)O.append(S,G);else if(K!==void 0)O.set(S,typeof K==="object"?JSON.stringify(K):K)}return O};class wx{fns=[];clear(){this.fns=[]}eject($){let O=this.getInterceptorIndex($);if(this.fns[O])this.fns[O]=null}exists($){let O=this.getInterceptorIndex($);return Boolean(this.fns[O])}getInterceptorIndex($){if(typeof $==="number")return this.fns[$]?$:-1;return this.fns.indexOf($)}update($,O){let x=this.getInterceptorIndex($);if(this.fns[x])return this.fns[x]=O,$;return!1}use($){return this.fns.push($),this.fns.length-1}}var JS=()=>({error:new wx,request:new wx,response:new wx}),m6=KS({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),c6={"Content-Type":"application/json"},PO=($={})=>({...XS,headers:c6,parseAs:"auto",querySerializer:m6,...$});var x0=($={})=>{let O=O0(PO(),$),x=()=>({...O}),j=(Y)=>{return O=O0(O,Y),x()},S=JS(),K=async(Y)=>{let Q={...O,...Y,fetch:Y.fetch??O.fetch??globalThis.fetch,headers:qx(O.headers,Y.headers),serializedBody:void 0};if(Q.security)await QS(Q);if(Q.requestValidator)await Q.requestValidator(Q);if(Q.body!==void 0&&Q.bodySerializer)Q.serializedBody=Q.bodySerializer(Q.body);if(Q.body===void 0||Q.serializedBody==="")Q.headers.delete("Content-Type");let T=Q,z=$0(T);return{opts:T,url:z}},G=async(Y)=>{let Q=Y.throwOnError??O.throwOnError,T=Y.responseStyle??O.responseStyle,z,W;try{let{opts:V,url:B}=await K(Y),I={redirect:"follow",...V,body:oj(V)};z=new Request(B,I);for(let N of S.request.fns)if(N)z=await N(z,V);let P=V.fetch;W=await P(z);for(let N of S.response.fns)if(N)W=await N(W,z,V);let A={request:z,response:W};if(W.ok){let N=(V.parseAs==="auto"?YS(W.headers.get("Content-Type")):V.parseAs)??"json";if(W.status===204||W.headers.get("Content-Length")==="0"){let U;switch(N){case"arrayBuffer":case"blob":case"text":U=await W[N]();break;case"formData":U=new FormData;break;case"stream":U=W.body;break;case"json":default:U={};break}return V.responseStyle==="data"?U:{data:U,...A}}let H;switch(N){case"arrayBuffer":case"blob":case"formData":case"text":H=await W[N]();break;case"json":{let U=await W.text();H=U?JSON.parse(U):{};break}case"stream":return V.responseStyle==="data"?W.body:{data:W.body,...A}}if(N==="json"){if(V.responseValidator)await V.responseValidator(H);if(V.responseTransformer)H=await V.responseTransformer(H)}return V.responseStyle==="data"?H:{data:H,...A}}let D=await W.text(),F;try{F=JSON.parse(D)}catch{}throw F??D}catch(V){let B=V;for(let I of S.error.fns)if(I)B=await I(B,W,z,Y);if(B=B||{},Q)throw B;return T==="data"?void 0:{error:B,request:z,response:W}}},Z=(Y)=>(Q)=>G({...Q,method:Y}),X=(Y)=>async(Q)=>{let{opts:T,url:z}=await K(Q);return SS({...T,body:T.body,method:Y,onRequest:async(W,V)=>{let B=new Request(W,V);for(let I of S.request.fns)if(I)B=await I(B,T);return B},serializedBody:oj(T),url:z})};return{buildUrl:(Y)=>$0({...O,...Y}),connect:Z("CONNECT"),delete:Z("DELETE"),get:Z("GET"),getConfig:x,head:Z("HEAD"),interceptors:S,options:Z("OPTIONS"),patch:Z("PATCH"),post:Z("POST"),put:Z("PUT"),request:G,setConfig:j,sse:{connect:X("CONNECT"),delete:X("DELETE"),get:X("GET"),head:X("HEAD"),options:X("OPTIONS"),patch:X("PATCH"),post:X("POST"),put:X("PUT"),trace:X("TRACE")},trace:Z("TRACE")}};var VS=x0(PO());class WS{client;constructor($){this.client=$?.client??VS}}class BS{defaultKey="default";instances=new Map;get($){let O=this.instances.get($??this.defaultKey);if(!O)throw Error('No SDK client found. Create one with "new Sdk()" to fix this error.');return O}set($,O){this.instances.set(O??this.defaultKey,$)}}class fx extends WS{static __registry=new BS;constructor($){super($);fx.__registry.set(this,$?.key)}unifiedSearch($){return($.client??this.client).post({url:"/search",...$,headers:{"Content-Type":"application/json",...$.headers}})}simpleUnifiedSearch($){return($.client??this.client).post({url:"/search/simple",...$,headers:{"Content-Type":"application/json",...$.headers}})}}function LS({onRequest:$,onSseError:O,onSseEvent:x,responseTransformer:j,responseValidator:S,sseDefaultRetryDelay:K,sseMaxRetryAttempts:G,sseMaxRetryDelay:Z,sseSleepFn:X,url:L,...Y}){let Q,T=X??((V)=>new Promise((B)=>setTimeout(B,V)));return{stream:async function*(){let V=K??3000,B=0,I=Y.signal??new AbortController().signal;while(!0){if(I.aborted)break;B++;let P=Y.headers instanceof Headers?Y.headers:new Headers(Y.headers);if(Q!==void 0)P.set("Last-Event-ID",Q);try{let A={redirect:"follow",...Y,body:Y.serializedBody,headers:P,signal:I},D=new Request(L,A);if($)D=await $(L,A);let N=await(Y.fetch??globalThis.fetch)(D);if(!N.ok)throw Error(`SSE failed: ${N.status} ${N.statusText}`);if(!N.body)throw Error("No body in SSE response");let H=N.body.pipeThrough(new TextDecoderStream).getReader(),U="",g=()=>{try{H.cancel()}catch{}};I.addEventListener("abort",g);try{while(!0){let{done:r,value:p}=await H.read();if(r)break;U+=p,U=U.replace(/\r\n?/g,`-`);let k=U.split(`--`);U=k.pop()??"";for(let a of k){let i=a.split(`-`),_=[],y;for(let R of i)if(R.startsWith("data:"))_.push(R.replace(/^data:\s*/,""));else if(R.startsWith("event:"))y=R.replace(/^event:\s*/,"");else if(R.startsWith("id:"))Q=R.replace(/^id:\s*/,"");else if(R.startsWith("retry:")){let v=Number.parseInt(R.replace(/^retry:\s*/,""),10);if(!Number.isNaN(v))V=v}let C,h=!1;if(_.length){let R=_.join(`-`);try{C=JSON.parse(R),h=!0}catch{C=R}}if(h){if(S)await S(C);if(j)C=await j(C)}if(x?.({data:C,event:y,id:Q,retry:V}),_.length)yield C}}}finally{I.removeEventListener("abort",g),H.releaseLock()}break}catch(A){if(O?.(A),G!==void 0&&B>=G)break;let D=Math.min(V*2**(B-1),Z??30000);await T(D)}}}()}}var d6=($)=>{switch($){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},u6=($)=>{switch($){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},l6=($)=>{switch($){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},bx=({allowReserved:$,explode:O,name:x,style:j,value:S})=>{if(!O){let Z=($?S:S.map((X)=>encodeURIComponent(X))).join(u6(j));switch(j){case"label":return`.${Z}`;case"matrix":return`;${x}=${Z}`;case"simple":return Z;default:return`${x}=${Z}`}}let K=d6(j),G=S.map((Z)=>{if(j==="label"||j==="simple")return $?Z:encodeURIComponent(Z);return KO({allowReserved:$,name:x,value:Z})}).join(K);return j==="label"||j==="matrix"?K+G:G},KO=({allowReserved:$,name:O,value:x})=>{if(x===void 0||x===null)return"";if(typeof x==="object")throw Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${O}=${$?x:encodeURIComponent(x)}`},gx=({allowReserved:$,explode:O,name:x,style:j,value:S,valueOnly:K})=>{if(S instanceof Date)return K?S.toISOString():`${x}=${S.toISOString()}`;if(j!=="deepObject"&&!O){let X=[];Object.entries(S).forEach(([Y,Q])=>{X=[...X,Y,$?Q:encodeURIComponent(Q)]});let L=X.join(",");switch(j){case"form":return`${x}=${L}`;case"label":return`.${L}`;case"matrix":return`;${x}=${L}`;default:return L}}let G=l6(j),Z=Object.entries(S).map(([X,L])=>KO({allowReserved:$,name:j==="deepObject"?`${x}[${X}]`:X,value:L})).join(G);return j==="label"||j==="matrix"?G+Z:Z};var r6=/\{[^{}]+\}/g,p6=({path:$,url:O})=>{let x=O,j=O.match(r6);if(j)for(let S of j){let K=!1,G=S.substring(1,S.length-1),Z="simple";if(G.endsWith("*"))K=!0,G=G.substring(0,G.length-1);if(G.startsWith("."))G=G.substring(1),Z="label";else if(G.startsWith(";"))G=G.substring(1),Z="matrix";let X=$[G];if(X===void 0||X===null)continue;if(Array.isArray(X)){x=x.replace(S,bx({explode:K,name:G,style:Z,value:X}));continue}if(typeof X==="object"){x=x.replace(S,gx({explode:K,name:G,style:Z,value:X,valueOnly:!0}));continue}if(Z==="matrix"){x=x.replace(S,`;${KO({name:G,value:X})}`);continue}let L=encodeURIComponent(Z==="label"?`.${X}`:X);x=x.replace(S,L)}return x},NS=({baseUrl:$,path:O,query:x,querySerializer:j,url:S})=>{let K=S.startsWith("/")?S:`/${S}`,G=($??"")+K;if(O)G=p6({path:O,url:G});let Z=x?j(x):"";if(Z.startsWith("?"))Z=Z.substring(1);if(Z)G+=`?${Z}`;return G};function j0($){let O=$.body!==void 0;if(O&&$.bodySerializer){if("serializedBody"in $)return $.serializedBody!==void 0&&$.serializedBody!==""?$.serializedBody:null;return $.body!==""?$.body:null}if(O)return $.body;return}var US=async($,O)=>{let x=typeof O==="function"?await O($):O;if(!x)return;if($.scheme==="bearer")return`Bearer ${x}`;if($.scheme==="basic")return`Basic ${btoa(x)}`;return x};var zS={bodySerializer:($)=>JSON.stringify($,(O,x)=>typeof x==="bigint"?x.toString():x)};var IS=({parameters:$={},...O}={})=>{return(j)=>{let S=[];if(j&&typeof j==="object")for(let K in j){let G=j[K];if(G===void 0||G===null)continue;let Z=$[K]||O;if(Array.isArray(G)){let X=bx({allowReserved:Z.allowReserved,explode:!0,name:K,style:"form",value:G,...Z.array});if(X)S.push(X)}else if(typeof G==="object"){let X=gx({allowReserved:Z.allowReserved,explode:!0,name:K,style:"deepObject",value:G,...Z.object});if(X)S.push(X)}else{let X=KO({allowReserved:Z.allowReserved,name:K,value:G});if(X)S.push(X)}}return S.join("&")}},TS=($)=>{if(!$)return"stream";let O=$.split(";")[0]?.trim();if(!O)return;if(O.startsWith("application/json")||O.endsWith("+json"))return"json";if(O==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some((x)=>O.startsWith(x)))return"blob";if(O.startsWith("text/"))return"text";return},a6=($,O)=>{if(!O)return!1;if($.headers.has(O)||$.query?.[O]||$.headers.get("Cookie")?.includes(`${O}=`))return!0;return!1};async function HS($){for(let O of $.security??[]){if(a6($,O.name))continue;let x=await US(O,$.auth);if(!x)continue;let j=O.name??"Authorization";switch(O.in){case"query":if(!$.query)$.query={};$.query[j]=x;break;case"cookie":$.headers.append("Cookie",`${j}=${x}`);break;case"header":default:$.headers.set(j,x);break}}}var S0=($)=>NS({baseUrl:$.baseUrl,path:$.path,query:$.query,querySerializer:typeof $.querySerializer==="function"?$.querySerializer:IS($.querySerializer),url:$.url}),G0=($,O)=>{let x={...$,...O};if(x.baseUrl?.endsWith("/"))x.baseUrl=x.baseUrl.substring(0,x.baseUrl.length-1);return x.headers=yx($.headers,O.headers),x},i6=($)=>{let O=[];return $.forEach((x,j)=>{O.push([j,x])}),O},yx=(...$)=>{let O=new Headers;for(let x of $){if(!x)continue;let j=x instanceof Headers?i6(x):Object.entries(x);for(let[S,K]of j)if(K===null)O.delete(S);else if(Array.isArray(K))for(let G of K)O.append(S,G);else if(K!==void 0)O.set(S,typeof K==="object"?JSON.stringify(K):K)}return O};class kx{fns=[];clear(){this.fns=[]}eject($){let O=this.getInterceptorIndex($);if(this.fns[O])this.fns[O]=null}exists($){let O=this.getInterceptorIndex($);return Boolean(this.fns[O])}getInterceptorIndex($){if(typeof $==="number")return this.fns[$]?$:-1;return this.fns.indexOf($)}update($,O){let x=this.getInterceptorIndex($);if(this.fns[x])return this.fns[x]=O,$;return!1}use($){return this.fns.push($),this.fns.length-1}}var RS=()=>({error:new kx,request:new kx,response:new kx}),n6=IS({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),s6={"Content-Type":"application/json"},_O=($={})=>({...zS,headers:s6,parseAs:"auto",querySerializer:n6,...$});var FO=($={})=>{let O=G0(_O(),$),x=()=>({...O}),j=(Y)=>{return O=G0(O,Y),x()},S=RS(),K=async(Y)=>{let Q={...O,...Y,fetch:Y.fetch??O.fetch??globalThis.fetch,headers:yx(O.headers,Y.headers),serializedBody:void 0};if(Q.security)await HS(Q);if(Q.requestValidator)await Q.requestValidator(Q);if(Q.body!==void 0&&Q.bodySerializer)Q.serializedBody=Q.bodySerializer(Q.body);if(Q.body===void 0||Q.serializedBody==="")Q.headers.delete("Content-Type");let T=Q,z=S0(T);return{opts:T,url:z}},G=async(Y)=>{let Q=Y.throwOnError??O.throwOnError,T=Y.responseStyle??O.responseStyle,z,W;try{let{opts:V,url:B}=await K(Y),I={redirect:"follow",...V,body:j0(V)};z=new Request(B,I);for(let N of S.request.fns)if(N)z=await N(z,V);let P=V.fetch;W=await P(z);for(let N of S.response.fns)if(N)W=await N(W,z,V);let A={request:z,response:W};if(W.ok){let N=(V.parseAs==="auto"?TS(W.headers.get("Content-Type")):V.parseAs)??"json";if(W.status===204||W.headers.get("Content-Length")==="0"){let U;switch(N){case"arrayBuffer":case"blob":case"text":U=await W[N]();break;case"formData":U=new FormData;break;case"stream":U=W.body;break;case"json":default:U={};break}return V.responseStyle==="data"?U:{data:U,...A}}let H;switch(N){case"arrayBuffer":case"blob":case"formData":case"text":H=await W[N]();break;case"json":{let U=await W.text();H=U?JSON.parse(U):{};break}case"stream":return V.responseStyle==="data"?W.body:{data:W.body,...A}}if(N==="json"){if(V.responseValidator)await V.responseValidator(H);if(V.responseTransformer)H=await V.responseTransformer(H)}return V.responseStyle==="data"?H:{data:H,...A}}let D=await W.text(),F;try{F=JSON.parse(D)}catch{}throw F??D}catch(V){let B=V;for(let I of S.error.fns)if(I)B=await I(B,W,z,Y);if(B=B||{},Q)throw B;return T==="data"?void 0:{error:B,request:z,response:W}}},Z=(Y)=>(Q)=>G({...Q,method:Y}),X=(Y)=>async(Q)=>{let{opts:T,url:z}=await K(Q);return LS({...T,body:T.body,method:Y,onRequest:async(W,V)=>{let B=new Request(W,V);for(let I of S.request.fns)if(I)B=await I(B,T);return B},serializedBody:j0(T),url:z})};return{buildUrl:(Y)=>S0({...O,...Y}),connect:Z("CONNECT"),delete:Z("DELETE"),get:Z("GET"),getConfig:x,head:Z("HEAD"),interceptors:S,options:Z("OPTIONS"),patch:Z("PATCH"),post:Z("POST"),put:Z("PUT"),request:G,setConfig:j,sse:{connect:X("CONNECT"),delete:X("DELETE"),get:X("GET"),head:X("HEAD"),options:X("OPTIONS"),patch:X("PATCH"),post:X("POST"),put:X("PUT"),trace:X("TRACE")},trace:Z("TRACE")}};var AS=FO(_O());class DS{client;constructor($){this.client=$?.client??AS}}class CS{defaultKey="default";instances=new Map;get($){let O=this.instances.get($??this.defaultKey);if(!O)throw Error('No SDK client found. Create one with "new Sdk()" to fix this error.');return O}set($,O){this.instances.set(O??this.defaultKey,$)}}class hx extends DS{static __registry=new CS;constructor($){super($);hx.__registry.set(this,$?.key)}listAgents($){return($?.client??this.client).get({url:"/agents",...$})}createAgent($){return($.client??this.client).post({url:"/agents",...$,headers:{"Content-Type":"application/json",...$.headers}})}updateAgent($){return($.client??this.client).put({url:"/agents/{agent_id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}deleteAnchor($){return($.client??this.client).delete({url:"/annotations/anchors",...$,headers:{"Content-Type":"application/json",...$.headers}})}editAnchor($){return($.client??this.client).patch({url:"/annotations/anchors",...$,headers:{"Content-Type":"application/json",...$.headers}})}getDocumentAnchors($){return($.client??this.client).get({url:"/annotations/anchors/document/{document_id}",...$})}createAnchor($){return($.client??this.client).post({url:"/annotations/anchors/document/{document_id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}getSelfBot($){return($?.client??this.client).get({url:"/bots/me",...$})}getBotOwnerProfiles($){return($?.client??this.client).get({url:"/bots/profiles",...$})}listBotChannels($){return($.client??this.client).get({url:"/bots/{bot_id}/channels",...$})}removeBotFromChannelByBot($){return($.client??this.client).delete({url:"/bots/{bot_id}/channels/{channel_id}",...$})}listOccurrences($){return($.client??this.client).get({url:"/calendar-events",...$})}mentionPreviews($){return($.client??this.client).post({url:"/calendar-events/preview",...$,headers:{"Content-Type":"application/json",...$.headers}})}listTeamCalendar($){return($.client??this.client).get({url:"/calendar-events/team",...$})}listTeamOutOfOffice($){return($.client??this.client).get({url:"/calendar-events/team-out-of-office",...$})}getActiveCalls($){return($?.client??this.client).get({url:"/call/active",...$})}guestCallChatRead($){return($.client??this.client).get({url:"/call/guest-chat/{call_id}",...$})}guestCallChatPost($){return($.client??this.client).post({url:"/call/guest-chat/{call_id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}meetingLookup($){return($.client??this.client).get({url:"/call/join/{token}",...$})}meetingGuestJoin($){return($.client??this.client).post({url:"/call/join/{token}",...$,headers:{"Content-Type":"application/json",...$.headers}})}meetingLeave($){return($.client??this.client).post({url:"/call/join/{token}/leave",...$})}meetingGuestParticipants($){return($.client??this.client).get({url:"/call/join/{token}/participants",...$})}meetingList($){return($?.client??this.client).get({url:"/call/meetings",...$})}meetingCreate($){return($.client??this.client).post({url:"/call/meetings",...$,headers:{"Content-Type":"application/json",...$.headers}})}meetingListActive($){return($?.client??this.client).get({url:"/call/meetings/active",...$})}meetingInvitePermissions($){return($.client??this.client).get({url:"/call/meetings/invite/{token}",...$})}meetingInvite($){return($.client??this.client).post({url:"/call/meetings/invite/{token}",...$,headers:{"Content-Type":"application/json",...$.headers}})}meetingInviteUsers($){return($.client??this.client).post({url:"/call/meetings/invite/{token}/users",...$,headers:{"Content-Type":"application/json",...$.headers}})}meetingJoin($){return($.client??this.client).post({url:"/call/meetings/join/{token}",...$})}meetingParticipants($){return($.client??this.client).get({url:"/call/meetings/join/{token}/participants",...$})}meetingPrepare($){return($?.client??this.client).post({url:"/call/meetings/prepare",...$})}meetingCancelPreparation($){return($.client??this.client).delete({url:"/call/meetings/prepare/{preparation_id}",...$})}meetingCancel($){return($.client??this.client).delete({url:"/call/meetings/{meeting_id}",...$})}meetingUpdate($){return($.client??this.client).patch({url:"/call/meetings/{meeting_id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}getBatchCallRecordPreview($){return($.client??this.client).post({url:"/call/record/preview",...$,headers:{"Content-Type":"application/json",...$.headers}})}deleteCallRecord($){return($.client??this.client).delete({url:"/call/record/{call_id}",...$})}getCallRecord($){return($.client??this.client).get({url:"/call/record/{call_id}",...$})}editCallRecord($){return($.client??this.client).patch({url:"/call/record/{call_id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}declineCall($){return($.client??this.client).post({url:"/call/record/{call_id}/decline",...$})}meetingShare($){return($.client??this.client).post({url:"/call/record/{call_id}/link",...$})}toggleShareWithTeam($){return($.client??this.client).post({url:"/call/record/{call_id}/share-with-team/toggle",...$})}editCallTranscript($){return($.client??this.client).patch({url:"/call/record/{call_id}/transcript",...$,headers:{"Content-Type":"application/json",...$.headers}})}getRingStatus($){return($.client??this.client).get({url:"/call/ring-status/{call_id}",...$})}declineRing($){return($.client??this.client).post({url:"/call/ring-status/{call_id}/decline",...$})}callWebhook($){return($?.client??this.client).post({url:"/call/webhook",...$})}leaveOrEndCall($){return($.client??this.client).delete({url:"/call/{channel_id}",...$})}getOrCreateCall($){return($.client??this.client).get({url:"/call/{channel_id}",...$})}checkActiveCall($){return($.client??this.client).get({url:"/call/{channel_id}/active",...$})}ingestTranscript($){return($.client??this.client).post({url:"/call/{room_name}/transcript",...$,headers:{"Content-Type":"application/json",...$.headers}})}listChannelLabels($){return($?.client??this.client).get({url:"/channel-labels",...$})}createChannelLabel($){return($.client??this.client).post({url:"/channel-labels",...$,headers:{"Content-Type":"application/json",...$.headers}})}setChannelLabel($){return($.client??this.client).put({url:"/channel-labels/channels/{channel_id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}previewSmartTag($){return($.client??this.client).post({url:"/channel-labels/preview",...$,headers:{"Content-Type":"application/json",...$.headers}})}deleteChannelLabel($){return($.client??this.client).delete({url:"/channel-labels/{label_id}",...$})}renameChannelLabel($){return($.client??this.client).patch({url:"/channel-labels/{label_id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}createChannel($){return($.client??this.client).post({url:"/channels",...$,headers:{"Content-Type":"application/json",...$.headers}})}getActivity($){return($?.client??this.client).get({url:"/channels/activity",...$})}postActivity($){return($.client??this.client).post({url:"/channels/activity",...$,headers:{"Content-Type":"application/json",...$.headers}})}getAttachmentReferences($){return($.client??this.client).get({url:"/channels/attachments/{entity_type}/{entity_id}/references",...$})}getOrCreateDm($){return($.client??this.client).post({url:"/channels/get_or_create_dm",...$,headers:{"Content-Type":"application/json",...$.headers}})}getOrCreatePrivate($){return($.client??this.client).post({url:"/channels/get_or_create_private",...$,headers:{"Content-Type":"application/json",...$.headers}})}joinChannelByCode($){return($.client??this.client).post({url:"/channels/join/{join_code}",...$})}createEntityMention($){return($.client??this.client).post({url:"/channels/mentions",...$,headers:{"Content-Type":"application/json",...$.headers}})}deleteEntityMention($){return($.client??this.client).delete({url:"/channels/mentions/{mention_id}",...$})}getBatchChannelPreview($){return($.client??this.client).post({url:"/channels/preview",...$,headers:{"Content-Type":"application/json",...$.headers}})}deleteChannel($){return($.client??this.client).delete({url:"/channels/{channel_id}",...$})}getChannel($){return($.client??this.client).get({url:"/channels/{channel_id}",...$})}patchChannel($){return($.client??this.client).patch({url:"/channels/{channel_id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}getChannelAttachments($){return($.client??this.client).get({url:"/channels/{channel_id}/attachments",...$})}createChannelScopedBot($){return($.client??this.client).post({url:"/channels/{channel_id}/bots/scoped",...$,headers:{"Content-Type":"application/json",...$.headers}})}joinChannel($){return($.client??this.client).post({url:"/channels/{channel_id}/join",...$})}getChannelJoinLink($){return($.client??this.client).get({url:"/channels/{channel_id}/join-link",...$})}leaveChannel($){return($.client??this.client).post({url:"/channels/{channel_id}/leave",...$})}removeParticipants($){return($.client??this.client).delete({url:"/channels/{channel_id}/participants",...$,headers:{"Content-Type":"application/json",...$.headers}})}getChannelParticipants($){return($.client??this.client).get({url:"/channels/{channel_id}/participants",...$})}addParticipants($){return($.client??this.client).post({url:"/channels/{channel_id}/participants",...$,headers:{"Content-Type":"application/json",...$.headers}})}setChannelPicture($){return($.client??this.client).put({url:"/channels/{channel_id}/profile_picture",...$,headers:{"Content-Type":"application/json",...$.headers}})}postChannelBotWebhook($){return($.client??this.client).post({url:"/channels/{channel_id}/webhook",...$,headers:{"Content-Type":"application/json",...$.headers}})}deleteCollabSurface($){return($.client??this.client).delete({url:"/collab_surfaces/{id}",...$})}getCollabSurface($){return($.client??this.client).get({url:"/collab_surfaces/{id}",...$})}ensureCollabSurface($){return($.client??this.client).put({url:"/collab_surfaces/{id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}createCollabSurfaceToken($){return($.client??this.client).post({url:"/collab_surfaces/{id}/token",...$})}getChannels($){return($?.client??this.client).get({url:"/comms/channels",...$})}createCrmCompany($){return($.client??this.client).post({url:"/crm/companies",...$,headers:{"Content-Type":"application/json",...$.headers}})}getCompany($){return($.client??this.client).get({url:"/crm/companies/{company_id}",...$})}listCompanyContacts($){return($.client??this.client).get({url:"/crm/companies/{company_id}/contacts",...$})}createCrmContact($){return($.client??this.client).post({url:"/crm/companies/{company_id}/contacts",...$,headers:{"Content-Type":"application/json",...$.headers}})}setEmailSync($){return($.client??this.client).put({url:"/crm/companies/{company_id}/email-sync",...$,headers:{"Content-Type":"application/json",...$.headers}})}setCompanyHidden($){return($.client??this.client).put({url:"/crm/companies/{company_id}/hidden",...$,headers:{"Content-Type":"application/json",...$.headers}})}setCrmCompanyName($){return($.client??this.client).put({url:"/crm/companies/{company_id}/name",...$,headers:{"Content-Type":"application/json",...$.headers}})}searchContacts($){return($?.client??this.client).get({url:"/crm/contacts",...$})}getContactByEmail($){return($.client??this.client).get({url:"/crm/contacts/by-email",...$})}getContact($){return($.client??this.client).get({url:"/crm/contacts/{contact_id}",...$})}setContactHidden($){return($.client??this.client).put({url:"/crm/contacts/{contact_id}/hidden",...$,headers:{"Content-Type":"application/json",...$.headers}})}setCrmContactName($){return($.client??this.client).put({url:"/crm/contacts/{contact_id}/name",...$,headers:{"Content-Type":"application/json",...$.headers}})}listCrmPipelines($){return($?.client??this.client).get({url:"/crm/pipelines",...$})}createCrmPipeline($){return($.client??this.client).post({url:"/crm/pipelines",...$,headers:{"Content-Type":"application/json",...$.headers}})}getCrmPipeline($){return($.client??this.client).get({url:"/crm/pipelines/{id}",...$})}renameCrmPipeline($){return($.client??this.client).put({url:"/crm/pipelines/{id}/name",...$,headers:{"Content-Type":"application/json",...$.headers}})}applyCrmPipelineOps($){return($.client??this.client).post({url:"/crm/pipelines/{id}/ops",...$,headers:{"Content-Type":"application/json",...$.headers}})}getCrmPipelinePermissions($){return($.client??this.client).get({url:"/crm/pipelines/{id}/permissions",...$})}updateCrmPipelinePermissions($){return($.client??this.client).patch({url:"/crm/pipelines/{id}/permissions",...$,headers:{"Content-Type":"application/json",...$.headers}})}getCrmPipelineRows($){return($.client??this.client).get({url:"/crm/pipelines/{id}/rows",...$})}queryCrmPipelineRows($){return($.client??this.client).post({url:"/crm/pipelines/{id}/rows",...$,headers:{"Content-Type":"application/json",...$.headers}})}shareCrmPipeline($){return($.client??this.client).put({url:"/crm/pipelines/{id}/sharing",...$,headers:{"Content-Type":"application/json",...$.headers}})}getCrmPipelineTable($){return($.client??this.client).get({url:"/crm/pipelines/{id}/table",...$})}trashCrmPipeline($){return($.client??this.client).put({url:"/crm/pipelines/{id}/trash",...$,headers:{"Content-Type":"application/json",...$.headers}})}getCrmTeamSettings($){return($?.client??this.client).get({url:"/crm/settings",...$})}putCrmTeamSettings($){return($.client??this.client).put({url:"/crm/settings",...$,headers:{"Content-Type":"application/json",...$.headers}})}resetCrmTeamStages($){return($?.client??this.client).delete({url:"/crm/stages",...$})}putCrmTeamStages($){return($.client??this.client).put({url:"/crm/stages",...$,headers:{"Content-Type":"application/json",...$.headers}})}listDatabases($){return($?.client??this.client).get({url:"/databases",...$})}createDatabase($){return($.client??this.client).post({url:"/databases",...$,headers:{"Content-Type":"application/json",...$.headers}})}saveDatabaseQuery($){return($.client??this.client).post({url:"/databases/queries",...$,headers:{"Content-Type":"application/json",...$.headers}})}getDatabaseQuery($){return($.client??this.client).get({url:"/databases/queries/{query_id}",...$})}ensureStarterHandler($){return($?.client??this.client).post({url:"/databases/starter",...$})}deliverDatabaseWebhook($){return($.client??this.client).post({url:"/databases/webhooks/{token}",...$,headers:{"Content-Type":"application/json",...$.headers}})}getDatabase($){return($.client??this.client).get({url:"/databases/{id}",...$})}shareDatabaseAwareness($){return($.client??this.client).put({url:"/databases/{id}/awareness",...$,headers:{"Content-Type":"application/json",...$.headers}})}undoDatabaseChange($){return($.client??this.client).post({url:"/databases/{id}/changes/{change}/undo",...$})}importDatabaseTable($){return($.client??this.client).post({url:"/databases/{id}/import",...$,headers:{"Content-Type":"application/json",...$.headers}})}applyDatabaseOps($){return($.client??this.client).post({url:"/databases/{id}/ops",...$,headers:{"Content-Type":"application/json",...$.headers}})}getDatabasePermissions($){return($.client??this.client).get({url:"/databases/{id}/permissions",...$})}updateDatabasePermissions($){return($.client??this.client).patch({url:"/databases/{id}/permissions",...$,headers:{"Content-Type":"application/json",...$.headers}})}getDatabaseTableChanges($){return($.client??this.client).get({url:"/databases/{id}/tables/{table_id}/changes",...$})}listDatabaseColumnCasts($){return($.client??this.client).get({url:"/databases/{id}/tables/{table_id}/columns/{column_id}/casts",...$})}convertDatabaseColumn($){return($.client??this.client).post({url:"/databases/{id}/tables/{table_id}/columns/{column_id}/conversion",...$,headers:{"Content-Type":"application/json",...$.headers}})}inferDatabaseColumnType($){return($.client??this.client).post({url:"/databases/{id}/tables/{table_id}/columns/{column_id}/infer-type",...$,headers:{"Content-Type":"application/json",...$.headers}})}getDatabaseRowHistory($){return($.client??this.client).get({url:"/databases/{id}/tables/{table_id}/rows/{row_id}/history",...$})}getDatabaseViewPositions($){return($.client??this.client).get({url:"/databases/{id}/views/{view_id}/positions",...$})}listDatabaseWebhooks($){return($.client??this.client).get({url:"/databases/{id}/webhooks",...$})}createDatabaseWebhook($){return($.client??this.client).post({url:"/databases/{id}/webhooks",...$,headers:{"Content-Type":"application/json",...$.headers}})}deleteDatabaseWebhook($){return($.client??this.client).delete({url:"/databases/{id}/webhooks/{webhook_id}",...$})}transcribeDictation($){return($.client??this.client).post({bodySerializer:null,url:"/dictation/transcribe",...$,headers:{"Content-Type":"audio/webm",...$.headers}})}getUserDocumentsHandler($){return($.client??this.client).get({url:"/documents",...$})}createDocument($){return($.client??this.client).post({url:"/documents",...$,headers:{"Content-Type":"application/json",...$.headers}})}createMarkdownHandler($){return($.client??this.client).post({url:"/documents/create_markdown",...$,headers:{"Content-Type":"application/json",...$.headers}})}createSkillHandler($){return($.client??this.client).post({url:"/documents/create_skill",...$,headers:{"Content-Type":"application/json",...$.headers}})}createSnippetHandler($){return($.client??this.client).post({url:"/documents/create_snippet",...$,headers:{"Content-Type":"application/json",...$.headers}})}createTaskHandler($){return($.client??this.client).post({url:"/documents/create_task",...$,headers:{"Content-Type":"application/json",...$.headers}})}getGithubPullRequestTasks($){return($.client??this.client).post({url:"/documents/github_prs/tasks",...$,headers:{"Content-Type":"application/json",...$.headers}})}initializeUserDocuments($){return($?.client??this.client).post({url:"/documents/initialize_user_documents",...$})}getDocumentListHandler($){return($?.client??this.client).get({url:"/documents/list",...$})}validateDocumentPermissionsToken($){return($.client??this.client).post({url:"/documents/permissions_token/validate",...$,headers:{"Content-Type":"application/json",...$.headers}})}getDocumentPermissionsToken($){return($.client??this.client).post({url:"/documents/permissions_token/{document_id}",...$})}presaveDocumentHandler($){return($.client??this.client).put({url:"/documents/presave/{document_id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}getBatchPreviewHandler($){return($.client??this.client).post({url:"/documents/preview",...$,headers:{"Content-Type":"application/json",...$.headers}})}getDocumentByTeamSlug($){return($.client??this.client).get({url:"/documents/slug/{slug}",...$})}handler($){return($?.client??this.client).get({url:"/documents/starter_docs",...$})}getSystemSkillsHandler($){return($?.client??this.client).get({url:"/documents/system_skills",...$})}deleteDocument($){return($.client??this.client).delete({url:"/documents/{document_id}",...$})}getDocument($){return($.client??this.client).get({url:"/documents/{document_id}",...$})}editDocument($){return($.client??this.client).patch({url:"/documents/{document_id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}saveDocumentHandler($){return($.client??this.client).put({url:"/documents/{document_id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}getDocumentBranchName($){return($.client??this.client).get({url:"/documents/{document_id}/branch_name",...$})}copyDocument($){return($.client??this.client).post({url:"/documents/{document_id}/copy",...$,headers:{"Content-Type":"application/json",...$.headers}})}exportDocument($){return($.client??this.client).get({url:"/documents/{document_id}/export",...$})}getDocumentGithubPullRequests($){return($.client??this.client).get({url:"/documents/{document_id}/github_prs",...$})}getLocationHandler($){return($.client??this.client).get({url:"/documents/{document_id}/location",...$})}getDocumentLocationV3($){return($.client??this.client).get({url:"/documents/{document_id}/location_v3",...$})}permanentlyDeleteDocument($){return($.client??this.client).delete({url:"/documents/{document_id}/permanent",...$})}getDocumentProcessingResult($){return($.client??this.client).get({url:"/documents/{document_id}/processing",...$})}jobProcessingResultHandler($){return($.client??this.client).get({url:"/documents/{document_id}/processing/{job_id}",...$})}revertDeleteDocument($){return($.client??this.client).put({url:"/documents/{document_id}/revert_delete",...$})}getDocumentShortId($){return($.client??this.client).get({url:"/documents/{document_id}/short_id",...$})}simpleSave($){return($.client??this.client).put({url:"/documents/{document_id}/simple_save",...$})}getDocumentTeamShare($){return($.client??this.client).get({url:"/documents/{document_id}/team_share",...$})}setDocumentTeamShare($){return($.client??this.client).put({url:"/documents/{document_id}/team_share",...$,headers:{"Content-Type":"application/json",...$.headers}})}getDocumentTextContent($){return($.client??this.client).get({url:"/documents/{document_id}/text-content",...$})}getDocumentViewsHandler($){return($.client??this.client).get({url:"/documents/{document_id}/views",...$})}getDocumentVersion($){return($.client??this.client).get({url:"/documents/{document_id}/{document_version_id}",...$})}accessRequestsState($){return($.client??this.client).get({url:"/entities/{entity_type}/{entity_id}/access-requests",...$})}accessRequestsCancel($){return($.client??this.client).delete({url:"/entities/{entity_type}/{entity_id}/access-requests/mine",...$})}accessRequestsSubmit($){return($.client??this.client).put({url:"/entities/{entity_type}/{entity_id}/access-requests/mine",...$,headers:{"Content-Type":"application/json",...$.headers}})}accessRequestsResolve($){return($.client??this.client).post({url:"/entities/{entity_type}/{entity_id}/access-requests/{request_id}/resolve",...$,headers:{"Content-Type":"application/json",...$.headers}})}accessRequestsDirect($){return($.client??this.client).get({url:"/entities/{entity_type}/{entity_id}/direct-access",...$})}accessRequestsRemoveDirect($){return($.client??this.client).delete({url:"/entities/{entity_type}/{entity_id}/direct-access/{user_id}",...$})}accessRequestsSetDirect($){return($.client??this.client).put({url:"/entities/{entity_type}/{entity_id}/direct-access/{user_id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}getEntityPermission($){return($.client??this.client).get({url:"/entity/{entity_type}/{entity_id}/permissions",...$})}listFavorites($){return($?.client??this.client).get({url:"/favorites",...$})}addFavorite($){return($.client??this.client).post({url:"/favorites",...$,headers:{"Content-Type":"application/json",...$.headers}})}reorderFavorites($){return($.client??this.client).patch({url:"/favorites/reorder",...$,headers:{"Content-Type":"application/json",...$.headers}})}removeFavoriteByEntity($){return($.client??this.client).delete({url:"/favorites/{entity_type}/{entity_id}",...$})}getForeignEntityBySource($){return($.client??this.client).get({url:"/foreign_entity/by_source/{source}/{foreign_entity_id}",...$})}getForeignEntity($){return($.client??this.client).get({url:"/foreign_entity/{id}",...$})}listForms($){return($.client??this.client).get({url:"/forms",...$})}createForm($){return($.client??this.client).post({url:"/forms",...$,headers:{"Content-Type":"application/json",...$.headers}})}listAccessibleForms($){return($?.client??this.client).get({url:"/forms/accessible",...$})}getForm($){return($.client??this.client).get({url:"/forms/{id}",...$})}updateForm($){return($.client??this.client).patch({url:"/forms/{id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}collaborateForm($){return($.client??this.client).post({url:"/forms/{id}/collaboration",...$})}putFormLayout($){return($.client??this.client).put({url:"/forms/{id}/layout",...$,headers:{"Content-Type":"application/json",...$.headers}})}getFormPermissions($){return($.client??this.client).get({url:"/forms/{id}/permissions",...$})}updateFormPermissions($){return($.client??this.client).patch({url:"/forms/{id}/permissions",...$,headers:{"Content-Type":"application/json",...$.headers}})}submitFormResponse($){return($.client??this.client).post({url:"/forms/{id}/responses",...$,headers:{"Content-Type":"application/json",...$.headers}})}getMyFormResponse($){return($.client??this.client).get({url:"/forms/{id}/responses/mine",...$})}editMyFormResponse($){return($.client??this.client).put({url:"/forms/{id}/responses/mine",...$,headers:{"Content-Type":"application/json",...$.headers}})}getFormResponseSummary($){return($.client??this.client).get({url:"/forms/{id}/responses/summary",...$})}getFormTally($){return($.client??this.client).get({url:"/forms/{id}/tally",...$})}installSync($){return($?.client??this.client).get({url:"/github/install-sync",...$})}getGithubPullRequestFacets($){return($?.client??this.client).get({url:"/github_pull_requests/facets",...$})}getGithubPullRequest($){return($.client??this.client).get({url:"/github_pull_requests/{id}",...$})}getGithubPullRequestChanges($){return($.client??this.client).get({url:"/github_pull_requests/{id}/changes",...$})}getGithubPullRequestChangesPatch($){return($.client??this.client).get({url:"/github_pull_requests/{id}/changes/patch",...$})}createHarnessPairing($){return($.client??this.client).post({url:"/harness-pairings",...$,headers:{"Content-Type":"application/json",...$.headers}})}getHarnessPairing($){return($.client??this.client).get({url:"/harness-pairings/{code}",...$})}approveHarnessPairing($){return($.client??this.client).post({url:"/harness-pairings/{code}/approve",...$,headers:{"Content-Type":"application/json",...$.headers}})}claimHarnessPairing($){return($.client??this.client).post({url:"/harness-pairings/{pairing_id}/claim",...$,headers:{"Content-Type":"application/json",...$.headers}})}listHarnesses($){return($?.client??this.client).get({url:"/harnesses",...$})}deleteSelfHarness($){return($?.client??this.client).delete({url:"/harnesses/me",...$})}getSelfHarness($){return($?.client??this.client).get({url:"/harnesses/me",...$})}listHarnessAgents($){return($?.client??this.client).get({url:"/harnesses/me/agents",...$})}listHarnessSessions($){return($?.client??this.client).get({url:"/harnesses/me/sessions",...$})}deleteHarness($){return($.client??this.client).delete({url:"/harnesses/{harness_id}",...$})}healthHandler($){return($?.client??this.client).get({url:"/health",...$})}getHistoryHandler($){return($?.client??this.client).get({url:"/history",...$})}deleteHistoryHandler($){return($.client??this.client).delete({url:"/history/{item_type}/{item_id}",...$})}upsertHistoryHandler($){return($.client??this.client).post({url:"/history/{item_type}/{item_id}",...$})}listInitiatives($){return($?.client??this.client).get({url:"/initiatives",...$})}createInitiative($){return($.client??this.client).post({url:"/initiatives",...$,headers:{"Content-Type":"application/json",...$.headers}})}deleteInitiative($){return($.client??this.client).delete({url:"/initiatives/{initiative_id}",...$})}getInitiative($){return($.client??this.client).get({url:"/initiatives/{initiative_id}",...$})}updateInitiative($){return($.client??this.client).patch({url:"/initiatives/{initiative_id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}getInstructionsHandler($){return($?.client??this.client).get({url:"/instructions",...$})}createInstructionsHandler($){return($?.client??this.client).post({url:"/instructions",...$})}getItemsSoup($){return($?.client??this.client).get({url:"/items/soup",...$})}postItemsSoup($){return($.client??this.client).post({url:"/items/soup",...$,headers:{"Content-Type":"application/json",...$.headers}})}postItemsSoupAst($){return($.client??this.client).post({url:"/items/soup/ast",...$,headers:{"Content-Type":"application/json",...$.headers}})}postItemsSoupAstGrouped($){return($.client??this.client).post({url:"/items/soup/ast/grouped",...$,headers:{"Content-Type":"application/json",...$.headers}})}messageTimeline($){return($.client??this.client).get({url:"/messages/{parent_type}/{parent_id}",...$})}entityMessageCreate($){return($.client??this.client).post({url:"/messages/{parent_type}/{parent_id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}entityMessageDeleteMessage($){return($.client??this.client).delete({url:"/messages/{parent_type}/{parent_id}/items/{id}",...$})}entityMessageGetMessage($){return($.client??this.client).get({url:"/messages/{parent_type}/{parent_id}/items/{id}",...$})}entityMessageEdit($){return($.client??this.client).patch({url:"/messages/{parent_type}/{parent_id}/items/{id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}entityMessageReact($){return($.client??this.client).post({url:"/messages/{parent_type}/{parent_id}/items/{id}/reactions",...$,headers:{"Content-Type":"application/json",...$.headers}})}entityMessageLegacy($){return($.client??this.client).get({url:"/messages/{parent_type}/{parent_id}/legacy/{legacy_id}",...$})}entityMessageDeleteThread($){return($.client??this.client).delete({url:"/messages/{parent_type}/{parent_id}/threads/{id}",...$})}entityMessageGetThread($){return($.client??this.client).get({url:"/messages/{parent_type}/{parent_id}/threads/{id}",...$})}entityMessagePatchThread($){return($.client??this.client).patch({url:"/messages/{parent_type}/{parent_id}/threads/{id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}messageTimelineEntries($){return($.client??this.client).get({url:"/messages/{parent_type}/{parent_id}/timeline",...$})}entityMessageTyping($){return($.client??this.client).post({url:"/messages/{parent_type}/{parent_id}/typing",...$,headers:{"Content-Type":"application/json",...$.headers}})}getPinsHandler($){return($?.client??this.client).get({url:"/pins",...$})}reorderPinsHandler($){return($.client??this.client).patch({url:"/pins",...$,headers:{"Content-Type":"application/json",...$.headers}})}removePinHandler($){return($.client??this.client).delete({url:"/pins/{pinned_item_id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}addPinHandler($){return($.client??this.client).post({url:"/pins/{pinned_item_id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}getProjectsHandler($){return($?.client??this.client).get({url:"/projects",...$})}createProjectHandler($){return($.client??this.client).post({url:"/projects",...$,headers:{"Content-Type":"application/json",...$.headers}})}getPendingProjectsHandler($){return($?.client??this.client).get({url:"/projects/pending",...$})}getBatchProjectPreview($){return($.client??this.client).post({url:"/projects/preview",...$,headers:{"Content-Type":"application/json",...$.headers}})}uploadFolderHandler($){return($.client??this.client).post({url:"/projects/upload",...$,headers:{"Content-Type":"application/json",...$.headers}})}uploadExtractFolderHandler($){return($.client??this.client).post({url:"/projects/upload_extract",...$,headers:{"Content-Type":"application/json",...$.headers}})}deleteProjectHandler($){return($.client??this.client).delete({url:"/projects/{id}",...$})}getProjectHandler($){return($.client??this.client).get({url:"/projects/{id}",...$})}getProjectUserAccessLevel($){return($.client??this.client).get({url:"/projects/{id}/access_level",...$})}getProjectContentHandler($){return($.client??this.client).get({url:"/projects/{id}/content",...$})}permanentlyDeleteProject($){return($.client??this.client).delete({url:"/projects/{id}/permanent",...$})}getProjectPermissionsV2($){return($.client??this.client).get({url:"/projects/{id}/permissions",...$})}revertDeleteProject($){return($.client??this.client).put({url:"/projects/{id}/revert_delete",...$})}recentlyDeleted($){return($?.client??this.client).get({url:"/recents/deleted",...$})}listEmailReminders($){return($?.client??this.client).get({url:"/reminders/email/collection",...$})}getEmailFollowup($){return($.client??this.client).get({url:"/reminders/email/{thread_id}",...$})}setEmailFollowup($){return($.client??this.client).put({url:"/reminders/email/{thread_id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}getViewsHandler($){return($?.client??this.client).get({url:"/saved_views",...$})}createViewHandler($){return($.client??this.client).post({url:"/saved_views",...$,headers:{"Content-Type":"application/json",...$.headers}})}excludeDefaultViewHandler($){return($.client??this.client).post({url:"/saved_views/exclude_default",...$,headers:{"Content-Type":"application/json",...$.headers}})}deleteViewHandler($){return($.client??this.client).delete({url:"/saved_views/{saved_view_id}",...$})}patchViewHandler($){return($.client??this.client).patch({url:"/saved_views/{saved_view_id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}listSlackImports($){return($?.client??this.client).get({url:"/slack/imports",...$})}createSlackImport($){return($.client??this.client).post({url:"/slack/imports",...$,headers:{"Content-Type":"application/json",...$.headers}})}getSlackImport($){return($.client??this.client).get({url:"/slack/imports/{job_id}",...$})}cancelSlackImport($){return($.client??this.client).post({url:"/slack/imports/{job_id}/cancel",...$})}finalizeSlackImport($){return($.client??this.client).post({url:"/slack/imports/{job_id}/finalize",...$})}registerSlackImportUploads($){return($.client??this.client).post({url:"/slack/imports/{job_id}/uploads",...$,headers:{"Content-Type":"application/json",...$.headers}})}completeSlackImportUploads($){return($.client??this.client).post({url:"/slack/imports/{job_id}/uploads/complete",...$,headers:{"Content-Type":"application/json",...$.headers}})}bulkWakeupSyncServiceDocuments($){return($.client??this.client).post({url:"/sync_service/wakeup",...$,headers:{"Content-Type":"application/json",...$.headers}})}editThreadV2($){return($.client??this.client).patch({url:"/threads/{thread_id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}listUserApiKeys($){return($?.client??this.client).get({url:"/user-api-keys",...$})}createUserApiKey($){return($.client??this.client).post({url:"/user-api-keys",...$,headers:{"Content-Type":"application/json",...$.headers}})}deleteUserApiKey($){return($.client??this.client).delete({url:"/user-api-keys/{id}",...$})}deleteUserDocumentViewLocation($){return($.client??this.client).delete({url:"/user_document_view_location/{document_id}",...$})}getUserDocumentViewLocation($){return($.client??this.client).get({url:"/user_document_view_location/{document_id}",...$})}upsertUserDocumentViewLocation($){return($.client??this.client).post({url:"/user_document_view_location/{document_id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}getDocumentPermissionsV2($){return($.client??this.client).get({url:"/v2/documents/{document_id}/permissions",...$})}editProjectV2($){return($.client??this.client).patch({url:"/v2/projects/{id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}streamEvents($){return($.client??this.client).sse.get({url:"/webhook/events/stream",...$})}listWebhooks($){return($?.client??this.client).get({url:"/webhook/webhooks",...$})}createWebhook($){return($.client??this.client).post({url:"/webhook/webhooks",...$,headers:{"Content-Type":"application/json",...$.headers}})}deleteWebhook($){return($.client??this.client).delete({url:"/webhook/webhooks/{webhook_id}",...$})}getWebhook($){return($.client??this.client).get({url:"/webhook/webhooks/{webhook_id}",...$})}patchWebhook($){return($.client??this.client).patch({url:"/webhook/webhooks/{webhook_id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}validateWebhook($){return($.client??this.client).post({url:"/webhook/webhooks/{webhook_id}/validate",...$})}}var MS={dev:"https://dev.macro.com",prod:"https://macro.com",local:"http://localhost:3000"},Z0={dev:{"agent-harness":"https://dev-gateway.macro.com/agent-harness",storage:"https://dev-gateway.macro.com/dss",auth:"https://dev-gateway.macro.com/auth",email:"https://dev-gateway.macro.com/email",calendar:"https://dev-gateway.macro.com/calendar",cognition:"https://dev-gateway.macro.com/cognition",notification:"https://dev-gateway.macro.com/notification",properties:"https://dev-gateway.macro.com/dss",search:"https://dev-gateway.macro.com/dss","scheduled-action":"https://dev-gateway.macro.com/scheduled-action","static-files":"https://static-file-service-dev.macro.com",connection:"https://dev-gateway.macro.com/connection-gateway",contacts:"https://dev-gateway.macro.com/contacts",unfurl:"https://dev-gateway.macro.com/unfurl"},prod:{"agent-harness":"https://gateway.macro.com/agent-harness",storage:"https://gateway.macro.com/dss",auth:"https://gateway.macro.com/auth",email:"https://gateway.macro.com/email",calendar:"https://gateway.macro.com/calendar",cognition:"https://gateway.macro.com/cognition",notification:"https://gateway.macro.com/notification",properties:"https://gateway.macro.com/dss",search:"https://gateway.macro.com/dss","scheduled-action":"https://gateway.macro.com/scheduled-action","static-files":"https://static-file-service.macro.com",connection:"https://gateway.macro.com/connection-gateway",contacts:"https://gateway.macro.com/contacts",unfurl:"https://gateway.macro.com/unfurl"},local:{"agent-harness":"http://localhost:8101",storage:"http://localhost:8086",auth:"http://localhost:8080",email:"http://localhost:8087",calendar:"http://localhost:8088/calendar",cognition:"http://localhost:8085",notification:"http://localhost:8089",properties:"http://localhost:8086",search:"http://localhost:8086","scheduled-action":"http://localhost:8099","static-files":"http://localhost:8100",connection:"http://localhost:8082",contacts:"http://localhost:8083",unfurl:"http://localhost:8095"}};function e6($,O){let x=O?.channel_id;return O&&x?{channel:f.byId($,x),thread:new P$($,x,O.thread_id)}:{channel:void 0,thread:void 0}}function B$($,O){return{session:$$.byId($,O.session_id),owner:M.byId($,O.owner_id),...e6($,O.origin)}}function YO($,O,x){let j=O.origin?.channel_id;return j&&x?j$.byId($,j,x):void 0}function QO($,O){return O?M.byId($,O):void 0}function PS($,O){return d(O).with({event_type:"agent_session.opened"},({metadata:x})=>({event_type:"agent_session.opened",metadata:x,...B$($,x.identity)})).with({event_type:"agent_session.turn_started"},({metadata:x})=>({event_type:"agent_session.turn_started",metadata:x,...B$($,x.identity),actor:QO($,x.actor),announcement:YO($,x.identity,x.announcement_message_id)})).with({event_type:"agent_session.turn_ended"},({metadata:x})=>({event_type:"agent_session.turn_ended",metadata:x,...B$($,x.identity),actor:QO($,x.actor),announcement:YO($,x.identity,x.announcement_message_id)})).with({event_type:"agent_session.command_rejected"},({metadata:x})=>({event_type:"agent_session.command_rejected",metadata:x,...B$($,x.identity),actor:QO($,x.actor),announcement:YO($,x.identity,x.announcement_message_id)})).with({event_type:"agent_session.settled"},({metadata:x})=>({event_type:"agent_session.settled",metadata:x,...B$($,x.identity),actor:QO($,x.last_turn?.actor),announcement:YO($,x.identity,x.last_turn?.announcement_message_id)})).with({event_type:"agent_session.waiting_for_input"},({metadata:x})=>({event_type:"agent_session.waiting_for_input",metadata:x,...B$($,x.identity),announcement:YO($,x.identity,x.announcement_message_id)})).with({event_type:"agent_session.input_received"},({metadata:x})=>({event_type:"agent_session.input_received",metadata:x,...B$($,x.identity)})).with({event_type:"agent_session.mentioned"},({metadata:x})=>({event_type:"agent_session.mentioned",metadata:x,...B$($,x.identity),mentionedBy:QO($,x.mentioned_by),mentioned:x.mentioned.map((j)=>M.byId($,j))})).with({event_type:"agent_session.stopped"},({metadata:x})=>({event_type:"agent_session.stopped",metadata:x,...B$($,x.identity),actor:QO($,x.turn_in_flight?.actor),announcement:YO($,x.identity,x.turn_in_flight?.announcement_message_id)})).with({event_type:"agent_session.renamed"},({metadata:x})=>({event_type:"agent_session.renamed",metadata:x,...B$($,x.identity)})).with({event_type:"agent_session.deleted"},({metadata:x})=>({event_type:"agent_session.deleted",metadata:x,...B$($,x.identity)})).exhaustive()}var _S="macro|";function J$($,O){return O.startsWith(_S)&&O.length>_S.length?M.byId($,O.toLowerCase()):void 0}function FS($,O){return d(O).with({event_type:"channel.created"},({metadata:x})=>({event_type:"channel.created",metadata:x,channel:f.byId($,x.channel_id),actor:J$($,x.actor),participants:x.participant_user_ids.map((j)=>M.byId($,j))})).with({event_type:"channel.updated"},({metadata:x})=>({event_type:"channel.updated",metadata:x,channel:f.byId($,x.channel_id),actor:J$($,x.actor)})).with({event_type:"channel.deleted"},({metadata:x})=>({event_type:"channel.deleted",metadata:x,channel:f.byId($,x.channel_id),actor:J$($,x.actor)})).with({event_type:"channel.picture_changed"},({metadata:x})=>({event_type:"channel.picture_changed",metadata:x,channel:f.byId($,x.channel_id),actor:J$($,x.actor)})).with({event_type:"channel.participant_added"},({metadata:x})=>({event_type:"channel.participant_added",metadata:x,channel:f.byId($,x.channel_id),addedBy:J$($,x.added_by),addedUsers:x.added_user_ids.map((j)=>M.byId($,j))})).with({event_type:"channel.participant_removed"},({metadata:x})=>({event_type:"channel.participant_removed",metadata:x,channel:f.byId($,x.channel_id),removedBy:M.byId($,x.removed_by),removedUsers:x.removed_user_ids.map((j)=>M.byId($,j))})).exhaustive()}function ES($,O){return d(O).with({event_type:"document.created"},({metadata:x})=>({event_type:"document.created",metadata:x,document:E.byId($,x.document_id),owner:M.byId($,x.owner),project:x.project_id?u.byId($,x.project_id):void 0})).with({event_type:"document.updated"},({metadata:x})=>({event_type:"document.updated",metadata:x,document:E.byId($,x.document_id),owner:M.byId($,x.owner),actor:x.actor_user_id?M.byId($,x.actor_user_id):void 0,project:x.project_id?u.byId($,x.project_id):void 0,previousProject:x.previous_project_id?u.byId($,x.previous_project_id):void 0})).with({event_type:"document.deleted"},({metadata:x})=>({event_type:"document.deleted",metadata:x,document:E.byId($,x.document_id),actor:x.actor_user_id?M.byId($,x.actor_user_id):void 0,project:x.project_id?u.byId($,x.project_id):void 0})).with({event_type:"document.content_uploaded"},({metadata:x})=>({event_type:"document.content_uploaded",metadata:x,document:E.byId($,x.document_id),owner:M.byId($,x.owner)})).with({event_type:"document.sync_content_updated"},({metadata:x})=>({event_type:"document.sync_content_updated",metadata:x,document:E.byId($,x.document_id)})).with({event_type:"document.purged"},({metadata:x})=>({event_type:"document.purged",metadata:x,document:E.byId($,x.document_id)})).with({event_type:"document.copied"},({metadata:x})=>({event_type:"document.copied",metadata:x,document:E.byId($,x.document_id),sourceDocument:E.byId($,x.source_document_id),owner:M.byId($,x.owner),project:x.project_id?u.byId($,x.project_id):void 0})).with({event_type:"document.interaction"},({metadata:x})=>({event_type:"document.interaction",metadata:x,document:E.byId($,x.document_id)})).exhaustive()}function JO($,O,x=[]){let j=O.parent;if(j.type==="call")return{type:"call",call:K$.byId($,j.id),message:k$.byId($,j.id,O.message_id),threadId:j.id};if(j.type==="channel")return{type:"channel",channel:f.byId($,j.id),message:j$.byId($,j.id,O.message_id,x),thread:O.thread_id?new P$($,j.id,O.thread_id):void 0};return{type:"document",document:E.byId($,j.id),comment:d$.byId($,j.id,O.message_id),threadId:O.root_id}}function wS($,O){return d(O).with({event_type:"message.posted"},({metadata:x})=>({event_type:"message.posted",metadata:x,target:JO($,x,x.mentions),sender:J$($,x.sender)})).with({event_type:"message.mentioned"},({metadata:x})=>({event_type:"message.mentioned",metadata:x,target:JO($,x),sender:J$($,x.sender)})).with({event_type:"message.patched"},({metadata:x})=>({event_type:"message.patched",metadata:x,target:JO($,x),actor:J$($,x.actor)})).with({event_type:"message.deleted"},({metadata:x})=>({event_type:"message.deleted",metadata:x,target:JO($,x),actor:J$($,x.actor)})).with({event_type:"message.attachment_created"},({metadata:x})=>({event_type:"message.attachment_created",metadata:x,target:JO($,x),actor:J$($,x.actor)})).with({event_type:"message.attachment_removed"},({metadata:x})=>({event_type:"message.attachment_removed",metadata:x,target:JO($,x),actor:J$($,x.actor)})).exhaustive()}async function qS($){let O=new TextEncoder,x=await crypto.subtle.importKey("raw",O.encode($.secret),{name:"HMAC",hash:"SHA-256"},!1,["sign"]),j=await crypto.subtle.sign("HMAC",x,O.encode(`${$.timestamp}.${$.rawBody}`));return`v1=${new Uint8Array(j).toHex()}`===$.signature}var t6="webhook.validation.test";function o6($,O){return d(O).with({event_type:O$.string.startsWith("document.")},(x)=>ES($,x)).with({event_type:O$.string.startsWith("channel.")},(x)=>FS($,x)).with({event_type:O$.string.startsWith("message.")},(x)=>wS($,x)).with({event_type:O$.string.startsWith("agent_session.")},(x)=>PS($,x)).otherwise(()=>{return})}class X0{client;secret;handlers=new Map;constructor($,O){this.client=$;this.secret=O}on($,O){let x=this.handlers.get($)??new Set;return x.add(O),this.handlers.set($,x),()=>x.delete(O)}onSelfMention($){return this.on("message.mentioned",async(O)=>{if(O.metadata.mentioned.entity_id.toLowerCase()!==(await this.client.myPrincipalId()).toLowerCase())return;await $(O)})}async listen($={}){let O=$.filters??this.filtersFromHandlers();if(O.length===0||O.every((K)=>K.events.length===0))throw new w("listen() needs filters — pass filters or register handlers with .on() first");let x=new AbortController;if($.signal)if($.signal.aborted)x.abort();else $.signal.addEventListener("abort",()=>x.abort(),{once:!0});let{stream:j}=await this.client.storage.streamEvents({query:{scope:$.scope??"user",filters:JSON.stringify(O)},signal:x.signal});return(async()=>{try{for await(let K of j)await this.dispatchEvent(K)}catch{if(x.signal.aborted)return;throw new w("event stream failed")}})().catch(()=>{}),()=>{x.abort()}}async handle($,O){if(!this.secret)throw new w("webhookSecret is required to verify incoming webhook deliveries");if(!await qS({secret:this.secret,timestamp:O.timestamp??"",rawBody:$,signature:O.signature??""}))throw new w("invalid webhook signature");if(O.event===t6)return;await this.dispatchEvent(JSON.parse($))}webhook(){if(!this.secret)throw new w("webhookSecret is required to verify incoming webhook deliveries");return async($)=>{return await this.handle(await $.text(),{event:$.headers.get("x-macro-event")??void 0,eventId:$.headers.get("x-macro-event-id")??void 0,timestamp:$.headers.get("x-macro-timestamp")??void 0,signature:$.headers.get("x-macro-signature")??void 0}),new Response("ok")}}filtersFromHandlers(){let $=[...this.handlers.entries()].filter(([,O])=>O.size>0).map(([O])=>O);return $.length>0?[{events:$}]:[]}async dispatchEvent($){let O=typeof $==="string"?JSON.parse($):$;if(O===null||typeof O!=="object"||!("event_type"in O))return;let x=O,j=this.handlers.get(x.event_type);if(!j||j.size===0)return;let S=o6(this.client,x);if(!S)return;await Promise.all([...j].map((K)=>K(S)))}}function fS(){return}var $7=0,K0;function O7($){K0=$}function L$($,O,x){if(!x&&!K0)return $;let j=(S)=>{for(let K of[K0,x])try{Promise.resolve(K?.(S)).catch(()=>{})}catch{}};return new Proxy($,{get(S,K,G){let Z=Reflect.get(S,K,G);if(typeof K!=="string"||typeof Z!=="function")return Z;return async(...X)=>{let L={id:++$7,service:O,operation:K};j({...L,status:"started"});try{let Y=await Reflect.apply(Z,S,X),Q=Y!==null&&typeof Y==="object"&&"error"in Y&&Y.error!=null;return j({...L,status:Q?"failed":"completed"}),Y}catch(Y){throw j({...L,status:"failed"}),Y}}}})}var gS="x-macro-user-api-key",x7="mak_",Y0="mbot_";function j7($){return d($).with(O$.string.startsWith(Y0),()=>{throw Error("bot token passed as a user credential. Use auth: { type: 'bot', token } or MACRO_BOT_TOKEN.")}).with(O$.string.startsWith(x7),(O)=>[gS,O]).otherwise((O)=>["Authorization",`Bearer ${O}`])}async function bS($){return typeof $==="function"?await $():$}async function S7($,O,x){return d($).with({type:"bot"},async(j)=>{let S=await bS(j.token);if(!S.startsWith(Y0))throw Error("user API key passed as a bot token. Use auth: { type: 'user', apiKey } or MACRO_API_KEY.");let K=[["x-macro-bot-token",S]];if(!x?.hasBotScope)K.push(["x-macro-bot-scope",j.scope??(O?"user":"team")]);if(O)K.push(["x-macro-bot-for-macro-user-id",O]);return K}).with({type:"user",apiKey:O$.string},({apiKey:j})=>{if(j.startsWith(Y0))throw Error("bot token passed as a user credential. Use auth: { type: 'bot', token } or MACRO_BOT_TOKEN.");return[[gS,j]]}).with({type:"user"},async({token:j})=>{return[j7(await bS(j))]}).exhaustive()}class Q0{agentHarness;auth;calendar;cognition;contacts;email;notification;properties;search;storage;webAppUrl;wsVerify;events;authConfig;hosts;localPortmap;requestedAs;selfBotRecord;selfPrincipal;constructor($){let O=G7($),x=O==="local"?fS():void 0,j={...Z0[O],...x?.hosts,...$.hosts};this.hosts=j,this.localPortmap=x;let S=typeof process<"u"?{}.MACRO_WEB_URL:void 0;if(this.webAppUrl=$.webAppUrl??S??x?.webAppUrl??MS[O],this.authConfig=Z7($),this.requestedAs=$.requestedAs,this.requestedAs&&this.authConfig.type!=="bot")throw Error("requestedAs() requires bot auth — a user token always acts as its own user");this.wsVerify=$.wsVerify,this.agentHarness=L$(new aO({client:this.makeClient(j["agent-harness"])}),"agent-harness",$.onRequest),this.auth=L$(new tO({client:this.makeClient(j.auth)}),"auth",$.onRequest),this.calendar=L$(new jx({client:this.makeClient(j.calendar)}),"calendar",$.onRequest),this.cognition=L$(new Kx({client:this.makeClient(j.cognition)}),"cognition",$.onRequest),this.contacts=L$(new Wx({client:this.makeClient(j.contacts)}),"contacts",$.onRequest),this.email=L$(new zx({client:this.makeClient(j.email)}),"email",$.onRequest),this.notification=L$(new Ax({client:this.makeClient(j.notification)}),"notification",$.onRequest),this.properties=L$(new _x({client:this.makeClient(j.properties)}),"properties",$.onRequest),this.search=L$(new fx({client:this.makeClient(j.search)}),"search",$.onRequest),this.storage=L$(new hx({client:this.makeClient(j.storage)}),"storage",$.onRequest);let K=typeof process<"u"?{}.MACRO_WEBHOOK_SECRET:void 0,G=$.webhookSecret??K;this.events=new X0(this,G)}hasActingUser(){return this.authConfig.type==="user"||this.requestedAs!==void 0}selfBot(){return this.selfBotRecord??=new BO(this).me().catch(($)=>{throw this.selfBotRecord=void 0,$}),this.selfBotRecord}myPrincipalId(){return this.selfPrincipal??=(this.authConfig.type==="bot"?this.selfBot().then(($)=>`bot|${$.id}`):M.me(this).then(($)=>$.id)).catch(($)=>{throw this.selfPrincipal=void 0,$}),this.selfPrincipal}makeClient($){let O=FO({baseUrl:$});return O.interceptors.request.use(async(x)=>{let j=await S7(this.authConfig,this.requestedAs,{hasBotScope:x.headers.has("x-macro-bot-scope")});for(let[S,K]of j)x.headers.set(S,K);return x}),O}}function G7($){if($.env)return $.env;let O=typeof process<"u"?{}.MACRO_ENV:void 0;if(!O)return"prod";if(!(O in Z0))throw Error(`invalid MACRO_ENV "${O}" — expected local, dev, or prod`);return O}function Z7($){if($.auth)return $.auth;if($.token)return{type:"user",token:$.token};let O=typeof process<"u"?{}.MACRO_API_KEY:void 0,x=typeof process<"u"?{}.MACRO_BOT_TOKEN:void 0;if(O&&x)throw Error("both MACRO_API_KEY and MACRO_BOT_TOKEN are set — pass auth to new Macro() to pick one");if(x)return{type:"bot",token:x};return{type:"user",token:O??(()=>{throw Error("no Macro credential. Set MACRO_API_KEY (API key or bearer token) or MACRO_BOT_TOKEN, or pass token/auth to new Macro().")})}}class kS{agentSessions;ai;bots;calendar;calls;channels;chats;crm;databases;documents;email;favorites;foreignEntities;forms;notifications;pins;projects;properties;tasks;teams;users;webhooks;workspace;events;webAppUrl;_client;opts;constructor($){this.opts=$;let O=new Q0($);this._client=O,this.agentSessions=new mx(O),this.ai=new cx(O),this.bots=new BO(O),this.calendar=new dx(O),this.calls=new ux(O),this.channels=new rx(O),this.chats=new px(O),this.crm=new ax(O),this.databases=new jj(O),this.documents=new Sj(O),this.email=new Gj(O),this.favorites=new Zj(O),this.foreignEntities=new Xj(O),this.forms=new Kj(O),this.notifications=new Yj(O),this.pins=new Qj(O),this.projects=new Jj(O),this.properties=new Vj(O),this.tasks=new Wj(O),this.teams=new Bj(O),this.users=new Lj(O),this.webhooks=new Nj(O),this.workspace=new Tj(O),this.events=O.events,this.webAppUrl=O.webAppUrl}myPrincipalId(){return this._client.myPrincipalId()}requestedAs($){return new kS({...this.opts,requestedAs:$.id})}}export{b$ as wrapXml,e as toBody,O7 as observeRequests,vS as msg,hS as here,Z$ as SessionReview,vx as ReviewItem,xj as MacroOpRefusedError,kS as Macro,f$ as FormSection,e$ as FormResponse,mO as FormReference,q$ as FormQuestion,n$ as FormOption,D$ as Form,WO as CodeExecution};+async function bO($,O,j){if(!Number.isInteger(O)||O<1)throw RangeError(`concurrency limit must be a positive integer, got ${O}`);let x=Array($.length),S=0,K=async()=>{while(S<$.length){let X=S;S+=1,x[X]=await j($[X])}},Z=Array.from({length:Math.min(O,$.length)},K);return await Promise.all(Z),x}class J${loader;value;inflight;constructor($,O){this.loader=$;this.value=O}get(){if(this.value!==void 0)return Promise.resolve(this.value);return this.inflight??=this.loader().then(($)=>{return this.value=$,$}),this.inflight}peek(){return this.value}clear(){this.value=void 0,this.inflight=void 0}}async function*a($){let O;do{let j=await $(O),x=j.nextCursor??void 0;if(O!==void 0&&x!==void 0&&JSON.stringify(x)===JSON.stringify(O))throw Error("Pagination cursor did not advance");yield*j.items,O=x}while(O!==void 0)}class b extends Error{constructor($){super($);this.name="MacroError"}}class SO extends b{status;data;constructor($,O){super(`Macro API error ${$}`);this.status=$;this.data=O;this.name="MacroApiError"}}class w extends b{constructor($){super($);this.name="MacroNotFoundError"}}function J($){if($.error!==void 0)throw new SO($.response?.status??0,$.error);return $.data}class A{client;id;detail;constructor($,O,j){this.client=$;this.id=O;this.detail=new J$(()=>this.fetch(),j)}field($){return async()=>(await this.detail.get())[$]??void 0}mappedField($,O){return async()=>O((await this.detail.get())[$]??void 0)}toJSON(){let $=this.detail.peek();return $===void 0?{id:this.id}:{id:this.id,detail:$}}async mutate($){let O=J(await $(this.client));return this.detail.clear(),O}}class F$ extends A{async permission(){return J(await this.client.storage.getEntityPermission({path:{entity_type:this.entityType,entity_id:this.id}}))}async favorite(){return J(await this.client.storage.addFavorite({body:{entityId:this.id,entityType:this.entityType}})),this}async unfavorite(){return J(await this.client.storage.removeFavoriteByEntity({path:{entity_type:this.entityType,entity_id:this.id}})),this}}class S$ extends F${propertyReference(){return{entity_type:this.propertyEntityType,entity_id:this.id}}async properties($){let{properties:O}=J(await this.client.properties.getEntityProperties({path:{entity_type:this.propertyEntityType,entity_id:this.id},query:$?.includeMetadata!==void 0?{include_metadata:$.includeMetadata}:void 0}));return O}async setProperty($,O){J(await this.client.properties.setEntityProperty({path:{...this.propertyReference(),property_id:$.id},body:{value:O??null}}))}async updatePropertyOptions($){return J(await this.client.properties.bulkUpdateEntityPropertyOptions({path:this.propertyReference(),body:{properties:$.map((O)=>({property_id:O.property.id,...O.add?{add_option_ids:O.add.map((j)=>j.id)}:{},...O.remove?{remove_option_ids:O.remove.map((j)=>j.id)}:{}}))}}))}async deleteProperty($){J(await this.client.properties.deleteEntityProperty({path:{entity_property_id:$.property.id}}))}}function l$($,O){return`<${$}>${JSON.stringify(O)}</${$}>`}function H6($){return typeof $==="object"&&$!==null&&typeof $.toMention==="function"}var R6={toMention:()=>({tag:l$("m-group-mention",{groupAlias:"here"}),mention:{entity_type:"group",entity_id:"here"}})};function D6($,...O){let j="",x=[];for(let[S,K]of $.entries()){j+=K;let Z=O[S];if(Z===void 0)continue;if(H6(Z)){let X=Z.toMention();j+=X.tag,x.push(X.mention)}else j+=String(Z)}return{content:j,mentions:C6(x)}}function C6($){let O=new Set;return $.filter((j)=>{let x=`${j.entity_type}:${j.entity_id}`;if(O.has(x))return!1;return O.add(x),!0})}function $$($){return typeof $==="string"?{content:$,mentions:[]}:$}class V$ extends A{static byId($,O){return new V$($,O)}static from($,O){return new V$($,O.id,O)}async fetch(){let $=J(await this.client.storage.listHarnesses()).find((O)=>O.id===this.id);if(!$)throw new w(`Harness ${this.id} is unavailable`);return $}name=this.field("name");connected=this.field("connected");kind=this.field("kind");async delete(){await this.mutate(($)=>$.storage.deleteHarness({path:{harness_id:this.id}}))}}class N$ extends A{static byId($,O){return new N$($,O)}static from($,O){return new N$($,O.bot.id,O)}async fetch(){let $=J(await this.client.storage.listAgents()).find((O)=>O.bot.id===this.id);if(!$)throw new w(`Agent ${this.id} is unavailable`);return $}name=this.mappedField("bot",($)=>$.name);instructions=this.field("instructions");defaultModel=this.field("default_model");channels=this.mappedField("channel_ids",($)=>$.map((O)=>f.byId(this.client,O)));host=this.mappedField("harness_id",($)=>$?V$.byId(this.client,$):void 0);async update($){await this.mutate((O)=>O.storage.updateAgent({path:{agent_id:this.id},body:Fx($)}))}}function Fx($){let{channels:O,team:j,host:x,autoAcceptPermissions:S,avatarUrl:K,channelScope:Z,defaultModel:X,isCoding:G,...L}=$;return{...L,channel_ids:O?.map((Y)=>Y.id),team_id:j?.id,harness_id:x?.id,auto_accept_permissions:S,avatar_url:K,channel_scope:Z,default_model:X,is_coding:G}}async function Xj($,O,j){let{channelId:x,thread:S}=_6(O);if(await M6($)){let{id:Z}=J(await $.storage.entityMessageCreate({path:{parent_type:"channel",parent_id:x},body:{content:j.content,mentions:j.mentions,attachments:[],thread_id:S?.rootId??null,nonce:crypto.randomUUID()}}));return Z}if(S)throw new b("a user-owned bot can only post via the channel webhook endpoint, which "+"does not support threads — use a team-owned bot, or requestedAs(user), "+"to reply in a thread");let{message_id:K}=J(await $.storage.postChannelBotWebhook({path:{channel_id:x},body:{content:j.content},headers:{"x-macro-bot-scope":"user"}}));return K}function _6($){return"rootId"in $?{channelId:$.channelId,thread:$}:{channelId:$.id}}async function M6($){if($.authConfig.type!=="bot"||$.hasActingUser())return!0;let{owner:O}=await $.selfBot();return O?.type==="team"}class g${client;channelId;rootId;constructor($,O,j){this.client=$;this.channelId=O;this.rootId=j}toJSON(){return{channelId:this.channelId,rootId:this.rootId}}channel(){return f.byId(this.client,this.channelId)}root(){return e.byId(this.client,this.channelId,this.rootId)}async replies(){let{replies:$}=J(await this.client.storage.entityMessageGetThread({path:{parent_type:"channel",parent_id:this.channelId,id:this.rootId}}));return $.map((O)=>e.from(this.client,this.channelId,O))}async reply($){let O=await Xj(this.client,this,$$($));return e.byId(this.client,this.channelId,O)}}class e extends F${channelId;mentions;entityType="channel_message";constructor($,O,j,x=[],S){super($,j,S);this.channelId=O;this.mentions=x}get path(){return{parent_type:"channel",parent_id:this.channelId,id:this.id}}async fetch(){return J(await this.client.storage.entityMessageGetMessage({path:this.path}))}static byId($,O,j,x=[]){return new e($,O,j,x)}static from($,O,j){return new e($,O,j.id,j.mentions,j)}content=this.field("content");createdAt=this.field("created_at");editedAt=this.field("edited_at");updatedAt=this.field("updated_at");async author(){return M.byId(this.client,(await this.detail.get()).sender_id)}channel(){return f.byId(this.client,this.channelId)}thread(){return new g$(this.client,this.channelId,this.id)}async react($){return await this.mutate((O)=>O.storage.entityMessageReact({path:this.path,body:{add:!0,emoji:$}})),this}async unreact($){return await this.mutate((O)=>O.storage.entityMessageReact({path:this.path,body:{add:!1,emoji:$}})),this}async edit($){let{content:O,mentions:j}=$$($);return await this.mutate((x)=>x.storage.entityMessageEdit({path:this.path,body:{content:O,mentions:j}})),this}async delete(){await this.mutate(($)=>$.storage.entityMessageDeleteMessage({path:this.path}))}async reply($){return this.thread().reply($)}}class Gj{client;channel;record;constructor($,O,j){this.client=$;this.channel=O;this.record=j}agent(){return N$.byId(this.client,this.record.botId)}sessions(){return this.record.sessions.map(($)=>({session:i.byId(this.client,$.sessionId),isCurrent:$.isCurrent,createdAt:$.createdAt}))}turns(){return this.record.turns.map(($)=>new Ex(this.client,this,$))}async startFresh($){J(await this.client.agentHarness.startFreshAgentConversation({path:{channel_id:this.channel.id,bot_id:this.record.botId},body:{sessionId:$.id}}))}toJSON(){return{channelId:this.channel.id,agentId:this.record.botId}}}class Ex{client;conversation;record;constructor($,O,j){this.client=$;this.conversation=O;this.record=j}source(){return e.byId(this.client,this.conversation.channel.id,this.record.sourceMessageId)}session(){return i.byId(this.client,this.record.sessionId)}async retry($){J(await this.client.agentHarness.retryAgentConversationTurn({path:{channel_id:this.conversation.channel.id,bot_id:this.conversation.agent().id,source:this.record.sourceMessageId},body:{actionId:$}}))}toJSON(){return{channelId:this.conversation.channel.id,sourceMessageId:this.record.sourceMessageId}}}class W$ extends A{parent;toJSON(){return{...super.toJSON(),parentType:this.parent.type,parentId:this.parent.entity.id}}constructor($,O,j){super($,j);this.parent=O}static byId($,O,j){return new W$($,O,j)}get path(){return{parent_type:this.parent.type,parent_id:this.parent.entity.id,id:this.id}}async fetch(){return J(await this.client.storage.entityMessageGetThread({path:this.path})).state}resolved=this.field("resolved");async update($){let O={resolved:$.resolved,detach_anchor:$.detachAnchor,nonce:$.nonce};await this.mutate((j)=>j.storage.entityMessagePatchThread({path:this.path,body:O}))}async delete($){await this.mutate((O)=>O.storage.entityMessageDeleteThread({path:this.path,query:{nonce:$}}))}}async function E$($,O,j,x){for(let K of[...x?.messages??[],...x?.around?[x.around]:[]]){let Z="channelId"in K?{type:"channel",id:K.channelId}:("documentId"in K)?{type:"document",id:K.documentId}:("callId"in K)?{type:"call",id:K.callId}:K.parent;if(Z.type!==O.type||Z.id!==O.entity.id)throw Error("Timeline message belongs to another resource")}let S=J(await $.storage.messageTimelineEntries({path:{parent_type:O.type,parent_id:O.entity.id},query:{selection:x?JSON.stringify({cursor:x.cursor,around:x.around?.id,ids:x.messages?.map((K)=>K.id),activity_after:x.activityAfter,activity_before:x.activityBefore,anchored:x.anchored,direction:x.direction,include_deleted_threads:x.includeDeletedThreads,limit:x.limit}):void 0}}));return{entries:S.entries.map((K)=>{if(K.type==="activity")return{type:"activity",activity:{...K.activity,actor:M.byId($,K.activity.actor_id)}};return{type:"message",message:j(K.message)}}),nextCursor:S.next_cursor??void 0,previousCursor:S.previous_cursor??void 0}}var A6=50;function j$($){let{filters:O,type:j,make:x,includeCrm:S}=$;return(K,Z,X)=>{let G=X?.searchOn??"name_content",L=X?.pageSize??A6;return a(async(Y)=>{let{results:Q,next_cursor:T}=J(await K.search.unifiedSearch({body:{query:Z,match_type:"partial",search_on:G,...O?{filters:O}:{},...S?{include_crm:!0}:{}},query:{page_size:L,...Y?{cursor:Y}:{}}}));return{items:Q.filter((W)=>W.type===j).map((W)=>x(K,W)),nextCursor:T}})}}class ZO{client;channel;record;constructor($,O,j){this.client=$;this.channel=O;this.record=j}get id(){return this.record.id}user(){return M.byId(this.client,this.record.user_id)}createdAt(){return this.record.created_at}async recordInteraction($){return new ZO(this.client,this.channel,J(await this.client.storage.postActivity({body:{activity_type:$,channel_id:this.channel.id}})))}toJSON(){return this.record}}class f extends S${async recordActivity($){return new ZO(this.client,this,J(await this.client.storage.postActivity({body:{activity_type:$,channel_id:this.id}})))}async setPicture($){await this.mutate((O)=>O.storage.setChannelPicture({path:{channel_id:this.id},body:{profile_picture_id:$?.id??null}}))}messageThreadById($){return W$.byId(this.client,{type:"channel",entity:this},$)}timelinePage($){return E$(this.client,{type:"channel",entity:this},(O)=>e.from(this.client,this.id,O),$)}async agentConversations(){return J(await this.client.agentHarness.listAgentConversations({path:{channel_id:this.id}})).conversations.map(($)=>new Gj(this.client,this,$))}entityType="channel";propertyEntityType="CHANNEL";async fetch(){return J(await this.client.storage.getChannel({path:{channel_id:this.id}}))}static byId($,O){return new f($,O)}static async dm($,O){let{channel_id:j}=J(await $.storage.getOrCreateDm({body:{recipient_id:O.id}}));return new f($,j)}static async private($,O){let{channel_id:j}=J(await $.storage.getOrCreatePrivate({body:{recipients:O.map((x)=>x.id)}}));return new f($,j)}static async create($,O){let{id:j}=J(await $.storage.createChannel({body:{channel_type:O.type,name:O.name??null,participants:(O.participants??[]).map((x)=>x.id),team_id:O.team?.id??null}}));return new f($,j)}name=this.field("channel_name");type=this.field("channel_type");async send($,O){let j=await Xj(this.client,O?.thread??this,$$($));return e.byId(this.client,this.id,j)}messages($){return this.timeline({limit:$?.pageSize})}messagesAfter($,O){return this.timeline({activity_after:$ instanceof Date?$.toISOString():$,limit:O?.pageSize})}timeline($){return a(async(O)=>{let j=J(await this.client.storage.messageTimeline({path:{parent_type:"channel",parent_id:this.id},query:{selection:JSON.stringify({...$,cursor:O})}}));return{items:j.items.map((x)=>e.from(this.client,this.id,x)),nextCursor:j.next_cursor}})}message($){return e.byId(this.client,this.id,$)}async rename($){await this.mutate((O)=>O.storage.patchChannel({path:{channel_id:this.id},body:{channel_name:$}}))}async delete(){await this.mutate(($)=>$.storage.deleteChannel({path:{channel_id:this.id}}))}async join(){await this.mutate(($)=>$.storage.joinChannel({path:{channel_id:this.id}}))}async joinCode(){let{join_code:$}=J(await this.client.storage.getChannelJoinLink({path:{channel_id:this.id}}));return $}async leave(){await this.mutate(($)=>$.storage.leaveChannel({path:{channel_id:this.id}}))}async participants(){return J(await this.client.storage.getChannelParticipants({path:{channel_id:this.id}}))}async addParticipants($){await this.mutate((O)=>O.storage.addParticipants({path:{channel_id:this.id},body:{participants:$.map((j)=>j.id)}}))}async removeParticipants($){await this.mutate((O)=>O.storage.removeParticipants({path:{channel_id:this.id},body:{participants:$.map((j)=>j.id)}}))}async typing($,O){J(await this.client.storage.entityMessageTyping({path:{parent_type:"channel",parent_id:this.id},body:{active:$==="start",thread_id:O?.thread?.rootId??null}}))}attachments($){return a(async(O)=>{let j=J(await this.client.storage.getChannelAttachments({path:{channel_id:this.id},query:{...$?.pageSize?{limit:$.pageSize}:{},...$?.type?{attachment_type:$.type}:{},...O?{cursor:O}:{}}}));return{items:j.items,nextCursor:j.next_cursor}})}webUrl(){return`${this.client.webAppUrl}/app/channel/${this.id}`}static search=j$({type:"channel",make:($,O)=>new f($,O.channel_id)})}class M extends S${entityType="user";propertyEntityType="USER";async fetch(){let{names:$}=J(await this.client.auth.getUserNamesWithEmail({body:{user_ids:[this.id]}})),O=$.find((j)=>j.id===this.id);if(!O)throw new w(`user ${this.id} not found`);return O}static byId($,O){return new M($,O)}static async me($){let{user_id:O}=J(await $.auth.getUserInfo());return new M($,O)}async name(){let $=await this.detail.get();return[$.first_name,$.last_name].filter(Boolean).join(" ")||void 0}email(){let $=this.id.startsWith("macro|")?this.id.slice(6):void 0;return $?.includes("@")?$:void 0}dm(){return f.dm(this.client,this)}toMention(){return{tag:l$("m-user-mention",{userId:this.id}),mention:{entity_type:"user",entity_id:this.id}}}}class o{client;entityType;entity;constructor($,O,j){this.client=$;this.entityType=O;this.entity=j}get path(){return{entity_type:this.entityType,entity_id:this.entity.id}}async state($){let O=J(await this.client.storage.accessRequestsState({path:this.path,query:{offset:$}}));return{accessLevel:O.accessLevel??void 0,canReview:O.canReview,owner:O.owner?M.byId(this.client,O.owner):void 0,pendingCount:O.pendingCount,supportedLevels:O.supportedLevels,nextOffset:O.nextOffset??void 0,mine:O.mine?WO.from(this.client,this,O.mine):void 0,requests:O.requests.map((j)=>WO.from(this.client,this,j))}}async submit($,O){return WO.from(this.client,this,J(await this.client.storage.accessRequestsSubmit({path:this.path,body:{requestedLevel:$,revision:O}})))}async cancel($){J(await this.client.storage.accessRequestsCancel({path:this.path,query:{revision:$}}))}async direct(){return J(await this.client.storage.accessRequestsDirect({path:this.path})).map(($)=>({user:M.byId(this.client,$.userId),accessLevel:$.accessLevel}))}async grant($,O){J(await this.client.storage.accessRequestsSetDirect({path:{...this.path,user_id:$.id},body:{accessLevel:O}}))}async remove($){J(await this.client.storage.accessRequestsRemoveDirect({path:{...this.path,user_id:$.id}}))}async resolve($,O){let j=$.access.toJSON();if(j.entity_type!==this.entityType||j.entity_id!==this.entity.id)throw Error("Access request belongs to another entity");return J(await this.client.storage.accessRequestsResolve({path:{...this.path,request_id:$.id},body:O}))}toJSON(){return this.path}}class WO extends A{access;resolvedRecord;constructor($,O,j){super($,j.id,j);this.access=O}static from($,O,j){return new WO($,O,j)}async fetch(){if(this.resolvedRecord)return this.resolvedRecord;let $;do{let O=await this.access.state($),j=[O.mine,...O.requests].find((x)=>x?.id===this.id);if(j)return j.detail.get();$=O.nextOffset}while($!==void 0);throw new w(`Access request ${this.id} is unavailable`)}revision=this.field("revision");status=this.field("status");requestedLevel=this.field("requestedLevel");requester=this.mappedField("requesterId",($)=>M.byId(this.client,$));async resolve($){this.resolvedRecord=await this.access.resolve(this,{revision:await this.revision(),grantedLevel:$}),this.detail.clear()}}function r$($){return{...$,channelSharePermissions:$.channelSharePermissions===void 0||$.channelSharePermissions===null?$.channelSharePermissions:$.channelSharePermissions.map((O)=>({channelId:O.channel.id,accessLevel:O.accessLevel,operation:O.operation}))}}class B$ extends A{parent;constructor($,O,j,x){super($,j,x);this.parent=O}static byId($,O,j){return new B$($,O,j)}static fromRecord($,O,j){return new B$($,O,j.id,j)}static async create($,O,j){return B$.createForSession($,O.session(),j,O)}static async createForSession($,O,j,x){let S=J(await $.agentHarness.createSessionReview({path:{session_id:O.id},body:{...j,executionId:x?.id??null}}));return B$.fromRecord($,O,S)}static async list($,O){return J(await $.agentHarness.listExecutionReviews({path:{session_id:O.session().id,execution_id:O.id}})).map((x)=>B$.fromRecord($,O.session(),x))}async fetch(){return J(await this.client.agentHarness.getSessionReview({path:{session_id:this.parent.id,review_id:this.id}}))}title=this.field("title");kind=this.field("kind");session(){return this.parent}async reference(){return{kind:await this.kind(),id:this.id}}async items(){return(await this.detail.get()).items.map(($)=>new wx($,{edit:(O)=>this.decide({action:"edit",item:$.id,draft:O}),submit:()=>this.decide({action:"submit",items:[$.id]}),dismiss:()=>this.decide({action:"dismiss",items:[$.id]})}))}async refresh(){return this.detail.clear(),await this.detail.get(),this}async submitAll(){await this.decide({action:"submit",items:[]})}async dismissAll(){await this.decide({action:"dismiss",items:[]})}async decide($){let O=(await this.detail.get()).revision;await this.mutate((j)=>j.agentHarness.decideSessionReview({path:{session_id:this.parent.id,review_id:this.id},body:{...$,revision:O}}))}}class wx{snapshot;actions;constructor($,O){this.snapshot=$;this.actions=O}get id(){return this.snapshot.id}get status(){return this.snapshot.status}get draft(){return this.snapshot.draft}get result(){return this.snapshot.result}async edit($){await this.actions.edit($)}async submit(){await this.actions.submit()}async dismiss(){await this.actions.dismiss()}}class kO extends A{parent;constructor($,O,j){super($,O);this.parent=j}static byId($,O,j){return new kO($,j,O)}async fetch(){return J(await this.client.agentHarness.getCodeExecution({path:{session_id:this.parent.id,execution_id:this.id}}))}reviews={create:($)=>B$.create(this.client,this,$),list:()=>B$.list(this.client,this)};session(){return this.parent}status=this.field("status");source=this.field("source");calls=this.field("calls");error=this.field("error");async result(){return(await this.detail.get()).result}async refresh(){return this.detail.clear(),await this.detail.get(),this}}class Kj{client;sessionId;dto;constructor($,O,j){this.client=$;this.sessionId=O;this.dto=j}static from($,O,j){return new Kj($,O,j)}get actionId(){return this.dto.actionId}get kind(){return this.dto.kind}get prompt(){return this.dto.prompt??void 0}get attachments(){return this.dto.attachments??[]}get actorUserId(){return this.dto.actorUserId??void 0}get createdAt(){return this.dto.createdAt}async edit($){return J(await this.client.agentHarness.editQueuedAction({path:{session_id:this.sessionId,action_id:this.actionId},body:{prompt:$}})),this.dto={...this.dto,prompt:$},this}async steer(){J(await this.client.agentHarness.steerQueuedAction({path:{session_id:this.sessionId,action_id:this.actionId}}))}async remove(){J(await this.client.agentHarness.removeQueuedAction({path:{session_id:this.sessionId,action_id:this.actionId}}))}}class gO{client;session;id;constructor($,O,j){this.client=$;this.session=O;this.id=j}static byId($,O,j){return new gO($,O,j)}async answer($){return J(await this.client.agentHarness.answerAgentSessionToolApproval({path:{session_id:this.session.id,approval_id:this.id},body:{answer:$}}))}toJSON(){return{id:this.id,sessionId:this.session.id}}}class i extends A{access=new o(this.client,"agent_session",this);toolApprovalById($){return gO.byId(this.client,this,$)}async sharePermissions(){return J(await this.client.agentHarness.getAgentSessionPermissions({path:{session_id:this.id}}))}async updateSharePermissions($){return this.mutate((O)=>O.agentHarness.updateAgentSessionPermissions({path:{session_id:this.id},body:r$($)}))}static byId($,O){return new i($,O)}static async createManaged($,O){let{session:j}=J(await $.agentHarness.createAgentSession({body:{prompt:O?.prompt,instructions:O?.instructions,model:O?.model,repoUrl:O?.repoUrl,repoBranch:O?.repoBranch}}));return new i($,j.id,j)}static async repositories($){let{repositories:O}=J(await $.agentHarness.listAgentRepositories());return O.map((j)=>({url:j.url,defaultBranch:j.defaultBranch??void 0}))}static async repositoryBranches($,O){let{branches:j}=J(await $.agentHarness.listAgentRepositoryBranches({query:{repoUrl:O}}));return j}async fetch(){return J(await this.client.agentHarness.getAgentSession({path:{session_id:this.id}}))}name=this.field("name");isArchived=this.field("isArchived");model=this.field("model");harness=this.field("harness");repoUrl=this.field("repoUrl");workspace=this.field("workspace");instructions=this.field("instructions");status=this.field("status");sandboxSize=this.field("sandboxSize");createdAt=this.field("createdAt");modifiedAt=this.field("modifiedAt");static async forPullRequest($,O){let{sessionIds:j}=J(await $.agentHarness.agentSessionsForPullRequest({body:{url:O}}));return j.map((x)=>i.byId($,x))}async pullRequests(){let{pullRequests:$}=J(await this.client.agentHarness.listAgentSessionPullRequests({path:{session_id:this.id}}));return $.map((O)=>({githubKey:O.githubKey,url:O.url,source:O.source,linkedBy:O.linkedBy?M.byId(this.client,O.linkedBy):void 0,createdAt:O.createdAt}))}async linkPullRequest($){J(await this.client.agentHarness.linkAgentSessionPullRequest({path:{session_id:this.id},body:{url:$}}))}async unlinkPullRequest($){J(await this.client.agentHarness.unlinkAgentSessionPullRequest({path:{session_id:this.id},query:{url:$}}))}async rename($){await this.mutate((O)=>O.agentHarness.renameAgentSession({path:{session_id:this.id},body:{name:$}}))}async archive(){await this.setArchived(!0)}async unarchive(){await this.setArchived(!1)}async setArchived($){await this.mutate((O)=>O.agentHarness.setAgentSessionArchived({path:{session_id:this.id},body:{isArchived:$}}))}async setSandboxSize($){let{size:O}=await this.mutate((j)=>j.agentHarness.putAgentSessionSandboxSize({path:{session_id:this.id},body:{size:$}}));return O}static async defaultSandboxSize($){return J(await $.agentHarness.getAgentSandboxSize()).size}static async setDefaultSandboxSize($,O){return J(await $.agentHarness.putAgentSandboxSize({body:{size:O}})).size}static async codingPreferences($){return J(await $.agentHarness.getAgentCodingPreferences())}static async setCodingPreferences($,O){return J(await $.agentHarness.putAgentCodingPreferences({body:O}))}async control($){return this.mutate((O)=>O.agentHarness.controlAgentSession({path:{session_id:this.id},body:$}))}prompt($,O){return this.control({type:"prompt",prompt:$,...O&&O.length>0?{attachments:O}:{}})}async queue(){let{entries:$}=J(await this.client.agentHarness.getAgentSessionQueue({path:{session_id:this.id}}));return $.map((O)=>Kj.from(this.client,this.id,O))}async changes(){return J(await this.client.agentHarness.getAgentSessionChanges({path:{session_id:this.id}}))}async changesPatch(){return J(await this.client.agentHarness.getAgentSessionChangesPatch({path:{session_id:this.id}})).patch}async refreshChanges(){return this.mutate(($)=>$.agentHarness.refreshAgentSessionChanges({path:{session_id:this.id}}))}async log(){return J(await this.client.agentHarness.getAgentSessionLog({path:{session_id:this.id}}))}reviews={create:($)=>B$.createForSession(this.client,this,$),byId:($)=>B$.byId(this.client,this,$)};codeExecutions={byId:($)=>kO.byId(this.client,this,$)};async delete(){await this.mutate(($)=>$.agentHarness.deleteAgentSession({path:{session_id:this.id}}))}}class qx{client;constructor($){this.client=$}byId($){return i.byId(this.client,$)}createManaged($){return i.createManaged(this.client,$)}repositories(){return i.repositories(this.client)}repositoryBranches($){return i.repositoryBranches(this.client,$)}forPullRequest($){return i.forPullRequest(this.client,$)}defaultSandboxSize(){return i.defaultSandboxSize(this.client)}setDefaultSandboxSize($){return i.setDefaultSandboxSize(this.client,$)}codingPreferences(){return i.codingPreferences(this.client)}setCodingPreferences($){return i.setCodingPreferences(this.client,$)}}class fx{client;constructor($){this.client=$}byId($){return N$.byId(this.client,$)}async list(){return J(await this.client.storage.listAgents()).map(($)=>N$.from(this.client,$))}async create($){return N$.from(this.client,J(await this.client.storage.createAgent({body:Fx($)})))}}class bx{client;async usage($={}){let{users:O,...j}=$;return J(await this.client.cognition.getUsageHandler({body:{...j,include_users:O?.map((x)=>x.id)}}))}constructor($){this.client=$}async structuredCompletion($){return J(await this.client.cognition.structuredCompletion({body:$}))}async decide($){return J(await this.client.cognition.decisions({body:$}))}}class p$ extends A{static byId($,O){return new p$($,O)}static from($,O){return new p$($,O.id,{id:O.id,name:O.name,createdAt:O.createdAt})}async fetch(){let $=J(await this.client.storage.listUserApiKeys()).keys.find((O)=>O.id===this.id);if(!$)throw new w(`API key ${this.id} is unavailable`);return $}name=this.field("name");createdAt=this.field("createdAt");async delete(){await this.mutate(($)=>$.storage.deleteUserApiKey({path:{id:this.id}}))}}class kx{client;constructor($){this.client=$}byId($){return p$.byId(this.client,$)}async list(){return J(await this.client.storage.listUserApiKeys()).keys.map(($)=>p$.from(this.client,$))}async create($){let O=J(await this.client.storage.createUserApiKey({body:{name:$}}));return{key:p$.from(this.client,O),secret:O.key}}async tokenForEmail($){return J(await this.client.auth.macroApiToken({query:{email:$}}))}}class yO{client;constructor($){this.client=$}async me(){if(this.client.authConfig.type!=="bot")throw new b("bots.me() requires bot auth — a user API key has no bot identity");return J(await this.client.storage.getSelfBot())}async channels(){if(this.client.authConfig.type!=="bot")throw new b("bots.channels() requires bot auth — a user API key has no bot identity");let $=await this.me();return J(await this.client.storage.listBotChannels({path:{bot_id:$.id}}))}async myPrincipalId(){if(this.client.authConfig.type!=="bot")throw new b("bots.myPrincipalId() requires bot auth — a user API key has no bot identity");return this.client.myPrincipalId()}}class U$ extends A{async fetch(){let{links:$}=J(await this.client.email.listLinks()),O=$.find((j)=>j.id===this.id);if(!O)throw new w(`email link ${this.id} not found`);return O}static byId($,O){return new U$($,O)}static async list($){let{links:O}=J(await $.email.listLinks());return O.map((j)=>new U$($,j.id,j))}emailAddress=this.field("email_address");provider=this.field("provider");isPrimary=this.field("is_primary");isSyncActive=this.field("is_sync_active");syncStatus=this.field("sync_status");needsReauth=this.field("needs_reauth");photoUrl=this.field("photo_url");async settingsOperations(){return J(await this.client.email.mailboxSettingsOperations({headers:{"X-Email-Link-Id":this.id}}))}}class y$ extends A{async setContributesToAvailability($){await this.mutate((O)=>O.calendar.setAvailabilityCalendar({path:{calendar_id:this.id},body:{contributesToAvailability:$}}))}async fetch(){let{calendars:$}=J(await this.client.calendar.listCalendars()),O=$.find((j)=>j.id===this.id);if(!O)throw new w(`calendar ${this.id} not found`);return O}static byId($,O){return new y$($,O)}static async list($){let{calendars:O}=J(await $.calendar.listCalendars());return O.map((j)=>new y$($,j.id,j))}name=this.field("name");emailAddress=this.field("emailAddress");isPrimary=this.field("isPrimary");isWritable=this.field("isWritable");isSubscription=this.field("isSubscription");color=this.field("color");syncError=this.field("syncError");emailLink=this.mappedField("emailLinkId",($)=>U$.byId(this.client,$))}class vO{client;id;constructor($,O){this.client=$;this.id=O}async status(){return J(await this.client.calendar.calendarReplacementStatus({path:{operation_id:this.id}}))}async confirm(){return J(await this.client.calendar.confirmCalendarReplacement({path:{operation_id:this.id}}))}async discard(){J(await this.client.calendar.discardCalendarReplacement({path:{operation_id:this.id}}))}}class z$ extends A{async fetch(){throw new b(`calendar event ${this.id} has no fetch-by-id endpoint; read the record returned by calendar.createEvent / event.update / event.rsvp instead`)}static byId($,O){return new z$($,O)}static fromRecord($,O){return new z$($,O.id,O)}title=this.field("title");description=this.field("description");location=this.field("location");time=this.field("time");status=this.field("status");attendees=this.field("attendees");transparency=this.field("transparency");isReadOnly=this.field("isReadOnly");recurrenceLines=this.field("recurrenceLines");calendar=this.mappedField("calendarId",($)=>$?y$.byId(this.client,$):void 0);record(){return this.detail.get()}async update($){let O=await this.mutate((j)=>j.calendar.updateCalendarEvent({path:{event_id:this.id},body:P6($)}));return z$.fromRecord(this.client,O)}async delete($={}){await this.mutate((O)=>O.calendar.deleteCalendarEvent({path:{event_id:this.id},query:{calendarId:$.calendar?.id,scope:$.scope,recurrenceId:$.recurrenceId}}))}async prepareReplacement($){let O=J(await this.client.calendar.prepareCalendarReplacement({path:{event_id:this.id},body:{removeConference:$.removeConference,recurrenceId:$.recurrenceId,calendarId:$.calendar?.id}}));return new vO(this.client,O.operationId)}async providerUrl($={}){return J(await this.client.calendar.calendarEventProviderUrl({path:{event_id:this.id},query:{recurrenceId:$.recurrenceId,calendarId:$.calendar?.id}})).url??void 0}async rsvp($){let O=await this.mutate((j)=>j.calendar.rsvpCalendarEvent({path:{event_id:this.id},body:{response:$.response,scope:$.scope,recurrenceId:$.recurrenceId,calendarId:$.calendar?.id}}));return z$.fromRecord(this.client,O)}}function P6($){return{title:$.title,description:$.description,location:$.location,time:$.time,attendees:$.attendees,recurrenceLines:$.recurrenceLines,visibility:$.visibility,transparency:$.transparency,reminders:$.reminders,conference:$.conference,outOfOffice:$.outOfOffice,scope:$.scope,recurrenceId:$.recurrenceId,calendarId:$.calendar?.id}}class gx{client;async availabilityCalendars(){return J(await this.client.calendar.getAvailabilityCalendars()).calendars.map(($)=>({calendar:y$.byId(this.client,$.calendarId),name:$.name,isPrimary:$.isPrimary,contributesToAvailability:$.contributesToAvailability}))}async teamSharing(){return J(await this.client.calendar.getTeamSharing()).sharing}async setTeamSharing($){return J(await this.client.calendar.setTeamSharing({body:{sharing:$}})).sharing}occurrences($){return a(async(O)=>{let j=J(await this.client.storage.listOccurrences({query:{...$,cursor:O}}));return{items:j.items.map((x)=>({event:z$.fromRecord(this.client,x.event),occurrence:x.occurrence})),nextCursor:j.nextCursor}})}async teamPage($){let O=J(await this.client.storage.listTeamCalendar({query:$}));return{items:O.items.map(({ownerId:j,...x})=>({...x,owner:M.byId(this.client,j)})),members:O.members.map((j)=>({user:M.byId(this.client,j.userId),sharing:j.sharing,coverage:j.coverage})),nextCursor:O.nextCursor??void 0}}async teamOutOfOffice($){let O=J(await this.client.storage.listTeamOutOfOffice({query:$}));return{items:O.items.map((j)=>({event:z$.byId(this.client,j.eventId),owner:M.byId(this.client,j.ownerId),occurrenceKey:j.occurrenceKey,time:j.time,title:j.title??void 0})),hasMore:O.hasMore}}constructor($){this.client=$}calendars(){return y$.list(this.client)}calendar($){return y$.byId(this.client,$)}event($){return z$.byId(this.client,$)}replacement($){return new vO(this.client,$)}async createEvent($){let O=J(await this.client.calendar.createCalendarEvent({body:F6($)}));return z$.fromRecord(this.client,O)}}function F6($){return{title:$.title,time:$.time,description:$.description,location:$.location,attendees:$.attendees,recurrenceLines:$.recurrenceLines,visibility:$.visibility,transparency:$.transparency,reminders:$.reminders,conference:$.conference,macroCall:$.macroCall,outOfOffice:$.outOfOffice,calendarId:$.calendar?.id,emailLinkId:$.emailLink?.id}}class I$ extends A{lookupToken;constructor($,O,j){super($,O,j);this.lookupToken=j?.shareToken}static byId($,O){return new I$($,O)}static from($,O){return new I$($,O.id,O)}async fetch(){if(this.lookupToken)return J(await this.client.storage.meetingLookup({path:{token:this.lookupToken}}));let $=J(await this.client.storage.meetingList()).meetings.find((O)=>O.id===this.id);if(!$)throw new w(`Meeting ${this.id} is unavailable`);return this.lookupToken=$.shareToken,$}title=this.field("title");scheduledStart=this.field("scheduledStart");scheduledEnd=this.field("scheduledEnd");channel=this.mappedField("channelId",($)=>$?f.byId(this.client,$):void 0);call=this.mappedField("callId",($)=>$?K$.byId(this.client,$):void 0);async update($){await this.mutate((O)=>O.storage.meetingUpdate({path:{meeting_id:this.id},body:$}))}async cancel(){await this.mutate(($)=>$.storage.meetingCancel({path:{meeting_id:this.id}}))}async invitePermissions(){return J(await this.client.storage.meetingInvitePermissions({path:{token:(await this.detail.get()).shareToken}}))}async invite($){J(await this.client.storage.meetingInvite({path:{token:(await this.detail.get()).shareToken},body:{email:$}}))}async inviteUsers($){J(await this.client.storage.meetingInviteUsers({path:{token:(await this.detail.get()).shareToken},body:{userIds:$.map((O)=>O.id)}}))}async webUrl(){return`${this.client.webAppUrl}/app/meet/join/${encodeURIComponent((await this.detail.get()).shareToken)}`}}class v$ extends A{callId;constructor($,O,j,x){super($,j,x);this.callId=O}get path(){return{parent_type:"call",parent_id:this.callId,id:this.id}}async fetch(){return J(await this.client.storage.entityMessageGetMessage({path:this.path}))}static byId($,O,j){return new v$($,O,j)}static from($,O,j){return new v$($,O,j.id,j)}content=this.field("content");createdAt=this.field("created_at");updatedAt=this.field("updated_at");call(){return K$.byId(this.client,this.callId)}async author(){return M.byId(this.client,(await this.detail.get()).sender_id)}async reply($){let O=J(await this.client.storage.entityMessageCreate({path:{parent_type:"call",parent_id:this.callId},body:{...$$($),thread_id:this.callId}}));return v$.from(this.client,this.callId,O)}async edit($){let{content:O,mentions:j}=$$($);return await this.mutate((x)=>x.storage.entityMessageEdit({path:this.path,body:{content:O,mentions:j}})),this}async delete(){await this.mutate(($)=>$.storage.entityMessageDeleteMessage({path:this.path}))}}class K$ extends F${messageThreadById($){return W$.byId(this.client,{type:"call",entity:this},$)}timelinePage($){return E$(this.client,{type:"call",entity:this},(O)=>v$.from(this.client,this.id,O),$)}access=new o(this.client,"call",this);async meeting(){return I$.from(this.client,J(await this.client.storage.meetingShare({path:{call_id:this.id}})))}async editTranscript($){await this.mutate((O)=>O.storage.editCallTranscript({path:{call_id:this.id},body:{assignments:$}}))}async toggleTeamShare(){return this.mutate(($)=>$.storage.toggleShareWithTeam({path:{call_id:this.id}}))}entityType="call";async fetch(){return J(await this.client.storage.getCallRecord({path:{call_id:this.id}}))}static byId($,O){return new K$($,O)}message($){return v$.byId(this.client,this.id,$)}name=this.field("customName");channel=this.mappedField("channelId",($)=>$?f.byId(this.client,$):void 0);channelName=this.field("channelName");creator=this.mappedField("createdBy",($)=>M.byId(this.client,$));isActive=this.field("isActive");status=this.field("status");roomName=this.field("roomName");startedAt=this.field("startedAt");endedAt=this.field("endedAt");durationMs=this.field("durationMs");summary=this.field("summary");transcript=this.field("transcript");participants=this.field("participants");guests=this.field("guests");teamShareAccessLevel=this.field("teamShareAccessLevel");shareWithTeam=this.field("shareWithTeam");recordingUrl=this.field("recordingUrl");recordingPreviewUrl=this.field("recordingPreviewUrl");recordingStartedAt=this.field("recordingStartedAt");async rename($){await this.mutate((O)=>O.storage.editCallRecord({path:{call_id:this.id},body:{customName:$??""}}))}async setTeamShare($){await this.mutate((O)=>O.storage.editCallRecord({path:{call_id:this.id},body:{sharePermission:{teamShareAccessLevel:$?"view":null}}}))}async delete(){await this.mutate(($)=>$.storage.deleteCallRecord({path:{call_id:this.id}}))}static search=j$({filters:{call_filters:{}},type:"call",make:($,O)=>new K$($,O.call_id)})}class yx{client;constructor($){this.client=$}byId($){return K$.byId(this.client,$)}search($,O){return K$.search(this.client,$,O)}}class vx{client;constructor($){this.client=$}async list(){let{labels:$}=J(await this.client.storage.listChannelLabels());return $}async create($,O=[]){return J(await this.client.storage.createChannelLabel({body:{name:$,channelIds:O.map((j)=>j.id)}}))}async createSmartTag($,O){return J(await this.client.storage.createChannelLabel({body:{name:$,rule:O}}))}async previewSmartTag($){return J(await this.client.storage.previewSmartTag({body:$}))}async updateSmartTag($,O,j){return J(await this.client.storage.renameChannelLabel({path:{label_id:$.id},body:{name:O,rule:j}}))}async rename($,O){return J(await this.client.storage.renameChannelLabel({path:{label_id:$.id},body:{name:O}}))}async delete($){J(await this.client.storage.deleteChannelLabel({path:{label_id:$.id}}))}async setLabel($,O){J(await this.client.storage.setChannelLabel({path:{channel_id:$.id},body:{labelId:O?.id??null}}))}}class hx{client;async activity(){return J(await this.client.storage.getActivity()).map(($)=>new ZO(this.client,f.byId(this.client,$.channel_id),$))}labels;constructor($){this.client=$;this.labels=new vx($)}byId($){return f.byId(this.client,$)}async dm($){return f.dm(this.client,$)}async private($){return f.private(this.client,$)}async create($){return f.create(this.client,$)}async list(){let{items:$}=J(await this.client.storage.getChannels());return $.map((O)=>f.byId(this.client,O.id.toString()))}async*search($,O){if(!O?.searchOn||O.searchOn==="name"){let{items:j}=J(await this.client.storage.getChannels()),x=$.toLowerCase();for(let S of j)if(S.name?.toLowerCase().includes(x))yield f.byId(this.client,S.id.toString())}else yield*f.search(this.client,$,O)}}class n extends S${async sharePermissions(){return J(await this.client.storage.getProjectPermissionsV2({path:{id:this.id}}))}async accessLevel(){return J(await this.client.storage.getProjectUserAccessLevel({path:{id:this.id}}))}access=new o(this.client,"project",this);entityType="project";propertyEntityType="PROJECT";async fetch(){let{data:$}=J(await this.client.storage.getProjectHandler({path:{id:this.id}}));return $.projectMetadata}static byId($,O){return new n($,O)}static async create($,O){let{data:j}=J(await $.storage.createProjectHandler({body:{name:O.name,projectParentId:O.parent?.id??null}}));return new n($,j.id,j)}name=this.field("name");parent=this.mappedField("parentId",($)=>$?n.byId(this.client,$):void 0);createdAt=this.field("createdAt");async items(){let{data:$}=J(await this.client.storage.getProjectContentHandler({path:{id:this.id}}));return $.map((O)=>O.item)}async rename($){await this.mutate((O)=>O.storage.editProjectV2({path:{id:this.id},body:{name:$}}))}async delete($){await this.mutate((O)=>$?.permanent?O.storage.permanentlyDeleteProject({path:{id:this.id}}):O.storage.deleteProjectHandler({path:{id:this.id}}))}async restore(){await this.mutate(($)=>$.storage.revertDeleteProject({path:{id:this.id}}))}static search=j$({filters:{project_filters:{}},type:"project",make:($,O)=>new n($,O.id)})}class hO{client;chat;id;message;constructor($,O,j,x){this.client=$;this.chat=O;this.id=j;this.message=x}static byId($,O,j,x){return new hO($,O,j,x)}async stop(){J(await this.client.cognition.stopChatStream({body:{chat_id:this.chat.id,stream_id:this.id}}))}toJSON(){return{id:this.id,chatId:this.chat.id,messageId:this.message.id}}}class mO extends A{chat;constructor($,O,j){super($,j);this.chat=O}static byId($,O,j){return new mO($,O,j)}async fetch(){let $=J(await this.client.cognition.getChat({path:{chat_id:this.chat.id}})).chat.messages.find((O)=>O.id===this.id);if(!$)throw new w(`Chat message ${this.id} is not yet available`);return $}content=this.field("content");role=this.field("role");async refresh(){this.detail.clear(),await this.detail.get()}toJSON(){return{...super.toJSON(),chatId:this.chat.id}}}class Z$ extends S${async send($){let{attachments:O,additionalInstructions:j,...x}=$,S=await this.mutate((Z)=>Z.cognition.sendChatMessage({body:{...x,chat_id:this.id,additional_instructions:j,attachments:O?.map((X)=>({entity_id:X.entity.id,entity_type:X.type}))}})),K=Z$.byId(this.client,S.chat_id);return hO.byId(this.client,K,S.stream_id,mO.byId(this.client,K,S.message_id))}access=new o(this.client,"chat",this);entityType="chat";propertyEntityType="CHAT";async fetch(){let{chat:$}=J(await this.client.cognition.getChat({path:{chat_id:this.id}}));return $}static byId($,O){return new Z$($,O)}static async create($,O){let{id:j}=J(await $.cognition.createChat({body:{name:O?.name??null,projectId:O?.project?.id??null}}));return new Z$($,j)}name=this.field("name");model=this.field("model");project=this.mappedField("projectId",($)=>$?n.byId(this.client,$):void 0);createdAt=this.field("createdAt");updatedAt=this.field("updatedAt");messages=this.field("messages");async rename($){await this.mutate((O)=>O.cognition.patchChat({path:{chat_id:this.id},body:{name:$}}))}async delete($){await this.mutate((O)=>$?.permanent?O.cognition.permanentlyDeleteChat({path:{chat_id:this.id}}):O.cognition.deleteChat({path:{chat_id:this.id}}))}async copy(){let{id:$}=await this.mutate((O)=>O.cognition.copyChat({path:{chat_id:this.id}}));return new Z$(this.client,$)}async restore(){await this.mutate(($)=>$.cognition.revertDeleteChat({path:{chat_id:this.id}}))}async history(){let{conversation:$}=J(await this.client.cognition.getChatHistoryHandler({path:{chat_id:this.id}}));return $}webUrl(){return`${this.client.webAppUrl}/app/chat/${this.id}`}static search=j$({filters:{chat_filters:{}},type:"chat",make:($,O)=>new Z$($,O.chat_id)});toMention(){return{tag:l$("m-document-mention",{documentId:this.id,documentName:this.detail.peek()?.name??"",blockName:"chat",blockParams:{}}),mention:{entity_type:"chat",entity_id:this.id}}}}class mx{client;constructor($){this.client=$}byId($){return Z$.byId(this.client,$)}create($){return Z$.create(this.client,$)}search($,O){return Z$.search(this.client,$,O)}}class T$ extends A{async fetch(){let O=J(await this.client.auth.getUserTeams()).find((j)=>j.id===this.id);if(!O)throw new w(`team ${this.id} not found`);return O}static byId($,O){return new T$($,O)}static async current($){let O=J(await $.auth.getTeam());if(!O)throw new w("caller has no current team");return new T$($,O.team.id,O.team)}static async list($){return J(await $.auth.getUserTeams()).map((j)=>new T$($,j.id,j))}name=this.field("name");slug=this.field("slug");defaultLinkShare=this.field("default_link_share");owner=this.mappedField("owner_id",($)=>M.byId(this.client,$));async members(){let $=J(await this.client.auth.getTeam());if(!$||$.team.id!==this.id)throw new b("members are only available for the current team (see Team.current)");return $.members.map((O)=>({user:M.byId(this.client,O.user_id),role:O.role}))}}var E6=8;class _$ extends A{parent;constructor($,O,j,x){super($,j,x);this.parent=O}get path(){return{parent_type:this.parent.type,parent_id:this.parent.id,id:this.id}}async fetch(){return J(await this.client.storage.entityMessageGetMessage({path:this.path}))}static byId($,O,j){return new _$($,O,j)}static from($,O,j){return new _$($,O,j.id,j)}text=this.field("content");createdAt=this.field("created_at");updatedAt=this.field("updated_at");deletedAt=this.field("deleted_at");async threadId(){return(await this.detail.get()).thread_id??this.id}async author(){return M.byId(this.client,(await this.detail.get()).sender_id)}async reply($){return cO(this.client,this.parent,$,{threadId:await this.threadId()})}async edit($){let{content:O,mentions:j}=$$($);return await this.mutate((x)=>x.storage.entityMessageEdit({path:this.path,body:{content:O,mentions:j}})),this}async delete(){await this.mutate(($)=>$.storage.entityMessageDeleteMessage({path:this.path}))}}async function Yj($,O){let j={parent_type:O.type,parent_id:O.id},x=a(async(K)=>{let Z=J(await $.storage.messageTimeline({path:j,query:{selection:JSON.stringify({limit:100,cursor:K})}}));return{items:Z.items,nextCursor:Z.next_cursor}}),S=[];for await(let K of x)S.push(K);return bO(S,E6,async(K)=>{let{state:Z,root:X,replies:G}=J(await $.storage.entityMessageGetThread({path:{...j,id:K.id}}));return{thread:Z,comments:[X,...G].map((L)=>_$.from($,O,L))}})}async function cO($,O,j,x){let S=J(await $.storage.entityMessageCreate({path:{parent_type:O.type,parent_id:O.id},body:{...$$(j),thread_id:x?.threadId??null}}));return _$.from($,O,S)}class w$ extends F${messageThreadById($){return W$.byId(this.client,{type:"crm_contact",entity:this},$)}timelinePage($){return E$(this.client,{type:"crm_contact",entity:this},(O)=>_$.from(this.client,{type:"crm_contact",id:this.id},O),$)}entityType="crm_contact";async fetch(){return J(await this.client.storage.getContact({path:{contact_id:this.id}}))}static byId($,O){return new w$($,O)}static from($,O){return new w$($,O.id,O)}name=this.field("name");email=this.field("email");company=this.mappedField("companyId",($)=>q$.byId(this.client,$));hidden=this.field("hidden");createdAt=this.field("createdAt");updatedAt=this.field("updatedAt");firstInteraction=this.field("firstInteraction");lastInteraction=this.field("lastInteraction");async hide(){await this.setHidden(!0)}async unhide(){await this.setHidden(!1)}async setHidden($){await this.mutate((O)=>O.storage.setContactHidden({path:{contact_id:this.id},body:{hidden:$}}))}async rename($){await this.mutate((O)=>O.storage.setCrmContactName({path:{contact_id:this.id},body:{name:$}}))}get commentParent(){return{type:"crm_contact",id:this.id}}async comments(){return Yj(this.client,this.commentParent)}async comment($,O){return cO(this.client,this.commentParent,$,O)}commentById($){return _$.byId(this.client,this.commentParent,$)}}class q$ extends S${messageThreadById($){return W$.byId(this.client,{type:"crm_company",entity:this},$)}timelinePage($){return E$(this.client,{type:"crm_company",entity:this},(O)=>_$.from(this.client,{type:"crm_company",id:this.id},O),$)}entityType="crm_company";propertyEntityType="COMPANY";async fetch(){return J(await this.client.storage.getCompany({path:{company_id:this.id}}))}static byId($,O){return new q$($,O)}static from($,O){return new q$($,O.id,O)}name=this.field("name");description=this.field("description");hidden=this.field("hidden");emailSync=this.field("emailSync");team=this.mappedField("teamId",($)=>T$.byId(this.client,$));createdAt=this.field("createdAt");updatedAt=this.field("updatedAt");async domain(){let{domains:$}=await this.detail.get();return $[0]?.domain}async domains(){let{domains:$}=await this.detail.get();return $.map((O)=>O.domain)}async contacts(){return J(await this.client.storage.listCompanyContacts({path:{company_id:this.id}})).map((O)=>w$.from(this.client,O))}static search=j$({filters:{crm_company_filters:{}},type:"company",includeCrm:!0,make:($,O)=>new q$($,O.id)});async hide(){await this.setHidden(!0)}async unhide(){await this.setHidden(!1)}async setHidden($){await this.mutate((O)=>O.storage.setCompanyHidden({path:{company_id:this.id},body:{hidden:$}}))}async setEmailSync($){await this.mutate((O)=>O.storage.setEmailSync({path:{company_id:this.id},body:{email_sync:$}}))}async rename($){await this.mutate((O)=>O.storage.setCrmCompanyName({path:{company_id:this.id},body:{name:$}}))}async createContact($){let O=await this.mutate((j)=>j.storage.createCrmContact({path:{company_id:this.id},body:$}));return w$.from(this.client,O)}get commentParent(){return{type:"crm_company",id:this.id}}async comments(){return Yj(this.client,this.commentParent)}async comment($,O){return cO(this.client,this.commentParent,$,O)}commentById($){return _$.byId(this.client,this.commentParent,$)}}class a$ extends A{tableDetail=new J$(async()=>J(await this.client.storage.getCrmPipelineTable({path:{id:this.id}})));static byId($,O){return new a$($,O)}static from($,O){return new a$($,O.id,O)}async fetch(){return J(await this.client.storage.getCrmPipeline({path:{id:this.id}}))}name=this.field("name");recordType=this.field("recordType");accessLevel=this.field("grant");sharing=this.field("sharing");owner=this.mappedField("userId",($)=>M.byId(this.client,$));team=this.mappedField("teamId",($)=>T$.byId(this.client,$));async rename($){await this.mutate((O)=>O.storage.renameCrmPipeline({path:{id:this.id},body:{name:$}}))}async setSharing($){if($===void 0)throw Error("Sharing is required");await this.mutate((O)=>O.storage.shareCrmPipeline({path:{id:this.id},body:{sharing:$}}))}async setTrashed($){await this.mutate((O)=>O.storage.trashCrmPipeline({path:{id:this.id},body:{trashed:$}}))}async sharePermissions(){return J(await this.client.storage.getCrmPipelinePermissions({path:{id:this.id}}))}async updateSharePermissions($){return this.mutate((O)=>O.storage.updateCrmPipelinePermissions({path:{id:this.id},body:r$($)}))}async table(){return Qj.from(this.client,this,await this.tableRecord())}tableRecord(){return this.tableDetail.get()}rows(){return a(async($)=>{let O=J(await this.client.storage.getCrmPipelineRows({path:{id:this.id},query:{after:$}}));return{items:O.rows.map((j)=>XO.from(this.client,this,j)),nextCursor:O.next}})}queryRows($={}){if($.rows?.some((O)=>O.pipeline.id!==this.id))throw Error("Rows belong to another pipeline");return a(async(O)=>{let j=J(await this.client.storage.queryCrmPipelineRows({path:{id:this.id},body:{after:O,query:$.query,rowIds:$.rows?.map((x)=>x.id)}}));return{items:j.rows.map((x)=>XO.from(this.client,this,x)),nextCursor:j.next}})}async applyOps($,O){if(O?.baseVersions?.some((S)=>S.table.pipeline.id!==this.id))throw Error("Table belongs to another pipeline");let j={ops:$,baseVersions:O?.baseVersions?Object.fromEntries(O.baseVersions.map((S)=>[S.table.id,S.version])):void 0},x=await this.mutate((S)=>S.storage.applyCrmPipelineOps({path:{id:this.id},body:j}));return this.tableDetail.clear(),x}}class Qj extends A{pipeline;toJSON(){return{...super.toJSON(),pipelineId:this.pipeline.id}}constructor($,O,j){super($,j.table.id,j);this.pipeline=O}static from($,O,j){return new Qj($,O,j)}fetch(){return this.pipeline.tableRecord()}async columns(){return(await this.pipeline.tableRecord()).columns.map(($)=>Jj.from(this.client,this,$))}async version(){return(await this.pipeline.tableRecord()).table.version}rowById($){return XO.byId(this.client,this.pipeline,$)}rows(){return this.pipeline.rows()}}class XO extends A{pipeline;toJSON(){return{...super.toJSON(),pipelineId:this.pipeline.id}}constructor($,O,j,x){super($,j,x);this.pipeline=O}static byId($,O,j){return new XO($,O,j)}static from($,O,j){return new XO($,O,j.rowId,j)}async fetch(){for await(let $ of this.pipeline.queryRows({rows:[this]}))if($.id===this.id)return $.detail.get();throw new w(`Pipeline row ${this.id} is unavailable`)}cells=this.field("cells");async refresh(){this.detail.clear(),await this.detail.get()}}class Jj extends A{table;toJSON(){return{...super.toJSON(),pipelineId:this.table.pipeline.id,tableId:this.table.id}}constructor($,O,j){super($,j.column.id,j);this.table=O}static from($,O,j){return new Jj($,O,j)}async fetch(){let $=(await this.table.pipeline.tableRecord()).columns.find((O)=>O.column.id===this.id);if(!$)throw new w(`Pipeline column ${this.id} is unavailable`);return $}async writable(){return(await this.fetch()).writable}async name(){return(await this.fetch()).column.display_name??(await this.fetch()).definition.definition.display_name}}class cx{client;constructor($){this.client=$}byId($){return a$.byId(this.client,$)}async list(){return J(await this.client.storage.listCrmPipelines()).map(($)=>a$.from(this.client,$))}async create($){return a$.from(this.client,J(await this.client.storage.createCrmPipeline({body:$})))}}class ux{client;pipelines;constructor($){this.client=$;this.pipelines=new cx($)}companyById($){return q$.byId(this.client,$)}contactById($){return w$.byId(this.client,$)}async contactByEmail($){let{contact:O}=J(await this.client.storage.getContactByEmail({query:{email:$}}));return O?w$.from(this.client,O):void 0}async searchContacts($,O={}){let{contacts:j}=J(await this.client.storage.searchContacts({query:{query:$,limit:O.limit}}));return j.map((x)=>w$.from(this.client,x))}async createCompany($){return q$.from(this.client,J(await this.client.storage.createCrmCompany({body:$})))}async settings(){return J(await this.client.storage.getCrmTeamSettings())}async updateSettings($){return J(await this.client.storage.putCrmTeamSettings({body:$}))}async setStages($){return J(await this.client.storage.putCrmTeamStages({body:$}))}async resetStages(){J(await this.client.storage.resetCrmTeamStages())}searchCompanies($){return q$.search(this.client,$)}}var G$=Symbol.for("@ts-pattern/matcher"),P1=Symbol.for("@ts-pattern/isVariadic");var dx=($)=>Boolean($&&typeof $=="object"),Vj=($)=>$&&!!$[G$],s=($,O,j)=>{if(Vj($)){let x=$[G$](),{matched:S,selections:K}=x.match(O);return S&&K&&Object.keys(K).forEach((Z)=>j(Z,K[Z])),S}if(dx($)){if(!dx(O))return!1;if(Array.isArray($)){if(!Array.isArray(O))return!1;let x=[],S=[],K=[];for(let Z of $.keys()){let X=$[Z];Vj(X)&&X[P1]?K.push(X):K.length?S.push(X):x.push(X)}if(K.length){if(K.length>1)throw Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(O.length<x.length+S.length)return!1;let Z=O.slice(0,x.length),X=S.length===0?[]:O.slice(-S.length),G=O.slice(x.length,S.length===0?1/0:-S.length);return x.every((L,Y)=>s(L,Z[Y],j))&&S.every((L,Y)=>s(L,X[Y],j))&&(K.length===0||s(K[0],G,j))}return $.length===O.length&&$.every((Z,X)=>s(Z,O[X],j))}return Reflect.ownKeys($).every((x)=>{let S=$[x];return((x in O)||Vj(K=S)&&K[G$]().matcherType==="optional")&&s(S,O[x],j);var K})}return Object.is(O,$)},X$=($)=>{var O,j,x;return dx($)?Vj($)?(O=(j=(x=$[G$]()).getSelectionKeys)==null?void 0:j.call(x))!=null?O:[]:Array.isArray($)?uO($,X$):uO(Object.values($),X$):[]},uO=($,O)=>$.reduce((j,x)=>j.concat(O(x)),[]);function w6(...$){if($.length===1){let[O]=$;return(j)=>s(O,j,()=>{})}if($.length===2){let[O,j]=$;return s(O,j,()=>{})}throw Error(`isMatching wasn't given the right number of arguments: expected 1 or 2, received ${$.length}.`)}function t($){return Object.assign($,{optional:()=>px($),and:(O)=>u($,O),or:(O)=>F1($,O),select:(O)=>O===void 0?dO($):dO(O,$)})}function lx($){return Object.assign(((O)=>Object.assign(O,{[Symbol.iterator](){let j=0,x=[{value:Object.assign(O,{[P1]:!0}),done:!1},{done:!0,value:void 0}];return{next:()=>{var S;return(S=x[j++])!=null?S:x.at(-1)}}}}))($),{optional:()=>lx(px($)),select:(O)=>lx(O===void 0?dO($):dO(O,$))})}function px($){return t({[G$]:()=>({match:(O)=>{let j={},x=(S,K)=>{j[S]=K};return O===void 0?(X$($).forEach((S)=>x(S,void 0)),{matched:!0,selections:j}):{matched:s($,O,x),selections:j}},getSelectionKeys:()=>X$($),matcherType:"optional"})})}var q6=($,O)=>{for(let j of $)if(!O(j))return!1;return!0},f6=($,O)=>{for(let[j,x]of $.entries())if(!O(x,j))return!1;return!0},b6=($,O)=>{let j=Reflect.ownKeys($);for(let x of j)if(!O(x,$[x]))return!1;return!0};function u(...$){return t({[G$]:()=>({match:(O)=>{let j={},x=(S,K)=>{j[S]=K};return{matched:$.every((S)=>s(S,O,x)),selections:j}},getSelectionKeys:()=>uO($,X$),matcherType:"and"})})}function F1(...$){return t({[G$]:()=>({match:(O)=>{let j={},x=(S,K)=>{j[S]=K};return uO($,X$).forEach((S)=>x(S,void 0)),{matched:$.some((S)=>s(S,O,x)),selections:j}},getSelectionKeys:()=>uO($,X$),matcherType:"or"})})}function m($){return{[G$]:()=>({match:(O)=>({matched:Boolean($(O))})})}}function dO(...$){let O=typeof $[0]=="string"?$[0]:void 0,j=$.length===2?$[1]:typeof $[0]=="string"?void 0:$[0];return t({[G$]:()=>({match:(x)=>{let S={[O!=null?O:"@ts-pattern/anonymous-select-key"]:x};return{matched:j===void 0||s(j,x,(K,Z)=>{S[K]=Z}),selections:S}},getSelectionKeys:()=>[O!=null?O:"@ts-pattern/anonymous-select-key"].concat(j===void 0?[]:X$(j))})})}function E1($){return!0}function f$($){return typeof $=="number"}function i$($){return typeof $=="string"}function n$($){return typeof $=="bigint"}var w1=t(m(E1)),k6=t(m(E1)),g6=w1,s$=($)=>Object.assign(t($),{startsWith:(O)=>{return s$(u($,(j=O,m((x)=>i$(x)&&x.startsWith(j)))));var j},endsWith:(O)=>{return s$(u($,(j=O,m((x)=>i$(x)&&x.endsWith(j)))));var j},minLength:(O)=>s$(u($,((j)=>m((x)=>i$(x)&&x.length>=j))(O))),length:(O)=>s$(u($,((j)=>m((x)=>i$(x)&&x.length===j))(O))),maxLength:(O)=>s$(u($,((j)=>m((x)=>i$(x)&&x.length<=j))(O))),includes:(O)=>{return s$(u($,(j=O,m((x)=>i$(x)&&x.includes(j)))));var j},regex:(O)=>{return s$(u($,(j=O,m((x)=>i$(x)&&Boolean(x.match(j))))));var j}}),A1=s$(m(i$)),b$=($)=>Object.assign(t($),{between:(O,j)=>b$(u($,((x,S)=>m((K)=>f$(K)&&x<=K&&S>=K))(O,j))),lt:(O)=>b$(u($,((j)=>m((x)=>f$(x)&&x<j))(O))),gt:(O)=>b$(u($,((j)=>m((x)=>f$(x)&&x>j))(O))),lte:(O)=>b$(u($,((j)=>m((x)=>f$(x)&&x<=j))(O))),gte:(O)=>b$(u($,((j)=>m((x)=>f$(x)&&x>=j))(O))),int:()=>b$(u($,m((O)=>f$(O)&&Number.isInteger(O)))),finite:()=>b$(u($,m((O)=>f$(O)&&Number.isFinite(O)))),positive:()=>b$(u($,m((O)=>f$(O)&&O>0))),negative:()=>b$(u($,m((O)=>f$(O)&&O<0)))}),y6=b$(m(f$)),t$=($)=>Object.assign(t($),{between:(O,j)=>t$(u($,((x,S)=>m((K)=>n$(K)&&x<=K&&S>=K))(O,j))),lt:(O)=>t$(u($,((j)=>m((x)=>n$(x)&&x<j))(O))),gt:(O)=>t$(u($,((j)=>m((x)=>n$(x)&&x>j))(O))),lte:(O)=>t$(u($,((j)=>m((x)=>n$(x)&&x<=j))(O))),gte:(O)=>t$(u($,((j)=>m((x)=>n$(x)&&x>=j))(O))),positive:()=>t$(u($,m((O)=>n$(O)&&O>0))),negative:()=>t$(u($,m((O)=>n$(O)&&O<0)))}),v6=t$(m(n$)),h6=t(m(function($){return typeof $=="boolean"})),m6=t(m(function($){return typeof $=="symbol"})),c6=t(m(function($){return $==null})),u6=t(m(function($){return $!=null})),x$={__proto__:null,matcher:G$,optional:px,array:function(...$){return lx({[G$]:()=>({match:(O)=>{if(!Array.isArray(O))return{matched:!1};if($.length===0)return{matched:!0};let j=$[0],x={};if(O.length===0)return X$(j).forEach((K)=>{x[K]=[]}),{matched:!0,selections:x};let S=(K,Z)=>{x[K]=(x[K]||[]).concat([Z])};return{matched:O.every((K)=>s(j,K,S)),selections:x}},getSelectionKeys:()=>$.length===0?[]:X$($[0])})})},set:function(...$){return t({[G$]:()=>({match:(O)=>{if(!(O instanceof Set))return{matched:!1};let j={};if(O.size===0)return{matched:!0,selections:j};if($.length===0)return{matched:!0};let x=(K,Z)=>{j[K]=(j[K]||[]).concat([Z])},S=$[0];return{matched:q6(O,(K)=>s(S,K,x)),selections:j}},getSelectionKeys:()=>$.length===0?[]:X$($[0])})})},map:function(...$){return t({[G$]:()=>({match:(O)=>{if(!(O instanceof Map))return{matched:!1};let j={};if(O.size===0)return{matched:!0,selections:j};let x=(X,G)=>{j[X]=(j[X]||[]).concat([G])};if($.length===0)return{matched:!0};var S;if($.length===1)throw Error(`\`P.map\` wasn't given enough arguments. Expected (key, value), received ${(S=$[0])==null?void 0:S.toString()}`);let[K,Z]=$;return{matched:f6(O,(X,G)=>{let L=s(K,G,x),Y=s(Z,X,x);return L&&Y}),selections:j}},getSelectionKeys:()=>$.length===0?[]:[...X$($[0]),...X$($[1])]})})},record:function(...$){return t({[G$]:()=>({match:(O)=>{if(O===null||typeof O!="object"||Array.isArray(O))return{matched:!1};var j;if($.length===0)throw Error(`\`P.record\` wasn't given enough arguments. Expected (value) or (key, value), received ${(j=$[0])==null?void 0:j.toString()}`);let x={},S=(X,G)=>{x[X]=(x[X]||[]).concat([G])},[K,Z]=$.length===1?[A1,$[0]]:$;return{matched:b6(O,(X,G)=>{let L=typeof X!="string"||Number.isNaN(Number(X))?null:Number(X),Y=L!==null&&s(K,L,S),Q=s(K,X,S),T=s(Z,G,S);return(Q||Y)&&T}),selections:x}},getSelectionKeys:()=>$.length===0?[]:[...X$($[0]),...X$($[1])]})})},intersection:u,union:F1,not:function($){return t({[G$]:()=>({match:(O)=>({matched:!s($,O,()=>{})}),getSelectionKeys:()=>[],matcherType:"not"})})},when:m,select:dO,any:w1,unknown:k6,_:g6,string:A1,number:y6,bigint:v6,boolean:h6,symbol:m6,nullish:c6,nonNullable:u6,instanceOf:function($){return t(m(function(O){return(j)=>j instanceof O}($)))},shape:function($){return t(m(w6($)))}};class q1 extends Error{constructor($){let O;try{O=JSON.stringify($)}catch(j){O=$}super(`Pattern matching error: no pattern matches value ${O}`),this.input=void 0,this.input=$}}var rx={matched:!1,value:void 0};function c($){return new Wj($,rx)}class Wj{constructor($,O){this.input=void 0,this.state=void 0,this.input=$,this.state=O}with(...$){if(this.state.matched)return this;let O=$[$.length-1],j=[$[0]],x;$.length===3&&typeof $[1]=="function"?x=$[1]:$.length>2&&j.push(...$.slice(1,$.length-1));let S=!1,K={},Z=(G,L)=>{S=!0,K[G]=L},X=!j.some((G)=>s(G,this.input,Z))||x&&!Boolean(x(this.input))?rx:{matched:!0,value:O(S?"@ts-pattern/anonymous-select-key"in K?K["@ts-pattern/anonymous-select-key"]:K:this.input,this.input)};return new Wj(this.input,X)}when($,O){if(this.state.matched)return this;let j=Boolean($(this.input));return new Wj(this.input,j?{matched:!0,value:O(this.input,this.input)}:rx)}otherwise($){return this.state.matched?this.state.value:$(this.input)}exhaustive($=d6){return this.state.matched?this.state.value:$(this.input)}run(){return this.exhaustive()}returnType(){return this}narrow(){return this}}function d6($){throw new q1($)}var ax,l6=new Uint8Array(16);function Bj(){if(!ax){if(typeof crypto>"u"||!crypto.getRandomValues)throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");ax=crypto.getRandomValues.bind(crypto)}return ax(l6)}var O$=[];for(let $=0;$<256;++$)O$.push(($+256).toString(16).slice(1));function f1($,O=0){return(O$[$[O+0]]+O$[$[O+1]]+O$[$[O+2]]+O$[$[O+3]]+"-"+O$[$[O+4]]+O$[$[O+5]]+"-"+O$[$[O+6]]+O$[$[O+7]]+"-"+O$[$[O+8]]+O$[$[O+9]]+"-"+O$[$[O+10]]+O$[$[O+11]]+O$[$[O+12]]+O$[$[O+13]]+O$[$[O+14]]+O$[$[O+15]]).toLowerCase()}var ix={};function r6($,O,j){let x;if($)x=b1($.random??$.rng?.()??Bj(),$.msecs,$.seq,O,j);else{let S=Date.now(),K=Bj();p6(ix,S,K),x=b1(K,ix.msecs,ix.seq,O,j)}return O??f1(x)}function p6($,O,j){if($.msecs??=-1/0,$.seq??=0,O>$.msecs)$.seq=j[6]<<23|j[7]<<16|j[8]<<8|j[9],$.msecs=O;else if($.seq=$.seq+1|0,$.seq===0)$.msecs++;return $}function b1($,O,j,x,S=0){if($.length<16)throw Error("Random bytes length must be >= 16");if(!x)x=new Uint8Array(16),S=0;else if(S<0||S+16>x.length)throw RangeError(`UUID byte range ${S}:${S+15} is out of buffer bounds`);return O??=Date.now(),j??=$[6]*127<<24|$[7]<<16|$[8]<<8|$[9],x[S++]=O/1099511627776&255,x[S++]=O/4294967296&255,x[S++]=O/16777216&255,x[S++]=O/65536&255,x[S++]=O/256&255,x[S++]=O&255,x[S++]=112|j>>>28&15,x[S++]=j>>>20&255,x[S++]=128|j>>>14&63,x[S++]=j>>>6&255,x[S++]=j<<2&255|$[10]&3,x[S++]=$[11],x[S++]=$[12],x[S++]=$[13],x[S++]=$[14],x[S++]=$[15],x}var h$=r6;class M${table;id;constructor($,O){this.table=$;this.id=O}static byId($,O){return new M$($,O)}async detail(){let{columns:$}=await this.table.detail(),O=$.find((j)=>j.column.id===this.id);if(!O)throw new w(`column ${this.id} is not on table ${this.table.id}`);return O}async name(){let $=await this.detail();return $.column.display_name??$.definition.definition.display_name}async rename($){return await this.table.database.renameColumn(this,$),this}async inferType($){return await this.table.database.inferColumnType(this,$),this}changeType($){return this.table.database.changeColumnType(this,$)}convertIntoNewColumn($){return this.table.database.convertColumnIntoNewColumn(this,$)}casts(){return this.table.database.columnCasts(this)}async delete(){await this.table.database.deleteColumn(this)}async dataType(){return(await this.detail()).definition.definition.data_type}async isMultiSelect(){return(await this.detail()).definition.definition.is_multi_select}async position(){return(await this.detail()).column.position}async definition(){return(await this.detail()).definition}async config(){return(await this.detail()).column.config??void 0}async addOptions($){return await this.table.database.addColumnOptions(this,$),this}toJSON(){return{id:this.id,tableId:this.table.id}}}class A${table;id;constructor($,O){this.table=$;this.id=O}static byId($,O){return new A$($,O)}history(){return this.table.database.rowHistory(this)}toJSON(){return{id:this.id,tableId:this.table.id}}}class Lj{table;id;constructor($,O){this.table=$;this.id=O}static byId($,O){return new Lj($,O)}async detail(){let{views:$}=await this.table.detail(),O=$.find((j)=>j.id===this.id);if(!O)throw new w(`view ${this.id} is not on table ${this.table.id}`);return O}async name(){return(await this.detail()).name}async position(){return(await this.detail()).position}async layout(){return(await this.detail()).layout}async query(){return(await this.detail()).query}positions(){return this.table.database.viewPositions(this)}toJSON(){return{id:this.id,tableId:this.table.id}}}class Y${database;id;constructor($,O){this.database=$;this.id=O}static byId($,O){return new Y$($,O)}async detail(){let{tables:$}=await this.database.schema(),O=$.find((j)=>j.table.id===this.id);if(!O)throw new w(`table ${this.id} is not in database ${this.database.id}`);return O}async name(){return(await this.detail()).table.name}async rename($){return await this.database.renameTable(this,$),this}async version(){return(await this.detail()).table.version}async position(){return(await this.detail()).table.position}async columns(){let{columns:$}=await this.detail();return $.map((O)=>M$.byId(this,O.column.id))}addColumn($){return this.database.addColumn(this,$)}async reorderColumns($){return await this.database.reorderColumns(this,$),this}row($){return A$.byId(this,$)}async views(){let{views:$}=await this.detail();return $.map((O)=>Lj.byId(this,O.id))}createWebhook(){return this.database.createWebhook(this)}async delete(){await this.database.deleteTable(this)}toJSON(){return{id:this.id,databaseId:this.database.id}}}async function Nj($,O,j,x={}){let S=J(await $.storage.queryDatabases({body:{sql:j,databaseId:x.database?.id,baseVersions:Object.fromEntries((x.baseVersions??[]).map(({table:Y,version:Q})=>[Y.id,Q]))}})),K=new Map;for(let Y of[x.database,...(x.baseVersions??[]).map(({table:Q})=>Q.database)]){if(!Y)continue;let Q=K.get(Y.id);if(Q)Q.add(Y);else K.set(Y.id,new Set([Y]))}let Z=(Y)=>{let Q=K.get(Y)?.values().next().value;if(Q)return Q;let T=O($,Y);return K.set(Y,new Set([T])),T},X=(Y)=>{let Q=S.tableDatabases[Y];if(!Q)throw Error(`SQL response is missing the owner of table ${Y}`);return Y$.byId(Z(Q),Y)},G=new Set(Object.keys(S.newVersions).map((Y)=>X(Y).database.id));if(S.statement.kind==="schema")G.add(S.statement.databaseId);for(let Y of G)for(let Q of K.get(Y)??[])Q.invalidateSchema();let L=c(S.statement).with({kind:"select"},(Y)=>Y).with({kind:"schema"},({databaseId:Y,summary:Q})=>({kind:"schema",database:Z(Y),summary:Q})).with({kind:"insert"},{kind:"update"},{kind:"delete"},({kind:Y,tableId:Q,tableName:T})=>({kind:Y,table:X(Q),tableName:T})).with({kind:"alterColumnType"},({tableId:Y,tableName:Q,columnId:T,columnName:z,to:W})=>{let V=X(Y);return{kind:"alterColumnType",table:V,tableName:Q,column:M$.byId(V,T),columnName:z,to:W}}).exhaustive();return{result:S.result?a6(S.result,X,S.tableDatabases):void 0,changesApplied:S.changesApplied,insertedRows:L.kind==="insert"?S.insertedRowIds.map((Y)=>A$.byId(L.table,Y)):[],newVersions:Object.entries(S.newVersions).map(([Y,Q])=>({table:X(Y),version:Q})),readVersions:Object.entries(S.readVersions).map(([Y,Q])=>({table:X(Y),version:Q})),truncatedTables:S.truncatedTables,statement:L}}function a6($,O,j){let x=$.sourceTable&&j[$.sourceTable]?O($.sourceTable):void 0;return{columns:$.columns.map(({relatedTable:S,...K})=>({...K,relatedTable:S&&j[S]?O(S):void 0})),rows:$.rows,sourceTable:x,rowHandles:x?$.rowIds.map((S)=>A$.byId(x,S)):[]}}class Uj{table;id;createdBy;record;constructor($,O,j,x){this.table=$;this.id=O;this.createdBy=j;this.record=x}static fromRecord($,O,j){return new Uj($,j.id,O,j)}get tokenPrefix(){return this.record.tokenPrefix}get createdAt(){return this.record.createdAt}delete(){return this.table.database.deleteWebhook(this)}toJSON(){return{id:this.id,tableId:this.table.id,tokenPrefix:this.tokenPrefix}}}class tx extends SO{op;row;column;taken;constructor($,O){super($,O);this.name="MacroOpRefusedError",this.message=O.message,this.op=O.op,this.row=O.row,this.column=O.column,this.taken=O.taken}}function zj($){return c($).with({type:"relation"},({table:O})=>({type:"relation",database:O.database.id,table:O.id})).with({type:x$.not("relation")},(O)=>O).exhaustive()}var i6={USER:"People",DOCUMENT:"Documents",TASK:"Tasks",COMPANY:"Companies",CONTACT:"Contacts",CALL_RECORD:"Calls",CHANNEL:"Channels",CHAT:"Chats",PROJECT:"Projects",THREAD:"Emails",CALENDAR_EVENT:"Events",INITIATIVE:"Initiatives"};function n6($){return c($).with({type:"text"},()=>"Text").with({type:"number"},()=>"Number").with({type:"boolean"},()=>"Checkbox").with({type:"date"},()=>"Date").with({type:"link"},()=>"URL").with({type:"select",multi:!0},()=>"Multi-select").with({type:"select",multi:!1},()=>"Select").with({type:"select_number",multi:!0},()=>"Multi-number select").with({type:"select_number",multi:!1},()=>"Number select").with({type:"tag"},()=>"Tag").with({type:"entity"},({target:O})=>i6[O]).with({type:"relation"},()=>"Relation").exhaustive()}function nx($){return $.map((O)=>({id:h$(),label:O}))}function k1($,O,j){return $?.kind===O&&"change"in $&&$.change.kind===j}function sx($){return c($).with({kind:"reorder_tables"},({kind:O})=>O).with({kind:x$.union("table","column","rows","view")},({kind:O,change:j})=>`${O}.${j.kind}`).exhaustive()}function m$($,O,j){let[x]=$;if($.length!==1||!k1(x,O,j))throw new b(`expected one ${O}.${j} result, got ${$.map(sx).join(", ")||"none"}`);return x}class Q$ extends A{access=new o(this.client,"database",this);async fetch(){return J(await this.client.storage.getDatabase({path:{id:this.id}}))}assertOwns($,O){if(O.id!==this.id)throw new b(`${$} does not belong to database ${this.id}`)}static byId($,O){return new Q$($,O)}static async create($,O){let j=J(await $.storage.createDatabase({body:{name:O.name}}));return new Q$($,j.id)}static async list($){return J(await $.storage.listDatabases()).map((j)=>new Q$($,j.database.id))}query($,O){return Nj(this.client,Q$.byId,$,{...O,database:this})}invalidateSchema(){this.detail.clear()}schema(){return this.detail.get()}name=this.mappedField("database",($)=>$.name);owner=this.mappedField("database",($)=>M.byId(this.client,$.owner_id));createdAt=this.mappedField("database",($)=>$.created_at);trashedAt=this.mappedField("database",($)=>$.trashed_at??void 0);grant=this.field("grant");tables=this.mappedField("tables",($)=>$.map((O)=>Y$.byId(this,O.table.id)));async table($){let{tables:O}=await this.schema(),j=O.find((x)=>x.table.name===$);return j?Y$.byId(this,j.table.id):void 0}async createTable($){let{table:O}=m$(await this.applyOps([{kind:"table",table:h$(),change:{kind:"create",name:$.name}}]),"table","created");return Y$.byId(this,O)}async applyOps($,O={}){let j={ops:$};if(O.baseVersions!==void 0){for(let{table:S}of O.baseVersions)this.assertOwns(`table ${S.id}`,S.database);j.baseVersions=Object.fromEntries(O.baseVersions.map(({table:S,version:K})=>[S.id,K]))}let{results:x}=await this.mutate(async(S)=>{let K=await S.storage.applyDatabaseOps({path:{id:this.id},body:j});if(K.error!==void 0&&"op"in K.error)throw new tx(K.response?.status??0,K.error);return K});return x}async reorderTables($){for(let x of $)this.assertOwns(`table ${x.id}`,x.database);let O=await this.applyOps([{kind:"reorder_tables",order:$.map((x)=>x.id)}]),[j]=O;if(O.length!==1||j?.kind!=="reorder_tables")throw new b(`expected one reorder_tables result, got ${O.map(sx).join(", ")||"none"}`);return j.tables.map(({table:x})=>Y$.byId(this,x))}async deleteTable($){this.assertOwns(`table ${$.id}`,$.database),m$(await this.applyOps([{kind:"table",table:$.id,change:{kind:"delete"}}]),"table","deleted")}async columnCasts($){return this.assertOwns(`column ${$.id}`,$.table.database),J(await this.client.storage.listDatabaseColumnCasts({path:{id:this.id,table_id:$.table.id,column_id:$.id}}))}async viewPositions($){this.assertOwns(`view ${$.id}`,$.table.database);let{positions:O}=J(await this.client.storage.getDatabaseViewPositions({path:{id:this.id,view_id:$.id}}));return O}async rowHistory($){this.assertOwns(`row ${$.id}`,$.table.database);let{changes:O}=J(await this.client.storage.getDatabaseRowHistory({path:{id:this.id,table_id:$.table.id,row_id:$.id}}));return O}async importTable($){let O=await this.mutate((j)=>j.storage.importDatabaseTable({path:{id:this.id},body:$}));return Y$.byId(this,O.id)}webhookOf($){return Uj.fromRecord(Y$.byId(this,$.tableId),M.byId(this.client,$.createdBy),$)}async webhooks(){let{webhooks:$}=J(await this.client.storage.listDatabaseWebhooks({path:{id:this.id}}));return $.map((O)=>this.webhookOf(O))}async createWebhook($){this.assertOwns("table",$.database);let O=J(await this.client.storage.createDatabaseWebhook({path:{id:this.id},body:{tableId:$.id}}));return{webhook:this.webhookOf(O.webhook),token:O.token}}async deleteWebhook($){this.assertOwns("webhook",$.table.database),J(await this.client.storage.deleteDatabaseWebhook({path:{id:this.id,webhook_id:$.id}}))}async sharePermissions(){return J(await this.client.storage.getDatabasePermissions({path:{id:this.id}}))}updateSharePermissions($){return this.mutate((O)=>O.storage.updateDatabasePermissions({path:{id:this.id},body:$}))}async changeColumnType($,O){this.assertOwns(`column ${$.id}`,$.table.database);let j=await $.table.version();return m$(await this.applyOps([{kind:"column",table:$.table.id,column:$.id,change:{kind:"change_type",to:zj(O.to)}}],{baseVersions:[{table:$.table,version:j}]}),"column","type_changed")}async columnConversion($,O){return this.assertOwns(`column ${$.id}`,$.table.database),J(await this.client.storage.convertDatabaseColumn({path:{id:this.id,table_id:$.table.id,column_id:$.id},body:{to:zj(O)}}))}async convertColumnIntoNewColumn($,O){let j=await this.columnConversion($,O.to),x=O.name??`${await $.name()} (${n6(O.to)})`,S=h$(),K=[{kind:"column",table:$.table.id,column:S,change:{kind:"create",definition:{source:"new",name:x,type:zj(O.to),options:nx(j.options)},after:$.id}}];if(j.cells.length>0)K.push({kind:"rows",table:$.table.id,change:{kind:"update",changes:{kind:"per_row",rows:j.cells.map(({row:X,value:G})=>({row:X,cells:[{column:S,value:G}]}))}}});let[Z]=await this.applyOps(K,{baseVersions:[{table:$.table,version:j.tableVersion}]});if(!k1(Z,"column","created"))throw new b(`expected a column.created result, got ${Z?sx(Z):"none"}`);return M$.byId($.table,Z.column)}async deleteColumn($){this.assertOwns(`column ${$.id}`,$.table.database);let O=await $.table.version(),{tableVersion:j}=m$(await this.applyOps([{kind:"column",table:$.table.id,column:$.id,change:{kind:"delete"}}],{baseVersions:[{table:$.table,version:O}]}),"column","deleted");return j}async reorderColumns($,O){this.assertOwns(`table ${$.id}`,$.database);for(let S of O)if(S.table.id!==$.id)throw new b(`column ${S.id} does not belong to table ${$.id}`);let j=await $.version(),{tableVersion:x}=m$(await this.applyOps([{kind:"table",table:$.id,change:{kind:"reorder_columns",order:O.map((S)=>S.id)}}],{baseVersions:[{table:$,version:j}]}),"table","columns_reordered");if(x===void 0)throw new b(`table ${$.id} reordered its columns without a version`);return x}async renameTable($,O){this.assertOwns(`table ${$.id}`,$.database);let j=await $.name(),{tableVersion:x}=m$(await this.applyOps([{kind:"table",table:$.id,change:{kind:"rename",name:O,previousName:j}}]),"table","renamed");if(x===void 0)throw new b(`table ${$.id} was renamed without a version`);return x}async renameColumn($,O){this.assertOwns(`column ${$.id}`,$.table.database);let j=await $.name(),{tableVersion:x}=m$(await this.applyOps([{kind:"column",table:$.table.id,column:$.id,change:{kind:"rename",name:O,previousName:j}}]),"column","renamed");return x}async inferColumnType($,O){return this.assertOwns(`column ${$.id}`,$.table.database),this.mutate((j)=>j.storage.inferDatabaseColumnType({path:{id:this.id,table_id:$.table.id,column_id:$.id},body:{dataType:O.dataType,baseVersion:O.baseVersion,...O.specificEntityType!==void 0?{specificEntityType:O.specificEntityType}:{}}}))}async addColumn($,O){if(this.assertOwns(`table ${$.id}`,$.database),O.after!==void 0&&O.after.table.id!==$.id)throw new b(`column ${O.after.id} does not belong to table ${$.id}`);let j="property"in O?{source:"existing",property:O.property.id}:{source:"new",name:O.name,type:zj(O.type),...O.options!==void 0?{options:nx(O.options)}:{},...O.inferType!==void 0?{inferType:O.inferType}:{}},{column:x}=m$(await this.applyOps([{kind:"column",table:$.id,column:h$(),change:{kind:"create",definition:j,...O.after!==void 0?{after:O.after.id}:{}}}]),"column","created");return M$.byId($,x)}async addColumnOptions($,O){return this.assertOwns(`column ${$.id}`,$.table.database),m$(await this.applyOps([{kind:"column",table:$.table.id,column:$.id,change:{kind:"add_options",options:nx(O)}}]),"column","options_added")}}class ex{client;constructor($){this.client=$}query($,O){return Nj(this.client,Q$.byId,$,O)}byId($){return Q$.byId(this.client,$)}create($){return Q$.create(this.client,$)}list(){return Q$.list(this.client)}}class GO extends A{document;toJSON(){return{...super.toJSON(),documentId:this.document.id}}constructor($,O,j,x){super($,j,x);this.document=O}static byId($,O,j){return new GO($,O,j)}static from($,O,j){return new GO($,O,j.uuid,j)}async fetch(){let $=J(await this.client.storage.getDocumentAnchors({path:{document_id:this.document.id}})).data.find((O)=>O.uuid===this.id);if(!$)throw new w(`Annotation ${this.id} is unavailable`);return $}kind=this.field("anchorType");page=this.field("page");async edit($){if(await this.kind()!=="placeable")throw Error("Only placeable comment annotations can be edited");await this.mutate((O)=>O.storage.editAnchor({body:{...$,uuid:this.id,anchorType:"free-comment",fileType:"pdf"}}))}async delete(){if(await this.kind()!=="highlight")throw Error("Only standalone highlights can be deleted with this endpoint");await this.mutate(($)=>$.storage.deleteAnchor({body:{uuid:this.id,anchorType:"highlight",fileType:"pdf"}}))}}class c$ extends A{documentId;constructor($,O,j,x){super($,j,x);this.documentId=O}get path(){return{parent_type:"document",parent_id:this.documentId,id:this.id}}async fetch(){return J(await this.client.storage.entityMessageGetMessage({path:this.path}))}static byId($,O,j){return new c$($,O,j)}static from($,O,j){return new c$($,O,j.id,j)}text=this.field("content");createdAt=this.field("created_at");updatedAt=this.field("updated_at");async threadId(){return(await this.detail.get()).thread_id??this.id}document(){return q.byId(this.client,this.documentId)}async author(){return M.byId(this.client,(await this.detail.get()).sender_id)}async reply($){return this.document().comment($,{threadId:await this.threadId()})}async edit($){let{content:O,mentions:j}=$$($);return await this.mutate((x)=>x.storage.entityMessageEdit({path:this.path,body:{content:O,mentions:j}})),this}async delete(){await this.mutate(($)=>$.storage.entityMessageDeleteMessage({path:this.path}))}}class lO{client;document;id;detail;constructor($,O,j){this.client=$;this.document=O;this.id=j;this.detail=new J$(async()=>J(await this.client.storage.getDocumentVersion({path:{document_id:O.id,document_version_id:j}})).data)}static byId($,O,j){return new lO($,O,j)}read(){return this.detail.get()}toJSON(){return{id:this.id,documentId:this.document.id}}}var s6=8;class q extends S${async anchors(){return J(await this.client.storage.getDocumentAnchors({path:{document_id:this.id}})).data.map(($)=>GO.from(this.client,this,$))}async createHighlight($){return GO.from(this.client,this,J(await this.client.storage.createAnchor({path:{document_id:this.id},body:{...$,fileType:"pdf",anchorType:"highlight"}})))}version($){return lO.byId(this.client,this,$)}async sharePermissions(){return J(await this.client.storage.getDocumentPermissionsV2({path:{document_id:this.id}})).documentPermissions}async permissionsToken(){return J(await this.client.storage.getDocumentPermissionsToken({path:{document_id:this.id}})).token}async prepareSave($){return J(await this.client.storage.presaveDocumentHandler({path:{document_id:this.id},body:{newBom:$}})).data}async save($){return(await this.mutate((O)=>O.storage.saveDocumentHandler({path:{document_id:this.id},body:$}))).data}async simpleSave(){return(await this.mutate(($)=>$.storage.simpleSave({path:{document_id:this.id}}))).data}messageThreadById($){return W$.byId(this.client,{type:"document",entity:this},$)}timelinePage($){return E$(this.client,{type:"document",entity:this},(O)=>c$.from(this.client,this.id,O),$)}access=new o(this.client,"document",this);async fetch(){let{data:$}=J(await this.client.storage.getDocument({path:{document_id:this.id}}));return $.documentMetadata}static byId($,O){return new q($,O)}static async create($,O){let{documentId:j}=J(await $.storage.createMarkdownHandler({body:{documentName:O.name,markdown:O.markdown??null,projectId:O.project?.id??null}}));return new q($,j)}static async createSnippet($,O){let{documentId:j}=J(await $.storage.createSnippetHandler({body:{snippetName:O.name,markdown:O.markdown??null,projectId:O.project?.id??null}}));return new q($,j)}static async createSkill($,O){let{documentId:j}=J(await $.storage.createSkillHandler({body:{skillName:O.name,markdown:O.markdown??null,projectId:O.project?.id??null}}));return new q($,j)}static recent($,O){let j=O?.pageSize??50;return a(async(x)=>{let S=J(await $.storage.getUserDocumentsHandler({query:{limit:j,offset:x?Number(x):0,...O?.fileType!==void 0?{file_type:O.fileType}:{}}})),K=S.data?.next_offset;return{items:(S.data?.documents??[]).map((Z)=>new q($,Z.documentId)),nextCursor:K!=null?String(K):null}})}static async recentlyDeleted($){let{data:O}=J(await $.storage.recentlyDeleted({}));return O.items.filter((j)=>j.type==="document").map((j)=>new q($,j.id))}entityType="document";propertyEntityType="DOCUMENT";name=this.field("documentName");fileType=this.field("fileType");project=this.mappedField("projectId",($)=>$?n.byId(this.client,$):void 0);owner=this.mappedField("owner",($)=>M.byId(this.client,$));branchedFrom=this.mappedField("branchedFromId",($)=>$?q.byId(this.client,$):void 0);createdAt=this.field("createdAt");updatedAt=this.field("updatedAt");deletedAt=this.field("deletedAt");async content(){let{text:$}=J(await this.client.storage.getDocumentTextContent({path:{document_id:this.id}}));if($!==null)return $;let{presigned_url:O}=J(await this.client.storage.exportDocument({path:{document_id:this.id}})),j=await fetch(O);if(!j.ok)throw new SO(j.status,{message:"failed to download document content"});return j.text()}async rename($){await this.mutate((O)=>O.storage.editDocument({path:{document_id:this.id},body:{documentName:$}}))}async move($){await this.mutate((O)=>O.storage.editDocument({path:{document_id:this.id},body:{projectId:$?.id??""}}))}async delete($){await this.mutate((O)=>$?.permanent?O.storage.permanentlyDeleteDocument({path:{document_id:this.id}}):O.storage.deleteDocument({path:{document_id:this.id}}))}async restore(){await this.mutate(($)=>$.storage.revertDeleteDocument({path:{document_id:this.id}}))}async copy($){let{data:O}=J(await this.client.storage.copyDocument({path:{document_id:this.id},query:$.versionId!==void 0?{version_id:$.versionId}:void 0,body:{documentName:$.name}}));return new q(this.client,O.documentMetadata.documentId)}async comments(){let $={parent_type:"document",parent_id:this.id},O=a(async(x)=>{let S=J(await this.client.storage.messageTimeline({path:$,query:{selection:JSON.stringify({limit:100,cursor:x})}}));return{items:S.items,nextCursor:S.next_cursor}}),j=[];for await(let x of O)j.push(x);return bO(j,s6,async(x)=>{let{state:S,root:K,replies:Z}=J(await this.client.storage.entityMessageGetThread({path:{...$,id:x.id}}));return{thread:S,comments:[K,...Z].map((X)=>c$.from(this.client,this.id,X))}})}async comment($,O){let j=await this.mutate((x)=>x.storage.entityMessageCreate({path:{parent_type:"document",parent_id:this.id},body:{...$$($),thread_id:O?.threadId??null}}));return c$.from(this.client,this.id,j)}async shortId(){return J(await this.client.storage.getDocumentShortId({path:{document_id:this.id}}))}async teamShare(){return J(await this.client.storage.getDocumentTeamShare({path:{document_id:this.id}}))}async setTeamShare($){await this.mutate((O)=>O.storage.setDocumentTeamShare({path:{document_id:this.id},body:{shareWithTeam:$}}))}async githubPullRequests(){let{pullRequests:$}=J(await this.client.storage.getDocumentGithubPullRequests({path:{document_id:this.id}}));return $}async branchName(){let{branchName:$}=J(await this.client.storage.getDocumentBranchName({path:{document_id:this.id}}));return $}webUrl(){return`${this.client.webAppUrl}/app/md/${this.id}`}static search=j$({filters:{document_filters:{}},type:"document",make:($,O)=>new q($,O.document_id)});toMention(){let $=this.detail.peek();return{tag:l$("m-document-mention",{documentId:this.id,documentName:$?.documentName??"",blockName:$?.fileType??"md"}),mention:{entity_type:"document",entity_id:this.id}}}}class Ij{id;name;constructor($,O){this.id=$;this.name=O}static async list($){let{skills:O}=J(await $.storage.getSystemSkillsHandler());return O.map((j)=>new Ij(j.id,j.name))}}class ox{client;async byTeamSlug($){let O=J(await this.client.storage.getDocumentByTeamSlug({path:{slug:$}}));if(typeof O!=="object"||O===null||!("data"in O)||typeof O.data!=="object"||O.data===null||!("documentMetadata"in O.data)||typeof O.data.documentMetadata!=="object"||O.data.documentMetadata===null||!("documentId"in O.data.documentMetadata)||typeof O.data.documentMetadata.documentId!=="string")throw Error("Invalid team task document response");return q.byId(this.client,O.data.documentMetadata.documentId)}async validatePermissionsToken($){let O=J(await this.client.storage.validateDocumentPermissionsToken({body:{token:$}}));return{document:q.byId(this.client,O.document_id),user:O.user_id?M.byId(this.client,O.user_id):void 0,accessLevel:O.access_level,expiresAt:O.exp,issuer:O.iss}}async createUpload($){let O={documentName:$.name,sha:$.sha,fileType:$.fileType,mimeType:$.mimeType,projectId:$.project?.id,teamId:$.team?.id,branchedFromId:$.branchedFrom?.id,emailAttachmentId:$.attachment?.id,isTask:$.isTask},j=J(await this.client.storage.createDocument({body:O})).data;return{document:q.byId(this.client,j.documentMetadata.documentId),uploadUrl:j.presignedUrl??void 0,contentType:j.contentType,content:j.documentMetadata.content}}constructor($){this.client=$}byId($){return q.byId(this.client,$)}create($){return q.create(this.client,$)}createSnippet($){return q.createSnippet(this.client,$)}createSkill($){return q.createSkill(this.client,$)}systemSkills(){return Ij.list(this.client)}search($,O){return q.search(this.client,$,O)}recent($){return q.recent(this.client,$)}recentlyDeleted(){return q.recentlyDeleted(this.client)}}class KO extends A{async fetch(){let{attachment:$}=J(await this.client.email.getAttachment({path:{id:this.id}}));return $}static byId($,O){return new KO($,O)}static from($,O){return new KO($,O.db_id,O)}filename=this.field("filename");mimeType=this.field("mime_type");size=this.field("size_bytes");dataUrl=this.field("data_url");sfsId=this.field("sfs_id");contentId=this.field("content_id");async toDocument(){let{document_id:$}=J(await this.client.email.getAttachmentDocumentId({path:{id:this.id}}));return q.byId(this.client,$)}}class H$ extends S${access=new o(this.client,"email_thread",this);async followup(){return J(await this.client.storage.getEmailFollowup({path:{thread_id:this.id}}))}async setFollowup($){return J(await this.client.storage.setEmailFollowup({path:{thread_id:this.id},body:$}))}async calendarInvitations(){return J(await this.client.email.getThreadCalendarInvitations({path:{thread_id:this.id}}))}async update($){await this.mutate((O)=>O.storage.editThreadV2({path:{thread_id:this.id},body:{projectId:$.project===void 0?void 0:$.project?.id??null,sharePermission:$.sharePermission?r$($.sharePermission):void 0}}))}entityType="email_thread";propertyEntityType="THREAD";async fetch(){let{thread:$}=J(await this.client.email.getThread({path:{thread_id:this.id},query:{limit:100}}));return $}static byId($,O){return new H$($,O)}createdAt=this.field("created_at");updatedAt=this.field("updated_at");isRead=this.field("is_read");inboxVisible=this.field("inbox_visible");accessLevel=this.field("access_level");providerId=this.field("provider_id");link=this.mappedField("link_id",($)=>U$.byId(this.client,$));project=this.mappedField("project_id",($)=>$?n.byId(this.client,$):void 0);latestInboundAt=this.field("latest_inbound_message_ts");latestOutboundAt=this.field("latest_outbound_message_ts");latestNonSpamAt=this.field("latest_non_spam_message_ts");async subject(){let{messages:$}=await this.detail.get();for(let O of $)if(O.subject)return O.subject;return}async participants(){let{messages:$}=await this.detail.get(),O=new Map;for(let j of $)for(let x of[j.from,...j.to,...j.cc,...j.bcc])if(x&&!O.has(x.email))O.set(x.email,x);return[...O.values()]}async messages($){return J(await this.client.email.getThreadMessagesHandler({path:{id:this.id},query:{...$?.since?{since:$.since}:{},...$?.limit?{limit:$.limit}:{}}})).map((j)=>R$.from(this.client,j))}async attachments(){let{messages:$}=await this.detail.get();return $.flatMap((O)=>O.attachments.map((j)=>KO.from(this.client,j)))}async reply($){let O=$.subject??await this.subject()??"",{message:j}=await this.mutate((x)=>x.email.sendMessage({body:{message:{thread_db_id:this.id,replying_to_id:$.replyingTo?.id??null,to:$.to,cc:$.cc??null,bcc:$.bcc??null,subject:O,body_text:$.bodyText}}}));return j.db_id?R$.byId(this.client,j.db_id):void 0}async archive($=!0){await this.mutate((O)=>O.email.archiveThread({path:{id:this.id},body:{value:$}}))}async updateState($){await this.mutate((O)=>O.email.updateThreadState({path:{id:this.id},body:$}))}async operations(){return J(await this.client.email.threadOperations({path:{id:this.id}}))}async markSeen(){await this.mutate(($)=>$.email.threadSeen({path:{id:this.id}}))}async addLabel($){await this.mutate((O)=>O.email.addRemoveThreadLabel({path:{id:this.id},body:{label_id:$.id,value:!0}}))}async removeLabel($){await this.mutate((O)=>O.email.addRemoveThreadLabel({path:{id:this.id},body:{label_id:$.id,value:!1}}))}async moveToProject($){await this.mutate((O)=>O.email.updateThreadProject({path:{thread_id:this.id},body:{projectId:$?.id??null}}))}static search=j$({filters:{email_filters:{}},type:"email",make:($,O)=>new H$($,O.thread_id)})}class R$ extends A{async fetch(){return J(await this.client.email.getMessage({path:{id:this.id}}))}static byId($,O){return new R$($,O)}static from($,O){return new R$($,O.db_id,O)}static async send($,O){let{message:j}=J(await $.email.sendMessage({body:{message:{to:O.to,cc:O.cc??null,bcc:O.bcc??null,subject:O.subject,body_text:O.bodyText}}}));return j.db_id?R$.byId($,j.db_id):void 0}subject=this.field("subject");from=this.field("from");to=this.field("to");cc=this.field("cc");bcc=this.field("bcc");body=this.field("body_parsed");sentAt=this.field("internal_date_ts");labels=this.field("labels");link=this.mappedField("link_id",($)=>U$.byId(this.client,$));async operationStatus(){return J(await this.client.email.messageOperationStatus({path:{id:this.id}}))}async resolveOperation($){await this.mutate((O)=>O.email.resolveMessageOperation({path:{id:this.id},body:$}))}async completeDraftAttachment($){let O=await this.link();await this.mutate((j)=>j.email.completeDraftAttachment({path:{id:this.id,attachment_id:$},headers:{"X-Email-Link-Id":O.id}}))}async transferDraft($){let O=await this.link();return this.mutate((j)=>j.email.transferDraft({path:{id:this.id},body:$,headers:{"X-Email-Link-Id":O.id}}))}async addLabel($){await this.mutate((O)=>O.email.addRemoveLabel({body:{label_id:$.id,message_ids:[this.id],value:!0}}))}async removeLabel($){await this.mutate((O)=>O.email.addRemoveLabel({body:{label_id:$.id,message_ids:[this.id],value:!1}}))}async thread(){return H$.byId(this.client,(await this.detail.get()).thread_db_id)}}class YO extends R${async inboxHeaders(){return{"X-Email-Link-Id":(await this.link()).id}}static byId($,O){return new YO($,O)}async update($){let O=await this.inboxHeaders();await this.mutate((j)=>j.email.createDraft({headers:O,body:{draft:{...$0($),db_id:this.id}}}))}async delete(){let $=await this.inboxHeaders();await this.mutate((O)=>O.email.deleteDraft({path:{id:this.id},headers:$}))}async schedule($,O){let j=await this.inboxHeaders();await this.mutate((x)=>x.email.upsertScheduledMessage({path:{id:this.id},headers:j,body:{send_time:$,include_signature:O?.includeSignature}}))}async unschedule(){let $=await this.inboxHeaders();await this.mutate((O)=>O.email.deleteScheduledDraft({path:{message_id:this.id},headers:$}))}async addAttachment($){let O={file_name:$.fileName,sha:$.sha,size:$.size,upload_id:$.uploadId},j=await this.inboxHeaders(),x=await this.mutate((S)=>S.email.addDraftAttachment({path:{id:this.id},headers:j,body:O}));return{attachment:rO.byId(this.client,this,x.attachment_id),uploadUrl:x.upload_url,contentType:x.content_type}}async forwardAttachment($){let O=await this.inboxHeaders(),j=await this.mutate((x)=>x.email.addForwardedAttachment({path:{id:this.id},headers:O,body:{attachment_id:$.id}}));return rO.byId(this.client,this,j.attachment_id,!0)}async removeAttachment($){if($.draft.id!==this.id)throw Error("Attachment belongs to another draft");let O=await this.inboxHeaders();if($.forwarded)await this.mutate((j)=>j.email.removeForwardedAttachment({path:{id:this.id,attachment_id:$.id},headers:O}));else await this.mutate((j)=>j.email.removeDraftAttachment({path:{id:this.id,attachment_id:$.id},headers:O}))}async verifyAttachment($){if($.draft.id!==this.id||$.forwarded)throw Error("Expected an uploaded attachment on this draft");await this.completeDraftAttachment($.id)}}class rO{draft;id;forwarded;constructor($,O,j){this.draft=$;this.id=O;this.forwarded=j}static byId($,O,j,x=!1){return new rO(O,j,x)}complete(){return this.draft.verifyAttachment(this)}remove(){return this.draft.removeAttachment(this)}toJSON(){return{id:this.id,draftId:this.draft.id,forwarded:this.forwarded}}}function $0($){let{bodyText:O,bodyHtml:j,bodyMacro:x,headers:S,includeSignature:K,thread:Z,replyingTo:X,...G}=$;return{...G,body_text:O,body_html:j===void 0?void 0:btoa(Array.from(new TextEncoder().encode(j),(L)=>String.fromCharCode(L)).join("")).replaceAll("+","-").replaceAll("/","_").replaceAll("=",""),body_macro:x,headers_json:S,include_signature:K,thread_db_id:Z?.id,replying_to_id:X?.id}}class QO extends A{inbox;constructor($,O,j,x){super($,O,j);this.inbox=x}get headers(){return this.inbox?{"X-Email-Link-Id":this.inbox.id}:void 0}static byId($,O,j){return new QO($,O,void 0,j)}static from($,O,j){return new QO($,O.id,O,j)}async fetch(){let $=J(await this.client.email.listEmailFilters({headers:this.headers})).filters.find((O)=>O.id===this.id);if(!$)throw new w(`Email filter ${this.id} is unavailable`);return $}emailAddress=this.field("email_address");emailDomain=this.field("email_domain");isImportant=this.field("is_important");async setImportant($){let O=await this.detail.get();await this.mutate((j)=>j.email.upsertEmailFilter({headers:this.headers,body:{email_address:O.email_address,email_domain:O.email_domain,is_important:$}}))}async delete(){await this.mutate(($)=>$.email.deleteEmailFilter({path:{id:this.id},headers:this.headers}))}}class e$ extends A{async fetch(){let{labels:$}=J(await this.client.email.listLabels()),O=$.find((j)=>j.id===this.id);if(!O)throw new w(`label ${this.id} not found`);return O}static byId($,O){return new e$($,O)}static async list($){let{labels:O}=J(await $.email.listLabels());return O.map((j)=>new e$($,j.id,j))}static async create($,O){let{label:j}=J(await $.email.createLabel({body:{label_name:O}}));if(!j.id)throw new b("created label has no id");return new e$($,j.id)}async delete(){J(await this.client.email.deleteLabel({path:{id:this.id}}))}name=this.field("name");linkId=this.field("linkId");type=this.field("type");createdAt=this.field("createdAt");labelListVisibility=this.field("labelListVisibility");messageListVisibility=this.field("messageListVisibility")}class O0{client;async createDraft($,O){let j=J(await this.client.email.createDraft({body:{draft:$0($)},headers:O?{"X-Email-Link-Id":O.id}:void 0}));if(!j.draft.db_id)throw Error("Draft response has no message id");return YO.byId(this.client,j.draft.db_id)}draftById($){return YO.byId(this.client,$)}async*scheduled($){let O=$?.pageSize??100;if(!Number.isInteger(O)||O<1)throw Error("pageSize must be positive");let j=Math.min(O,1000);for(let x=0;;x+=j){let S=J(await this.client.email.getScheduledMessages({query:{offset:x,limit:j},headers:$?.inbox?{"X-Email-Link-Id":$.inbox.id}:void 0}));for(let K of S.messages)yield YO.byId(this.client,K.db_id);if(S.messages.length<j)return}}async filters($){return J(await this.client.email.listEmailFilters({headers:$?{"X-Email-Link-Id":$.id}:void 0})).filters.map((O)=>QO.from(this.client,O,$))}async upsertFilter($,O){return QO.from(this.client,J(await this.client.email.upsertEmailFilter({headers:O?{"X-Email-Link-Id":O.id}:void 0,body:{email_address:$.emailAddress,email_domain:$.emailDomain,is_important:$.isImportant}})).filter,O)}async contacts(){return J(await this.client.email.listContacts()).contacts}reminders($){let{inboxes:O,...j}=$??{};return a(async(x)=>{let S=J(await this.client.storage.listEmailReminders({query:{...j,inboxIds:O?.map((K)=>K.id),cursor:x}}));return{items:S.items.map(({threadId:K,...Z})=>({...Z,thread:H$.byId(this.client,K)})),nextCursor:S.nextCursor}})}constructor($){this.client=$}byId($){return H$.byId(this.client,$)}message($){return R$.byId(this.client,$)}attachment($){return KO.byId(this.client,$)}link($){return U$.byId(this.client,$)}links(){return U$.list(this.client)}async connectionProviders(){return J(await this.client.auth.emailConnectionProviders())}async recoverDraftTransfer($){return J(await this.client.email.recoverDraftTransfer({path:{id:$}}))}send($){return R$.send(this.client,$)}search($,O){return H$.search(this.client,$,O)}inbox($){return a(async(O)=>{let j=J(await this.client.email.previewsInboxCursor({path:{view:"inbox"},query:{...$?.pageSize?{limit:$.pageSize}:{},...$?.sort?{sort_method:$.sort}:{},...O?{cursor:O}:{}}}));return{items:j.items.map((x)=>H$.byId(this.client,x.id)),nextCursor:j.next_cursor}})}label($){return e$.byId(this.client,$)}labels(){return e$.list(this.client)}createLabel($){return e$.create(this.client,$)}async deleteLabel($){J(await this.client.email.deleteLabel({path:{id:$.id}}))}async blockSender($){J(await this.client.email.blockSender({body:{email_address:$}}))}async unblockSender($){J(await this.client.email.unblockSender({body:{email_address:$}}))}async blockedSenders(){return J(await this.client.email.listBlockedSenders()).blocked_emails}}class BO{client;id;constructor($,O){this.client=$;this.id=O}static byId($,O){return new BO($,O)}async delete(){J(await this.client.storage.deleteEntityMention({path:{mention_id:this.id}}))}toJSON(){return{id:this.id}}}class j0{client;constructor($){this.client=$}byId($){return BO.byId(this.client,$)}async create($,O){let j=J(await this.client.storage.createEntityMention({body:{source_entity_id:$.entity.id,source_entity_type:$.type,entity_id:O.entity.id,entity_type:O.type}}));return BO.byId(this.client,j.id)}}class x0{client;constructor($){this.client=$}async list($={}){let{favorites:O}=J(await this.client.storage.listFavorites({query:{entityType:$.entityTypes,entityId:$.entityIds}}));return O}async add($){return J(await this.client.storage.addFavorite({body:{entityId:$.id,entityType:$.entityType}}))}async remove($){J(await this.client.storage.removeFavoriteByEntity({path:{entity_type:$.entityType,entity_id:$.id}}))}async reorder($){J(await this.client.storage.reorderFavorites({body:{favorites:$}}))}}class o$ extends F${entityType="foreign_entity";async fetch(){return J(await this.client.storage.getForeignEntity({path:{id:this.id}}))}static byId($,O){return new o$($,O)}static fromRecord($,O){return new o$($,O.id,O)}foreignEntityId=this.field("foreignEntityId");source=this.field("foreignEntitySource");storedForId=this.field("storedForId");storedForAuthEntity=this.field("storedForAuthEntity");createdAt=this.field("createdAt");updatedAt=this.field("updatedAt");async metadata(){return(await this.detail.get()).metadata}}function g1({login:$,...O}){return{...O,login:$??void 0}}class S0{client;constructor($){this.client=$}byId($){return o$.byId(this.client,$)}async bySource($,O){return o$.fromRecord(this.client,J(await this.client.storage.getForeignEntityBySource({path:{source:$,foreign_entity_id:O}})))}async githubPullRequestFacets(){let{repositories:$,authors:O,assignees:j,labels:x}=J(await this.client.storage.getGithubPullRequestFacets());return{repositories:$,authors:O.map(g1),assignees:j.map(g1),labels:x.map(({color:S,...K})=>({...K,color:S??void 0}))}}}class u${form;id;constructor($,O){this.form=$;this.id=O}static byId($,O){return new u$($,O)}async detail(){let O=(await this.form.schema()).sections.flatMap((j)=>j.kind==="questions"?j.questions:[]).find((j)=>j.id===this.id);if(!O)throw new w(`question ${this.id} is not on form ${this.form.id}`);return O}async title(){return(await this.detail()).title}async column(){return M$.byId(await this.form.table(),(await this.detail()).column)}async options(){return(await this.detail()).options.map(($)=>JO.byId(this,$.id))}}class JO{question;id;constructor($,O){this.question=$;this.id=O}static byId($,O){return new JO($,O)}async detail(){let $=(await this.question.detail()).options.find((O)=>O.id===this.id);if(!$)throw new w(`option ${this.id} is not on question ${this.question.id}`);return $}async label(){return(await this.detail()).label}async color(){return(await this.detail()).color??void 0}}class LO{form;id;detail;constructor($,O,j){this.form=$;this.id=O;this.detail=new J$(()=>this.load(),j)}async load(){let $=await this.form.myResponse();if($.response.id!==this.id)throw new w(`response ${this.id} is not your current response`);return $}static byId($,O,j){return new LO($,O,j)}async status(){return(await this.detail.get()).status}async row(){return(await this.detail.get()).row}async answers(){return(await this.detail.get()).answers}async booking(){return(await this.detail.get()).booking}async refresh(){let $=await this.load();return this.detail=new J$(()=>this.load(),$),this}}class d${form;id;constructor($,O){this.form=$;this.id=O}static byId($,O){return new d$($,O)}async detail(){let $=(await this.form.schema()).sections.find((O)=>O.id===this.id);if(!$)throw new w(`section ${this.id} is not on form ${this.form.id}`);return $}async title(){return(await this.detail()).title}async questions(){let $=await this.detail();return $.kind==="questions"?$.questions.map((O)=>u$.byId(this.form,O.id)):[]}}class Tj{entityType;id;constructor($,O){this.entityType=$;this.id=O}static byId($,O){return new Tj($,O)}}class k$ extends A{async fetch(){return J(await this.client.storage.getForm({path:{id:this.id}}))}static byId($,O){return new k$($,O)}static async create($,O){let j=J(await $.storage.createForm({body:{name:O.name,source:O.table?{kind:"table",databaseId:O.table.database.id,tableId:O.table.id}:{kind:"new"}}}));return new k$($,j.form.id,j)}static async list($,O){if(!O)return J(await $.storage.listAccessibleForms()).map(({form:S})=>new k$($,S.id));return J(await $.storage.listForms({query:{databaseId:O.id}})).map((x)=>new k$($,x.id))}schema(){return this.detail.get()}name=this.mappedField("form",($)=>$.name);description=this.mappedField("form",($)=>$.description);owner=this.mappedField("form",($)=>M.byId(this.client,$.ownerId));database=this.mappedField("form",($)=>Q$.byId(this.client,$.databaseId));table=this.mappedField("form",($)=>Y$.byId(Q$.byId(this.client,$.databaseId),$.tableId));audience=this.mappedField("form",($)=>$.audience);status=this.mappedField("form",($)=>$.status);closesAt=this.mappedField("form",($)=>$.closesAt??void 0);access=this.field("access");async sections(){return(await this.detail.get()).sections.map(($)=>d$.byId(this,$.id))}async questions(){return(await this.detail.get()).sections.flatMap(($)=>$.kind==="questions"?$.questions.map((O)=>u$.byId(this,O.id)):[])}async update($){return await this.mutate((O)=>O.storage.updateForm({path:{id:this.id},body:$})),this}assertOwns($){if($.form.id!==this.id)throw new b(`question or section does not belong to form ${this.id}`)}async replaceLayout($){let O=await this.table(),j=(Z)=>{if(Z.table.id!==O.id||Z.table.database.id!==O.database.id)throw new b(`column does not belong to form ${this.id}'s table`);return Z.id},x=(Z)=>({conjunction:Z.conjunction,conditions:Z.conditions.map((X)=>c(X).with({kind:"group"},(G)=>({kind:"group",...x(G)})).with({kind:"condition"},(G)=>({kind:"condition",column:j(G.column),test:c(G.test).with({kind:"options"},(L)=>({...L,options:L.options.map((Y)=>Y.id)})).with({kind:"entities"},(L)=>({...L,entities:L.entities.map((Y)=>Y.id)})).with({kind:x$.union("presence","text","number","date","checkbox")},(L)=>L).exhaustive()})).exhaustive())}),S={sections:$.map((Z)=>{if(Z.section)this.assertOwns(Z.section);let X={id:Z.section?.id??h$(),title:Z.title,description:Z.description??""};return c(Z).with({kind:"booking"},(G)=>({...X,kind:"booking",target:G.target})).with({kind:"gate"},(G)=>({...X,kind:"gate",rules:x(G.rules),message:G.message})).with({kind:"questions"},(G)=>({...X,kind:"questions",questions:G.questions.map((L)=>{if(L.question)this.assertOwns(L.question);return{id:L.question?.id??h$(),column:j(L.column),helpText:L.helpText??"",required:L.required??!1,widget:L.widget??null}})})).exhaustive()})},K=await this.mutate((Z)=>Z.storage.putFormLayout({path:{id:this.id},body:S}));return{form:this,publicationError:K.publicationError}}wireAnswers($){return $.map(({question:O,value:j})=>{this.assertOwns(O);let x=c(j).with({type:"rows"},(S)=>({type:"rows",value:S.value.map((K)=>K.id)})).with({type:"options"},(S)=>({type:"options",value:S.value.map((K)=>{if(K.question.id!==O.id||K.question.form.id!==this.id)throw new b("option does not belong to the answered question");return{id:K.id}})})).with({type:"entities"},(S)=>({type:"entities",value:S.value.map(({entityType:K,entity:Z})=>({entityType:K,entityId:Z.id}))})).with({type:x$.union("text","number","boolean","date","link","clear")},(S)=>S).exhaustive();return{question:O.id,value:x}})}unlockedBooking($){return $?{...$,section:d$.byId(this,$.section)}:void 0}async outcome($,O){return c($).with({outcome:"stopped"},(j)=>({...j,section:d$.byId(this,j.section)})).with({outcome:"submitted"},async(j)=>{let x=A$.byId(await this.table(),j.row),S=this.unlockedBooking(j.booking);return{outcome:"submitted",response:LO.byId(this,j.response,{status:"submitted",row:x,answers:O,booking:S}),row:x,...S?{booking:S}:{}}}).exhaustive()}async submit($){let O={answers:this.wireAnswers($)};return this.outcome(J(await this.client.storage.submitFormResponse({path:{id:this.id},body:O})),$)}async editResponse($){let O={answers:this.wireAnswers($)};return this.outcome(J(await this.client.storage.editMyFormResponse({path:{id:this.id},body:O})),$)}async myResponse(){let $=J(await this.client.storage.getMyFormResponse({path:{id:this.id}})),O=await this.table(),j=await Promise.all($.answers.map(async(K)=>{let Z=u$.byId(this,K.question),X=await c(K.value).with({type:"options"},(G)=>({type:"options",value:G.value.map((L)=>{if(!("id"in L))throw new b("stored form answers must reference options by id");return JO.byId(Z,L.id)})})).with({type:"entities"},(G)=>({type:"entities",value:G.value.map((L)=>({entityType:L.entityType,entity:Tj.byId(L.entityType,L.entityId)}))})).with({type:"rows"},async(G)=>{let L=await Z.detail();if(L.kind.type!=="relation")throw new b("row answer requires a relation question");let Y=Y$.byId(Q$.byId(this.client,L.kind.database),L.kind.table);return{type:"rows",value:G.value.map((Q)=>A$.byId(Y,Q))}}).with({type:x$.union("text","number","boolean","date","link","clear")},(G)=>G).exhaustive();return{question:Z,value:X}})),x=$.response.row?A$.byId(O,$.response.row):void 0,S=this.unlockedBooking($.booking);return{...S?{booking:S}:{},response:LO.byId(this,$.response.id,{status:$.response.status,row:x,answers:j,booking:S}),status:$.response.status,stoppedAtSection:$.response.stoppedAtSection?d$.byId(this,$.response.stoppedAtSection):void 0,row:x,submittedAt:$.response.submittedAt,updatedAt:$.response.updatedAt,answers:j}}async responseSummary(){let $=J(await this.client.storage.getFormResponseSummary({path:{id:this.id}}));return{...$,stoppedBySection:$.stoppedBySection.map((O)=>({section:d$.byId(this,O.section),count:O.count}))}}async tally(){return J(await this.client.storage.getFormTally({path:{id:this.id}})).questions.map((O)=>{let j=u$.byId(this,O.question);return{question:j,responses:O.responses,buckets:O.buckets.map((x)=>({count:x.count,value:c(x.value).with({kind:"option"},(S)=>({kind:"option",option:JO.byId(j,S.option)})).with({kind:"checkbox"},(S)=>S).exhaustive()}))}})}async sharePermissions(){return J(await this.client.storage.getFormPermissions({path:{id:this.id}}))}updateSharePermissions($){return this.mutate((O)=>O.storage.updateFormPermissions({path:{id:this.id},body:$}))}webUrl(){return`${this.client.webAppUrl}/app/form/${this.id}`}respondUrl(){return`${this.client.webAppUrl}/app/form/${this.id}/respond`}}class Z0{client;constructor($){this.client=$}byId($){return k$.byId(this.client,$)}create($){return k$.create(this.client,$)}list($){return k$.list(this.client,$)}}class NO extends A{static byId($,O){return new NO($,O)}async fetch(){return J(await this.client.storage.getGithubPullRequest({path:{id:this.id}}))}title=this.field("title");url=this.field("url");status=this.field("status");async changes(){let $=J(await this.client.storage.getGithubPullRequestChanges({path:{id:this.id}}));return{changeset:$.changeset?new X0(this.client,this,$.changeset):void 0,error:$.error??void 0}}}class X0{client;pullRequest;record;constructor($,O,j){this.client=$;this.pullRequest=O;this.record=j}get id(){return this.record.id}async patch(){return J(await this.client.storage.getGithubPullRequestChangesPatch({path:{id:this.pullRequest.id},query:{changeset:this.id}})).patch}toJSON(){return{pullRequestId:this.pullRequest.id,...this.record}}}class G0{client;constructor($){this.client=$}byId($){return NO.byId(this.client,$)}forEntity($){return NO.byId(this.client,$.id)}}class UO extends A{static byId($,O){return new UO($,O)}async fetch(){return J(await this.client.storage.getHarnessPairing({path:{code:this.id}}))}name=this.field("requested_name");expiresAt=this.field("expires_at");async approve($){let O={name:$?.name,team_id:$?.team?.id,allow_permission_bypass:$?.allowPermissionBypass};return V$.from(this.client,await this.mutate((j)=>j.storage.approveHarnessPairing({path:{code:this.id},body:O})))}}class pO{client;id;constructor($,O){this.client=$;this.id=O}static byId($,O){return new pO($,O)}async claim($){let O=J(await this.client.storage.claimHarnessPairing({path:{pairing_id:this.id},body:{device_secret:$}}));return"harness"in O?{harness:V$.from(this.client,O.harness),token:O.token}:void 0}toJSON(){return{id:this.id}}}class K0{client;constructor($){this.client=$}byId($){return V$.byId(this.client,$)}async list(){return J(await this.client.storage.listHarnesses()).map(($)=>V$.from(this.client,$))}async me(){return V$.from(this.client,J(await this.client.storage.getSelfHarness()))}async deleteSelf(){J(await this.client.storage.deleteSelfHarness())}async agents(){return J(await this.client.storage.listHarnessAgents()).map(($)=>N$.byId(this.client,$.bot_id))}async sessions(){return J(await this.client.storage.listHarnessSessions()).map(($)=>i.byId(this.client,$.session_id))}pairing($){return UO.byId(this.client,$)}async createPairing($){let O=J(await this.client.storage.createHarnessPairing({body:$}));return{pairing:UO.byId(this.client,O.code),device:pO.byId(this.client,O.pairing_id),deviceSecret:O.device_secret,expiresAt:O.expires_at,pollIntervalSeconds:O.poll_interval_seconds}}}var t6="00000001-0000-0000-0000-000000000002",e6="00000001-0000-0000-0002-000000000004";function o6($){let O=$.match(/^https:\/\/github\.com\/([^/]+)\/([^/]+)\/pull\/([1-9][0-9]*)\/?(?:[?#].*)?$/i);if(!O)throw Error(`Expected a GitHub pull request URL like https://github.com/owner/repo/pull/1, got ${$}`);return`${O[1]}/${O[2]}/pull/${O[3]}`}class D$ extends q{static byId($,O){return new D$($,O)}static async create($,O){let{documentId:j}=J(await $.storage.createTaskHandler({body:{taskName:O.name,markdown:O.markdown??null,projectId:O.project?.id??null,teamId:O.team?.id??null,shareWithTeam:O.shareWithTeam??!0}}));return new D$($,j)}static async forPullRequest($,O){let j=o6(O),{pullRequests:x}=J(await $.storage.getGithubPullRequestTasks({body:{githubKeys:[j]}}));return(x[0]?.taskIds??[]).map((S)=>new D$($,S))}async completed(){let{subType:$}=await this.detail.get();if($!=="task")return;let j=(await this.properties()).find((x)=>x.definition.id===t6)?.value;return j?.type==="SelectOption"&&j.value.includes(e6)}webUrl(){return`${this.client.webAppUrl}/app/task/${this.id}`}static search=j$({filters:{document_filters:{sub_types:["task"],task_filters:{}}},type:"document",make:($,O)=>new D$($,O.document_id)})}class $O extends A{access=new o(this.client,"initiative",this);static byId($,O){return new $O($,O)}static from($,O){return new $O($,O.id,O)}async fetch(){return J(await this.client.storage.getInitiative({path:{initiative_id:this.id}}))}name=this.field("name");owner=this.mappedField("ownerId",($)=>M.byId(this.client,$));members=this.mappedField("memberIds",($)=>$.map((O)=>M.byId(this.client,O)));tasks=this.mappedField("taskIds",($)=>$.map((O)=>D$.byId(this.client,O)));accessLevel=this.field("userAccessLevel");sharePermissions=this.field("sharePermission");async update($){await this.mutate((O)=>O.storage.updateInitiative({path:{initiative_id:this.id},body:{name:$.name,memberIds:$.members?.map((j)=>j.id),sharePermission:$.sharePermission?r$($.sharePermission):void 0}}))}async delete(){await this.mutate(($)=>$.storage.deleteInitiative({path:{initiative_id:this.id}}))}}class Y0{client;constructor($){this.client=$}byId($){return $O.byId(this.client,$)}async list(){return J(await this.client.storage.listInitiatives()).initiatives.map(($)=>$O.byId(this.client,$.id))}async create($){return $O.from(this.client,J(await this.client.storage.createInitiative({body:{name:$.name,description:$.description,memberIds:$.members?.map((O)=>O.id),shareWithTeam:$.shareWithTeam,propertyValues:$.propertyValues}})))}}class Q0{client;constructor($){this.client=$}byId($){return I$.byId(this.client,$)}async create($){return I$.from(this.client,J(await this.client.storage.meetingCreate({body:$})))}async list(){return J(await this.client.storage.meetingList()).meetings.map(($)=>I$.from(this.client,$))}async active(){return J(await this.client.storage.meetingListActive()).meetings.map(($)=>I$.from(this.client,$))}async lookup($){return I$.from(this.client,J(await this.client.storage.meetingLookup({path:{token:$}})))}}class VO extends A{async fetch(){return J(await this.client.notification.getTypedNotificationById({path:{notification_id:this.id}}))}static byId($,O){return new VO($,O)}static from($,O){return new VO($,O.id,O)}static list($,O){return a(async(j)=>{let x=J(await $.notification.listTypedNotifications({query:{...O?.pageSize?{limit:O.pageSize}:{},...O?.states!==void 0?{states:O.states.join(",")}:{},...j?{cursor:j}:{}}}));return{items:x.items.map((S)=>VO.from($,S)),nextCursor:x.next_cursor}})}type=this.field("notification_event_type");createdAt=this.field("created_at");updatedAt=this.field("updated_at");state=this.field("state");done=this.mappedField("state",($)=>$==="done");sent=this.field("sent");viewedAt=this.field("viewed_at");deletedAt=this.field("deleted_at");owner=this.mappedField("owner_id",($)=>M.byId(this.client,$));sender=this.mappedField("sender_id",($)=>$?M.byId(this.client,$):void 0);metadata=this.field("notification_metadata");async seen(){return await this.state()!=="unseen"}async markSeen(){await this.mutate(($)=>$.notification.bulkMarkNotificationsSeen({body:{notificationIds:[this.id]}}))}async markDone(){await this.mutate(($)=>$.notification.bulkMarkNotificationsDone({body:{notificationIds:[this.id]}}))}async markUndone(){await this.mutate(($)=>$.notification.bulkMarkNotificationsUndone({body:{notificationIds:[this.id]}}))}async delete(){await this.mutate(($)=>$.notification.deleteUserNotificationV2({path:{notification_id:this.id}}))}}class J0{client;constructor($){this.client=$}byId($){return VO.byId(this.client,$)}list($){return VO.list(this.client,$)}async markSeen($){J(await this.client.notification.bulkMarkNotificationsSeen({body:{notificationIds:$}}))}async markDone($){J(await this.client.notification.bulkMarkNotificationsDone({body:{notificationIds:$}}))}async delete($){J(await this.client.notification.bulkDeleteUserNotificationsV2({body:{notificationIds:$}}))}async preferences(){return J(await this.client.notification.getNotificationTypePreferences())}async enableType($){J(await this.client.notification.enableNotificationType({path:{notification_event_type:$}}))}async disableType($){J(await this.client.notification.disableNotificationType({path:{notification_event_type:$}}))}}class V0{client;constructor($){this.client=$}async list(){let{data:$}=J(await this.client.storage.getPinsHandler({}));return $?.recent??[]}async add($,O){J(await this.client.storage.addPinHandler({path:{pinned_item_id:$.id},body:{pinType:$.entityType,pinIndex:O.index}}))}async remove($){J(await this.client.storage.removePinHandler({path:{pinned_item_id:$.id},body:{pinType:$.entityType}}))}async reorder($){J(await this.client.storage.reorderPinsHandler({body:$}))}}class W0{client;constructor($){this.client=$}byId($){return n.byId(this.client,$)}create($){return n.create(this.client,$)}search($,O){return n.search(this.client,$,O)}}class zO{client;definitionId;id;record;constructor($,O,j,x){this.client=$;this.definitionId=O;this.id=j;this.record=x}static from($,O,j){return new zO($,O,j.id,j)}get value(){return this.record.value}get color(){return this.record.color??void 0}get displayOrder(){return this.record.display_order}get createdAt(){return this.record.created_at}get updatedAt(){return this.record.updated_at}async update($){return this.record=J(await this.client.properties.updatePropertyOption({path:{definition_id:this.definitionId,option_id:this.id},body:$})),this}async delete(){J(await this.client.properties.deletePropertyOption({path:{definition_id:this.definitionId,option_id:this.id}}))}}class OO{client;id;detail;constructor($,O,j){this.client=$;this.id=O;this.detail=new J$(()=>this.fetch(),j)}async fetch(){return J(await this.client.properties.getPropertyDefinition({path:{definition_id:this.id}}))}static async create($,O){let j=J(await $.properties.createPropertyDefinition({body:{display_name:O.displayName,scope:O.scope,data_type:O.dataType}}));return new OO($,j.id,j)}static byId($,O){return new OO($,O)}static fromRecord($,O){return new OO($,O.id,O)}get displayName(){return this.detail.get().then(($)=>$.display_name)}get dataType(){return this.detail.get().then(($)=>$.data_type)}get owner(){return this.detail.get().then(($)=>$.owner)}get isSystem(){return this.detail.get().then(($)=>$.is_system)}get isMultiSelect(){return this.detail.get().then(($)=>$.is_multi_select)}get createdAt(){return this.detail.get().then(($)=>$.created_at)}get updatedAt(){return this.detail.get().then(($)=>$.updated_at)}async delete(){return J(await this.client.properties.deletePropertyDefinition({path:{definition_id:this.id}}))}async options(){return J(await this.client.properties.getPropertyOptions({path:{definition_id:this.id}})).map((O)=>zO.from(this.client,this.id,O))}async addOption($){let O=J(await this.client.properties.addPropertyOption({path:{definition_id:this.id},body:$}));return zO.from(this.client,this.id,O)}async updateOption($,O){let j=J(await this.client.properties.updatePropertyOption({path:{definition_id:this.id,option_id:$.id},body:O}));return zO.from(this.client,this.id,j)}async deleteOption($){return J(await this.client.properties.deletePropertyOption({path:{definition_id:this.id,option_id:$.id}}))}}class B0{client;constructor($){this.client=$}async list($){return J(await this.client.properties.listProperties({query:{scope:$?.scope??"all",...$?.forEntityType!==void 0?{for_entity_type:$.forEntityType}:{}}})).map((j)=>{let x="definition"in j?j.definition:j;return OO.fromRecord(this.client,x)})}create($){return OO.create(this.client,$)}definition($){return OO.byId(this.client,$)}async bulkEntityProperties($){return J(await this.client.properties.getBulkEntityProperties({body:$}))}async updateEntityPropertyOptions($,O){return J(await this.client.properties.bulkUpdateEntitiesPropertyOptions({body:{entities:$.map((x)=>x.propertyReference()),property_id:O.property.id,...O.add?{add_option_ids:O.add.map((x)=>x.id)}:{},...O.remove?{remove_option_ids:O.remove.map((x)=>x.id)}:{}}})).results}async addEntityPropertyOption($){return J(await this.client.properties.addEntityPropertyOption({path:{...$.entity.propertyReference(),property_id:$.property.id,option_id:$.option.id}}))}async removeEntityPropertyOption($){return J(await this.client.properties.removeEntityPropertyOption({path:{...$.entity.propertyReference(),property_id:$.property.id,option_id:$.option.id}}))}async tags(){return J(await this.client.properties.listTags({}))}}function L0($){return c($).with({type:"cron"},(O)=>O).with({type:"events"},(O)=>({type:"events",filters:O.filters.map(({entities:j,...x})=>({...x,ids:j?.map((S)=>S.entity.id)}))})).exhaustive()}function $7($){return c($).with({type:"multiple"},(O)=>({type:"multiple",triggers:O.triggers.map(L0)})).with({type:"cron"},L0).with({type:"events"},L0).exhaustive()}class jO extends A{static byId($,O){return new jO($,O)}static from($,O){if(!O.id)throw Error("Routine response has no id");return new jO($,O.id,O)}async fetch(){return J(await this.client.scheduledAction.getScheduledAction({path:{id:this.id}}))}name=this.field("name");trigger=this.field("trigger");enabled=this.field("enabled");nextRunAt=this.field("next_run_at");revision=this.field("configuration_revision");owner=this.mappedField("owner",($)=>M.byId(this.client,$));async update($){await this.mutate((O)=>O.scheduledAction.updateScheduledAction({path:{id:this.id},body:U0($)}))}async setEnabled($){await this.mutate((O)=>O.scheduledAction.setScheduledActionEnabled({path:{id:this.id},body:{enabled:$}}))}async execute(){let $=J(await this.client.scheduledAction.executeScheduledActionNow({path:{id:this.id}}));if($.resource)return c($.resource).with({type:"agent"},(O)=>i.byId(this.client,O.id)).with({type:"chat"},(O)=>Z$.byId(this.client,O.id)).exhaustive();return $.chat_id?Z$.byId(this.client,$.chat_id):void 0}async history(){return J(await this.client.scheduledAction.listScheduledActionHistory({path:{id:this.id}})).map(($)=>new N0(this,$))}async delete(){await this.mutate(($)=>$.scheduledAction.deleteScheduledAction({path:{id:this.id}}))}}class N0{routine;record;constructor($,O){this.routine=$;this.record=O}get id(){return this.record.id??void 0}toJSON(){return{routine:this.routine.id,...this.record}}}function U0($){let O={prompt:$.prompt,user_prompt:$.userPrompt,model:$.model,agent:$.agent?{bot_id:$.agent.id}:void 0};return{kind:"Agent",name:$.name,enabled:$.enabled,trigger:$7($.trigger),task:{...O}}}class z0{client;constructor($){this.client=$}byId($){return jO.byId(this.client,$)}async create($){return jO.from(this.client,J(await this.client.scheduledAction.createScheduledAction({body:{...U0($),enabled:$.enabled??!0}})))}async list($){return J(await this.client.scheduledAction.listScheduledActions({query:{include_events:$?.includeEvents}})).map((O)=>jO.from(this.client,O))}}class I0{client;constructor($){this.client=$}byId($){return D$.byId(this.client,$)}create($){return D$.create(this.client,$)}forPullRequest($){return D$.forPullRequest(this.client,$)}search($,O){return D$.search(this.client,$,O)}}class T0{client;constructor($){this.client=$}byId($){return T$.byId(this.client,$)}current(){return T$.current(this.client)}list(){return T$.list(this.client)}}class H0{client;constructor($){this.client=$}async get($){return J(await this.client.unfurl.getUnfurl({query:{url:$}}))}async bulk($){return J(await this.client.unfurl.getUnfurlBulk({body:{url_list:$}}))}}class R0{client;constructor($){this.client=$}byId($){return M.byId(this.client,$)}me(){return M.me(this.client)}}class xO extends A{signingSecret;constructor($,O,j,x){super($,O,j);this.signingSecret=x}async fetch(){return J(await this.client.storage.getWebhook({path:{webhook_id:this.id}}))}static async create($,O){let j=J(await $.storage.createWebhook({body:{endpoint_url:O.url,namespace:O.namespace,name:O.name,filters:O.filters,scope:O.scope??"user",...O.headers!==void 0?{headers:O.headers}:{}}}));return new xO($,j.id,j,j.signing_secret)}static byId($,O){return new xO($,O)}static fromRecord($,O){return new xO($,O.id,O)}name=this.field("name");namespace=this.field("namespace");endpointUrl=this.field("endpoint_url");status=this.field("status");isValid=this.field("is_valid");filters=this.field("filters");createdAt=this.field("created_at");workspaceId=this.field("workspace_id");createdBy=this.mappedField("created_by_user_id",($)=>M.byId(this.client,$));async scope(){let $=await this.detail.get();return $.workspace_id===$.created_by_user_id?"user":"team"}async update($){await this.mutate((O)=>O.storage.patchWebhook({path:{webhook_id:this.id},body:$}))}async rename($){await this.update({name:$})}async setUrl($){await this.update({endpoint_url:$})}async setFilters($){await this.update({filters:$})}async pause(){await this.update({status:"paused"})}async resume(){await this.update({status:"active"})}async delete(){await this.mutate(($)=>$.storage.deleteWebhook({path:{webhook_id:this.id}}))}async validate(){return this.mutate(($)=>$.storage.validateWebhook({path:{webhook_id:this.id}}))}}class D0{client;constructor($){this.client=$}create($){return xO.create(this.client,$)}byId($){return xO.byId(this.client,$)}async list(){let{webhooks:$}=J(await this.client.storage.listWebhooks());return $.map((O)=>xO.fromRecord(this.client,O))}}function C0($){if("properties"in $.data)return $.data.properties;if($.tag==="calendarEvent")return $.data.extra.properties;return[]}function y1($,O,j){let x=[];for(let S of C0(O)){if(S.definition.data_type!=="TAG"||S.value?.type!=="SelectOption")continue;for(let K of S.value.value){let Z=j.get(K);if(Z&&!x.some((X)=>X.label===Z.label&&X.scope===Z.scope))x.push(Z)}}switch(O.tag){case"document":return{type:"document",id:O.data.id,entity:q.byId($,O.data.id),snapshot:O,tags:x,name:O.data.name,fileType:O.data.fileType,subType:O.data.subType?.type};case"chat":return{type:"ai_chat",id:O.data.id,entity:Z$.byId($,O.data.id),snapshot:O,tags:x,name:O.data.name};case"project":return{type:"project",id:O.data.id,entity:n.byId($,O.data.id),snapshot:O,tags:x,name:O.data.name};case"emailThread":return{type:"email",id:O.data.id,entity:H$.byId($,O.data.id),snapshot:O,tags:x,subject:O.data.name,snippet:O.data.snippet,senderName:O.data.senderName,senderEmail:O.data.senderEmail,inboxVisible:O.data.inboxVisible,isRead:O.data.isRead,isDraft:O.data.isDraft};case"channel":return{type:"channel",id:O.data.channel.id,entity:f.byId($,O.data.channel.id),snapshot:O,tags:x,name:O.data.channel.name};case"channelThread":return{type:"channel_thread",id:O.data.id,entity:new g$($,O.data.channel_id,O.data.id),snapshot:O,tags:x,channelId:O.data.channel_id};case"call":return{type:"call",id:O.data.callId,entity:K$.byId($,O.data.callId),snapshot:O,tags:x,createdBy:O.data.createdBy};case"calendarEvent":return{type:"calendar_event",id:O.data.id,entity:z$.byId($,O.data.id),snapshot:O,tags:x,title:O.data.title,status:O.data.status,location:O.data.location,conferenceUrl:O.data.conferenceUrl,conferenceProvider:O.data.conferenceProvider,time:O.data.time};case"foreignEntity":return{type:"foreign_entity",id:O.data.id,entity:o$.byId($,O.data.id),snapshot:O,tags:x,foreignEntityId:O.data.foreignEntityId,foreignEntitySource:O.data.foreignEntitySource,metadata:O.data.metadata};default:throw Error(`Unexpected workspace entity type: ${O.tag}`)}}var v1="00000000-0000-0000-0000-000000000000",_0={document:["df","id"],project:["pf","pid"],ai_chat:["cf","cid"],email:["ef","ThreadId"],channel:["chanf","ChannelId"],channel_thread:["cthf","ThreadId"],call:["callf","CallId"],calendar_event:["calf","id"],foreign_entity:["fef","id"]},Hj=($)=>$.replace(/[A-Z]/g,(O)=>O.toLowerCase()),h1=($,O)=>$==null?O:{"&":[$,O]};function M0($,O){if(!$||typeof $!=="object"||Array.isArray($))throw Error(`Invalid workspace ${O}: expected a filter expression.`);let j=Object.entries($),x=j[0];if(j.length!==1||x===void 0)throw Error(`Invalid workspace ${O}: use exactly one of l, &, |, !.`);let[S,K]=x;if(S==="l")return;if(S==="!"){M0(K,`${O}.!`);return}if(S!=="&"&&S!=="|")throw Error(`Invalid workspace ${O}: use l, &, | or !.`);if(!Array.isArray(K)||K.length!==2)throw Error(`Invalid workspace ${O}.${S}: expected exactly two expressions. Use {l: {...}} for a single condition; nest binary operators for three or more.`);K.forEach((Z,X)=>{M0(Z,`${O}.${S}[${X}]`)})}class Rj{client;tagSets;constructor($){this.client=$}sets(){return this.tagSets??=this.client.properties.listTags({}).then(J),this.tagSets}async tagMap(){let $=new Map;for(let O of await this.sets())for(let j of O.options)if(j.value.type==="string")$.set(j.id,{label:j.value.value,scope:O.scope==="user"?"personal":"team"});return $}async body($){for(let[S,K,Z]of[["sortBy",$.sortBy,["recently_viewed","recently_updated","recently_created"]],["emailPreset",$.emailPreset,["signal"]],["tagsMatch",$.tagsMatch,["any","all"]]])if(K!==void 0&&!Z.includes(K))throw Error(`Invalid workspace ${S}: ${K}`);if($.includeTypes!==void 0&&(!Array.isArray($.includeTypes)||$.includeTypes.some((S)=>!Object.hasOwn(_0,S))))throw Error(`Invalid workspace includeTypes. Supported values: ${Object.keys(_0).join(", ")}. Tasks use document with df: {l: {dst: 'task'}}.`);for(let S of["df","pf","cf","ef","chanf","cthf","callf","fef","calf","propf"])if($[S]!=null)M0($[S],S);if($.tags?.some((S)=>S.scope!==void 0&&S.scope!=="personal"&&S.scope!=="team"))throw Error("Invalid workspace tag scope");if($.limit!==void 0&&!Number.isFinite($.limit))throw Error("Workspace limit must be finite");let O={df:$.df,pf:$.pf,cf:$.cf,ef:$.ef,chanf:$.chanf,cthf:$.cthf,callf:$.callf,fef:$.fef,calf:$.calf,propf:$.propf,ccf:{l:{id:v1}},favorites_only:$.favoritesOnly,expand:!0,limit:Math.max(1,Math.min(500,Math.trunc($.limit??50))),sort_method:$.sortBy==="recently_viewed"?"viewed_at":$.sortBy==="recently_created"?"created_at":"updated_at",sort_direction:"desc",emailView:$.emailView??"inbox"};if($.emailPreset==="signal")O.ef={"&":[{l:{Importance:!0}},{l:{Shared:"exclude"}}]};let j=$.inbox?.trim();if(j){let{links:S}=J(await this.client.email.listLinks()),K=S.filter((X)=>Hj(X.email_address)===Hj(j)),Z=K[0];if(!Z)throw Error(`No connected inbox matches "${j}". Connected inboxes: ${S.map((X)=>X.email_address).join(", ")}.`);if(K.length>1)throw Error(`Multiple connected inboxes match "${j}"; cannot pick one.`);O.ef=h1(O.ef,{l:{Owner:Z.id}})}let x=$.includeTypes??($.emailPreset==="signal"?["email"]:void 0);if(x?.length){for(let[S,[K,Z]]of Object.entries(_0))if(!x.includes(S))O[K]={l:{[Z]:v1}}}if($.tags?.length){let S=(await this.sets()).flatMap((G)=>{let L=G.definition;if(!L)return[];return G.options.flatMap((Y)=>Y.value.type==="string"?[{id:Y.id,definitionId:L.id,label:Y.value.value,scope:G.scope==="user"?"personal":"team"}]:[])}),K=new Map;for(let G of $.tags){let L=S.filter((Y)=>Hj(Y.label)===Hj(G.label.trim())&&(!G.scope||Y.scope===G.scope));if(!L.length)throw Error(`Unknown tag "${G.label}". Available tags: ${S.map((Y)=>`${Y.label} (${Y.scope})`).join(", ")}.`);if($.tagsMatch==="all"&&L.length>1)throw Error(`Tag "${G.label}" is ambiguous; specify personal or team scope.`);for(let Y of L)K.set(Y.id,Y)}let X=[...K.values()].map((G)=>({l:{pd:G.definitionId,v:{so:G.id}}})).reduce((G,L)=>G===void 0?L:{[$.tagsMatch==="all"?"&":"|"]:[G,L]},void 0);O.propf=h1(O.propf,X)}return O}}class A0{client;constructor($){this.client=$}async page($={}){let O=new Rj(this.client);return this.fetch(O,await O.body($),$.cursor)}async*list($={}){let O=new Rj(this.client),j=await O.body($);yield*a((x)=>this.fetch(O,j,x))}async fetch($,O,j){let x=J(await this.client.storage.postItemsSoupAst({body:O,query:j?{cursor:j}:void 0})),K=x.items.some((Z)=>C0(Z).some((X)=>X.definition.data_type==="TAG"))?await $.tagMap():new Map;return{items:x.items.map((Z)=>y1(this.client,Z,K)),nextCursor:x.next_cursor,hasMore:x.next_cursor!=null}}}function m1({onRequest:$,onSseError:O,onSseEvent:j,responseTransformer:x,responseValidator:S,sseDefaultRetryDelay:K,sseMaxRetryAttempts:Z,sseMaxRetryDelay:X,sseSleepFn:G,url:L,...Y}){let Q,T=G??((V)=>new Promise((B)=>setTimeout(B,V)));return{stream:async function*(){let V=K??3000,B=0,I=Y.signal??new AbortController().signal;while(!0){if(I.aborted)break;B++;let P=Y.headers instanceof Headers?Y.headers:new Headers(Y.headers);if(Q!==void 0)P.set("Last-Event-ID",Q);try{let D={redirect:"follow",...Y,body:Y.serializedBody,headers:P,signal:I},C=new Request(L,D);if($)C=await $(L,D);let N=await(Y.fetch??globalThis.fetch)(C);if(!N.ok)throw Error(`SSE failed: ${N.status} ${N.statusText}`);if(!N.body)throw Error("No body in SSE response");let H=N.body.pipeThrough(new TextDecoderStream).getReader(),U="",k=()=>{try{H.cancel()}catch{}};I.addEventListener("abort",k);try{while(!0){let{done:d,value:l}=await H.read();if(d)break;U+=l,U=U.replace(/\r\n?/g,`+`);let g=U.split(`++`);U=g.pop()??"";for(let r of g){let p=r.split(`+`),F=[],y;for(let R of p)if(R.startsWith("data:"))F.push(R.replace(/^data:\s*/,""));else if(R.startsWith("event:"))y=R.replace(/^event:\s*/,"");else if(R.startsWith("id:"))Q=R.replace(/^id:\s*/,"");else if(R.startsWith("retry:")){let h=Number.parseInt(R.replace(/^retry:\s*/,""),10);if(!Number.isNaN(h))V=h}let _,v=!1;if(F.length){let R=F.join(`+`);try{_=JSON.parse(R),v=!0}catch{_=R}}if(v){if(S)await S(_);if(x)_=await x(_)}if(j?.({data:_,event:y,id:Q,retry:V}),F.length)yield _}}}finally{I.removeEventListener("abort",k),H.releaseLock()}break}catch(D){if(O?.(D),Z!==void 0&&B>=Z)break;let C=Math.min(V*2**(B-1),X??30000);await T(C)}}}()}}var O7=($)=>{switch($){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},j7=($)=>{switch($){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},x7=($)=>{switch($){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},Dj=({allowReserved:$,explode:O,name:j,style:x,value:S})=>{if(!O){let X=($?S:S.map((G)=>encodeURIComponent(G))).join(j7(x));switch(x){case"label":return`.${X}`;case"matrix":return`;${j}=${X}`;case"simple":return X;default:return`${j}=${X}`}}let K=O7(x),Z=S.map((X)=>{if(x==="label"||x==="simple")return $?X:encodeURIComponent(X);return IO({allowReserved:$,name:j,value:X})}).join(K);return x==="label"||x==="matrix"?K+Z:Z},IO=({allowReserved:$,name:O,value:j})=>{if(j===void 0||j===null)return"";if(typeof j==="object")throw Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${O}=${$?j:encodeURIComponent(j)}`},Cj=({allowReserved:$,explode:O,name:j,style:x,value:S,valueOnly:K})=>{if(S instanceof Date)return K?S.toISOString():`${j}=${S.toISOString()}`;if(x!=="deepObject"&&!O){let G=[];Object.entries(S).forEach(([Y,Q])=>{G=[...G,Y,$?Q:encodeURIComponent(Q)]});let L=G.join(",");switch(x){case"form":return`${j}=${L}`;case"label":return`.${L}`;case"matrix":return`;${j}=${L}`;default:return L}}let Z=x7(x),X=Object.entries(S).map(([G,L])=>IO({allowReserved:$,name:x==="deepObject"?`${j}[${G}]`:G,value:L})).join(Z);return x==="label"||x==="matrix"?Z+X:X};var S7=/\{[^{}]+\}/g,Z7=({path:$,url:O})=>{let j=O,x=O.match(S7);if(x)for(let S of x){let K=!1,Z=S.substring(1,S.length-1),X="simple";if(Z.endsWith("*"))K=!0,Z=Z.substring(0,Z.length-1);if(Z.startsWith("."))Z=Z.substring(1),X="label";else if(Z.startsWith(";"))Z=Z.substring(1),X="matrix";let G=$[Z];if(G===void 0||G===null)continue;if(Array.isArray(G)){j=j.replace(S,Dj({explode:K,name:Z,style:X,value:G}));continue}if(typeof G==="object"){j=j.replace(S,Cj({explode:K,name:Z,style:X,value:G,valueOnly:!0}));continue}if(X==="matrix"){j=j.replace(S,`;${IO({name:Z,value:G})}`);continue}let L=encodeURIComponent(X==="label"?`.${G}`:G);j=j.replace(S,L)}return j},c1=({baseUrl:$,path:O,query:j,querySerializer:x,url:S})=>{let K=S.startsWith("/")?S:`/${S}`,Z=($??"")+K;if(O)Z=Z7({path:O,url:Z});let X=j?x(j):"";if(X.startsWith("?"))X=X.substring(1);if(X)Z+=`?${X}`;return Z};function P0($){let O=$.body!==void 0;if(O&&$.bodySerializer){if("serializedBody"in $)return $.serializedBody!==void 0&&$.serializedBody!==""?$.serializedBody:null;return $.body!==""?$.body:null}if(O)return $.body;return}var u1=async($,O)=>{let j=typeof O==="function"?await O($):O;if(!j)return;if($.scheme==="bearer")return`Bearer ${j}`;if($.scheme==="basic")return`Basic ${btoa(j)}`;return j};var d1={bodySerializer:($)=>JSON.stringify($,(O,j)=>typeof j==="bigint"?j.toString():j)};var l1=({parameters:$={},...O}={})=>{return(x)=>{let S=[];if(x&&typeof x==="object")for(let K in x){let Z=x[K];if(Z===void 0||Z===null)continue;let X=$[K]||O;if(Array.isArray(Z)){let G=Dj({allowReserved:X.allowReserved,explode:!0,name:K,style:"form",value:Z,...X.array});if(G)S.push(G)}else if(typeof Z==="object"){let G=Cj({allowReserved:X.allowReserved,explode:!0,name:K,style:"deepObject",value:Z,...X.object});if(G)S.push(G)}else{let G=IO({allowReserved:X.allowReserved,name:K,value:Z});if(G)S.push(G)}}return S.join("&")}},r1=($)=>{if(!$)return"stream";let O=$.split(";")[0]?.trim();if(!O)return;if(O.startsWith("application/json")||O.endsWith("+json"))return"json";if(O==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some((j)=>O.startsWith(j)))return"blob";if(O.startsWith("text/"))return"text";return},X7=($,O)=>{if(!O)return!1;if($.headers.has(O)||$.query?.[O]||$.headers.get("Cookie")?.includes(`${O}=`))return!0;return!1};async function p1($){for(let O of $.security??[]){if(X7($,O.name))continue;let j=await u1(O,$.auth);if(!j)continue;let x=O.name??"Authorization";switch(O.in){case"query":if(!$.query)$.query={};$.query[x]=j;break;case"cookie":$.headers.append("Cookie",`${x}=${j}`);break;case"header":default:$.headers.set(x,j);break}}}var F0=($)=>c1({baseUrl:$.baseUrl,path:$.path,query:$.query,querySerializer:typeof $.querySerializer==="function"?$.querySerializer:l1($.querySerializer),url:$.url}),E0=($,O)=>{let j={...$,...O};if(j.baseUrl?.endsWith("/"))j.baseUrl=j.baseUrl.substring(0,j.baseUrl.length-1);return j.headers=Mj($.headers,O.headers),j},G7=($)=>{let O=[];return $.forEach((j,x)=>{O.push([x,j])}),O},Mj=(...$)=>{let O=new Headers;for(let j of $){if(!j)continue;let x=j instanceof Headers?G7(j):Object.entries(j);for(let[S,K]of x)if(K===null)O.delete(S);else if(Array.isArray(K))for(let Z of K)O.append(S,Z);else if(K!==void 0)O.set(S,typeof K==="object"?JSON.stringify(K):K)}return O};class _j{fns=[];clear(){this.fns=[]}eject($){let O=this.getInterceptorIndex($);if(this.fns[O])this.fns[O]=null}exists($){let O=this.getInterceptorIndex($);return Boolean(this.fns[O])}getInterceptorIndex($){if(typeof $==="number")return this.fns[$]?$:-1;return this.fns.indexOf($)}update($,O){let j=this.getInterceptorIndex($);if(this.fns[j])return this.fns[j]=O,$;return!1}use($){return this.fns.push($),this.fns.length-1}}var a1=()=>({error:new _j,request:new _j,response:new _j}),K7=l1({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),Y7={"Content-Type":"application/json"},aO=($={})=>({...d1,headers:Y7,parseAs:"auto",querySerializer:K7,...$});var w0=($={})=>{let O=E0(aO(),$),j=()=>({...O}),x=(Y)=>{return O=E0(O,Y),j()},S=a1(),K=async(Y)=>{let Q={...O,...Y,fetch:Y.fetch??O.fetch??globalThis.fetch,headers:Mj(O.headers,Y.headers),serializedBody:void 0};if(Q.security)await p1(Q);if(Q.requestValidator)await Q.requestValidator(Q);if(Q.body!==void 0&&Q.bodySerializer)Q.serializedBody=Q.bodySerializer(Q.body);if(Q.body===void 0||Q.serializedBody==="")Q.headers.delete("Content-Type");let T=Q,z=F0(T);return{opts:T,url:z}},Z=async(Y)=>{let Q=Y.throwOnError??O.throwOnError,T=Y.responseStyle??O.responseStyle,z,W;try{let{opts:V,url:B}=await K(Y),I={redirect:"follow",...V,body:P0(V)};z=new Request(B,I);for(let N of S.request.fns)if(N)z=await N(z,V);let P=V.fetch;W=await P(z);for(let N of S.response.fns)if(N)W=await N(W,z,V);let D={request:z,response:W};if(W.ok){let N=(V.parseAs==="auto"?r1(W.headers.get("Content-Type")):V.parseAs)??"json";if(W.status===204||W.headers.get("Content-Length")==="0"){let U;switch(N){case"arrayBuffer":case"blob":case"text":U=await W[N]();break;case"formData":U=new FormData;break;case"stream":U=W.body;break;case"json":default:U={};break}return V.responseStyle==="data"?U:{data:U,...D}}let H;switch(N){case"arrayBuffer":case"blob":case"formData":case"text":H=await W[N]();break;case"json":{let U=await W.text();H=U?JSON.parse(U):{};break}case"stream":return V.responseStyle==="data"?W.body:{data:W.body,...D}}if(N==="json"){if(V.responseValidator)await V.responseValidator(H);if(V.responseTransformer)H=await V.responseTransformer(H)}return V.responseStyle==="data"?H:{data:H,...D}}let C=await W.text(),E;try{E=JSON.parse(C)}catch{}throw E??C}catch(V){let B=V;for(let I of S.error.fns)if(I)B=await I(B,W,z,Y);if(B=B||{},Q)throw B;return T==="data"?void 0:{error:B,request:z,response:W}}},X=(Y)=>(Q)=>Z({...Q,method:Y}),G=(Y)=>async(Q)=>{let{opts:T,url:z}=await K(Q);return m1({...T,body:T.body,method:Y,onRequest:async(W,V)=>{let B=new Request(W,V);for(let I of S.request.fns)if(I)B=await I(B,T);return B},serializedBody:P0(T),url:z})};return{buildUrl:(Y)=>F0({...O,...Y}),connect:X("CONNECT"),delete:X("DELETE"),get:X("GET"),getConfig:j,head:X("HEAD"),interceptors:S,options:X("OPTIONS"),patch:X("PATCH"),post:X("POST"),put:X("PUT"),request:Z,setConfig:x,sse:{connect:G("CONNECT"),delete:G("DELETE"),get:G("GET"),head:G("HEAD"),options:G("OPTIONS"),patch:G("PATCH"),post:G("POST"),put:G("PUT"),trace:G("TRACE")},trace:X("TRACE")}};var i1=w0(aO());class n1{client;constructor($){this.client=$?.client??i1}}class s1{defaultKey="default";instances=new Map;get($){let O=this.instances.get($??this.defaultKey);if(!O)throw Error('No SDK client found. Create one with "new Sdk()" to fix this error.');return O}set($,O){this.instances.set(O??this.defaultKey,$)}}class Aj extends n1{static __registry=new s1;constructor($){super($);Aj.__registry.set(this,$?.key)}discoverAgentCapabilitiesHandler($){return($.client??this.client).post({security:[{scheme:"bearer",type:"http"}],url:"/agent-capabilities/discover",...$,headers:{"Content-Type":"application/json",...$.headers}})}getAgentCodingPreferences($){return($?.client??this.client).get({url:"/agent-coding-preferences",...$})}putAgentCodingPreferences($){return($.client??this.client).put({url:"/agent-coding-preferences",...$,headers:{"Content-Type":"application/json",...$.headers}})}listAgentConversations($){return($.client??this.client).get({security:[{scheme:"bearer",type:"http"}],url:"/agent-conversations/{channel_id}",...$})}startFreshAgentConversation($){return($.client??this.client).post({security:[{scheme:"bearer",type:"http"}],url:"/agent-conversations/{channel_id}/{bot_id}/start-fresh",...$,headers:{"Content-Type":"application/json",...$.headers}})}retryAgentConversationTurn($){return($.client??this.client).post({security:[{scheme:"bearer",type:"http"}],url:"/agent-conversations/{channel_id}/{bot_id}/turns/{source}/retry",...$,headers:{"Content-Type":"application/json",...$.headers}})}loadAgentModelsHandler($){return($.client??this.client).post({security:[{scheme:"bearer",type:"http"}],url:"/agent-models/load",...$,headers:{"Content-Type":"application/json",...$.headers}})}listAgentRepositories($){return($?.client??this.client).get({security:[{scheme:"bearer",type:"http"}],url:"/agent-repositories",...$})}listAgentRepositoryBranches($){return($.client??this.client).get({security:[{scheme:"bearer",type:"http"}],url:"/agent-repositories/branches",...$})}getAgentSandboxSize($){return($?.client??this.client).get({url:"/agent-sandbox-size",...$})}putAgentSandboxSize($){return($.client??this.client).put({url:"/agent-sandbox-size",...$,headers:{"Content-Type":"application/json",...$.headers}})}createAgentSession($){return($.client??this.client).post({url:"/agent-sessions",...$,headers:{"Content-Type":"application/json",...$.headers}})}agentSessionsForPullRequest($){return($.client??this.client).post({url:"/agent-sessions/by-pull-request",...$,headers:{"Content-Type":"application/json",...$.headers}})}agentSessionsForPullRequests($){return($.client??this.client).post({url:"/agent-sessions/by-pull-requests",...$,headers:{"Content-Type":"application/json",...$.headers}})}previewAgentSessions($){return($.client??this.client).post({url:"/agent-sessions/preview",...$,headers:{"Content-Type":"application/json",...$.headers}})}warmAgentSessionHandler($){return($.client??this.client).post({url:"/agent-sessions/warm",...$,headers:{"Content-Type":"application/json",...$.headers}})}deleteAgentSession($){return($.client??this.client).delete({url:"/agent-sessions/{session_id}",...$})}getAgentSession($){return($.client??this.client).get({url:"/agent-sessions/{session_id}",...$})}setAgentSessionArchived($){return($.client??this.client).put({url:"/agent-sessions/{session_id}/archived",...$,headers:{"Content-Type":"application/json",...$.headers}})}getAgentSessionChanges($){return($.client??this.client).get({url:"/agent-sessions/{session_id}/changes",...$})}getAgentSessionChangesPatch($){return($.client??this.client).get({url:"/agent-sessions/{session_id}/changes/patch",...$})}refreshAgentSessionChanges($){return($.client??this.client).post({url:"/agent-sessions/{session_id}/changes/refresh",...$})}getCodeExecution($){return($.client??this.client).get({url:"/agent-sessions/{session_id}/code-executions/{execution_id}",...$})}listExecutionReviews($){return($.client??this.client).get({url:"/agent-sessions/{session_id}/code-executions/{execution_id}/reviews",...$})}controlAgentSession($){return($.client??this.client).post({url:"/agent-sessions/{session_id}/control",...$,headers:{"Content-Type":"application/json",...$.headers}})}getAgentSessionLog($){return($.client??this.client).get({url:"/agent-sessions/{session_id}/log",...$})}renameAgentSession($){return($.client??this.client).put({url:"/agent-sessions/{session_id}/name",...$,headers:{"Content-Type":"application/json",...$.headers}})}getAgentSessionPermissions($){return($.client??this.client).get({url:"/agent-sessions/{session_id}/permissions",...$})}updateAgentSessionPermissions($){return($.client??this.client).patch({url:"/agent-sessions/{session_id}/permissions",...$,headers:{"Content-Type":"application/json",...$.headers}})}unlinkAgentSessionPullRequest($){return($.client??this.client).delete({url:"/agent-sessions/{session_id}/pull-requests",...$})}listAgentSessionPullRequests($){return($.client??this.client).get({url:"/agent-sessions/{session_id}/pull-requests",...$})}linkAgentSessionPullRequest($){return($.client??this.client).put({url:"/agent-sessions/{session_id}/pull-requests",...$,headers:{"Content-Type":"application/json",...$.headers}})}getAgentSessionQueue($){return($.client??this.client).get({url:"/agent-sessions/{session_id}/queue",...$})}removeQueuedAction($){return($.client??this.client).delete({url:"/agent-sessions/{session_id}/queue/{action_id}",...$})}editQueuedAction($){return($.client??this.client).put({url:"/agent-sessions/{session_id}/queue/{action_id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}steerQueuedAction($){return($.client??this.client).post({url:"/agent-sessions/{session_id}/queue/{action_id}/steer",...$})}createSessionReview($){return($.client??this.client).post({url:"/agent-sessions/{session_id}/reviews",...$,headers:{"Content-Type":"application/json",...$.headers}})}getSessionReview($){return($.client??this.client).get({url:"/agent-sessions/{session_id}/reviews/{review_id}",...$})}decideSessionReview($){return($.client??this.client).post({url:"/agent-sessions/{session_id}/reviews/{review_id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}putAgentSessionSandboxSize($){return($.client??this.client).put({url:"/agent-sessions/{session_id}/sandbox-size",...$,headers:{"Content-Type":"application/json",...$.headers}})}answerAgentSessionToolApproval($){return($.client??this.client).post({url:"/agent-sessions/{session_id}/tool-approvals/{approval_id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}disconnect($){return($.client??this.client).delete({security:[{scheme:"bearer",type:"http"}],url:"/claude-auth",...$,headers:{"Content-Type":"application/json",...$.headers}})}status($){return($?.client??this.client).get({security:[{scheme:"bearer",type:"http"}],url:"/claude-auth",...$})}complete($){return($.client??this.client).post({security:[{scheme:"bearer",type:"http"}],url:"/claude-auth/complete",...$,headers:{"Content-Type":"application/json",...$.headers}})}start($){return($.client??this.client).post({security:[{scheme:"bearer",type:"http"}],url:"/claude-auth/start",...$,headers:{"Content-Type":"application/json",...$.headers}})}}function t1({onRequest:$,onSseError:O,onSseEvent:j,responseTransformer:x,responseValidator:S,sseDefaultRetryDelay:K,sseMaxRetryAttempts:Z,sseMaxRetryDelay:X,sseSleepFn:G,url:L,...Y}){let Q,T=G??((V)=>new Promise((B)=>setTimeout(B,V)));return{stream:async function*(){let V=K??3000,B=0,I=Y.signal??new AbortController().signal;while(!0){if(I.aborted)break;B++;let P=Y.headers instanceof Headers?Y.headers:new Headers(Y.headers);if(Q!==void 0)P.set("Last-Event-ID",Q);try{let D={redirect:"follow",...Y,body:Y.serializedBody,headers:P,signal:I},C=new Request(L,D);if($)C=await $(L,D);let N=await(Y.fetch??globalThis.fetch)(C);if(!N.ok)throw Error(`SSE failed: ${N.status} ${N.statusText}`);if(!N.body)throw Error("No body in SSE response");let H=N.body.pipeThrough(new TextDecoderStream).getReader(),U="",k=()=>{try{H.cancel()}catch{}};I.addEventListener("abort",k);try{while(!0){let{done:d,value:l}=await H.read();if(d)break;U+=l,U=U.replace(/\r\n?/g,`+`);let g=U.split(`++`);U=g.pop()??"";for(let r of g){let p=r.split(`+`),F=[],y;for(let R of p)if(R.startsWith("data:"))F.push(R.replace(/^data:\s*/,""));else if(R.startsWith("event:"))y=R.replace(/^event:\s*/,"");else if(R.startsWith("id:"))Q=R.replace(/^id:\s*/,"");else if(R.startsWith("retry:")){let h=Number.parseInt(R.replace(/^retry:\s*/,""),10);if(!Number.isNaN(h))V=h}let _,v=!1;if(F.length){let R=F.join(`+`);try{_=JSON.parse(R),v=!0}catch{_=R}}if(v){if(S)await S(_);if(x)_=await x(_)}if(j?.({data:_,event:y,id:Q,retry:V}),F.length)yield _}}}finally{I.removeEventListener("abort",k),H.releaseLock()}break}catch(D){if(O?.(D),Z!==void 0&&B>=Z)break;let C=Math.min(V*2**(B-1),X??30000);await T(C)}}}()}}var Q7=($)=>{switch($){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},J7=($)=>{switch($){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},V7=($)=>{switch($){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},Pj=({allowReserved:$,explode:O,name:j,style:x,value:S})=>{if(!O){let X=($?S:S.map((G)=>encodeURIComponent(G))).join(J7(x));switch(x){case"label":return`.${X}`;case"matrix":return`;${j}=${X}`;case"simple":return X;default:return`${j}=${X}`}}let K=Q7(x),Z=S.map((X)=>{if(x==="label"||x==="simple")return $?X:encodeURIComponent(X);return TO({allowReserved:$,name:j,value:X})}).join(K);return x==="label"||x==="matrix"?K+Z:Z},TO=({allowReserved:$,name:O,value:j})=>{if(j===void 0||j===null)return"";if(typeof j==="object")throw Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${O}=${$?j:encodeURIComponent(j)}`},Fj=({allowReserved:$,explode:O,name:j,style:x,value:S,valueOnly:K})=>{if(S instanceof Date)return K?S.toISOString():`${j}=${S.toISOString()}`;if(x!=="deepObject"&&!O){let G=[];Object.entries(S).forEach(([Y,Q])=>{G=[...G,Y,$?Q:encodeURIComponent(Q)]});let L=G.join(",");switch(x){case"form":return`${j}=${L}`;case"label":return`.${L}`;case"matrix":return`;${j}=${L}`;default:return L}}let Z=V7(x),X=Object.entries(S).map(([G,L])=>TO({allowReserved:$,name:x==="deepObject"?`${j}[${G}]`:G,value:L})).join(Z);return x==="label"||x==="matrix"?Z+X:X};var W7=/\{[^{}]+\}/g,B7=({path:$,url:O})=>{let j=O,x=O.match(W7);if(x)for(let S of x){let K=!1,Z=S.substring(1,S.length-1),X="simple";if(Z.endsWith("*"))K=!0,Z=Z.substring(0,Z.length-1);if(Z.startsWith("."))Z=Z.substring(1),X="label";else if(Z.startsWith(";"))Z=Z.substring(1),X="matrix";let G=$[Z];if(G===void 0||G===null)continue;if(Array.isArray(G)){j=j.replace(S,Pj({explode:K,name:Z,style:X,value:G}));continue}if(typeof G==="object"){j=j.replace(S,Fj({explode:K,name:Z,style:X,value:G,valueOnly:!0}));continue}if(X==="matrix"){j=j.replace(S,`;${TO({name:Z,value:G})}`);continue}let L=encodeURIComponent(X==="label"?`.${G}`:G);j=j.replace(S,L)}return j},e1=({baseUrl:$,path:O,query:j,querySerializer:x,url:S})=>{let K=S.startsWith("/")?S:`/${S}`,Z=($??"")+K;if(O)Z=B7({path:O,url:Z});let X=j?x(j):"";if(X.startsWith("?"))X=X.substring(1);if(X)Z+=`?${X}`;return Z};function q0($){let O=$.body!==void 0;if(O&&$.bodySerializer){if("serializedBody"in $)return $.serializedBody!==void 0&&$.serializedBody!==""?$.serializedBody:null;return $.body!==""?$.body:null}if(O)return $.body;return}var o1=async($,O)=>{let j=typeof O==="function"?await O($):O;if(!j)return;if($.scheme==="bearer")return`Bearer ${j}`;if($.scheme==="basic")return`Basic ${btoa(j)}`;return j};var $S={bodySerializer:($)=>JSON.stringify($,(O,j)=>typeof j==="bigint"?j.toString():j)};var OS=({parameters:$={},...O}={})=>{return(x)=>{let S=[];if(x&&typeof x==="object")for(let K in x){let Z=x[K];if(Z===void 0||Z===null)continue;let X=$[K]||O;if(Array.isArray(Z)){let G=Pj({allowReserved:X.allowReserved,explode:!0,name:K,style:"form",value:Z,...X.array});if(G)S.push(G)}else if(typeof Z==="object"){let G=Fj({allowReserved:X.allowReserved,explode:!0,name:K,style:"deepObject",value:Z,...X.object});if(G)S.push(G)}else{let G=TO({allowReserved:X.allowReserved,name:K,value:Z});if(G)S.push(G)}}return S.join("&")}},jS=($)=>{if(!$)return"stream";let O=$.split(";")[0]?.trim();if(!O)return;if(O.startsWith("application/json")||O.endsWith("+json"))return"json";if(O==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some((j)=>O.startsWith(j)))return"blob";if(O.startsWith("text/"))return"text";return},L7=($,O)=>{if(!O)return!1;if($.headers.has(O)||$.query?.[O]||$.headers.get("Cookie")?.includes(`${O}=`))return!0;return!1};async function xS($){for(let O of $.security??[]){if(L7($,O.name))continue;let j=await o1(O,$.auth);if(!j)continue;let x=O.name??"Authorization";switch(O.in){case"query":if(!$.query)$.query={};$.query[x]=j;break;case"cookie":$.headers.append("Cookie",`${x}=${j}`);break;case"header":default:$.headers.set(x,j);break}}}var f0=($)=>e1({baseUrl:$.baseUrl,path:$.path,query:$.query,querySerializer:typeof $.querySerializer==="function"?$.querySerializer:OS($.querySerializer),url:$.url}),b0=($,O)=>{let j={...$,...O};if(j.baseUrl?.endsWith("/"))j.baseUrl=j.baseUrl.substring(0,j.baseUrl.length-1);return j.headers=wj($.headers,O.headers),j},N7=($)=>{let O=[];return $.forEach((j,x)=>{O.push([x,j])}),O},wj=(...$)=>{let O=new Headers;for(let j of $){if(!j)continue;let x=j instanceof Headers?N7(j):Object.entries(j);for(let[S,K]of x)if(K===null)O.delete(S);else if(Array.isArray(K))for(let Z of K)O.append(S,Z);else if(K!==void 0)O.set(S,typeof K==="object"?JSON.stringify(K):K)}return O};class Ej{fns=[];clear(){this.fns=[]}eject($){let O=this.getInterceptorIndex($);if(this.fns[O])this.fns[O]=null}exists($){let O=this.getInterceptorIndex($);return Boolean(this.fns[O])}getInterceptorIndex($){if(typeof $==="number")return this.fns[$]?$:-1;return this.fns.indexOf($)}update($,O){let j=this.getInterceptorIndex($);if(this.fns[j])return this.fns[j]=O,$;return!1}use($){return this.fns.push($),this.fns.length-1}}var SS=()=>({error:new Ej,request:new Ej,response:new Ej}),U7=OS({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),z7={"Content-Type":"application/json"},iO=($={})=>({...$S,headers:z7,parseAs:"auto",querySerializer:U7,...$});var k0=($={})=>{let O=b0(iO(),$),j=()=>({...O}),x=(Y)=>{return O=b0(O,Y),j()},S=SS(),K=async(Y)=>{let Q={...O,...Y,fetch:Y.fetch??O.fetch??globalThis.fetch,headers:wj(O.headers,Y.headers),serializedBody:void 0};if(Q.security)await xS(Q);if(Q.requestValidator)await Q.requestValidator(Q);if(Q.body!==void 0&&Q.bodySerializer)Q.serializedBody=Q.bodySerializer(Q.body);if(Q.body===void 0||Q.serializedBody==="")Q.headers.delete("Content-Type");let T=Q,z=f0(T);return{opts:T,url:z}},Z=async(Y)=>{let Q=Y.throwOnError??O.throwOnError,T=Y.responseStyle??O.responseStyle,z,W;try{let{opts:V,url:B}=await K(Y),I={redirect:"follow",...V,body:q0(V)};z=new Request(B,I);for(let N of S.request.fns)if(N)z=await N(z,V);let P=V.fetch;W=await P(z);for(let N of S.response.fns)if(N)W=await N(W,z,V);let D={request:z,response:W};if(W.ok){let N=(V.parseAs==="auto"?jS(W.headers.get("Content-Type")):V.parseAs)??"json";if(W.status===204||W.headers.get("Content-Length")==="0"){let U;switch(N){case"arrayBuffer":case"blob":case"text":U=await W[N]();break;case"formData":U=new FormData;break;case"stream":U=W.body;break;case"json":default:U={};break}return V.responseStyle==="data"?U:{data:U,...D}}let H;switch(N){case"arrayBuffer":case"blob":case"formData":case"text":H=await W[N]();break;case"json":{let U=await W.text();H=U?JSON.parse(U):{};break}case"stream":return V.responseStyle==="data"?W.body:{data:W.body,...D}}if(N==="json"){if(V.responseValidator)await V.responseValidator(H);if(V.responseTransformer)H=await V.responseTransformer(H)}return V.responseStyle==="data"?H:{data:H,...D}}let C=await W.text(),E;try{E=JSON.parse(C)}catch{}throw E??C}catch(V){let B=V;for(let I of S.error.fns)if(I)B=await I(B,W,z,Y);if(B=B||{},Q)throw B;return T==="data"?void 0:{error:B,request:z,response:W}}},X=(Y)=>(Q)=>Z({...Q,method:Y}),G=(Y)=>async(Q)=>{let{opts:T,url:z}=await K(Q);return t1({...T,body:T.body,method:Y,onRequest:async(W,V)=>{let B=new Request(W,V);for(let I of S.request.fns)if(I)B=await I(B,T);return B},serializedBody:q0(T),url:z})};return{buildUrl:(Y)=>f0({...O,...Y}),connect:X("CONNECT"),delete:X("DELETE"),get:X("GET"),getConfig:j,head:X("HEAD"),interceptors:S,options:X("OPTIONS"),patch:X("PATCH"),post:X("POST"),put:X("PUT"),request:Z,setConfig:x,sse:{connect:G("CONNECT"),delete:G("DELETE"),get:G("GET"),head:G("HEAD"),options:G("OPTIONS"),patch:G("PATCH"),post:G("POST"),put:G("PUT"),trace:G("TRACE")},trace:X("TRACE")}};var ZS=k0(iO());class XS{client;constructor($){this.client=$?.client??ZS}}class GS{defaultKey="default";instances=new Map;get($){let O=this.instances.get($??this.defaultKey);if(!O)throw Error('No SDK client found. Create one with "new Sdk()" to fix this error.');return O}set($,O){this.instances.set(O??this.defaultKey,$)}}class qj extends XS{static __registry=new GS;constructor($){super($);qj.__registry.set(this,$?.key)}updateAiBillingAutoReload($){return($.client??this.client).patch({url:"/ai-billing/auto-reload",...$,headers:{"Content-Type":"application/json",...$.headers}})}createAiCreditCheckout($){return($.client??this.client).post({url:"/ai-billing/credits/checkout",...$,headers:{"Content-Type":"application/json",...$.headers}})}updateAiBillingOverage($){return($.client??this.client).patch({url:"/ai-billing/overage",...$,headers:{"Content-Type":"application/json",...$.headers}})}getAiBillingPlans($){return($?.client??this.client).get({url:"/ai-billing/plans",...$})}getAiBillingSummary($){return($?.client??this.client).get({url:"/ai-billing/summary",...$})}disconnectCodex($){return($?.client??this.client).delete({url:"/codex",...$})}getCodexConnection($){return($?.client??this.client).get({url:"/codex",...$})}configureCodex($){return($.client??this.client).put({url:"/codex/config",...$,headers:{"Content-Type":"application/json",...$.headers}})}listCodexEnvironments($){return($?.client??this.client).get({url:"/codex/environments",...$})}startCodexLogin($){return($?.client??this.client).post({url:"/codex/login",...$})}cancelCodexLogin($){return($.client??this.client).delete({url:"/codex/login/{attempt_id}",...$})}pollCodexLogin($){return($.client??this.client).get({url:"/codex/login/{attempt_id}",...$})}deleteCursorApiKey($){return($?.client??this.client).delete({url:"/cursor-api-key",...$})}getCursorApiKey($){return($?.client??this.client).get({url:"/cursor-api-key",...$})}putCursorApiKey($){return($.client??this.client).put({url:"/cursor-api-key",...$,headers:{"Content-Type":"application/json",...$.headers}})}putCursorDefaultModel($){return($.client??this.client).put({url:"/cursor-api-key/default-model",...$,headers:{"Content-Type":"application/json",...$.headers}})}listCursorModels($){return($?.client??this.client).get({url:"/cursor-api-key/models",...$})}verifyFusionauthUserEmail($){return($.client??this.client).get({url:"/email/fusionauth/verify/{verification_id}",...$})}resendFusionauthVerifyUserEmail($){return($.client??this.client).post({url:"/email/fusionauth_resend",...$,headers:{"Content-Type":"application/json",...$.headers}})}generateEmailLink($){return($.client??this.client).post({url:"/email/generate/link",...$,headers:{"Content-Type":"application/json",...$.headers}})}verifyEmailLink($){return($.client??this.client).get({url:"/email/verify/{verification_id}",...$})}setGithubPullRequestDraft($){return($.client??this.client).post({url:"/github_pull_requests/draft",...$,headers:{"Content-Type":"application/json",...$.headers}})}enrichGithubPullRequests($){return($.client??this.client).post({url:"/github_pull_requests/enrich",...$,headers:{"Content-Type":"application/json",...$.headers}})}mergeGithubPullRequest($){return($.client??this.client).post({url:"/github_pull_requests/merge",...$,headers:{"Content-Type":"application/json",...$.headers}})}getGithubPullRequestMergeability($){return($.client??this.client).post({url:"/github_pull_requests/mergeability",...$,headers:{"Content-Type":"application/json",...$.headers}})}listGtmInviteLinks($){return($?.client??this.client).get({url:"/gtm-invite/links",...$})}createGtmInviteLink($){return($.client??this.client).post({url:"/gtm-invite/links",...$,headers:{"Content-Type":"application/json",...$.headers}})}revokeGtmInviteLink($){return($.client??this.client).delete({url:"/gtm-invite/links/{id}",...$})}getGtmInviteOffer($){return($?.client??this.client).get({url:"/gtm-invite/offer",...$})}resolveGtmInviteLink($){return($.client??this.client).get({url:"/gtm-invite/public/{token}",...$})}redeemGtmInviteLink($){return($.client??this.client).post({url:"/gtm-invite/redeem",...$,headers:{"Content-Type":"application/json",...$.headers}})}healthHandler($){return($?.client??this.client).get({url:"/health",...$})}macroApiToken($){return($.client??this.client).get({url:"/jwt/macro_api_token",...$})}refresh($){return($?.client??this.client).post({url:"/jwt/refresh",...$})}createInProgressLink($){return($?.client??this.client).post({url:"/link",...$})}emailConnectionProviders($){return($?.client??this.client).get({url:"/link/email/providers",...$})}deleteGithubLink($){return($?.client??this.client).delete({url:"/link/github",...$})}initGithubLink($){return($.client??this.client).post({url:"/link/github",...$})}checkGithubLinkStatus($){return($?.client??this.client).get({url:"/link/github/status",...$})}initGmailLink($){return($.client??this.client).post({url:"/link/gmail",...$})}checkGmailLinkStatus($){return($?.client??this.client).get({url:"/link/gmail/status",...$})}initOutlookLink($){return($?.client??this.client).post({url:"/link/outlook",...$})}appleLogin($){return($.client??this.client).post({url:"/login/apple",...$,headers:{"Content-Type":"application/json",...$.headers}})}passwordLogin($){return($.client??this.client).post({url:"/login/password",...$,headers:{"Content-Type":"application/json",...$.headers}})}passwordlessLogin($){return($.client??this.client).post({url:"/login/passwordless",...$,headers:{"Content-Type":"application/json",...$.headers}})}ssoLogin($){return($.client??this.client).get({url:"/login/sso",...$})}logout($){return($?.client??this.client).post({url:"/logout",...$})}createMergeRequest($){return($.client??this.client).post({url:"/merge",...$,headers:{"Content-Type":"application/json",...$.headers}})}verifyMergeRequest($){return($.client??this.client).get({url:"/merge/verify/{code}",...$})}sendMobileWelcomeEmail($){return($.client??this.client).post({url:"/mobile-welcome-email",...$,headers:{"Content-Type":"application/json",...$.headers}})}passwordlessCallback($){return($.client??this.client).get({url:"/oauth/passwordless/{code}",...$})}oauthRedirect($){return($?.client??this.client).get({url:"/oauth/redirect",...$})}oauth2Callback($){return($.client??this.client).get({url:"/oauth2/{provider}/callback",...$})}getPermissions($){return($?.client??this.client).get({url:"/permissions",...$})}getUserPermissions($){return($?.client??this.client).get({url:"/permissions/me",...$})}getReferralCode($){return($?.client??this.client).get({url:"/referral/code",...$})}sendReferralCode($){return($.client??this.client).post({url:"/referral/send",...$,headers:{"Content-Type":"application/json",...$.headers}})}sessionCreation($){return($?.client??this.client).post({url:"/session",...$})}sessionLogin($){return($.client??this.client).get({url:"/session/login/{session_code}",...$})}deleteTeam($){return($?.client??this.client).delete({url:"/team",...$})}getTeam($){return($?.client??this.client).get({url:"/team",...$})}patchTeam($){return($.client??this.client).patch({url:"/team",...$,headers:{"Content-Type":"application/json",...$.headers}})}createTeam($){return($.client??this.client).post({url:"/team",...$,headers:{"Content-Type":"application/json",...$.headers}})}toggleTeamAutoJoinDomain($){return($?.client??this.client).post({url:"/team/auto-join-domain/toggle",...$})}patchTeamCrmSettings($){return($.client??this.client).patch({url:"/team/crm",...$,headers:{"Content-Type":"application/json",...$.headers}})}inviteToTeam($){return($.client??this.client).post({url:"/team/invite",...$,headers:{"Content-Type":"application/json",...$.headers}})}deleteTeamInviteHandler($){return($.client??this.client).delete({url:"/team/invite/{team_invite_id}",...$})}getTeamInvites($){return($?.client??this.client).get({url:"/team/invites",...$})}rejectInvitation($){return($.client??this.client).delete({url:"/team/join/{team_invite_id}",...$})}joinTeam($){return($.client??this.client).get({url:"/team/join/{team_invite_id}",...$})}patchTeamMemberPlan($){return($.client??this.client).patch({url:"/team/members/{member_user_id}/plan",...$,headers:{"Content-Type":"application/json",...$.headers}})}toggleTeamNonAdminInvites($){return($?.client??this.client).post({url:"/team/non-admin-invites/toggle",...$})}removeUserFromTeam($){return($.client??this.client).delete({url:"/team/remove/{remove_user_id}",...$})}getUserTeams($){return($?.client??this.client).get({url:"/team/user",...$})}getUserInvites($){return($?.client??this.client).get({url:"/team/user/invites",...$})}getUserNames($){return($.client??this.client).post({url:"/user/get_names",...$,headers:{"Content-Type":"application/json",...$.headers}})}getUserNamesWithEmail($){return($.client??this.client).post({url:"/user/get_names_with_email",...$,headers:{"Content-Type":"application/json",...$.headers}})}patchUserGroup($){return($.client??this.client).patch({url:"/user/group",...$,headers:{"Content-Type":"application/json",...$.headers}})}getLegacyUserPermissions($){return($?.client??this.client).get({url:"/user/legacy_user_permissions",...$})}getUserLinkExists($){return($.client??this.client).get({url:"/user/link_exists",...$})}deleteUser($){return($?.client??this.client).delete({url:"/user/me",...$})}getUserInfo($){return($?.client??this.client).get({url:"/user/me",...$})}getUserName($){return($?.client??this.client).get({url:"/user/name",...$})}putUserName($){return($?.client??this.client).put({url:"/user/name",...$})}patchUserOnboarding($){return($.client??this.client).patch({url:"/user/onboarding",...$,headers:{"Content-Type":"application/json",...$.headers}})}getUserOrganization($){return($?.client??this.client).get({url:"/user/organization",...$})}putProfilePicture($){return($.client??this.client).put({url:"/user/profile_picture",...$})}postProfilePictures($){return($.client??this.client).post({url:"/user/profile_pictures",...$,headers:{"Content-Type":"application/json",...$.headers}})}getUserQuota($){return($?.client??this.client).get({url:"/user/quota",...$})}createCheckoutSessionV2($){return($.client??this.client).post({url:"/user/stripe/checkoutv2",...$,headers:{"Content-Type":"application/json",...$.headers}})}getSubscriptionStatus($){return($?.client??this.client).get({url:"/user/stripe/plan",...$})}changePlan($){return($.client??this.client).post({url:"/user/stripe/plan",...$,headers:{"Content-Type":"application/json",...$.headers}})}createPortalSession($){return($.client??this.client).post({url:"/user/stripe/portal",...$,headers:{"Content-Type":"application/json",...$.headers}})}getTrialEligibility($){return($?.client??this.client).get({url:"/user/stripe/trial_eligibility",...$})}patchUserTutorial($){return($.client??this.client).patch({url:"/user/tutorial",...$,headers:{"Content-Type":"application/json",...$.headers}})}}function KS({onRequest:$,onSseError:O,onSseEvent:j,responseTransformer:x,responseValidator:S,sseDefaultRetryDelay:K,sseMaxRetryAttempts:Z,sseMaxRetryDelay:X,sseSleepFn:G,url:L,...Y}){let Q,T=G??((V)=>new Promise((B)=>setTimeout(B,V)));return{stream:async function*(){let V=K??3000,B=0,I=Y.signal??new AbortController().signal;while(!0){if(I.aborted)break;B++;let P=Y.headers instanceof Headers?Y.headers:new Headers(Y.headers);if(Q!==void 0)P.set("Last-Event-ID",Q);try{let D={redirect:"follow",...Y,body:Y.serializedBody,headers:P,signal:I},C=new Request(L,D);if($)C=await $(L,D);let N=await(Y.fetch??globalThis.fetch)(C);if(!N.ok)throw Error(`SSE failed: ${N.status} ${N.statusText}`);if(!N.body)throw Error("No body in SSE response");let H=N.body.pipeThrough(new TextDecoderStream).getReader(),U="",k=()=>{try{H.cancel()}catch{}};I.addEventListener("abort",k);try{while(!0){let{done:d,value:l}=await H.read();if(d)break;U+=l,U=U.replace(/\r\n?/g,`+`);let g=U.split(`++`);U=g.pop()??"";for(let r of g){let p=r.split(`+`),F=[],y;for(let R of p)if(R.startsWith("data:"))F.push(R.replace(/^data:\s*/,""));else if(R.startsWith("event:"))y=R.replace(/^event:\s*/,"");else if(R.startsWith("id:"))Q=R.replace(/^id:\s*/,"");else if(R.startsWith("retry:")){let h=Number.parseInt(R.replace(/^retry:\s*/,""),10);if(!Number.isNaN(h))V=h}let _,v=!1;if(F.length){let R=F.join(`+`);try{_=JSON.parse(R),v=!0}catch{_=R}}if(v){if(S)await S(_);if(x)_=await x(_)}if(j?.({data:_,event:y,id:Q,retry:V}),F.length)yield _}}}finally{I.removeEventListener("abort",k),H.releaseLock()}break}catch(D){if(O?.(D),Z!==void 0&&B>=Z)break;let C=Math.min(V*2**(B-1),X??30000);await T(C)}}}()}}var I7=($)=>{switch($){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},T7=($)=>{switch($){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},H7=($)=>{switch($){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},fj=({allowReserved:$,explode:O,name:j,style:x,value:S})=>{if(!O){let X=($?S:S.map((G)=>encodeURIComponent(G))).join(T7(x));switch(x){case"label":return`.${X}`;case"matrix":return`;${j}=${X}`;case"simple":return X;default:return`${j}=${X}`}}let K=I7(x),Z=S.map((X)=>{if(x==="label"||x==="simple")return $?X:encodeURIComponent(X);return HO({allowReserved:$,name:j,value:X})}).join(K);return x==="label"||x==="matrix"?K+Z:Z},HO=({allowReserved:$,name:O,value:j})=>{if(j===void 0||j===null)return"";if(typeof j==="object")throw Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${O}=${$?j:encodeURIComponent(j)}`},bj=({allowReserved:$,explode:O,name:j,style:x,value:S,valueOnly:K})=>{if(S instanceof Date)return K?S.toISOString():`${j}=${S.toISOString()}`;if(x!=="deepObject"&&!O){let G=[];Object.entries(S).forEach(([Y,Q])=>{G=[...G,Y,$?Q:encodeURIComponent(Q)]});let L=G.join(",");switch(x){case"form":return`${j}=${L}`;case"label":return`.${L}`;case"matrix":return`;${j}=${L}`;default:return L}}let Z=H7(x),X=Object.entries(S).map(([G,L])=>HO({allowReserved:$,name:x==="deepObject"?`${j}[${G}]`:G,value:L})).join(Z);return x==="label"||x==="matrix"?Z+X:X};var R7=/\{[^{}]+\}/g,D7=({path:$,url:O})=>{let j=O,x=O.match(R7);if(x)for(let S of x){let K=!1,Z=S.substring(1,S.length-1),X="simple";if(Z.endsWith("*"))K=!0,Z=Z.substring(0,Z.length-1);if(Z.startsWith("."))Z=Z.substring(1),X="label";else if(Z.startsWith(";"))Z=Z.substring(1),X="matrix";let G=$[Z];if(G===void 0||G===null)continue;if(Array.isArray(G)){j=j.replace(S,fj({explode:K,name:Z,style:X,value:G}));continue}if(typeof G==="object"){j=j.replace(S,bj({explode:K,name:Z,style:X,value:G,valueOnly:!0}));continue}if(X==="matrix"){j=j.replace(S,`;${HO({name:Z,value:G})}`);continue}let L=encodeURIComponent(X==="label"?`.${G}`:G);j=j.replace(S,L)}return j},YS=({baseUrl:$,path:O,query:j,querySerializer:x,url:S})=>{let K=S.startsWith("/")?S:`/${S}`,Z=($??"")+K;if(O)Z=D7({path:O,url:Z});let X=j?x(j):"";if(X.startsWith("?"))X=X.substring(1);if(X)Z+=`?${X}`;return Z};function g0($){let O=$.body!==void 0;if(O&&$.bodySerializer){if("serializedBody"in $)return $.serializedBody!==void 0&&$.serializedBody!==""?$.serializedBody:null;return $.body!==""?$.body:null}if(O)return $.body;return}var QS=async($,O)=>{let j=typeof O==="function"?await O($):O;if(!j)return;if($.scheme==="bearer")return`Bearer ${j}`;if($.scheme==="basic")return`Basic ${btoa(j)}`;return j};var JS={bodySerializer:($)=>JSON.stringify($,(O,j)=>typeof j==="bigint"?j.toString():j)};var VS=({parameters:$={},...O}={})=>{return(x)=>{let S=[];if(x&&typeof x==="object")for(let K in x){let Z=x[K];if(Z===void 0||Z===null)continue;let X=$[K]||O;if(Array.isArray(Z)){let G=fj({allowReserved:X.allowReserved,explode:!0,name:K,style:"form",value:Z,...X.array});if(G)S.push(G)}else if(typeof Z==="object"){let G=bj({allowReserved:X.allowReserved,explode:!0,name:K,style:"deepObject",value:Z,...X.object});if(G)S.push(G)}else{let G=HO({allowReserved:X.allowReserved,name:K,value:Z});if(G)S.push(G)}}return S.join("&")}},WS=($)=>{if(!$)return"stream";let O=$.split(";")[0]?.trim();if(!O)return;if(O.startsWith("application/json")||O.endsWith("+json"))return"json";if(O==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some((j)=>O.startsWith(j)))return"blob";if(O.startsWith("text/"))return"text";return},C7=($,O)=>{if(!O)return!1;if($.headers.has(O)||$.query?.[O]||$.headers.get("Cookie")?.includes(`${O}=`))return!0;return!1};async function BS($){for(let O of $.security??[]){if(C7($,O.name))continue;let j=await QS(O,$.auth);if(!j)continue;let x=O.name??"Authorization";switch(O.in){case"query":if(!$.query)$.query={};$.query[x]=j;break;case"cookie":$.headers.append("Cookie",`${x}=${j}`);break;case"header":default:$.headers.set(x,j);break}}}var y0=($)=>YS({baseUrl:$.baseUrl,path:$.path,query:$.query,querySerializer:typeof $.querySerializer==="function"?$.querySerializer:VS($.querySerializer),url:$.url}),v0=($,O)=>{let j={...$,...O};if(j.baseUrl?.endsWith("/"))j.baseUrl=j.baseUrl.substring(0,j.baseUrl.length-1);return j.headers=gj($.headers,O.headers),j},_7=($)=>{let O=[];return $.forEach((j,x)=>{O.push([x,j])}),O},gj=(...$)=>{let O=new Headers;for(let j of $){if(!j)continue;let x=j instanceof Headers?_7(j):Object.entries(j);for(let[S,K]of x)if(K===null)O.delete(S);else if(Array.isArray(K))for(let Z of K)O.append(S,Z);else if(K!==void 0)O.set(S,typeof K==="object"?JSON.stringify(K):K)}return O};class kj{fns=[];clear(){this.fns=[]}eject($){let O=this.getInterceptorIndex($);if(this.fns[O])this.fns[O]=null}exists($){let O=this.getInterceptorIndex($);return Boolean(this.fns[O])}getInterceptorIndex($){if(typeof $==="number")return this.fns[$]?$:-1;return this.fns.indexOf($)}update($,O){let j=this.getInterceptorIndex($);if(this.fns[j])return this.fns[j]=O,$;return!1}use($){return this.fns.push($),this.fns.length-1}}var LS=()=>({error:new kj,request:new kj,response:new kj}),M7=VS({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),A7={"Content-Type":"application/json"},nO=($={})=>({...JS,headers:A7,parseAs:"auto",querySerializer:M7,...$});var h0=($={})=>{let O=v0(nO(),$),j=()=>({...O}),x=(Y)=>{return O=v0(O,Y),j()},S=LS(),K=async(Y)=>{let Q={...O,...Y,fetch:Y.fetch??O.fetch??globalThis.fetch,headers:gj(O.headers,Y.headers),serializedBody:void 0};if(Q.security)await BS(Q);if(Q.requestValidator)await Q.requestValidator(Q);if(Q.body!==void 0&&Q.bodySerializer)Q.serializedBody=Q.bodySerializer(Q.body);if(Q.body===void 0||Q.serializedBody==="")Q.headers.delete("Content-Type");let T=Q,z=y0(T);return{opts:T,url:z}},Z=async(Y)=>{let Q=Y.throwOnError??O.throwOnError,T=Y.responseStyle??O.responseStyle,z,W;try{let{opts:V,url:B}=await K(Y),I={redirect:"follow",...V,body:g0(V)};z=new Request(B,I);for(let N of S.request.fns)if(N)z=await N(z,V);let P=V.fetch;W=await P(z);for(let N of S.response.fns)if(N)W=await N(W,z,V);let D={request:z,response:W};if(W.ok){let N=(V.parseAs==="auto"?WS(W.headers.get("Content-Type")):V.parseAs)??"json";if(W.status===204||W.headers.get("Content-Length")==="0"){let U;switch(N){case"arrayBuffer":case"blob":case"text":U=await W[N]();break;case"formData":U=new FormData;break;case"stream":U=W.body;break;case"json":default:U={};break}return V.responseStyle==="data"?U:{data:U,...D}}let H;switch(N){case"arrayBuffer":case"blob":case"formData":case"text":H=await W[N]();break;case"json":{let U=await W.text();H=U?JSON.parse(U):{};break}case"stream":return V.responseStyle==="data"?W.body:{data:W.body,...D}}if(N==="json"){if(V.responseValidator)await V.responseValidator(H);if(V.responseTransformer)H=await V.responseTransformer(H)}return V.responseStyle==="data"?H:{data:H,...D}}let C=await W.text(),E;try{E=JSON.parse(C)}catch{}throw E??C}catch(V){let B=V;for(let I of S.error.fns)if(I)B=await I(B,W,z,Y);if(B=B||{},Q)throw B;return T==="data"?void 0:{error:B,request:z,response:W}}},X=(Y)=>(Q)=>Z({...Q,method:Y}),G=(Y)=>async(Q)=>{let{opts:T,url:z}=await K(Q);return KS({...T,body:T.body,method:Y,onRequest:async(W,V)=>{let B=new Request(W,V);for(let I of S.request.fns)if(I)B=await I(B,T);return B},serializedBody:g0(T),url:z})};return{buildUrl:(Y)=>y0({...O,...Y}),connect:X("CONNECT"),delete:X("DELETE"),get:X("GET"),getConfig:j,head:X("HEAD"),interceptors:S,options:X("OPTIONS"),patch:X("PATCH"),post:X("POST"),put:X("PUT"),request:Z,setConfig:x,sse:{connect:G("CONNECT"),delete:G("DELETE"),get:G("GET"),head:G("HEAD"),options:G("OPTIONS"),patch:G("PATCH"),post:G("POST"),put:G("PUT"),trace:G("TRACE")},trace:X("TRACE")}};var NS=h0(nO());class US{client;constructor($){this.client=$?.client??NS}}class zS{defaultKey="default";instances=new Map;get($){let O=this.instances.get($??this.defaultKey);if(!O)throw Error('No SDK client found. Create one with "new Sdk()" to fix this error.');return O}set($,O){this.instances.set(O??this.defaultKey,$)}}class yj extends US{static __registry=new zS;constructor($){super($);yj.__registry.set(this,$?.key)}getAvailabilityCalendars($){return($?.client??this.client).get({url:"/availability-calendars",...$})}setAvailabilityCalendar($){return($.client??this.client).put({url:"/availability-calendars/{calendar_id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}listCalendars($){return($?.client??this.client).get({url:"/calendars",...$})}createCalendarEvent($){return($.client??this.client).post({url:"/events",...$,headers:{"Content-Type":"application/json",...$.headers}})}deleteCalendarEvent($){return($.client??this.client).delete({url:"/events/{event_id}",...$})}updateCalendarEvent($){return($.client??this.client).patch({url:"/events/{event_id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}calendarEventProviderUrl($){return($.client??this.client).get({url:"/events/{event_id}/provider-url",...$})}prepareCalendarReplacement($){return($.client??this.client).post({url:"/events/{event_id}/replacement",...$,headers:{"Content-Type":"application/json",...$.headers}})}rsvpCalendarEvent($){return($.client??this.client).put({url:"/events/{event_id}/rsvp",...$,headers:{"Content-Type":"application/json",...$.headers}})}healthHandler($){return($?.client??this.client).get({url:"/health",...$})}discardCalendarReplacement($){return($.client??this.client).delete({url:"/replacements/{operation_id}",...$})}calendarReplacementStatus($){return($.client??this.client).get({url:"/replacements/{operation_id}",...$})}confirmCalendarReplacement($){return($.client??this.client).post({url:"/replacements/{operation_id}/confirm",...$})}getTeamSharing($){return($?.client??this.client).get({url:"/team-sharing",...$})}setTeamSharing($){return($.client??this.client).put({url:"/team-sharing",...$,headers:{"Content-Type":"application/json",...$.headers}})}}function IS({onRequest:$,onSseError:O,onSseEvent:j,responseTransformer:x,responseValidator:S,sseDefaultRetryDelay:K,sseMaxRetryAttempts:Z,sseMaxRetryDelay:X,sseSleepFn:G,url:L,...Y}){let Q,T=G??((V)=>new Promise((B)=>setTimeout(B,V)));return{stream:async function*(){let V=K??3000,B=0,I=Y.signal??new AbortController().signal;while(!0){if(I.aborted)break;B++;let P=Y.headers instanceof Headers?Y.headers:new Headers(Y.headers);if(Q!==void 0)P.set("Last-Event-ID",Q);try{let D={redirect:"follow",...Y,body:Y.serializedBody,headers:P,signal:I},C=new Request(L,D);if($)C=await $(L,D);let N=await(Y.fetch??globalThis.fetch)(C);if(!N.ok)throw Error(`SSE failed: ${N.status} ${N.statusText}`);if(!N.body)throw Error("No body in SSE response");let H=N.body.pipeThrough(new TextDecoderStream).getReader(),U="",k=()=>{try{H.cancel()}catch{}};I.addEventListener("abort",k);try{while(!0){let{done:d,value:l}=await H.read();if(d)break;U+=l,U=U.replace(/\r\n?/g,`+`);let g=U.split(`++`);U=g.pop()??"";for(let r of g){let p=r.split(`+`),F=[],y;for(let R of p)if(R.startsWith("data:"))F.push(R.replace(/^data:\s*/,""));else if(R.startsWith("event:"))y=R.replace(/^event:\s*/,"");else if(R.startsWith("id:"))Q=R.replace(/^id:\s*/,"");else if(R.startsWith("retry:")){let h=Number.parseInt(R.replace(/^retry:\s*/,""),10);if(!Number.isNaN(h))V=h}let _,v=!1;if(F.length){let R=F.join(`+`);try{_=JSON.parse(R),v=!0}catch{_=R}}if(v){if(S)await S(_);if(x)_=await x(_)}if(j?.({data:_,event:y,id:Q,retry:V}),F.length)yield _}}}finally{I.removeEventListener("abort",k),H.releaseLock()}break}catch(D){if(O?.(D),Z!==void 0&&B>=Z)break;let C=Math.min(V*2**(B-1),X??30000);await T(C)}}}()}}var P7=($)=>{switch($){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},F7=($)=>{switch($){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},E7=($)=>{switch($){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},vj=({allowReserved:$,explode:O,name:j,style:x,value:S})=>{if(!O){let X=($?S:S.map((G)=>encodeURIComponent(G))).join(F7(x));switch(x){case"label":return`.${X}`;case"matrix":return`;${j}=${X}`;case"simple":return X;default:return`${j}=${X}`}}let K=P7(x),Z=S.map((X)=>{if(x==="label"||x==="simple")return $?X:encodeURIComponent(X);return RO({allowReserved:$,name:j,value:X})}).join(K);return x==="label"||x==="matrix"?K+Z:Z},RO=({allowReserved:$,name:O,value:j})=>{if(j===void 0||j===null)return"";if(typeof j==="object")throw Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${O}=${$?j:encodeURIComponent(j)}`},hj=({allowReserved:$,explode:O,name:j,style:x,value:S,valueOnly:K})=>{if(S instanceof Date)return K?S.toISOString():`${j}=${S.toISOString()}`;if(x!=="deepObject"&&!O){let G=[];Object.entries(S).forEach(([Y,Q])=>{G=[...G,Y,$?Q:encodeURIComponent(Q)]});let L=G.join(",");switch(x){case"form":return`${j}=${L}`;case"label":return`.${L}`;case"matrix":return`;${j}=${L}`;default:return L}}let Z=E7(x),X=Object.entries(S).map(([G,L])=>RO({allowReserved:$,name:x==="deepObject"?`${j}[${G}]`:G,value:L})).join(Z);return x==="label"||x==="matrix"?Z+X:X};var w7=/\{[^{}]+\}/g,q7=({path:$,url:O})=>{let j=O,x=O.match(w7);if(x)for(let S of x){let K=!1,Z=S.substring(1,S.length-1),X="simple";if(Z.endsWith("*"))K=!0,Z=Z.substring(0,Z.length-1);if(Z.startsWith("."))Z=Z.substring(1),X="label";else if(Z.startsWith(";"))Z=Z.substring(1),X="matrix";let G=$[Z];if(G===void 0||G===null)continue;if(Array.isArray(G)){j=j.replace(S,vj({explode:K,name:Z,style:X,value:G}));continue}if(typeof G==="object"){j=j.replace(S,hj({explode:K,name:Z,style:X,value:G,valueOnly:!0}));continue}if(X==="matrix"){j=j.replace(S,`;${RO({name:Z,value:G})}`);continue}let L=encodeURIComponent(X==="label"?`.${G}`:G);j=j.replace(S,L)}return j},TS=({baseUrl:$,path:O,query:j,querySerializer:x,url:S})=>{let K=S.startsWith("/")?S:`/${S}`,Z=($??"")+K;if(O)Z=q7({path:O,url:Z});let X=j?x(j):"";if(X.startsWith("?"))X=X.substring(1);if(X)Z+=`?${X}`;return Z};function m0($){let O=$.body!==void 0;if(O&&$.bodySerializer){if("serializedBody"in $)return $.serializedBody!==void 0&&$.serializedBody!==""?$.serializedBody:null;return $.body!==""?$.body:null}if(O)return $.body;return}var HS=async($,O)=>{let j=typeof O==="function"?await O($):O;if(!j)return;if($.scheme==="bearer")return`Bearer ${j}`;if($.scheme==="basic")return`Basic ${btoa(j)}`;return j};var RS={bodySerializer:($)=>JSON.stringify($,(O,j)=>typeof j==="bigint"?j.toString():j)};var DS=({parameters:$={},...O}={})=>{return(x)=>{let S=[];if(x&&typeof x==="object")for(let K in x){let Z=x[K];if(Z===void 0||Z===null)continue;let X=$[K]||O;if(Array.isArray(Z)){let G=vj({allowReserved:X.allowReserved,explode:!0,name:K,style:"form",value:Z,...X.array});if(G)S.push(G)}else if(typeof Z==="object"){let G=hj({allowReserved:X.allowReserved,explode:!0,name:K,style:"deepObject",value:Z,...X.object});if(G)S.push(G)}else{let G=RO({allowReserved:X.allowReserved,name:K,value:Z});if(G)S.push(G)}}return S.join("&")}},CS=($)=>{if(!$)return"stream";let O=$.split(";")[0]?.trim();if(!O)return;if(O.startsWith("application/json")||O.endsWith("+json"))return"json";if(O==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some((j)=>O.startsWith(j)))return"blob";if(O.startsWith("text/"))return"text";return},f7=($,O)=>{if(!O)return!1;if($.headers.has(O)||$.query?.[O]||$.headers.get("Cookie")?.includes(`${O}=`))return!0;return!1};async function _S($){for(let O of $.security??[]){if(f7($,O.name))continue;let j=await HS(O,$.auth);if(!j)continue;let x=O.name??"Authorization";switch(O.in){case"query":if(!$.query)$.query={};$.query[x]=j;break;case"cookie":$.headers.append("Cookie",`${x}=${j}`);break;case"header":default:$.headers.set(x,j);break}}}var c0=($)=>TS({baseUrl:$.baseUrl,path:$.path,query:$.query,querySerializer:typeof $.querySerializer==="function"?$.querySerializer:DS($.querySerializer),url:$.url}),u0=($,O)=>{let j={...$,...O};if(j.baseUrl?.endsWith("/"))j.baseUrl=j.baseUrl.substring(0,j.baseUrl.length-1);return j.headers=cj($.headers,O.headers),j},b7=($)=>{let O=[];return $.forEach((j,x)=>{O.push([x,j])}),O},cj=(...$)=>{let O=new Headers;for(let j of $){if(!j)continue;let x=j instanceof Headers?b7(j):Object.entries(j);for(let[S,K]of x)if(K===null)O.delete(S);else if(Array.isArray(K))for(let Z of K)O.append(S,Z);else if(K!==void 0)O.set(S,typeof K==="object"?JSON.stringify(K):K)}return O};class mj{fns=[];clear(){this.fns=[]}eject($){let O=this.getInterceptorIndex($);if(this.fns[O])this.fns[O]=null}exists($){let O=this.getInterceptorIndex($);return Boolean(this.fns[O])}getInterceptorIndex($){if(typeof $==="number")return this.fns[$]?$:-1;return this.fns.indexOf($)}update($,O){let j=this.getInterceptorIndex($);if(this.fns[j])return this.fns[j]=O,$;return!1}use($){return this.fns.push($),this.fns.length-1}}var MS=()=>({error:new mj,request:new mj,response:new mj}),k7=DS({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),g7={"Content-Type":"application/json"},sO=($={})=>({...RS,headers:g7,parseAs:"auto",querySerializer:k7,...$});var d0=($={})=>{let O=u0(sO(),$),j=()=>({...O}),x=(Y)=>{return O=u0(O,Y),j()},S=MS(),K=async(Y)=>{let Q={...O,...Y,fetch:Y.fetch??O.fetch??globalThis.fetch,headers:cj(O.headers,Y.headers),serializedBody:void 0};if(Q.security)await _S(Q);if(Q.requestValidator)await Q.requestValidator(Q);if(Q.body!==void 0&&Q.bodySerializer)Q.serializedBody=Q.bodySerializer(Q.body);if(Q.body===void 0||Q.serializedBody==="")Q.headers.delete("Content-Type");let T=Q,z=c0(T);return{opts:T,url:z}},Z=async(Y)=>{let Q=Y.throwOnError??O.throwOnError,T=Y.responseStyle??O.responseStyle,z,W;try{let{opts:V,url:B}=await K(Y),I={redirect:"follow",...V,body:m0(V)};z=new Request(B,I);for(let N of S.request.fns)if(N)z=await N(z,V);let P=V.fetch;W=await P(z);for(let N of S.response.fns)if(N)W=await N(W,z,V);let D={request:z,response:W};if(W.ok){let N=(V.parseAs==="auto"?CS(W.headers.get("Content-Type")):V.parseAs)??"json";if(W.status===204||W.headers.get("Content-Length")==="0"){let U;switch(N){case"arrayBuffer":case"blob":case"text":U=await W[N]();break;case"formData":U=new FormData;break;case"stream":U=W.body;break;case"json":default:U={};break}return V.responseStyle==="data"?U:{data:U,...D}}let H;switch(N){case"arrayBuffer":case"blob":case"formData":case"text":H=await W[N]();break;case"json":{let U=await W.text();H=U?JSON.parse(U):{};break}case"stream":return V.responseStyle==="data"?W.body:{data:W.body,...D}}if(N==="json"){if(V.responseValidator)await V.responseValidator(H);if(V.responseTransformer)H=await V.responseTransformer(H)}return V.responseStyle==="data"?H:{data:H,...D}}let C=await W.text(),E;try{E=JSON.parse(C)}catch{}throw E??C}catch(V){let B=V;for(let I of S.error.fns)if(I)B=await I(B,W,z,Y);if(B=B||{},Q)throw B;return T==="data"?void 0:{error:B,request:z,response:W}}},X=(Y)=>(Q)=>Z({...Q,method:Y}),G=(Y)=>async(Q)=>{let{opts:T,url:z}=await K(Q);return IS({...T,body:T.body,method:Y,onRequest:async(W,V)=>{let B=new Request(W,V);for(let I of S.request.fns)if(I)B=await I(B,T);return B},serializedBody:m0(T),url:z})};return{buildUrl:(Y)=>c0({...O,...Y}),connect:X("CONNECT"),delete:X("DELETE"),get:X("GET"),getConfig:j,head:X("HEAD"),interceptors:S,options:X("OPTIONS"),patch:X("PATCH"),post:X("POST"),put:X("PUT"),request:Z,setConfig:x,sse:{connect:G("CONNECT"),delete:G("DELETE"),get:G("GET"),head:G("HEAD"),options:G("OPTIONS"),patch:G("PATCH"),post:G("POST"),put:G("PUT"),trace:G("TRACE")},trace:X("TRACE")}};var AS=d0(sO());class PS{client;constructor($){this.client=$?.client??AS}}class FS{defaultKey="default";instances=new Map;get($){let O=this.instances.get($??this.defaultKey);if(!O)throw Error('No SDK client found. Create one with "new Sdk()" to fix this error.');return O}set($,O){this.instances.set(O??this.defaultKey,$)}}class uj extends PS{static __registry=new FS;constructor($){super($);uj.__registry.set(this,$?.key)}setPricingHandler($){return($.client??this.client).post({url:"/ai-cost/pricing",...$,headers:{"Content-Type":"application/json",...$.headers}})}getUsageHandler($){return($.client??this.client).post({url:"/ai-cost/usage",...$,headers:{"Content-Type":"application/json",...$.headers}})}upsertAiProjection($){return($.client??this.client).post({url:"/ai-projections",...$,headers:{"Content-Type":"application/json",...$.headers}})}getChatsForAttachmentHandler($){return($.client??this.client).get({url:"/attachments/{attachment_id}/chats",...$})}deleteChat($){return($.client??this.client).delete({url:"/chat/{chat_id}",...$})}patchChat($){return($.client??this.client).patch({url:"/chat/{chat_id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}permanentlyDeleteChat($){return($.client??this.client).delete({url:"/chat/{chat_id}/permanent",...$})}createChat($){return($.client??this.client).post({url:"/chats",...$,headers:{"Content-Type":"application/json",...$.headers}})}getChatHistoryHandler($){return($.client??this.client).get({url:"/chats/history/{chat_id}",...$})}getChatHistoryBatchMessagesHandler($){return($.client??this.client).post({url:"/chats/history_batch_messages",...$,headers:{"Content-Type":"application/json",...$.headers}})}getChat($){return($.client??this.client).get({url:"/chats/{chat_id}",...$})}copyChat($){return($.client??this.client).post({url:"/chats/{chat_id}/copy",...$})}getChatPermissions($){return($.client??this.client).get({url:"/chats/{chat_id}/permissions",...$})}revertDeleteChat($){return($.client??this.client).put({url:"/chats/{chat_id}/revert_delete",...$})}callTool($){return($.client??this.client).post({url:"/chats/{chat_id}/tool/call",...$,headers:{"Content-Type":"application/json",...$.headers}})}rejectToolCall($){return($.client??this.client).post({url:"/chats/{chat_id}/tool/reject",...$,headers:{"Content-Type":"application/json",...$.headers}})}updateToolResponse($){return($.client??this.client).post({url:"/chats/{chat_id}/tool/response/update",...$,headers:{"Content-Type":"application/json",...$.headers}})}updateToolCall($){return($.client??this.client).post({url:"/chats/{chat_id}/tool/update",...$,headers:{"Content-Type":"application/json",...$.headers}})}getCitationHandler($){return($.client??this.client).get({url:"/citations/{id}",...$})}decisions($){return($.client??this.client).post({url:"/decisions",...$,headers:{"Content-Type":"application/json",...$.headers}})}healthHandler($){return($?.client??this.client).get({url:"/health",...$})}runImportHandler($){return($.client??this.client).post({url:"/import/run",...$,headers:{"Content-Type":"application/json",...$.headers}})}discoverHandler($){return($.client??this.client).post({url:"/import/runs/{source}/discover",...$})}dismissRunHandler($){return($.client??this.client).post({url:"/import/runs/{source}/dismiss",...$})}retryGatherHandler($){return($.client??this.client).post({url:"/import/runs/{source}/retry",...$})}getStateHandler($){return($?.client??this.client).get({url:"/import/state",...$})}deleteMcpServer($){return($.client??this.client).delete({url:"/mcp/servers",...$})}listMcpServers($){return($?.client??this.client).get({url:"/mcp/servers",...$})}addMcpServer($){return($.client??this.client).post({url:"/mcp/servers",...$,headers:{"Content-Type":"application/json",...$.headers}})}updateMcpServer($){return($.client??this.client).put({url:"/mcp/servers",...$,headers:{"Content-Type":"application/json",...$.headers}})}mcpAuthCallback($){return($?.client??this.client).get({url:"/mcp/servers/auth/callback",...$})}mcpOauthClientMetadata($){return($?.client??this.client).get({url:"/mcp/servers/auth/client-metadata",...$})}startMcpAuth($){return($.client??this.client).post({url:"/mcp/servers/auth/start",...$,headers:{"Content-Type":"application/json",...$.headers}})}getMemoryHandler($){return($?.client??this.client).get({url:"/memory",...$})}getStateHandler2($){return($?.client??this.client).get({url:"/onboarding",...$})}completeHandler($){return($.client??this.client).post({url:"/onboarding/complete",...$,headers:{"Content-Type":"application/json",...$.headers}})}browsePipedreamMcpCatalog($){return($?.client??this.client).get({url:"/pipedream/mcp/catalog",...$})}completePipedreamMcpConnection($){return($.client??this.client).post({url:"/pipedream/mcp/complete",...$,headers:{"Content-Type":"application/json",...$.headers}})}deletePipedreamMcpConnection($){return($.client??this.client).delete({url:"/pipedream/mcp/connections",...$})}listPipedreamMcpConnections($){return($?.client??this.client).get({url:"/pipedream/mcp/connections",...$})}updatePipedreamMcpConnection($){return($.client??this.client).put({url:"/pipedream/mcp/connections",...$,headers:{"Content-Type":"application/json",...$.headers}})}createPipedreamMcpToken($){return($?.client??this.client).post({url:"/pipedream/mcp/token",...$})}getBatchPreview($){return($.client??this.client).post({url:"/preview",...$,headers:{"Content-Type":"application/json",...$.headers}})}sendChatMessage($){return($.client??this.client).post({url:"/stream/chat/message",...$,headers:{"Content-Type":"application/json",...$.headers}})}stopChatStream($){return($.client??this.client).post({url:"/stream/chat/message/stop",...$,headers:{"Content-Type":"application/json",...$.headers}})}structuredCompletion($){return($.client??this.client).post({url:"/structured-completion",...$,headers:{"Content-Type":"application/json",...$.headers}})}}function ES({onRequest:$,onSseError:O,onSseEvent:j,responseTransformer:x,responseValidator:S,sseDefaultRetryDelay:K,sseMaxRetryAttempts:Z,sseMaxRetryDelay:X,sseSleepFn:G,url:L,...Y}){let Q,T=G??((V)=>new Promise((B)=>setTimeout(B,V)));return{stream:async function*(){let V=K??3000,B=0,I=Y.signal??new AbortController().signal;while(!0){if(I.aborted)break;B++;let P=Y.headers instanceof Headers?Y.headers:new Headers(Y.headers);if(Q!==void 0)P.set("Last-Event-ID",Q);try{let D={redirect:"follow",...Y,body:Y.serializedBody,headers:P,signal:I},C=new Request(L,D);if($)C=await $(L,D);let N=await(Y.fetch??globalThis.fetch)(C);if(!N.ok)throw Error(`SSE failed: ${N.status} ${N.statusText}`);if(!N.body)throw Error("No body in SSE response");let H=N.body.pipeThrough(new TextDecoderStream).getReader(),U="",k=()=>{try{H.cancel()}catch{}};I.addEventListener("abort",k);try{while(!0){let{done:d,value:l}=await H.read();if(d)break;U+=l,U=U.replace(/\r\n?/g,`+`);let g=U.split(`++`);U=g.pop()??"";for(let r of g){let p=r.split(`+`),F=[],y;for(let R of p)if(R.startsWith("data:"))F.push(R.replace(/^data:\s*/,""));else if(R.startsWith("event:"))y=R.replace(/^event:\s*/,"");else if(R.startsWith("id:"))Q=R.replace(/^id:\s*/,"");else if(R.startsWith("retry:")){let h=Number.parseInt(R.replace(/^retry:\s*/,""),10);if(!Number.isNaN(h))V=h}let _,v=!1;if(F.length){let R=F.join(`+`);try{_=JSON.parse(R),v=!0}catch{_=R}}if(v){if(S)await S(_);if(x)_=await x(_)}if(j?.({data:_,event:y,id:Q,retry:V}),F.length)yield _}}}finally{I.removeEventListener("abort",k),H.releaseLock()}break}catch(D){if(O?.(D),Z!==void 0&&B>=Z)break;let C=Math.min(V*2**(B-1),X??30000);await T(C)}}}()}}var y7=($)=>{switch($){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},v7=($)=>{switch($){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},h7=($)=>{switch($){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},dj=({allowReserved:$,explode:O,name:j,style:x,value:S})=>{if(!O){let X=($?S:S.map((G)=>encodeURIComponent(G))).join(v7(x));switch(x){case"label":return`.${X}`;case"matrix":return`;${j}=${X}`;case"simple":return X;default:return`${j}=${X}`}}let K=y7(x),Z=S.map((X)=>{if(x==="label"||x==="simple")return $?X:encodeURIComponent(X);return DO({allowReserved:$,name:j,value:X})}).join(K);return x==="label"||x==="matrix"?K+Z:Z},DO=({allowReserved:$,name:O,value:j})=>{if(j===void 0||j===null)return"";if(typeof j==="object")throw Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${O}=${$?j:encodeURIComponent(j)}`},lj=({allowReserved:$,explode:O,name:j,style:x,value:S,valueOnly:K})=>{if(S instanceof Date)return K?S.toISOString():`${j}=${S.toISOString()}`;if(x!=="deepObject"&&!O){let G=[];Object.entries(S).forEach(([Y,Q])=>{G=[...G,Y,$?Q:encodeURIComponent(Q)]});let L=G.join(",");switch(x){case"form":return`${j}=${L}`;case"label":return`.${L}`;case"matrix":return`;${j}=${L}`;default:return L}}let Z=h7(x),X=Object.entries(S).map(([G,L])=>DO({allowReserved:$,name:x==="deepObject"?`${j}[${G}]`:G,value:L})).join(Z);return x==="label"||x==="matrix"?Z+X:X};var m7=/\{[^{}]+\}/g,c7=({path:$,url:O})=>{let j=O,x=O.match(m7);if(x)for(let S of x){let K=!1,Z=S.substring(1,S.length-1),X="simple";if(Z.endsWith("*"))K=!0,Z=Z.substring(0,Z.length-1);if(Z.startsWith("."))Z=Z.substring(1),X="label";else if(Z.startsWith(";"))Z=Z.substring(1),X="matrix";let G=$[Z];if(G===void 0||G===null)continue;if(Array.isArray(G)){j=j.replace(S,dj({explode:K,name:Z,style:X,value:G}));continue}if(typeof G==="object"){j=j.replace(S,lj({explode:K,name:Z,style:X,value:G,valueOnly:!0}));continue}if(X==="matrix"){j=j.replace(S,`;${DO({name:Z,value:G})}`);continue}let L=encodeURIComponent(X==="label"?`.${G}`:G);j=j.replace(S,L)}return j},wS=({baseUrl:$,path:O,query:j,querySerializer:x,url:S})=>{let K=S.startsWith("/")?S:`/${S}`,Z=($??"")+K;if(O)Z=c7({path:O,url:Z});let X=j?x(j):"";if(X.startsWith("?"))X=X.substring(1);if(X)Z+=`?${X}`;return Z};function l0($){let O=$.body!==void 0;if(O&&$.bodySerializer){if("serializedBody"in $)return $.serializedBody!==void 0&&$.serializedBody!==""?$.serializedBody:null;return $.body!==""?$.body:null}if(O)return $.body;return}var qS=async($,O)=>{let j=typeof O==="function"?await O($):O;if(!j)return;if($.scheme==="bearer")return`Bearer ${j}`;if($.scheme==="basic")return`Basic ${btoa(j)}`;return j};var fS={bodySerializer:($)=>JSON.stringify($,(O,j)=>typeof j==="bigint"?j.toString():j)};var bS=({parameters:$={},...O}={})=>{return(x)=>{let S=[];if(x&&typeof x==="object")for(let K in x){let Z=x[K];if(Z===void 0||Z===null)continue;let X=$[K]||O;if(Array.isArray(Z)){let G=dj({allowReserved:X.allowReserved,explode:!0,name:K,style:"form",value:Z,...X.array});if(G)S.push(G)}else if(typeof Z==="object"){let G=lj({allowReserved:X.allowReserved,explode:!0,name:K,style:"deepObject",value:Z,...X.object});if(G)S.push(G)}else{let G=DO({allowReserved:X.allowReserved,name:K,value:Z});if(G)S.push(G)}}return S.join("&")}},kS=($)=>{if(!$)return"stream";let O=$.split(";")[0]?.trim();if(!O)return;if(O.startsWith("application/json")||O.endsWith("+json"))return"json";if(O==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some((j)=>O.startsWith(j)))return"blob";if(O.startsWith("text/"))return"text";return},u7=($,O)=>{if(!O)return!1;if($.headers.has(O)||$.query?.[O]||$.headers.get("Cookie")?.includes(`${O}=`))return!0;return!1};async function gS($){for(let O of $.security??[]){if(u7($,O.name))continue;let j=await qS(O,$.auth);if(!j)continue;let x=O.name??"Authorization";switch(O.in){case"query":if(!$.query)$.query={};$.query[x]=j;break;case"cookie":$.headers.append("Cookie",`${x}=${j}`);break;case"header":default:$.headers.set(x,j);break}}}var r0=($)=>wS({baseUrl:$.baseUrl,path:$.path,query:$.query,querySerializer:typeof $.querySerializer==="function"?$.querySerializer:bS($.querySerializer),url:$.url}),p0=($,O)=>{let j={...$,...O};if(j.baseUrl?.endsWith("/"))j.baseUrl=j.baseUrl.substring(0,j.baseUrl.length-1);return j.headers=pj($.headers,O.headers),j},d7=($)=>{let O=[];return $.forEach((j,x)=>{O.push([x,j])}),O},pj=(...$)=>{let O=new Headers;for(let j of $){if(!j)continue;let x=j instanceof Headers?d7(j):Object.entries(j);for(let[S,K]of x)if(K===null)O.delete(S);else if(Array.isArray(K))for(let Z of K)O.append(S,Z);else if(K!==void 0)O.set(S,typeof K==="object"?JSON.stringify(K):K)}return O};class rj{fns=[];clear(){this.fns=[]}eject($){let O=this.getInterceptorIndex($);if(this.fns[O])this.fns[O]=null}exists($){let O=this.getInterceptorIndex($);return Boolean(this.fns[O])}getInterceptorIndex($){if(typeof $==="number")return this.fns[$]?$:-1;return this.fns.indexOf($)}update($,O){let j=this.getInterceptorIndex($);if(this.fns[j])return this.fns[j]=O,$;return!1}use($){return this.fns.push($),this.fns.length-1}}var yS=()=>({error:new rj,request:new rj,response:new rj}),l7=bS({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),r7={"Content-Type":"application/json"},tO=($={})=>({...fS,headers:r7,parseAs:"auto",querySerializer:l7,...$});var a0=($={})=>{let O=p0(tO(),$),j=()=>({...O}),x=(Y)=>{return O=p0(O,Y),j()},S=yS(),K=async(Y)=>{let Q={...O,...Y,fetch:Y.fetch??O.fetch??globalThis.fetch,headers:pj(O.headers,Y.headers),serializedBody:void 0};if(Q.security)await gS(Q);if(Q.requestValidator)await Q.requestValidator(Q);if(Q.body!==void 0&&Q.bodySerializer)Q.serializedBody=Q.bodySerializer(Q.body);if(Q.body===void 0||Q.serializedBody==="")Q.headers.delete("Content-Type");let T=Q,z=r0(T);return{opts:T,url:z}},Z=async(Y)=>{let Q=Y.throwOnError??O.throwOnError,T=Y.responseStyle??O.responseStyle,z,W;try{let{opts:V,url:B}=await K(Y),I={redirect:"follow",...V,body:l0(V)};z=new Request(B,I);for(let N of S.request.fns)if(N)z=await N(z,V);let P=V.fetch;W=await P(z);for(let N of S.response.fns)if(N)W=await N(W,z,V);let D={request:z,response:W};if(W.ok){let N=(V.parseAs==="auto"?kS(W.headers.get("Content-Type")):V.parseAs)??"json";if(W.status===204||W.headers.get("Content-Length")==="0"){let U;switch(N){case"arrayBuffer":case"blob":case"text":U=await W[N]();break;case"formData":U=new FormData;break;case"stream":U=W.body;break;case"json":default:U={};break}return V.responseStyle==="data"?U:{data:U,...D}}let H;switch(N){case"arrayBuffer":case"blob":case"formData":case"text":H=await W[N]();break;case"json":{let U=await W.text();H=U?JSON.parse(U):{};break}case"stream":return V.responseStyle==="data"?W.body:{data:W.body,...D}}if(N==="json"){if(V.responseValidator)await V.responseValidator(H);if(V.responseTransformer)H=await V.responseTransformer(H)}return V.responseStyle==="data"?H:{data:H,...D}}let C=await W.text(),E;try{E=JSON.parse(C)}catch{}throw E??C}catch(V){let B=V;for(let I of S.error.fns)if(I)B=await I(B,W,z,Y);if(B=B||{},Q)throw B;return T==="data"?void 0:{error:B,request:z,response:W}}},X=(Y)=>(Q)=>Z({...Q,method:Y}),G=(Y)=>async(Q)=>{let{opts:T,url:z}=await K(Q);return ES({...T,body:T.body,method:Y,onRequest:async(W,V)=>{let B=new Request(W,V);for(let I of S.request.fns)if(I)B=await I(B,T);return B},serializedBody:l0(T),url:z})};return{buildUrl:(Y)=>r0({...O,...Y}),connect:X("CONNECT"),delete:X("DELETE"),get:X("GET"),getConfig:j,head:X("HEAD"),interceptors:S,options:X("OPTIONS"),patch:X("PATCH"),post:X("POST"),put:X("PUT"),request:Z,setConfig:x,sse:{connect:G("CONNECT"),delete:G("DELETE"),get:G("GET"),head:G("HEAD"),options:G("OPTIONS"),patch:G("PATCH"),post:G("POST"),put:G("PUT"),trace:G("TRACE")},trace:X("TRACE")}};var vS=a0(tO());class hS{client;constructor($){this.client=$?.client??vS}}class mS{defaultKey="default";instances=new Map;get($){let O=this.instances.get($??this.defaultKey);if(!O)throw Error('No SDK client found. Create one with "new Sdk()" to fix this error.');return O}set($,O){this.instances.set(O??this.defaultKey,$)}}class aj extends hS{static __registry=new mS;constructor($){super($);aj.__registry.set(this,$?.key)}getContacts($){return($?.client??this.client).get({url:"/contacts",...$})}addContact($){return($.client??this.client).post({url:"/contacts",...$,headers:{"Content-Type":"application/json",...$.headers}})}}function cS({onRequest:$,onSseError:O,onSseEvent:j,responseTransformer:x,responseValidator:S,sseDefaultRetryDelay:K,sseMaxRetryAttempts:Z,sseMaxRetryDelay:X,sseSleepFn:G,url:L,...Y}){let Q,T=G??((V)=>new Promise((B)=>setTimeout(B,V)));return{stream:async function*(){let V=K??3000,B=0,I=Y.signal??new AbortController().signal;while(!0){if(I.aborted)break;B++;let P=Y.headers instanceof Headers?Y.headers:new Headers(Y.headers);if(Q!==void 0)P.set("Last-Event-ID",Q);try{let D={redirect:"follow",...Y,body:Y.serializedBody,headers:P,signal:I},C=new Request(L,D);if($)C=await $(L,D);let N=await(Y.fetch??globalThis.fetch)(C);if(!N.ok)throw Error(`SSE failed: ${N.status} ${N.statusText}`);if(!N.body)throw Error("No body in SSE response");let H=N.body.pipeThrough(new TextDecoderStream).getReader(),U="",k=()=>{try{H.cancel()}catch{}};I.addEventListener("abort",k);try{while(!0){let{done:d,value:l}=await H.read();if(d)break;U+=l,U=U.replace(/\r\n?/g,`+`);let g=U.split(`++`);U=g.pop()??"";for(let r of g){let p=r.split(`+`),F=[],y;for(let R of p)if(R.startsWith("data:"))F.push(R.replace(/^data:\s*/,""));else if(R.startsWith("event:"))y=R.replace(/^event:\s*/,"");else if(R.startsWith("id:"))Q=R.replace(/^id:\s*/,"");else if(R.startsWith("retry:")){let h=Number.parseInt(R.replace(/^retry:\s*/,""),10);if(!Number.isNaN(h))V=h}let _,v=!1;if(F.length){let R=F.join(`+`);try{_=JSON.parse(R),v=!0}catch{_=R}}if(v){if(S)await S(_);if(x)_=await x(_)}if(j?.({data:_,event:y,id:Q,retry:V}),F.length)yield _}}}finally{I.removeEventListener("abort",k),H.releaseLock()}break}catch(D){if(O?.(D),Z!==void 0&&B>=Z)break;let C=Math.min(V*2**(B-1),X??30000);await T(C)}}}()}}var p7=($)=>{switch($){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},a7=($)=>{switch($){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},i7=($)=>{switch($){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},ij=({allowReserved:$,explode:O,name:j,style:x,value:S})=>{if(!O){let X=($?S:S.map((G)=>encodeURIComponent(G))).join(a7(x));switch(x){case"label":return`.${X}`;case"matrix":return`;${j}=${X}`;case"simple":return X;default:return`${j}=${X}`}}let K=p7(x),Z=S.map((X)=>{if(x==="label"||x==="simple")return $?X:encodeURIComponent(X);return CO({allowReserved:$,name:j,value:X})}).join(K);return x==="label"||x==="matrix"?K+Z:Z},CO=({allowReserved:$,name:O,value:j})=>{if(j===void 0||j===null)return"";if(typeof j==="object")throw Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${O}=${$?j:encodeURIComponent(j)}`},nj=({allowReserved:$,explode:O,name:j,style:x,value:S,valueOnly:K})=>{if(S instanceof Date)return K?S.toISOString():`${j}=${S.toISOString()}`;if(x!=="deepObject"&&!O){let G=[];Object.entries(S).forEach(([Y,Q])=>{G=[...G,Y,$?Q:encodeURIComponent(Q)]});let L=G.join(",");switch(x){case"form":return`${j}=${L}`;case"label":return`.${L}`;case"matrix":return`;${j}=${L}`;default:return L}}let Z=i7(x),X=Object.entries(S).map(([G,L])=>CO({allowReserved:$,name:x==="deepObject"?`${j}[${G}]`:G,value:L})).join(Z);return x==="label"||x==="matrix"?Z+X:X};var n7=/\{[^{}]+\}/g,s7=({path:$,url:O})=>{let j=O,x=O.match(n7);if(x)for(let S of x){let K=!1,Z=S.substring(1,S.length-1),X="simple";if(Z.endsWith("*"))K=!0,Z=Z.substring(0,Z.length-1);if(Z.startsWith("."))Z=Z.substring(1),X="label";else if(Z.startsWith(";"))Z=Z.substring(1),X="matrix";let G=$[Z];if(G===void 0||G===null)continue;if(Array.isArray(G)){j=j.replace(S,ij({explode:K,name:Z,style:X,value:G}));continue}if(typeof G==="object"){j=j.replace(S,nj({explode:K,name:Z,style:X,value:G,valueOnly:!0}));continue}if(X==="matrix"){j=j.replace(S,`;${CO({name:Z,value:G})}`);continue}let L=encodeURIComponent(X==="label"?`.${G}`:G);j=j.replace(S,L)}return j},uS=({baseUrl:$,path:O,query:j,querySerializer:x,url:S})=>{let K=S.startsWith("/")?S:`/${S}`,Z=($??"")+K;if(O)Z=s7({path:O,url:Z});let X=j?x(j):"";if(X.startsWith("?"))X=X.substring(1);if(X)Z+=`?${X}`;return Z};function i0($){let O=$.body!==void 0;if(O&&$.bodySerializer){if("serializedBody"in $)return $.serializedBody!==void 0&&$.serializedBody!==""?$.serializedBody:null;return $.body!==""?$.body:null}if(O)return $.body;return}var dS=async($,O)=>{let j=typeof O==="function"?await O($):O;if(!j)return;if($.scheme==="bearer")return`Bearer ${j}`;if($.scheme==="basic")return`Basic ${btoa(j)}`;return j};var lS={bodySerializer:($)=>JSON.stringify($,(O,j)=>typeof j==="bigint"?j.toString():j)};var rS=({parameters:$={},...O}={})=>{return(x)=>{let S=[];if(x&&typeof x==="object")for(let K in x){let Z=x[K];if(Z===void 0||Z===null)continue;let X=$[K]||O;if(Array.isArray(Z)){let G=ij({allowReserved:X.allowReserved,explode:!0,name:K,style:"form",value:Z,...X.array});if(G)S.push(G)}else if(typeof Z==="object"){let G=nj({allowReserved:X.allowReserved,explode:!0,name:K,style:"deepObject",value:Z,...X.object});if(G)S.push(G)}else{let G=CO({allowReserved:X.allowReserved,name:K,value:Z});if(G)S.push(G)}}return S.join("&")}},pS=($)=>{if(!$)return"stream";let O=$.split(";")[0]?.trim();if(!O)return;if(O.startsWith("application/json")||O.endsWith("+json"))return"json";if(O==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some((j)=>O.startsWith(j)))return"blob";if(O.startsWith("text/"))return"text";return},t7=($,O)=>{if(!O)return!1;if($.headers.has(O)||$.query?.[O]||$.headers.get("Cookie")?.includes(`${O}=`))return!0;return!1};async function aS($){for(let O of $.security??[]){if(t7($,O.name))continue;let j=await dS(O,$.auth);if(!j)continue;let x=O.name??"Authorization";switch(O.in){case"query":if(!$.query)$.query={};$.query[x]=j;break;case"cookie":$.headers.append("Cookie",`${x}=${j}`);break;case"header":default:$.headers.set(x,j);break}}}var n0=($)=>uS({baseUrl:$.baseUrl,path:$.path,query:$.query,querySerializer:typeof $.querySerializer==="function"?$.querySerializer:rS($.querySerializer),url:$.url}),s0=($,O)=>{let j={...$,...O};if(j.baseUrl?.endsWith("/"))j.baseUrl=j.baseUrl.substring(0,j.baseUrl.length-1);return j.headers=tj($.headers,O.headers),j},e7=($)=>{let O=[];return $.forEach((j,x)=>{O.push([x,j])}),O},tj=(...$)=>{let O=new Headers;for(let j of $){if(!j)continue;let x=j instanceof Headers?e7(j):Object.entries(j);for(let[S,K]of x)if(K===null)O.delete(S);else if(Array.isArray(K))for(let Z of K)O.append(S,Z);else if(K!==void 0)O.set(S,typeof K==="object"?JSON.stringify(K):K)}return O};class sj{fns=[];clear(){this.fns=[]}eject($){let O=this.getInterceptorIndex($);if(this.fns[O])this.fns[O]=null}exists($){let O=this.getInterceptorIndex($);return Boolean(this.fns[O])}getInterceptorIndex($){if(typeof $==="number")return this.fns[$]?$:-1;return this.fns.indexOf($)}update($,O){let j=this.getInterceptorIndex($);if(this.fns[j])return this.fns[j]=O,$;return!1}use($){return this.fns.push($),this.fns.length-1}}var iS=()=>({error:new sj,request:new sj,response:new sj}),o7=rS({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),$5={"Content-Type":"application/json"},eO=($={})=>({...lS,headers:$5,parseAs:"auto",querySerializer:o7,...$});var t0=($={})=>{let O=s0(eO(),$),j=()=>({...O}),x=(Y)=>{return O=s0(O,Y),j()},S=iS(),K=async(Y)=>{let Q={...O,...Y,fetch:Y.fetch??O.fetch??globalThis.fetch,headers:tj(O.headers,Y.headers),serializedBody:void 0};if(Q.security)await aS(Q);if(Q.requestValidator)await Q.requestValidator(Q);if(Q.body!==void 0&&Q.bodySerializer)Q.serializedBody=Q.bodySerializer(Q.body);if(Q.body===void 0||Q.serializedBody==="")Q.headers.delete("Content-Type");let T=Q,z=n0(T);return{opts:T,url:z}},Z=async(Y)=>{let Q=Y.throwOnError??O.throwOnError,T=Y.responseStyle??O.responseStyle,z,W;try{let{opts:V,url:B}=await K(Y),I={redirect:"follow",...V,body:i0(V)};z=new Request(B,I);for(let N of S.request.fns)if(N)z=await N(z,V);let P=V.fetch;W=await P(z);for(let N of S.response.fns)if(N)W=await N(W,z,V);let D={request:z,response:W};if(W.ok){let N=(V.parseAs==="auto"?pS(W.headers.get("Content-Type")):V.parseAs)??"json";if(W.status===204||W.headers.get("Content-Length")==="0"){let U;switch(N){case"arrayBuffer":case"blob":case"text":U=await W[N]();break;case"formData":U=new FormData;break;case"stream":U=W.body;break;case"json":default:U={};break}return V.responseStyle==="data"?U:{data:U,...D}}let H;switch(N){case"arrayBuffer":case"blob":case"formData":case"text":H=await W[N]();break;case"json":{let U=await W.text();H=U?JSON.parse(U):{};break}case"stream":return V.responseStyle==="data"?W.body:{data:W.body,...D}}if(N==="json"){if(V.responseValidator)await V.responseValidator(H);if(V.responseTransformer)H=await V.responseTransformer(H)}return V.responseStyle==="data"?H:{data:H,...D}}let C=await W.text(),E;try{E=JSON.parse(C)}catch{}throw E??C}catch(V){let B=V;for(let I of S.error.fns)if(I)B=await I(B,W,z,Y);if(B=B||{},Q)throw B;return T==="data"?void 0:{error:B,request:z,response:W}}},X=(Y)=>(Q)=>Z({...Q,method:Y}),G=(Y)=>async(Q)=>{let{opts:T,url:z}=await K(Q);return cS({...T,body:T.body,method:Y,onRequest:async(W,V)=>{let B=new Request(W,V);for(let I of S.request.fns)if(I)B=await I(B,T);return B},serializedBody:i0(T),url:z})};return{buildUrl:(Y)=>n0({...O,...Y}),connect:X("CONNECT"),delete:X("DELETE"),get:X("GET"),getConfig:j,head:X("HEAD"),interceptors:S,options:X("OPTIONS"),patch:X("PATCH"),post:X("POST"),put:X("PUT"),request:Z,setConfig:x,sse:{connect:G("CONNECT"),delete:G("DELETE"),get:G("GET"),head:G("HEAD"),options:G("OPTIONS"),patch:G("PATCH"),post:G("POST"),put:G("PUT"),trace:G("TRACE")},trace:X("TRACE")}};var nS=t0(eO());class sS{client;constructor($){this.client=$?.client??nS}}class tS{defaultKey="default";instances=new Map;get($){let O=this.instances.get($??this.defaultKey);if(!O)throw Error('No SDK client found. Create one with "new Sdk()" to fix this error.');return O}set($,O){this.instances.set(O??this.defaultKey,$)}}class ej extends sS{static __registry=new tS;constructor($){super($);ej.__registry.set(this,$?.key)}getAttachment($){return($.client??this.client).get({url:"/email/attachments/{id}",...$})}getAttachmentDocumentId($){return($.client??this.client).get({url:"/email/attachments/{id}/document_id",...$})}cancelBackfillGmail($){return($.client??this.client).delete({url:"/email/backfill/gmail",...$,headers:{"Content-Type":"application/json",...$.headers}})}listBackfillGmail($){return($?.client??this.client).get({url:"/email/backfill/gmail",...$})}getBackfillGmailActive($){return($?.client??this.client).get({url:"/email/backfill/gmail/active",...$})}getBackfillGmail($){return($.client??this.client).get({url:"/email/backfill/gmail/{id}",...$})}listContacts($){return($?.client??this.client).get({url:"/email/contacts",...$})}blockSender($){return($.client??this.client).post({url:"/email/contacts/block",...$,headers:{"Content-Type":"application/json",...$.headers}})}listBlockedSenders($){return($?.client??this.client).get({url:"/email/contacts/blocked",...$})}unblockSender($){return($.client??this.client).post({url:"/email/contacts/unblock",...$,headers:{"Content-Type":"application/json",...$.headers}})}recoverDraftTransfer($){return($.client??this.client).post({url:"/email/draft-transfers/{id}/recover",...$})}createDraft($){return($.client??this.client).post({url:"/email/drafts",...$,headers:{"Content-Type":"application/json",...$.headers}})}getScheduledMessages($){return($?.client??this.client).get({url:"/email/drafts/scheduled",...$})}upsertScheduledMessage($){return($.client??this.client).put({url:"/email/drafts/scheduled/{id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}deleteScheduledDraft($){return($.client??this.client).delete({url:"/email/drafts/scheduled/{message_id}",...$})}deleteDraft($){return($.client??this.client).delete({url:"/email/drafts/{id}",...$})}addDraftAttachment($){return($.client??this.client).post({url:"/email/drafts/{id}/attachments",...$,headers:{"Content-Type":"application/json",...$.headers}})}removeDraftAttachment($){return($.client??this.client).delete({url:"/email/drafts/{id}/attachments/{attachment_id}",...$})}completeDraftAttachment($){return($.client??this.client).post({url:"/email/drafts/{id}/attachments/{attachment_id}/complete",...$})}addForwardedAttachment($){return($.client??this.client).post({url:"/email/drafts/{id}/forwarded-attachments",...$,headers:{"Content-Type":"application/json",...$.headers}})}removeForwardedAttachment($){return($.client??this.client).delete({url:"/email/drafts/{id}/forwarded-attachments/{attachment_id}",...$})}messageOperationStatus($){return($.client??this.client).get({url:"/email/drafts/{id}/operation",...$})}resolveMessageOperation($){return($.client??this.client).post({url:"/email/drafts/{id}/resolve",...$,headers:{"Content-Type":"application/json",...$.headers}})}transferDraft($){return($.client??this.client).post({url:"/email/drafts/{id}/transfer",...$,headers:{"Content-Type":"application/json",...$.headers}})}listEmailFilters($){return($?.client??this.client).get({url:"/email/filters",...$})}upsertEmailFilter($){return($.client??this.client).put({url:"/email/filters",...$,headers:{"Content-Type":"application/json",...$.headers}})}deleteEmailFilter($){return($.client??this.client).delete({url:"/email/filters/{id}",...$})}initUser($){return($?.client??this.client).post({url:"/email/init",...$})}listLabels($){return($?.client??this.client).get({url:"/email/labels",...$})}createLabel($){return($.client??this.client).post({url:"/email/labels",...$,headers:{"Content-Type":"application/json",...$.headers}})}deleteLabel($){return($.client??this.client).delete({url:"/email/labels/{id}",...$})}listLinks($){return($?.client??this.client).get({url:"/email/links",...$})}healthCheckLinks($){return($?.client??this.client).post({url:"/email/links/health-check",...$})}deleteLink($){return($.client??this.client).delete({url:"/email/links/{link_id}",...$})}disableLinkCalendar($){return($.client??this.client).delete({url:"/email/links/{link_id}/calendar",...$})}resyncLink($){return($.client??this.client).post({url:"/email/links/{link_id}/resync",...$})}sendMessage($){return($.client??this.client).post({url:"/email/messages",...$,headers:{"Content-Type":"application/json",...$.headers}})}getMessagesBatch($){return($.client??this.client).post({url:"/email/messages/batch",...$,headers:{"Content-Type":"application/json",...$.headers}})}addRemoveLabel($){return($.client??this.client).patch({url:"/email/messages/labels",...$,headers:{"Content-Type":"application/json",...$.headers}})}getMessage($){return($.client??this.client).get({url:"/email/messages/{id}",...$})}patchSettings($){return($.client??this.client).patch({url:"/email/settings",...$,headers:{"Content-Type":"application/json",...$.headers}})}mailboxSettingsOperations($){return($?.client??this.client).get({url:"/email/settings/operations",...$})}disableSync($){return($?.client??this.client).delete({url:"/email/sync",...$})}previewsInboxCursor($){return($.client??this.client).get({url:"/email/threads/previews/cursor/{view}",...$})}archiveThread($){return($.client??this.client).patch({url:"/email/threads/{id}/archived",...$,headers:{"Content-Type":"application/json",...$.headers}})}addRemoveThreadLabel($){return($.client??this.client).patch({url:"/email/threads/{id}/labels",...$,headers:{"Content-Type":"application/json",...$.headers}})}getThreadMessagesHandler($){return($.client??this.client).get({url:"/email/threads/{id}/messages",...$})}threadOperations($){return($.client??this.client).get({url:"/email/threads/{id}/operations",...$})}threadSeen($){return($.client??this.client).post({url:"/email/threads/{id}/seen",...$})}updateThreadState($){return($.client??this.client).patch({url:"/email/threads/{id}/state",...$,headers:{"Content-Type":"application/json",...$.headers}})}getThread($){return($.client??this.client).get({url:"/email/threads/{thread_id}",...$})}getThreadCalendarInvitations($){return($.client??this.client).get({url:"/email/threads/{thread_id}/calendar-invitations",...$})}updateThreadProject($){return($.client??this.client).patch({url:"/email/threads/{thread_id}/project",...$,headers:{"Content-Type":"application/json",...$.headers}})}healthHandler($){return($?.client??this.client).get({url:"/health",...$})}}function eS({onRequest:$,onSseError:O,onSseEvent:j,responseTransformer:x,responseValidator:S,sseDefaultRetryDelay:K,sseMaxRetryAttempts:Z,sseMaxRetryDelay:X,sseSleepFn:G,url:L,...Y}){let Q,T=G??((V)=>new Promise((B)=>setTimeout(B,V)));return{stream:async function*(){let V=K??3000,B=0,I=Y.signal??new AbortController().signal;while(!0){if(I.aborted)break;B++;let P=Y.headers instanceof Headers?Y.headers:new Headers(Y.headers);if(Q!==void 0)P.set("Last-Event-ID",Q);try{let D={redirect:"follow",...Y,body:Y.serializedBody,headers:P,signal:I},C=new Request(L,D);if($)C=await $(L,D);let N=await(Y.fetch??globalThis.fetch)(C);if(!N.ok)throw Error(`SSE failed: ${N.status} ${N.statusText}`);if(!N.body)throw Error("No body in SSE response");let H=N.body.pipeThrough(new TextDecoderStream).getReader(),U="",k=()=>{try{H.cancel()}catch{}};I.addEventListener("abort",k);try{while(!0){let{done:d,value:l}=await H.read();if(d)break;U+=l,U=U.replace(/\r\n?/g,`+`);let g=U.split(`++`);U=g.pop()??"";for(let r of g){let p=r.split(`+`),F=[],y;for(let R of p)if(R.startsWith("data:"))F.push(R.replace(/^data:\s*/,""));else if(R.startsWith("event:"))y=R.replace(/^event:\s*/,"");else if(R.startsWith("id:"))Q=R.replace(/^id:\s*/,"");else if(R.startsWith("retry:")){let h=Number.parseInt(R.replace(/^retry:\s*/,""),10);if(!Number.isNaN(h))V=h}let _,v=!1;if(F.length){let R=F.join(`+`);try{_=JSON.parse(R),v=!0}catch{_=R}}if(v){if(S)await S(_);if(x)_=await x(_)}if(j?.({data:_,event:y,id:Q,retry:V}),F.length)yield _}}}finally{I.removeEventListener("abort",k),H.releaseLock()}break}catch(D){if(O?.(D),Z!==void 0&&B>=Z)break;let C=Math.min(V*2**(B-1),X??30000);await T(C)}}}()}}var O5=($)=>{switch($){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},j5=($)=>{switch($){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},x5=($)=>{switch($){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},oj=({allowReserved:$,explode:O,name:j,style:x,value:S})=>{if(!O){let X=($?S:S.map((G)=>encodeURIComponent(G))).join(j5(x));switch(x){case"label":return`.${X}`;case"matrix":return`;${j}=${X}`;case"simple":return X;default:return`${j}=${X}`}}let K=O5(x),Z=S.map((X)=>{if(x==="label"||x==="simple")return $?X:encodeURIComponent(X);return _O({allowReserved:$,name:j,value:X})}).join(K);return x==="label"||x==="matrix"?K+Z:Z},_O=({allowReserved:$,name:O,value:j})=>{if(j===void 0||j===null)return"";if(typeof j==="object")throw Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${O}=${$?j:encodeURIComponent(j)}`},$x=({allowReserved:$,explode:O,name:j,style:x,value:S,valueOnly:K})=>{if(S instanceof Date)return K?S.toISOString():`${j}=${S.toISOString()}`;if(x!=="deepObject"&&!O){let G=[];Object.entries(S).forEach(([Y,Q])=>{G=[...G,Y,$?Q:encodeURIComponent(Q)]});let L=G.join(",");switch(x){case"form":return`${j}=${L}`;case"label":return`.${L}`;case"matrix":return`;${j}=${L}`;default:return L}}let Z=x5(x),X=Object.entries(S).map(([G,L])=>_O({allowReserved:$,name:x==="deepObject"?`${j}[${G}]`:G,value:L})).join(Z);return x==="label"||x==="matrix"?Z+X:X};var S5=/\{[^{}]+\}/g,Z5=({path:$,url:O})=>{let j=O,x=O.match(S5);if(x)for(let S of x){let K=!1,Z=S.substring(1,S.length-1),X="simple";if(Z.endsWith("*"))K=!0,Z=Z.substring(0,Z.length-1);if(Z.startsWith("."))Z=Z.substring(1),X="label";else if(Z.startsWith(";"))Z=Z.substring(1),X="matrix";let G=$[Z];if(G===void 0||G===null)continue;if(Array.isArray(G)){j=j.replace(S,oj({explode:K,name:Z,style:X,value:G}));continue}if(typeof G==="object"){j=j.replace(S,$x({explode:K,name:Z,style:X,value:G,valueOnly:!0}));continue}if(X==="matrix"){j=j.replace(S,`;${_O({name:Z,value:G})}`);continue}let L=encodeURIComponent(X==="label"?`.${G}`:G);j=j.replace(S,L)}return j},oS=({baseUrl:$,path:O,query:j,querySerializer:x,url:S})=>{let K=S.startsWith("/")?S:`/${S}`,Z=($??"")+K;if(O)Z=Z5({path:O,url:Z});let X=j?x(j):"";if(X.startsWith("?"))X=X.substring(1);if(X)Z+=`?${X}`;return Z};function e0($){let O=$.body!==void 0;if(O&&$.bodySerializer){if("serializedBody"in $)return $.serializedBody!==void 0&&$.serializedBody!==""?$.serializedBody:null;return $.body!==""?$.body:null}if(O)return $.body;return}var $2=async($,O)=>{let j=typeof O==="function"?await O($):O;if(!j)return;if($.scheme==="bearer")return`Bearer ${j}`;if($.scheme==="basic")return`Basic ${btoa(j)}`;return j};var O2={bodySerializer:($)=>JSON.stringify($,(O,j)=>typeof j==="bigint"?j.toString():j)};var j2=({parameters:$={},...O}={})=>{return(x)=>{let S=[];if(x&&typeof x==="object")for(let K in x){let Z=x[K];if(Z===void 0||Z===null)continue;let X=$[K]||O;if(Array.isArray(Z)){let G=oj({allowReserved:X.allowReserved,explode:!0,name:K,style:"form",value:Z,...X.array});if(G)S.push(G)}else if(typeof Z==="object"){let G=$x({allowReserved:X.allowReserved,explode:!0,name:K,style:"deepObject",value:Z,...X.object});if(G)S.push(G)}else{let G=_O({allowReserved:X.allowReserved,name:K,value:Z});if(G)S.push(G)}}return S.join("&")}},x2=($)=>{if(!$)return"stream";let O=$.split(";")[0]?.trim();if(!O)return;if(O.startsWith("application/json")||O.endsWith("+json"))return"json";if(O==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some((j)=>O.startsWith(j)))return"blob";if(O.startsWith("text/"))return"text";return},X5=($,O)=>{if(!O)return!1;if($.headers.has(O)||$.query?.[O]||$.headers.get("Cookie")?.includes(`${O}=`))return!0;return!1};async function S2($){for(let O of $.security??[]){if(X5($,O.name))continue;let j=await $2(O,$.auth);if(!j)continue;let x=O.name??"Authorization";switch(O.in){case"query":if(!$.query)$.query={};$.query[x]=j;break;case"cookie":$.headers.append("Cookie",`${x}=${j}`);break;case"header":default:$.headers.set(x,j);break}}}var o0=($)=>oS({baseUrl:$.baseUrl,path:$.path,query:$.query,querySerializer:typeof $.querySerializer==="function"?$.querySerializer:j2($.querySerializer),url:$.url}),$1=($,O)=>{let j={...$,...O};if(j.baseUrl?.endsWith("/"))j.baseUrl=j.baseUrl.substring(0,j.baseUrl.length-1);return j.headers=jx($.headers,O.headers),j},G5=($)=>{let O=[];return $.forEach((j,x)=>{O.push([x,j])}),O},jx=(...$)=>{let O=new Headers;for(let j of $){if(!j)continue;let x=j instanceof Headers?G5(j):Object.entries(j);for(let[S,K]of x)if(K===null)O.delete(S);else if(Array.isArray(K))for(let Z of K)O.append(S,Z);else if(K!==void 0)O.set(S,typeof K==="object"?JSON.stringify(K):K)}return O};class Ox{fns=[];clear(){this.fns=[]}eject($){let O=this.getInterceptorIndex($);if(this.fns[O])this.fns[O]=null}exists($){let O=this.getInterceptorIndex($);return Boolean(this.fns[O])}getInterceptorIndex($){if(typeof $==="number")return this.fns[$]?$:-1;return this.fns.indexOf($)}update($,O){let j=this.getInterceptorIndex($);if(this.fns[j])return this.fns[j]=O,$;return!1}use($){return this.fns.push($),this.fns.length-1}}var Z2=()=>({error:new Ox,request:new Ox,response:new Ox}),K5=j2({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),Y5={"Content-Type":"application/json"},oO=($={})=>({...O2,headers:Y5,parseAs:"auto",querySerializer:K5,...$});var O1=($={})=>{let O=$1(oO(),$),j=()=>({...O}),x=(Y)=>{return O=$1(O,Y),j()},S=Z2(),K=async(Y)=>{let Q={...O,...Y,fetch:Y.fetch??O.fetch??globalThis.fetch,headers:jx(O.headers,Y.headers),serializedBody:void 0};if(Q.security)await S2(Q);if(Q.requestValidator)await Q.requestValidator(Q);if(Q.body!==void 0&&Q.bodySerializer)Q.serializedBody=Q.bodySerializer(Q.body);if(Q.body===void 0||Q.serializedBody==="")Q.headers.delete("Content-Type");let T=Q,z=o0(T);return{opts:T,url:z}},Z=async(Y)=>{let Q=Y.throwOnError??O.throwOnError,T=Y.responseStyle??O.responseStyle,z,W;try{let{opts:V,url:B}=await K(Y),I={redirect:"follow",...V,body:e0(V)};z=new Request(B,I);for(let N of S.request.fns)if(N)z=await N(z,V);let P=V.fetch;W=await P(z);for(let N of S.response.fns)if(N)W=await N(W,z,V);let D={request:z,response:W};if(W.ok){let N=(V.parseAs==="auto"?x2(W.headers.get("Content-Type")):V.parseAs)??"json";if(W.status===204||W.headers.get("Content-Length")==="0"){let U;switch(N){case"arrayBuffer":case"blob":case"text":U=await W[N]();break;case"formData":U=new FormData;break;case"stream":U=W.body;break;case"json":default:U={};break}return V.responseStyle==="data"?U:{data:U,...D}}let H;switch(N){case"arrayBuffer":case"blob":case"formData":case"text":H=await W[N]();break;case"json":{let U=await W.text();H=U?JSON.parse(U):{};break}case"stream":return V.responseStyle==="data"?W.body:{data:W.body,...D}}if(N==="json"){if(V.responseValidator)await V.responseValidator(H);if(V.responseTransformer)H=await V.responseTransformer(H)}return V.responseStyle==="data"?H:{data:H,...D}}let C=await W.text(),E;try{E=JSON.parse(C)}catch{}throw E??C}catch(V){let B=V;for(let I of S.error.fns)if(I)B=await I(B,W,z,Y);if(B=B||{},Q)throw B;return T==="data"?void 0:{error:B,request:z,response:W}}},X=(Y)=>(Q)=>Z({...Q,method:Y}),G=(Y)=>async(Q)=>{let{opts:T,url:z}=await K(Q);return eS({...T,body:T.body,method:Y,onRequest:async(W,V)=>{let B=new Request(W,V);for(let I of S.request.fns)if(I)B=await I(B,T);return B},serializedBody:e0(T),url:z})};return{buildUrl:(Y)=>o0({...O,...Y}),connect:X("CONNECT"),delete:X("DELETE"),get:X("GET"),getConfig:j,head:X("HEAD"),interceptors:S,options:X("OPTIONS"),patch:X("PATCH"),post:X("POST"),put:X("PUT"),request:Z,setConfig:x,sse:{connect:G("CONNECT"),delete:G("DELETE"),get:G("GET"),head:G("HEAD"),options:G("OPTIONS"),patch:G("PATCH"),post:G("POST"),put:G("PUT"),trace:G("TRACE")},trace:X("TRACE")}};var X2=O1(oO());class G2{client;constructor($){this.client=$?.client??X2}}class K2{defaultKey="default";instances=new Map;get($){let O=this.instances.get($??this.defaultKey);if(!O)throw Error('No SDK client found. Create one with "new Sdk()" to fix this error.');return O}set($,O){this.instances.set(O??this.defaultKey,$)}}class xx extends G2{static __registry=new K2;constructor($){super($);xx.__registry.set(this,$?.key)}healthHandler($){return($?.client??this.client).get({url:"/health",...$})}getUnsubscribes($){return($?.client??this.client).get({url:"/unsubscribe",...$})}unsubscribeEmail($){return($?.client??this.client).post({url:"/unsubscribe/email",...$})}removeUnsubscribeItem($){return($.client??this.client).delete({url:"/unsubscribe/item/{item_type}/{item_id}",...$})}unsubscribeItem($){return($.client??this.client).post({url:"/unsubscribe/item/{item_type}/{item_id}",...$})}removeUnsubscribeAll($){return($?.client??this.client).delete({url:"/unsubscribe/mute",...$})}unsubscribeAll($){return($?.client??this.client).post({url:"/unsubscribe/mute",...$})}listTypedNotifications($){return($?.client??this.client).get({url:"/v1/user_notifications",...$})}bulkGetTypedNotificationsByEventItemIds($){return($.client??this.client).post({url:"/v1/user_notifications/item/bulk",...$,headers:{"Content-Type":"application/json",...$.headers}})}getTypedNotificationsByEventItemId($){return($.client??this.client).get({url:"/v1/user_notifications/item/{event_item_id}",...$})}getNotificationTypePreferences($){return($?.client??this.client).get({url:"/v1/user_notifications/preferences",...$})}disableNotificationType($){return($.client??this.client).put({url:"/v1/user_notifications/preferences/{notification_event_type}/disable",...$})}enableNotificationType($){return($.client??this.client).put({url:"/v1/user_notifications/preferences/{notification_event_type}/enable",...$})}getTypedNotificationById($){return($.client??this.client).get({url:"/v1/user_notifications/{notification_id}",...$})}bulkDeleteUserNotificationsV2($){return($.client??this.client).delete({url:"/v2/user_notifications/bulk",...$,headers:{"Content-Type":"application/json",...$.headers}})}bulkMarkNotificationsDone($){return($.client??this.client).patch({url:"/v2/user_notifications/bulk/done",...$,headers:{"Content-Type":"application/json",...$.headers}})}bulkMarkNotificationsSeen($){return($.client??this.client).patch({url:"/v2/user_notifications/bulk/seen",...$,headers:{"Content-Type":"application/json",...$.headers}})}bulkMarkNotificationsUndone($){return($.client??this.client).patch({url:"/v2/user_notifications/bulk/undone",...$,headers:{"Content-Type":"application/json",...$.headers}})}deleteUserNotificationV2($){return($.client??this.client).delete({url:"/v2/user_notifications/{notification_id}",...$})}}function Y2({onRequest:$,onSseError:O,onSseEvent:j,responseTransformer:x,responseValidator:S,sseDefaultRetryDelay:K,sseMaxRetryAttempts:Z,sseMaxRetryDelay:X,sseSleepFn:G,url:L,...Y}){let Q,T=G??((V)=>new Promise((B)=>setTimeout(B,V)));return{stream:async function*(){let V=K??3000,B=0,I=Y.signal??new AbortController().signal;while(!0){if(I.aborted)break;B++;let P=Y.headers instanceof Headers?Y.headers:new Headers(Y.headers);if(Q!==void 0)P.set("Last-Event-ID",Q);try{let D={redirect:"follow",...Y,body:Y.serializedBody,headers:P,signal:I},C=new Request(L,D);if($)C=await $(L,D);let N=await(Y.fetch??globalThis.fetch)(C);if(!N.ok)throw Error(`SSE failed: ${N.status} ${N.statusText}`);if(!N.body)throw Error("No body in SSE response");let H=N.body.pipeThrough(new TextDecoderStream).getReader(),U="",k=()=>{try{H.cancel()}catch{}};I.addEventListener("abort",k);try{while(!0){let{done:d,value:l}=await H.read();if(d)break;U+=l,U=U.replace(/\r\n?/g,`+`);let g=U.split(`++`);U=g.pop()??"";for(let r of g){let p=r.split(`+`),F=[],y;for(let R of p)if(R.startsWith("data:"))F.push(R.replace(/^data:\s*/,""));else if(R.startsWith("event:"))y=R.replace(/^event:\s*/,"");else if(R.startsWith("id:"))Q=R.replace(/^id:\s*/,"");else if(R.startsWith("retry:")){let h=Number.parseInt(R.replace(/^retry:\s*/,""),10);if(!Number.isNaN(h))V=h}let _,v=!1;if(F.length){let R=F.join(`+`);try{_=JSON.parse(R),v=!0}catch{_=R}}if(v){if(S)await S(_);if(x)_=await x(_)}if(j?.({data:_,event:y,id:Q,retry:V}),F.length)yield _}}}finally{I.removeEventListener("abort",k),H.releaseLock()}break}catch(D){if(O?.(D),Z!==void 0&&B>=Z)break;let C=Math.min(V*2**(B-1),X??30000);await T(C)}}}()}}var Q5=($)=>{switch($){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},J5=($)=>{switch($){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},V5=($)=>{switch($){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},Sx=({allowReserved:$,explode:O,name:j,style:x,value:S})=>{if(!O){let X=($?S:S.map((G)=>encodeURIComponent(G))).join(J5(x));switch(x){case"label":return`.${X}`;case"matrix":return`;${j}=${X}`;case"simple":return X;default:return`${j}=${X}`}}let K=Q5(x),Z=S.map((X)=>{if(x==="label"||x==="simple")return $?X:encodeURIComponent(X);return MO({allowReserved:$,name:j,value:X})}).join(K);return x==="label"||x==="matrix"?K+Z:Z},MO=({allowReserved:$,name:O,value:j})=>{if(j===void 0||j===null)return"";if(typeof j==="object")throw Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${O}=${$?j:encodeURIComponent(j)}`},Zx=({allowReserved:$,explode:O,name:j,style:x,value:S,valueOnly:K})=>{if(S instanceof Date)return K?S.toISOString():`${j}=${S.toISOString()}`;if(x!=="deepObject"&&!O){let G=[];Object.entries(S).forEach(([Y,Q])=>{G=[...G,Y,$?Q:encodeURIComponent(Q)]});let L=G.join(",");switch(x){case"form":return`${j}=${L}`;case"label":return`.${L}`;case"matrix":return`;${j}=${L}`;default:return L}}let Z=V5(x),X=Object.entries(S).map(([G,L])=>MO({allowReserved:$,name:x==="deepObject"?`${j}[${G}]`:G,value:L})).join(Z);return x==="label"||x==="matrix"?Z+X:X};var W5=/\{[^{}]+\}/g,B5=({path:$,url:O})=>{let j=O,x=O.match(W5);if(x)for(let S of x){let K=!1,Z=S.substring(1,S.length-1),X="simple";if(Z.endsWith("*"))K=!0,Z=Z.substring(0,Z.length-1);if(Z.startsWith("."))Z=Z.substring(1),X="label";else if(Z.startsWith(";"))Z=Z.substring(1),X="matrix";let G=$[Z];if(G===void 0||G===null)continue;if(Array.isArray(G)){j=j.replace(S,Sx({explode:K,name:Z,style:X,value:G}));continue}if(typeof G==="object"){j=j.replace(S,Zx({explode:K,name:Z,style:X,value:G,valueOnly:!0}));continue}if(X==="matrix"){j=j.replace(S,`;${MO({name:Z,value:G})}`);continue}let L=encodeURIComponent(X==="label"?`.${G}`:G);j=j.replace(S,L)}return j},Q2=({baseUrl:$,path:O,query:j,querySerializer:x,url:S})=>{let K=S.startsWith("/")?S:`/${S}`,Z=($??"")+K;if(O)Z=B5({path:O,url:Z});let X=j?x(j):"";if(X.startsWith("?"))X=X.substring(1);if(X)Z+=`?${X}`;return Z};function j1($){let O=$.body!==void 0;if(O&&$.bodySerializer){if("serializedBody"in $)return $.serializedBody!==void 0&&$.serializedBody!==""?$.serializedBody:null;return $.body!==""?$.body:null}if(O)return $.body;return}var J2=async($,O)=>{let j=typeof O==="function"?await O($):O;if(!j)return;if($.scheme==="bearer")return`Bearer ${j}`;if($.scheme==="basic")return`Basic ${btoa(j)}`;return j};var V2={bodySerializer:($)=>JSON.stringify($,(O,j)=>typeof j==="bigint"?j.toString():j)};var W2=({parameters:$={},...O}={})=>{return(x)=>{let S=[];if(x&&typeof x==="object")for(let K in x){let Z=x[K];if(Z===void 0||Z===null)continue;let X=$[K]||O;if(Array.isArray(Z)){let G=Sx({allowReserved:X.allowReserved,explode:!0,name:K,style:"form",value:Z,...X.array});if(G)S.push(G)}else if(typeof Z==="object"){let G=Zx({allowReserved:X.allowReserved,explode:!0,name:K,style:"deepObject",value:Z,...X.object});if(G)S.push(G)}else{let G=MO({allowReserved:X.allowReserved,name:K,value:Z});if(G)S.push(G)}}return S.join("&")}},B2=($)=>{if(!$)return"stream";let O=$.split(";")[0]?.trim();if(!O)return;if(O.startsWith("application/json")||O.endsWith("+json"))return"json";if(O==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some((j)=>O.startsWith(j)))return"blob";if(O.startsWith("text/"))return"text";return},L5=($,O)=>{if(!O)return!1;if($.headers.has(O)||$.query?.[O]||$.headers.get("Cookie")?.includes(`${O}=`))return!0;return!1};async function L2($){for(let O of $.security??[]){if(L5($,O.name))continue;let j=await J2(O,$.auth);if(!j)continue;let x=O.name??"Authorization";switch(O.in){case"query":if(!$.query)$.query={};$.query[x]=j;break;case"cookie":$.headers.append("Cookie",`${x}=${j}`);break;case"header":default:$.headers.set(x,j);break}}}var x1=($)=>Q2({baseUrl:$.baseUrl,path:$.path,query:$.query,querySerializer:typeof $.querySerializer==="function"?$.querySerializer:W2($.querySerializer),url:$.url}),S1=($,O)=>{let j={...$,...O};if(j.baseUrl?.endsWith("/"))j.baseUrl=j.baseUrl.substring(0,j.baseUrl.length-1);return j.headers=Gx($.headers,O.headers),j},N5=($)=>{let O=[];return $.forEach((j,x)=>{O.push([x,j])}),O},Gx=(...$)=>{let O=new Headers;for(let j of $){if(!j)continue;let x=j instanceof Headers?N5(j):Object.entries(j);for(let[S,K]of x)if(K===null)O.delete(S);else if(Array.isArray(K))for(let Z of K)O.append(S,Z);else if(K!==void 0)O.set(S,typeof K==="object"?JSON.stringify(K):K)}return O};class Xx{fns=[];clear(){this.fns=[]}eject($){let O=this.getInterceptorIndex($);if(this.fns[O])this.fns[O]=null}exists($){let O=this.getInterceptorIndex($);return Boolean(this.fns[O])}getInterceptorIndex($){if(typeof $==="number")return this.fns[$]?$:-1;return this.fns.indexOf($)}update($,O){let j=this.getInterceptorIndex($);if(this.fns[j])return this.fns[j]=O,$;return!1}use($){return this.fns.push($),this.fns.length-1}}var N2=()=>({error:new Xx,request:new Xx,response:new Xx}),U5=W2({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),z5={"Content-Type":"application/json"},$j=($={})=>({...V2,headers:z5,parseAs:"auto",querySerializer:U5,...$});var Z1=($={})=>{let O=S1($j(),$),j=()=>({...O}),x=(Y)=>{return O=S1(O,Y),j()},S=N2(),K=async(Y)=>{let Q={...O,...Y,fetch:Y.fetch??O.fetch??globalThis.fetch,headers:Gx(O.headers,Y.headers),serializedBody:void 0};if(Q.security)await L2(Q);if(Q.requestValidator)await Q.requestValidator(Q);if(Q.body!==void 0&&Q.bodySerializer)Q.serializedBody=Q.bodySerializer(Q.body);if(Q.body===void 0||Q.serializedBody==="")Q.headers.delete("Content-Type");let T=Q,z=x1(T);return{opts:T,url:z}},Z=async(Y)=>{let Q=Y.throwOnError??O.throwOnError,T=Y.responseStyle??O.responseStyle,z,W;try{let{opts:V,url:B}=await K(Y),I={redirect:"follow",...V,body:j1(V)};z=new Request(B,I);for(let N of S.request.fns)if(N)z=await N(z,V);let P=V.fetch;W=await P(z);for(let N of S.response.fns)if(N)W=await N(W,z,V);let D={request:z,response:W};if(W.ok){let N=(V.parseAs==="auto"?B2(W.headers.get("Content-Type")):V.parseAs)??"json";if(W.status===204||W.headers.get("Content-Length")==="0"){let U;switch(N){case"arrayBuffer":case"blob":case"text":U=await W[N]();break;case"formData":U=new FormData;break;case"stream":U=W.body;break;case"json":default:U={};break}return V.responseStyle==="data"?U:{data:U,...D}}let H;switch(N){case"arrayBuffer":case"blob":case"formData":case"text":H=await W[N]();break;case"json":{let U=await W.text();H=U?JSON.parse(U):{};break}case"stream":return V.responseStyle==="data"?W.body:{data:W.body,...D}}if(N==="json"){if(V.responseValidator)await V.responseValidator(H);if(V.responseTransformer)H=await V.responseTransformer(H)}return V.responseStyle==="data"?H:{data:H,...D}}let C=await W.text(),E;try{E=JSON.parse(C)}catch{}throw E??C}catch(V){let B=V;for(let I of S.error.fns)if(I)B=await I(B,W,z,Y);if(B=B||{},Q)throw B;return T==="data"?void 0:{error:B,request:z,response:W}}},X=(Y)=>(Q)=>Z({...Q,method:Y}),G=(Y)=>async(Q)=>{let{opts:T,url:z}=await K(Q);return Y2({...T,body:T.body,method:Y,onRequest:async(W,V)=>{let B=new Request(W,V);for(let I of S.request.fns)if(I)B=await I(B,T);return B},serializedBody:j1(T),url:z})};return{buildUrl:(Y)=>x1({...O,...Y}),connect:X("CONNECT"),delete:X("DELETE"),get:X("GET"),getConfig:j,head:X("HEAD"),interceptors:S,options:X("OPTIONS"),patch:X("PATCH"),post:X("POST"),put:X("PUT"),request:Z,setConfig:x,sse:{connect:G("CONNECT"),delete:G("DELETE"),get:G("GET"),head:G("HEAD"),options:G("OPTIONS"),patch:G("PATCH"),post:G("POST"),put:G("PUT"),trace:G("TRACE")},trace:X("TRACE")}};var U2=Z1($j());class z2{client;constructor($){this.client=$?.client??U2}}class I2{defaultKey="default";instances=new Map;get($){let O=this.instances.get($??this.defaultKey);if(!O)throw Error('No SDK client found. Create one with "new Sdk()" to fix this error.');return O}set($,O){this.instances.set(O??this.defaultKey,$)}}class Kx extends z2{static __registry=new I2;constructor($){super($);Kx.__registry.set(this,$?.key)}listProperties($){return($.client??this.client).get({url:"/properties/definitions",...$})}createPropertyDefinition($){return($.client??this.client).post({url:"/properties/definitions",...$,headers:{"Content-Type":"application/json",...$.headers}})}deletePropertyDefinition($){return($.client??this.client).delete({url:"/properties/definitions/{definition_id}",...$})}getPropertyDefinition($){return($.client??this.client).get({url:"/properties/definitions/{definition_id}",...$})}getPropertyOptions($){return($.client??this.client).get({url:"/properties/definitions/{definition_id}/options",...$})}addPropertyOption($){return($.client??this.client).post({url:"/properties/definitions/{definition_id}/options",...$,headers:{"Content-Type":"application/json",...$.headers}})}deletePropertyOption($){return($.client??this.client).delete({url:"/properties/definitions/{definition_id}/options/{option_id}",...$})}updatePropertyOption($){return($.client??this.client).patch({url:"/properties/definitions/{definition_id}/options/{option_id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}getBulkEntityProperties($){return($.client??this.client).post({url:"/properties/entities/bulk",...$,headers:{"Content-Type":"application/json",...$.headers}})}getEntityProperties($){return($.client??this.client).get({url:"/properties/entities/{entity_type}/{entity_id}",...$})}bulkUpdateEntityPropertyOptions($){return($.client??this.client).post({url:"/properties/entities/{entity_type}/{entity_id}/options/bulk",...$,headers:{"Content-Type":"application/json",...$.headers}})}setEntityProperty($){return($.client??this.client).put({url:"/properties/entities/{entity_type}/{entity_id}/{property_id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}removeEntityPropertyOption($){return($.client??this.client).delete({url:"/properties/entities/{entity_type}/{entity_id}/{property_id}/options/{option_id}",...$})}addEntityPropertyOption($){return($.client??this.client).post({url:"/properties/entities/{entity_type}/{entity_id}/{property_id}/options/{option_id}",...$})}deleteEntityProperty($){return($.client??this.client).delete({url:"/properties/entity_properties/{entity_property_id}",...$})}bulkUpdateEntitiesPropertyOptions($){return($.client??this.client).post({url:"/properties/options/bulk",...$,headers:{"Content-Type":"application/json",...$.headers}})}listTags($){return($?.client??this.client).get({url:"/properties/tags",...$})}ensureTagSet($){return($.client??this.client).post({url:"/properties/tags",...$,headers:{"Content-Type":"application/json",...$.headers}})}mergeTag($){return($.client??this.client).post({url:"/properties/tags/merge",...$,headers:{"Content-Type":"application/json",...$.headers}})}promoteTag($){return($.client??this.client).post({url:"/properties/tags/promote",...$,headers:{"Content-Type":"application/json",...$.headers}})}}function T2({onRequest:$,onSseError:O,onSseEvent:j,responseTransformer:x,responseValidator:S,sseDefaultRetryDelay:K,sseMaxRetryAttempts:Z,sseMaxRetryDelay:X,sseSleepFn:G,url:L,...Y}){let Q,T=G??((V)=>new Promise((B)=>setTimeout(B,V)));return{stream:async function*(){let V=K??3000,B=0,I=Y.signal??new AbortController().signal;while(!0){if(I.aborted)break;B++;let P=Y.headers instanceof Headers?Y.headers:new Headers(Y.headers);if(Q!==void 0)P.set("Last-Event-ID",Q);try{let D={redirect:"follow",...Y,body:Y.serializedBody,headers:P,signal:I},C=new Request(L,D);if($)C=await $(L,D);let N=await(Y.fetch??globalThis.fetch)(C);if(!N.ok)throw Error(`SSE failed: ${N.status} ${N.statusText}`);if(!N.body)throw Error("No body in SSE response");let H=N.body.pipeThrough(new TextDecoderStream).getReader(),U="",k=()=>{try{H.cancel()}catch{}};I.addEventListener("abort",k);try{while(!0){let{done:d,value:l}=await H.read();if(d)break;U+=l,U=U.replace(/\r\n?/g,`+`);let g=U.split(`++`);U=g.pop()??"";for(let r of g){let p=r.split(`+`),F=[],y;for(let R of p)if(R.startsWith("data:"))F.push(R.replace(/^data:\s*/,""));else if(R.startsWith("event:"))y=R.replace(/^event:\s*/,"");else if(R.startsWith("id:"))Q=R.replace(/^id:\s*/,"");else if(R.startsWith("retry:")){let h=Number.parseInt(R.replace(/^retry:\s*/,""),10);if(!Number.isNaN(h))V=h}let _,v=!1;if(F.length){let R=F.join(`+`);try{_=JSON.parse(R),v=!0}catch{_=R}}if(v){if(S)await S(_);if(x)_=await x(_)}if(j?.({data:_,event:y,id:Q,retry:V}),F.length)yield _}}}finally{I.removeEventListener("abort",k),H.releaseLock()}break}catch(D){if(O?.(D),Z!==void 0&&B>=Z)break;let C=Math.min(V*2**(B-1),X??30000);await T(C)}}}()}}var I5=($)=>{switch($){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},T5=($)=>{switch($){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},H5=($)=>{switch($){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},Yx=({allowReserved:$,explode:O,name:j,style:x,value:S})=>{if(!O){let X=($?S:S.map((G)=>encodeURIComponent(G))).join(T5(x));switch(x){case"label":return`.${X}`;case"matrix":return`;${j}=${X}`;case"simple":return X;default:return`${j}=${X}`}}let K=I5(x),Z=S.map((X)=>{if(x==="label"||x==="simple")return $?X:encodeURIComponent(X);return AO({allowReserved:$,name:j,value:X})}).join(K);return x==="label"||x==="matrix"?K+Z:Z},AO=({allowReserved:$,name:O,value:j})=>{if(j===void 0||j===null)return"";if(typeof j==="object")throw Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${O}=${$?j:encodeURIComponent(j)}`},Qx=({allowReserved:$,explode:O,name:j,style:x,value:S,valueOnly:K})=>{if(S instanceof Date)return K?S.toISOString():`${j}=${S.toISOString()}`;if(x!=="deepObject"&&!O){let G=[];Object.entries(S).forEach(([Y,Q])=>{G=[...G,Y,$?Q:encodeURIComponent(Q)]});let L=G.join(",");switch(x){case"form":return`${j}=${L}`;case"label":return`.${L}`;case"matrix":return`;${j}=${L}`;default:return L}}let Z=H5(x),X=Object.entries(S).map(([G,L])=>AO({allowReserved:$,name:x==="deepObject"?`${j}[${G}]`:G,value:L})).join(Z);return x==="label"||x==="matrix"?Z+X:X};var R5=/\{[^{}]+\}/g,D5=({path:$,url:O})=>{let j=O,x=O.match(R5);if(x)for(let S of x){let K=!1,Z=S.substring(1,S.length-1),X="simple";if(Z.endsWith("*"))K=!0,Z=Z.substring(0,Z.length-1);if(Z.startsWith("."))Z=Z.substring(1),X="label";else if(Z.startsWith(";"))Z=Z.substring(1),X="matrix";let G=$[Z];if(G===void 0||G===null)continue;if(Array.isArray(G)){j=j.replace(S,Yx({explode:K,name:Z,style:X,value:G}));continue}if(typeof G==="object"){j=j.replace(S,Qx({explode:K,name:Z,style:X,value:G,valueOnly:!0}));continue}if(X==="matrix"){j=j.replace(S,`;${AO({name:Z,value:G})}`);continue}let L=encodeURIComponent(X==="label"?`.${G}`:G);j=j.replace(S,L)}return j},H2=({baseUrl:$,path:O,query:j,querySerializer:x,url:S})=>{let K=S.startsWith("/")?S:`/${S}`,Z=($??"")+K;if(O)Z=D5({path:O,url:Z});let X=j?x(j):"";if(X.startsWith("?"))X=X.substring(1);if(X)Z+=`?${X}`;return Z};function X1($){let O=$.body!==void 0;if(O&&$.bodySerializer){if("serializedBody"in $)return $.serializedBody!==void 0&&$.serializedBody!==""?$.serializedBody:null;return $.body!==""?$.body:null}if(O)return $.body;return}var R2=async($,O)=>{let j=typeof O==="function"?await O($):O;if(!j)return;if($.scheme==="bearer")return`Bearer ${j}`;if($.scheme==="basic")return`Basic ${btoa(j)}`;return j};var D2={bodySerializer:($)=>JSON.stringify($,(O,j)=>typeof j==="bigint"?j.toString():j)};var C2=({parameters:$={},...O}={})=>{return(x)=>{let S=[];if(x&&typeof x==="object")for(let K in x){let Z=x[K];if(Z===void 0||Z===null)continue;let X=$[K]||O;if(Array.isArray(Z)){let G=Yx({allowReserved:X.allowReserved,explode:!0,name:K,style:"form",value:Z,...X.array});if(G)S.push(G)}else if(typeof Z==="object"){let G=Qx({allowReserved:X.allowReserved,explode:!0,name:K,style:"deepObject",value:Z,...X.object});if(G)S.push(G)}else{let G=AO({allowReserved:X.allowReserved,name:K,value:Z});if(G)S.push(G)}}return S.join("&")}},_2=($)=>{if(!$)return"stream";let O=$.split(";")[0]?.trim();if(!O)return;if(O.startsWith("application/json")||O.endsWith("+json"))return"json";if(O==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some((j)=>O.startsWith(j)))return"blob";if(O.startsWith("text/"))return"text";return},C5=($,O)=>{if(!O)return!1;if($.headers.has(O)||$.query?.[O]||$.headers.get("Cookie")?.includes(`${O}=`))return!0;return!1};async function M2($){for(let O of $.security??[]){if(C5($,O.name))continue;let j=await R2(O,$.auth);if(!j)continue;let x=O.name??"Authorization";switch(O.in){case"query":if(!$.query)$.query={};$.query[x]=j;break;case"cookie":$.headers.append("Cookie",`${x}=${j}`);break;case"header":default:$.headers.set(x,j);break}}}var G1=($)=>H2({baseUrl:$.baseUrl,path:$.path,query:$.query,querySerializer:typeof $.querySerializer==="function"?$.querySerializer:C2($.querySerializer),url:$.url}),K1=($,O)=>{let j={...$,...O};if(j.baseUrl?.endsWith("/"))j.baseUrl=j.baseUrl.substring(0,j.baseUrl.length-1);return j.headers=Vx($.headers,O.headers),j},_5=($)=>{let O=[];return $.forEach((j,x)=>{O.push([x,j])}),O},Vx=(...$)=>{let O=new Headers;for(let j of $){if(!j)continue;let x=j instanceof Headers?_5(j):Object.entries(j);for(let[S,K]of x)if(K===null)O.delete(S);else if(Array.isArray(K))for(let Z of K)O.append(S,Z);else if(K!==void 0)O.set(S,typeof K==="object"?JSON.stringify(K):K)}return O};class Jx{fns=[];clear(){this.fns=[]}eject($){let O=this.getInterceptorIndex($);if(this.fns[O])this.fns[O]=null}exists($){let O=this.getInterceptorIndex($);return Boolean(this.fns[O])}getInterceptorIndex($){if(typeof $==="number")return this.fns[$]?$:-1;return this.fns.indexOf($)}update($,O){let j=this.getInterceptorIndex($);if(this.fns[j])return this.fns[j]=O,$;return!1}use($){return this.fns.push($),this.fns.length-1}}var A2=()=>({error:new Jx,request:new Jx,response:new Jx}),M5=C2({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),A5={"Content-Type":"application/json"},Oj=($={})=>({...D2,headers:A5,parseAs:"auto",querySerializer:M5,...$});var Y1=($={})=>{let O=K1(Oj(),$),j=()=>({...O}),x=(Y)=>{return O=K1(O,Y),j()},S=A2(),K=async(Y)=>{let Q={...O,...Y,fetch:Y.fetch??O.fetch??globalThis.fetch,headers:Vx(O.headers,Y.headers),serializedBody:void 0};if(Q.security)await M2(Q);if(Q.requestValidator)await Q.requestValidator(Q);if(Q.body!==void 0&&Q.bodySerializer)Q.serializedBody=Q.bodySerializer(Q.body);if(Q.body===void 0||Q.serializedBody==="")Q.headers.delete("Content-Type");let T=Q,z=G1(T);return{opts:T,url:z}},Z=async(Y)=>{let Q=Y.throwOnError??O.throwOnError,T=Y.responseStyle??O.responseStyle,z,W;try{let{opts:V,url:B}=await K(Y),I={redirect:"follow",...V,body:X1(V)};z=new Request(B,I);for(let N of S.request.fns)if(N)z=await N(z,V);let P=V.fetch;W=await P(z);for(let N of S.response.fns)if(N)W=await N(W,z,V);let D={request:z,response:W};if(W.ok){let N=(V.parseAs==="auto"?_2(W.headers.get("Content-Type")):V.parseAs)??"json";if(W.status===204||W.headers.get("Content-Length")==="0"){let U;switch(N){case"arrayBuffer":case"blob":case"text":U=await W[N]();break;case"formData":U=new FormData;break;case"stream":U=W.body;break;case"json":default:U={};break}return V.responseStyle==="data"?U:{data:U,...D}}let H;switch(N){case"arrayBuffer":case"blob":case"formData":case"text":H=await W[N]();break;case"json":{let U=await W.text();H=U?JSON.parse(U):{};break}case"stream":return V.responseStyle==="data"?W.body:{data:W.body,...D}}if(N==="json"){if(V.responseValidator)await V.responseValidator(H);if(V.responseTransformer)H=await V.responseTransformer(H)}return V.responseStyle==="data"?H:{data:H,...D}}let C=await W.text(),E;try{E=JSON.parse(C)}catch{}throw E??C}catch(V){let B=V;for(let I of S.error.fns)if(I)B=await I(B,W,z,Y);if(B=B||{},Q)throw B;return T==="data"?void 0:{error:B,request:z,response:W}}},X=(Y)=>(Q)=>Z({...Q,method:Y}),G=(Y)=>async(Q)=>{let{opts:T,url:z}=await K(Q);return T2({...T,body:T.body,method:Y,onRequest:async(W,V)=>{let B=new Request(W,V);for(let I of S.request.fns)if(I)B=await I(B,T);return B},serializedBody:X1(T),url:z})};return{buildUrl:(Y)=>G1({...O,...Y}),connect:X("CONNECT"),delete:X("DELETE"),get:X("GET"),getConfig:j,head:X("HEAD"),interceptors:S,options:X("OPTIONS"),patch:X("PATCH"),post:X("POST"),put:X("PUT"),request:Z,setConfig:x,sse:{connect:G("CONNECT"),delete:G("DELETE"),get:G("GET"),head:G("HEAD"),options:G("OPTIONS"),patch:G("PATCH"),post:G("POST"),put:G("PUT"),trace:G("TRACE")},trace:X("TRACE")}};var P2=Y1(Oj());class F2{client;constructor($){this.client=$?.client??P2}}class E2{defaultKey="default";instances=new Map;get($){let O=this.instances.get($??this.defaultKey);if(!O)throw Error('No SDK client found. Create one with "new Sdk()" to fix this error.');return O}set($,O){this.instances.set(O??this.defaultKey,$)}}class Wx extends F2{static __registry=new E2;constructor($){super($);Wx.__registry.set(this,$?.key)}scheduledActionHealth($){return($?.client??this.client).get({url:"/health",...$})}listScheduledActions($){return($?.client??this.client).get({url:"/scheduled-actions",...$})}createScheduledAction($){return($.client??this.client).post({url:"/scheduled-actions",...$,headers:{"Content-Type":"application/json",...$.headers}})}deleteScheduledAction($){return($.client??this.client).delete({url:"/scheduled-actions/{id}",...$})}getScheduledAction($){return($.client??this.client).get({url:"/scheduled-actions/{id}",...$})}updateScheduledAction($){return($.client??this.client).put({url:"/scheduled-actions/{id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}setScheduledActionEnabled($){return($.client??this.client).put({url:"/scheduled-actions/{id}/enabled",...$,headers:{"Content-Type":"application/json",...$.headers}})}executeScheduledActionNow($){return($.client??this.client).post({url:"/scheduled-actions/{id}/execute",...$})}listScheduledActionHistory($){return($.client??this.client).get({url:"/scheduled-actions/{id}/history",...$})}}function w2({onRequest:$,onSseError:O,onSseEvent:j,responseTransformer:x,responseValidator:S,sseDefaultRetryDelay:K,sseMaxRetryAttempts:Z,sseMaxRetryDelay:X,sseSleepFn:G,url:L,...Y}){let Q,T=G??((V)=>new Promise((B)=>setTimeout(B,V)));return{stream:async function*(){let V=K??3000,B=0,I=Y.signal??new AbortController().signal;while(!0){if(I.aborted)break;B++;let P=Y.headers instanceof Headers?Y.headers:new Headers(Y.headers);if(Q!==void 0)P.set("Last-Event-ID",Q);try{let D={redirect:"follow",...Y,body:Y.serializedBody,headers:P,signal:I},C=new Request(L,D);if($)C=await $(L,D);let N=await(Y.fetch??globalThis.fetch)(C);if(!N.ok)throw Error(`SSE failed: ${N.status} ${N.statusText}`);if(!N.body)throw Error("No body in SSE response");let H=N.body.pipeThrough(new TextDecoderStream).getReader(),U="",k=()=>{try{H.cancel()}catch{}};I.addEventListener("abort",k);try{while(!0){let{done:d,value:l}=await H.read();if(d)break;U+=l,U=U.replace(/\r\n?/g,`+`);let g=U.split(`++`);U=g.pop()??"";for(let r of g){let p=r.split(`+`),F=[],y;for(let R of p)if(R.startsWith("data:"))F.push(R.replace(/^data:\s*/,""));else if(R.startsWith("event:"))y=R.replace(/^event:\s*/,"");else if(R.startsWith("id:"))Q=R.replace(/^id:\s*/,"");else if(R.startsWith("retry:")){let h=Number.parseInt(R.replace(/^retry:\s*/,""),10);if(!Number.isNaN(h))V=h}let _,v=!1;if(F.length){let R=F.join(`+`);try{_=JSON.parse(R),v=!0}catch{_=R}}if(v){if(S)await S(_);if(x)_=await x(_)}if(j?.({data:_,event:y,id:Q,retry:V}),F.length)yield _}}}finally{I.removeEventListener("abort",k),H.releaseLock()}break}catch(D){if(O?.(D),Z!==void 0&&B>=Z)break;let C=Math.min(V*2**(B-1),X??30000);await T(C)}}}()}}var P5=($)=>{switch($){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},F5=($)=>{switch($){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},E5=($)=>{switch($){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},Bx=({allowReserved:$,explode:O,name:j,style:x,value:S})=>{if(!O){let X=($?S:S.map((G)=>encodeURIComponent(G))).join(F5(x));switch(x){case"label":return`.${X}`;case"matrix":return`;${j}=${X}`;case"simple":return X;default:return`${j}=${X}`}}let K=P5(x),Z=S.map((X)=>{if(x==="label"||x==="simple")return $?X:encodeURIComponent(X);return PO({allowReserved:$,name:j,value:X})}).join(K);return x==="label"||x==="matrix"?K+Z:Z},PO=({allowReserved:$,name:O,value:j})=>{if(j===void 0||j===null)return"";if(typeof j==="object")throw Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${O}=${$?j:encodeURIComponent(j)}`},Lx=({allowReserved:$,explode:O,name:j,style:x,value:S,valueOnly:K})=>{if(S instanceof Date)return K?S.toISOString():`${j}=${S.toISOString()}`;if(x!=="deepObject"&&!O){let G=[];Object.entries(S).forEach(([Y,Q])=>{G=[...G,Y,$?Q:encodeURIComponent(Q)]});let L=G.join(",");switch(x){case"form":return`${j}=${L}`;case"label":return`.${L}`;case"matrix":return`;${j}=${L}`;default:return L}}let Z=E5(x),X=Object.entries(S).map(([G,L])=>PO({allowReserved:$,name:x==="deepObject"?`${j}[${G}]`:G,value:L})).join(Z);return x==="label"||x==="matrix"?Z+X:X};var w5=/\{[^{}]+\}/g,q5=({path:$,url:O})=>{let j=O,x=O.match(w5);if(x)for(let S of x){let K=!1,Z=S.substring(1,S.length-1),X="simple";if(Z.endsWith("*"))K=!0,Z=Z.substring(0,Z.length-1);if(Z.startsWith("."))Z=Z.substring(1),X="label";else if(Z.startsWith(";"))Z=Z.substring(1),X="matrix";let G=$[Z];if(G===void 0||G===null)continue;if(Array.isArray(G)){j=j.replace(S,Bx({explode:K,name:Z,style:X,value:G}));continue}if(typeof G==="object"){j=j.replace(S,Lx({explode:K,name:Z,style:X,value:G,valueOnly:!0}));continue}if(X==="matrix"){j=j.replace(S,`;${PO({name:Z,value:G})}`);continue}let L=encodeURIComponent(X==="label"?`.${G}`:G);j=j.replace(S,L)}return j},q2=({baseUrl:$,path:O,query:j,querySerializer:x,url:S})=>{let K=S.startsWith("/")?S:`/${S}`,Z=($??"")+K;if(O)Z=q5({path:O,url:Z});let X=j?x(j):"";if(X.startsWith("?"))X=X.substring(1);if(X)Z+=`?${X}`;return Z};function Q1($){let O=$.body!==void 0;if(O&&$.bodySerializer){if("serializedBody"in $)return $.serializedBody!==void 0&&$.serializedBody!==""?$.serializedBody:null;return $.body!==""?$.body:null}if(O)return $.body;return}var f2=async($,O)=>{let j=typeof O==="function"?await O($):O;if(!j)return;if($.scheme==="bearer")return`Bearer ${j}`;if($.scheme==="basic")return`Basic ${btoa(j)}`;return j};var b2={bodySerializer:($)=>JSON.stringify($,(O,j)=>typeof j==="bigint"?j.toString():j)};var k2=({parameters:$={},...O}={})=>{return(x)=>{let S=[];if(x&&typeof x==="object")for(let K in x){let Z=x[K];if(Z===void 0||Z===null)continue;let X=$[K]||O;if(Array.isArray(Z)){let G=Bx({allowReserved:X.allowReserved,explode:!0,name:K,style:"form",value:Z,...X.array});if(G)S.push(G)}else if(typeof Z==="object"){let G=Lx({allowReserved:X.allowReserved,explode:!0,name:K,style:"deepObject",value:Z,...X.object});if(G)S.push(G)}else{let G=PO({allowReserved:X.allowReserved,name:K,value:Z});if(G)S.push(G)}}return S.join("&")}},g2=($)=>{if(!$)return"stream";let O=$.split(";")[0]?.trim();if(!O)return;if(O.startsWith("application/json")||O.endsWith("+json"))return"json";if(O==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some((j)=>O.startsWith(j)))return"blob";if(O.startsWith("text/"))return"text";return},f5=($,O)=>{if(!O)return!1;if($.headers.has(O)||$.query?.[O]||$.headers.get("Cookie")?.includes(`${O}=`))return!0;return!1};async function y2($){for(let O of $.security??[]){if(f5($,O.name))continue;let j=await f2(O,$.auth);if(!j)continue;let x=O.name??"Authorization";switch(O.in){case"query":if(!$.query)$.query={};$.query[x]=j;break;case"cookie":$.headers.append("Cookie",`${x}=${j}`);break;case"header":default:$.headers.set(x,j);break}}}var J1=($)=>q2({baseUrl:$.baseUrl,path:$.path,query:$.query,querySerializer:typeof $.querySerializer==="function"?$.querySerializer:k2($.querySerializer),url:$.url}),V1=($,O)=>{let j={...$,...O};if(j.baseUrl?.endsWith("/"))j.baseUrl=j.baseUrl.substring(0,j.baseUrl.length-1);return j.headers=Ux($.headers,O.headers),j},b5=($)=>{let O=[];return $.forEach((j,x)=>{O.push([x,j])}),O},Ux=(...$)=>{let O=new Headers;for(let j of $){if(!j)continue;let x=j instanceof Headers?b5(j):Object.entries(j);for(let[S,K]of x)if(K===null)O.delete(S);else if(Array.isArray(K))for(let Z of K)O.append(S,Z);else if(K!==void 0)O.set(S,typeof K==="object"?JSON.stringify(K):K)}return O};class Nx{fns=[];clear(){this.fns=[]}eject($){let O=this.getInterceptorIndex($);if(this.fns[O])this.fns[O]=null}exists($){let O=this.getInterceptorIndex($);return Boolean(this.fns[O])}getInterceptorIndex($){if(typeof $==="number")return this.fns[$]?$:-1;return this.fns.indexOf($)}update($,O){let j=this.getInterceptorIndex($);if(this.fns[j])return this.fns[j]=O,$;return!1}use($){return this.fns.push($),this.fns.length-1}}var v2=()=>({error:new Nx,request:new Nx,response:new Nx}),k5=k2({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),g5={"Content-Type":"application/json"},jj=($={})=>({...b2,headers:g5,parseAs:"auto",querySerializer:k5,...$});var W1=($={})=>{let O=V1(jj(),$),j=()=>({...O}),x=(Y)=>{return O=V1(O,Y),j()},S=v2(),K=async(Y)=>{let Q={...O,...Y,fetch:Y.fetch??O.fetch??globalThis.fetch,headers:Ux(O.headers,Y.headers),serializedBody:void 0};if(Q.security)await y2(Q);if(Q.requestValidator)await Q.requestValidator(Q);if(Q.body!==void 0&&Q.bodySerializer)Q.serializedBody=Q.bodySerializer(Q.body);if(Q.body===void 0||Q.serializedBody==="")Q.headers.delete("Content-Type");let T=Q,z=J1(T);return{opts:T,url:z}},Z=async(Y)=>{let Q=Y.throwOnError??O.throwOnError,T=Y.responseStyle??O.responseStyle,z,W;try{let{opts:V,url:B}=await K(Y),I={redirect:"follow",...V,body:Q1(V)};z=new Request(B,I);for(let N of S.request.fns)if(N)z=await N(z,V);let P=V.fetch;W=await P(z);for(let N of S.response.fns)if(N)W=await N(W,z,V);let D={request:z,response:W};if(W.ok){let N=(V.parseAs==="auto"?g2(W.headers.get("Content-Type")):V.parseAs)??"json";if(W.status===204||W.headers.get("Content-Length")==="0"){let U;switch(N){case"arrayBuffer":case"blob":case"text":U=await W[N]();break;case"formData":U=new FormData;break;case"stream":U=W.body;break;case"json":default:U={};break}return V.responseStyle==="data"?U:{data:U,...D}}let H;switch(N){case"arrayBuffer":case"blob":case"formData":case"text":H=await W[N]();break;case"json":{let U=await W.text();H=U?JSON.parse(U):{};break}case"stream":return V.responseStyle==="data"?W.body:{data:W.body,...D}}if(N==="json"){if(V.responseValidator)await V.responseValidator(H);if(V.responseTransformer)H=await V.responseTransformer(H)}return V.responseStyle==="data"?H:{data:H,...D}}let C=await W.text(),E;try{E=JSON.parse(C)}catch{}throw E??C}catch(V){let B=V;for(let I of S.error.fns)if(I)B=await I(B,W,z,Y);if(B=B||{},Q)throw B;return T==="data"?void 0:{error:B,request:z,response:W}}},X=(Y)=>(Q)=>Z({...Q,method:Y}),G=(Y)=>async(Q)=>{let{opts:T,url:z}=await K(Q);return w2({...T,body:T.body,method:Y,onRequest:async(W,V)=>{let B=new Request(W,V);for(let I of S.request.fns)if(I)B=await I(B,T);return B},serializedBody:Q1(T),url:z})};return{buildUrl:(Y)=>J1({...O,...Y}),connect:X("CONNECT"),delete:X("DELETE"),get:X("GET"),getConfig:j,head:X("HEAD"),interceptors:S,options:X("OPTIONS"),patch:X("PATCH"),post:X("POST"),put:X("PUT"),request:Z,setConfig:x,sse:{connect:G("CONNECT"),delete:G("DELETE"),get:G("GET"),head:G("HEAD"),options:G("OPTIONS"),patch:G("PATCH"),post:G("POST"),put:G("PUT"),trace:G("TRACE")},trace:X("TRACE")}};var h2=W1(jj());class m2{client;constructor($){this.client=$?.client??h2}}class c2{defaultKey="default";instances=new Map;get($){let O=this.instances.get($??this.defaultKey);if(!O)throw Error('No SDK client found. Create one with "new Sdk()" to fix this error.');return O}set($,O){this.instances.set(O??this.defaultKey,$)}}class zx extends m2{static __registry=new c2;constructor($){super($);zx.__registry.set(this,$?.key)}unifiedSearch($){return($.client??this.client).post({url:"/search",...$,headers:{"Content-Type":"application/json",...$.headers}})}simpleUnifiedSearch($){return($.client??this.client).post({url:"/search/simple",...$,headers:{"Content-Type":"application/json",...$.headers}})}}function u2({onRequest:$,onSseError:O,onSseEvent:j,responseTransformer:x,responseValidator:S,sseDefaultRetryDelay:K,sseMaxRetryAttempts:Z,sseMaxRetryDelay:X,sseSleepFn:G,url:L,...Y}){let Q,T=G??((V)=>new Promise((B)=>setTimeout(B,V)));return{stream:async function*(){let V=K??3000,B=0,I=Y.signal??new AbortController().signal;while(!0){if(I.aborted)break;B++;let P=Y.headers instanceof Headers?Y.headers:new Headers(Y.headers);if(Q!==void 0)P.set("Last-Event-ID",Q);try{let D={redirect:"follow",...Y,body:Y.serializedBody,headers:P,signal:I},C=new Request(L,D);if($)C=await $(L,D);let N=await(Y.fetch??globalThis.fetch)(C);if(!N.ok)throw Error(`SSE failed: ${N.status} ${N.statusText}`);if(!N.body)throw Error("No body in SSE response");let H=N.body.pipeThrough(new TextDecoderStream).getReader(),U="",k=()=>{try{H.cancel()}catch{}};I.addEventListener("abort",k);try{while(!0){let{done:d,value:l}=await H.read();if(d)break;U+=l,U=U.replace(/\r\n?/g,`+`);let g=U.split(`++`);U=g.pop()??"";for(let r of g){let p=r.split(`+`),F=[],y;for(let R of p)if(R.startsWith("data:"))F.push(R.replace(/^data:\s*/,""));else if(R.startsWith("event:"))y=R.replace(/^event:\s*/,"");else if(R.startsWith("id:"))Q=R.replace(/^id:\s*/,"");else if(R.startsWith("retry:")){let h=Number.parseInt(R.replace(/^retry:\s*/,""),10);if(!Number.isNaN(h))V=h}let _,v=!1;if(F.length){let R=F.join(`+`);try{_=JSON.parse(R),v=!0}catch{_=R}}if(v){if(S)await S(_);if(x)_=await x(_)}if(j?.({data:_,event:y,id:Q,retry:V}),F.length)yield _}}}finally{I.removeEventListener("abort",k),H.releaseLock()}break}catch(D){if(O?.(D),Z!==void 0&&B>=Z)break;let C=Math.min(V*2**(B-1),X??30000);await T(C)}}}()}}var y5=($)=>{switch($){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},v5=($)=>{switch($){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},h5=($)=>{switch($){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},Ix=({allowReserved:$,explode:O,name:j,style:x,value:S})=>{if(!O){let X=($?S:S.map((G)=>encodeURIComponent(G))).join(v5(x));switch(x){case"label":return`.${X}`;case"matrix":return`;${j}=${X}`;case"simple":return X;default:return`${j}=${X}`}}let K=y5(x),Z=S.map((X)=>{if(x==="label"||x==="simple")return $?X:encodeURIComponent(X);return FO({allowReserved:$,name:j,value:X})}).join(K);return x==="label"||x==="matrix"?K+Z:Z},FO=({allowReserved:$,name:O,value:j})=>{if(j===void 0||j===null)return"";if(typeof j==="object")throw Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${O}=${$?j:encodeURIComponent(j)}`},Tx=({allowReserved:$,explode:O,name:j,style:x,value:S,valueOnly:K})=>{if(S instanceof Date)return K?S.toISOString():`${j}=${S.toISOString()}`;if(x!=="deepObject"&&!O){let G=[];Object.entries(S).forEach(([Y,Q])=>{G=[...G,Y,$?Q:encodeURIComponent(Q)]});let L=G.join(",");switch(x){case"form":return`${j}=${L}`;case"label":return`.${L}`;case"matrix":return`;${j}=${L}`;default:return L}}let Z=h5(x),X=Object.entries(S).map(([G,L])=>FO({allowReserved:$,name:x==="deepObject"?`${j}[${G}]`:G,value:L})).join(Z);return x==="label"||x==="matrix"?Z+X:X};var m5=/\{[^{}]+\}/g,c5=({path:$,url:O})=>{let j=O,x=O.match(m5);if(x)for(let S of x){let K=!1,Z=S.substring(1,S.length-1),X="simple";if(Z.endsWith("*"))K=!0,Z=Z.substring(0,Z.length-1);if(Z.startsWith("."))Z=Z.substring(1),X="label";else if(Z.startsWith(";"))Z=Z.substring(1),X="matrix";let G=$[Z];if(G===void 0||G===null)continue;if(Array.isArray(G)){j=j.replace(S,Ix({explode:K,name:Z,style:X,value:G}));continue}if(typeof G==="object"){j=j.replace(S,Tx({explode:K,name:Z,style:X,value:G,valueOnly:!0}));continue}if(X==="matrix"){j=j.replace(S,`;${FO({name:Z,value:G})}`);continue}let L=encodeURIComponent(X==="label"?`.${G}`:G);j=j.replace(S,L)}return j},d2=({baseUrl:$,path:O,query:j,querySerializer:x,url:S})=>{let K=S.startsWith("/")?S:`/${S}`,Z=($??"")+K;if(O)Z=c5({path:O,url:Z});let X=j?x(j):"";if(X.startsWith("?"))X=X.substring(1);if(X)Z+=`?${X}`;return Z};function B1($){let O=$.body!==void 0;if(O&&$.bodySerializer){if("serializedBody"in $)return $.serializedBody!==void 0&&$.serializedBody!==""?$.serializedBody:null;return $.body!==""?$.body:null}if(O)return $.body;return}var l2=async($,O)=>{let j=typeof O==="function"?await O($):O;if(!j)return;if($.scheme==="bearer")return`Bearer ${j}`;if($.scheme==="basic")return`Basic ${btoa(j)}`;return j};var r2={bodySerializer:($)=>JSON.stringify($,(O,j)=>typeof j==="bigint"?j.toString():j)};var p2=({parameters:$={},...O}={})=>{return(x)=>{let S=[];if(x&&typeof x==="object")for(let K in x){let Z=x[K];if(Z===void 0||Z===null)continue;let X=$[K]||O;if(Array.isArray(Z)){let G=Ix({allowReserved:X.allowReserved,explode:!0,name:K,style:"form",value:Z,...X.array});if(G)S.push(G)}else if(typeof Z==="object"){let G=Tx({allowReserved:X.allowReserved,explode:!0,name:K,style:"deepObject",value:Z,...X.object});if(G)S.push(G)}else{let G=FO({allowReserved:X.allowReserved,name:K,value:Z});if(G)S.push(G)}}return S.join("&")}},a2=($)=>{if(!$)return"stream";let O=$.split(";")[0]?.trim();if(!O)return;if(O.startsWith("application/json")||O.endsWith("+json"))return"json";if(O==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some((j)=>O.startsWith(j)))return"blob";if(O.startsWith("text/"))return"text";return},u5=($,O)=>{if(!O)return!1;if($.headers.has(O)||$.query?.[O]||$.headers.get("Cookie")?.includes(`${O}=`))return!0;return!1};async function i2($){for(let O of $.security??[]){if(u5($,O.name))continue;let j=await l2(O,$.auth);if(!j)continue;let x=O.name??"Authorization";switch(O.in){case"query":if(!$.query)$.query={};$.query[x]=j;break;case"cookie":$.headers.append("Cookie",`${x}=${j}`);break;case"header":default:$.headers.set(x,j);break}}}var L1=($)=>d2({baseUrl:$.baseUrl,path:$.path,query:$.query,querySerializer:typeof $.querySerializer==="function"?$.querySerializer:p2($.querySerializer),url:$.url}),N1=($,O)=>{let j={...$,...O};if(j.baseUrl?.endsWith("/"))j.baseUrl=j.baseUrl.substring(0,j.baseUrl.length-1);return j.headers=Rx($.headers,O.headers),j},d5=($)=>{let O=[];return $.forEach((j,x)=>{O.push([x,j])}),O},Rx=(...$)=>{let O=new Headers;for(let j of $){if(!j)continue;let x=j instanceof Headers?d5(j):Object.entries(j);for(let[S,K]of x)if(K===null)O.delete(S);else if(Array.isArray(K))for(let Z of K)O.append(S,Z);else if(K!==void 0)O.set(S,typeof K==="object"?JSON.stringify(K):K)}return O};class Hx{fns=[];clear(){this.fns=[]}eject($){let O=this.getInterceptorIndex($);if(this.fns[O])this.fns[O]=null}exists($){let O=this.getInterceptorIndex($);return Boolean(this.fns[O])}getInterceptorIndex($){if(typeof $==="number")return this.fns[$]?$:-1;return this.fns.indexOf($)}update($,O){let j=this.getInterceptorIndex($);if(this.fns[j])return this.fns[j]=O,$;return!1}use($){return this.fns.push($),this.fns.length-1}}var n2=()=>({error:new Hx,request:new Hx,response:new Hx}),l5=p2({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),r5={"Content-Type":"application/json"},xj=($={})=>({...r2,headers:r5,parseAs:"auto",querySerializer:l5,...$});var Sj=($={})=>{let O=N1(xj(),$),j=()=>({...O}),x=(Y)=>{return O=N1(O,Y),j()},S=n2(),K=async(Y)=>{let Q={...O,...Y,fetch:Y.fetch??O.fetch??globalThis.fetch,headers:Rx(O.headers,Y.headers),serializedBody:void 0};if(Q.security)await i2(Q);if(Q.requestValidator)await Q.requestValidator(Q);if(Q.body!==void 0&&Q.bodySerializer)Q.serializedBody=Q.bodySerializer(Q.body);if(Q.body===void 0||Q.serializedBody==="")Q.headers.delete("Content-Type");let T=Q,z=L1(T);return{opts:T,url:z}},Z=async(Y)=>{let Q=Y.throwOnError??O.throwOnError,T=Y.responseStyle??O.responseStyle,z,W;try{let{opts:V,url:B}=await K(Y),I={redirect:"follow",...V,body:B1(V)};z=new Request(B,I);for(let N of S.request.fns)if(N)z=await N(z,V);let P=V.fetch;W=await P(z);for(let N of S.response.fns)if(N)W=await N(W,z,V);let D={request:z,response:W};if(W.ok){let N=(V.parseAs==="auto"?a2(W.headers.get("Content-Type")):V.parseAs)??"json";if(W.status===204||W.headers.get("Content-Length")==="0"){let U;switch(N){case"arrayBuffer":case"blob":case"text":U=await W[N]();break;case"formData":U=new FormData;break;case"stream":U=W.body;break;case"json":default:U={};break}return V.responseStyle==="data"?U:{data:U,...D}}let H;switch(N){case"arrayBuffer":case"blob":case"formData":case"text":H=await W[N]();break;case"json":{let U=await W.text();H=U?JSON.parse(U):{};break}case"stream":return V.responseStyle==="data"?W.body:{data:W.body,...D}}if(N==="json"){if(V.responseValidator)await V.responseValidator(H);if(V.responseTransformer)H=await V.responseTransformer(H)}return V.responseStyle==="data"?H:{data:H,...D}}let C=await W.text(),E;try{E=JSON.parse(C)}catch{}throw E??C}catch(V){let B=V;for(let I of S.error.fns)if(I)B=await I(B,W,z,Y);if(B=B||{},Q)throw B;return T==="data"?void 0:{error:B,request:z,response:W}}},X=(Y)=>(Q)=>Z({...Q,method:Y}),G=(Y)=>async(Q)=>{let{opts:T,url:z}=await K(Q);return u2({...T,body:T.body,method:Y,onRequest:async(W,V)=>{let B=new Request(W,V);for(let I of S.request.fns)if(I)B=await I(B,T);return B},serializedBody:B1(T),url:z})};return{buildUrl:(Y)=>L1({...O,...Y}),connect:X("CONNECT"),delete:X("DELETE"),get:X("GET"),getConfig:j,head:X("HEAD"),interceptors:S,options:X("OPTIONS"),patch:X("PATCH"),post:X("POST"),put:X("PUT"),request:Z,setConfig:x,sse:{connect:G("CONNECT"),delete:G("DELETE"),get:G("GET"),head:G("HEAD"),options:G("OPTIONS"),patch:G("PATCH"),post:G("POST"),put:G("PUT"),trace:G("TRACE")},trace:X("TRACE")}};var s2=Sj(xj());class t2{client;constructor($){this.client=$?.client??s2}}class e2{defaultKey="default";instances=new Map;get($){let O=this.instances.get($??this.defaultKey);if(!O)throw Error('No SDK client found. Create one with "new Sdk()" to fix this error.');return O}set($,O){this.instances.set(O??this.defaultKey,$)}}class Dx extends t2{static __registry=new e2;constructor($){super($);Dx.__registry.set(this,$?.key)}listAgents($){return($?.client??this.client).get({url:"/agents",...$})}createAgent($){return($.client??this.client).post({url:"/agents",...$,headers:{"Content-Type":"application/json",...$.headers}})}updateAgent($){return($.client??this.client).put({url:"/agents/{agent_id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}deleteAnchor($){return($.client??this.client).delete({url:"/annotations/anchors",...$,headers:{"Content-Type":"application/json",...$.headers}})}editAnchor($){return($.client??this.client).patch({url:"/annotations/anchors",...$,headers:{"Content-Type":"application/json",...$.headers}})}getDocumentAnchors($){return($.client??this.client).get({url:"/annotations/anchors/document/{document_id}",...$})}createAnchor($){return($.client??this.client).post({url:"/annotations/anchors/document/{document_id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}getSelfBot($){return($?.client??this.client).get({url:"/bots/me",...$})}getBotOwnerProfiles($){return($?.client??this.client).get({url:"/bots/profiles",...$})}listBotChannels($){return($.client??this.client).get({url:"/bots/{bot_id}/channels",...$})}removeBotFromChannelByBot($){return($.client??this.client).delete({url:"/bots/{bot_id}/channels/{channel_id}",...$})}listOccurrences($){return($.client??this.client).get({url:"/calendar-events",...$})}mentionPreviews($){return($.client??this.client).post({url:"/calendar-events/preview",...$,headers:{"Content-Type":"application/json",...$.headers}})}listTeamCalendar($){return($.client??this.client).get({url:"/calendar-events/team",...$})}listTeamOutOfOffice($){return($.client??this.client).get({url:"/calendar-events/team-out-of-office",...$})}getActiveCalls($){return($?.client??this.client).get({url:"/call/active",...$})}guestCallChatRead($){return($.client??this.client).get({url:"/call/guest-chat/{call_id}",...$})}guestCallChatPost($){return($.client??this.client).post({url:"/call/guest-chat/{call_id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}meetingLookup($){return($.client??this.client).get({url:"/call/join/{token}",...$})}meetingGuestJoin($){return($.client??this.client).post({url:"/call/join/{token}",...$,headers:{"Content-Type":"application/json",...$.headers}})}meetingLeave($){return($.client??this.client).post({url:"/call/join/{token}/leave",...$})}meetingGuestParticipants($){return($.client??this.client).get({url:"/call/join/{token}/participants",...$})}meetingList($){return($?.client??this.client).get({url:"/call/meetings",...$})}meetingCreate($){return($.client??this.client).post({url:"/call/meetings",...$,headers:{"Content-Type":"application/json",...$.headers}})}meetingListActive($){return($?.client??this.client).get({url:"/call/meetings/active",...$})}meetingInvitePermissions($){return($.client??this.client).get({url:"/call/meetings/invite/{token}",...$})}meetingInvite($){return($.client??this.client).post({url:"/call/meetings/invite/{token}",...$,headers:{"Content-Type":"application/json",...$.headers}})}meetingInviteUsers($){return($.client??this.client).post({url:"/call/meetings/invite/{token}/users",...$,headers:{"Content-Type":"application/json",...$.headers}})}meetingJoin($){return($.client??this.client).post({url:"/call/meetings/join/{token}",...$})}meetingParticipants($){return($.client??this.client).get({url:"/call/meetings/join/{token}/participants",...$})}meetingPrepare($){return($?.client??this.client).post({url:"/call/meetings/prepare",...$})}meetingCancelPreparation($){return($.client??this.client).delete({url:"/call/meetings/prepare/{preparation_id}",...$})}meetingCancel($){return($.client??this.client).delete({url:"/call/meetings/{meeting_id}",...$})}meetingUpdate($){return($.client??this.client).patch({url:"/call/meetings/{meeting_id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}getBatchCallRecordPreview($){return($.client??this.client).post({url:"/call/record/preview",...$,headers:{"Content-Type":"application/json",...$.headers}})}deleteCallRecord($){return($.client??this.client).delete({url:"/call/record/{call_id}",...$})}getCallRecord($){return($.client??this.client).get({url:"/call/record/{call_id}",...$})}editCallRecord($){return($.client??this.client).patch({url:"/call/record/{call_id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}declineCall($){return($.client??this.client).post({url:"/call/record/{call_id}/decline",...$})}meetingShare($){return($.client??this.client).post({url:"/call/record/{call_id}/link",...$})}toggleShareWithTeam($){return($.client??this.client).post({url:"/call/record/{call_id}/share-with-team/toggle",...$})}editCallTranscript($){return($.client??this.client).patch({url:"/call/record/{call_id}/transcript",...$,headers:{"Content-Type":"application/json",...$.headers}})}getRingStatus($){return($.client??this.client).get({url:"/call/ring-status/{call_id}",...$})}declineRing($){return($.client??this.client).post({url:"/call/ring-status/{call_id}/decline",...$})}callWebhook($){return($?.client??this.client).post({url:"/call/webhook",...$})}leaveOrEndCall($){return($.client??this.client).delete({url:"/call/{channel_id}",...$})}getOrCreateCall($){return($.client??this.client).get({url:"/call/{channel_id}",...$})}checkActiveCall($){return($.client??this.client).get({url:"/call/{channel_id}/active",...$})}ingestTranscript($){return($.client??this.client).post({url:"/call/{room_name}/transcript",...$,headers:{"Content-Type":"application/json",...$.headers}})}listChannelLabels($){return($?.client??this.client).get({url:"/channel-labels",...$})}createChannelLabel($){return($.client??this.client).post({url:"/channel-labels",...$,headers:{"Content-Type":"application/json",...$.headers}})}setChannelLabel($){return($.client??this.client).put({url:"/channel-labels/channels/{channel_id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}previewSmartTag($){return($.client??this.client).post({url:"/channel-labels/preview",...$,headers:{"Content-Type":"application/json",...$.headers}})}deleteChannelLabel($){return($.client??this.client).delete({url:"/channel-labels/{label_id}",...$})}renameChannelLabel($){return($.client??this.client).patch({url:"/channel-labels/{label_id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}createChannel($){return($.client??this.client).post({url:"/channels",...$,headers:{"Content-Type":"application/json",...$.headers}})}getActivity($){return($?.client??this.client).get({url:"/channels/activity",...$})}postActivity($){return($.client??this.client).post({url:"/channels/activity",...$,headers:{"Content-Type":"application/json",...$.headers}})}getAttachmentReferences($){return($.client??this.client).get({url:"/channels/attachments/{entity_type}/{entity_id}/references",...$})}getOrCreateDm($){return($.client??this.client).post({url:"/channels/get_or_create_dm",...$,headers:{"Content-Type":"application/json",...$.headers}})}getOrCreatePrivate($){return($.client??this.client).post({url:"/channels/get_or_create_private",...$,headers:{"Content-Type":"application/json",...$.headers}})}joinChannelByCode($){return($.client??this.client).post({url:"/channels/join/{join_code}",...$})}createEntityMention($){return($.client??this.client).post({url:"/channels/mentions",...$,headers:{"Content-Type":"application/json",...$.headers}})}deleteEntityMention($){return($.client??this.client).delete({url:"/channels/mentions/{mention_id}",...$})}getBatchChannelPreview($){return($.client??this.client).post({url:"/channels/preview",...$,headers:{"Content-Type":"application/json",...$.headers}})}deleteChannel($){return($.client??this.client).delete({url:"/channels/{channel_id}",...$})}getChannel($){return($.client??this.client).get({url:"/channels/{channel_id}",...$})}patchChannel($){return($.client??this.client).patch({url:"/channels/{channel_id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}getChannelAttachments($){return($.client??this.client).get({url:"/channels/{channel_id}/attachments",...$})}createChannelScopedBot($){return($.client??this.client).post({url:"/channels/{channel_id}/bots/scoped",...$,headers:{"Content-Type":"application/json",...$.headers}})}joinChannel($){return($.client??this.client).post({url:"/channels/{channel_id}/join",...$})}getChannelJoinLink($){return($.client??this.client).get({url:"/channels/{channel_id}/join-link",...$})}leaveChannel($){return($.client??this.client).post({url:"/channels/{channel_id}/leave",...$})}removeParticipants($){return($.client??this.client).delete({url:"/channels/{channel_id}/participants",...$,headers:{"Content-Type":"application/json",...$.headers}})}getChannelParticipants($){return($.client??this.client).get({url:"/channels/{channel_id}/participants",...$})}addParticipants($){return($.client??this.client).post({url:"/channels/{channel_id}/participants",...$,headers:{"Content-Type":"application/json",...$.headers}})}setChannelPicture($){return($.client??this.client).put({url:"/channels/{channel_id}/profile_picture",...$,headers:{"Content-Type":"application/json",...$.headers}})}postChannelBotWebhook($){return($.client??this.client).post({url:"/channels/{channel_id}/webhook",...$,headers:{"Content-Type":"application/json",...$.headers}})}deleteCollabSurface($){return($.client??this.client).delete({url:"/collab_surfaces/{id}",...$})}getCollabSurface($){return($.client??this.client).get({url:"/collab_surfaces/{id}",...$})}ensureCollabSurface($){return($.client??this.client).put({url:"/collab_surfaces/{id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}createCollabSurfaceToken($){return($.client??this.client).post({url:"/collab_surfaces/{id}/token",...$})}getChannels($){return($?.client??this.client).get({url:"/comms/channels",...$})}createCrmCompany($){return($.client??this.client).post({url:"/crm/companies",...$,headers:{"Content-Type":"application/json",...$.headers}})}getCompany($){return($.client??this.client).get({url:"/crm/companies/{company_id}",...$})}listCompanyContacts($){return($.client??this.client).get({url:"/crm/companies/{company_id}/contacts",...$})}createCrmContact($){return($.client??this.client).post({url:"/crm/companies/{company_id}/contacts",...$,headers:{"Content-Type":"application/json",...$.headers}})}setEmailSync($){return($.client??this.client).put({url:"/crm/companies/{company_id}/email-sync",...$,headers:{"Content-Type":"application/json",...$.headers}})}setCompanyHidden($){return($.client??this.client).put({url:"/crm/companies/{company_id}/hidden",...$,headers:{"Content-Type":"application/json",...$.headers}})}setCrmCompanyName($){return($.client??this.client).put({url:"/crm/companies/{company_id}/name",...$,headers:{"Content-Type":"application/json",...$.headers}})}searchContacts($){return($?.client??this.client).get({url:"/crm/contacts",...$})}getContactByEmail($){return($.client??this.client).get({url:"/crm/contacts/by-email",...$})}getContact($){return($.client??this.client).get({url:"/crm/contacts/{contact_id}",...$})}setContactHidden($){return($.client??this.client).put({url:"/crm/contacts/{contact_id}/hidden",...$,headers:{"Content-Type":"application/json",...$.headers}})}setCrmContactName($){return($.client??this.client).put({url:"/crm/contacts/{contact_id}/name",...$,headers:{"Content-Type":"application/json",...$.headers}})}listCrmPipelines($){return($?.client??this.client).get({url:"/crm/pipelines",...$})}createCrmPipeline($){return($.client??this.client).post({url:"/crm/pipelines",...$,headers:{"Content-Type":"application/json",...$.headers}})}getCrmPipeline($){return($.client??this.client).get({url:"/crm/pipelines/{id}",...$})}renameCrmPipeline($){return($.client??this.client).put({url:"/crm/pipelines/{id}/name",...$,headers:{"Content-Type":"application/json",...$.headers}})}applyCrmPipelineOps($){return($.client??this.client).post({url:"/crm/pipelines/{id}/ops",...$,headers:{"Content-Type":"application/json",...$.headers}})}getCrmPipelinePermissions($){return($.client??this.client).get({url:"/crm/pipelines/{id}/permissions",...$})}updateCrmPipelinePermissions($){return($.client??this.client).patch({url:"/crm/pipelines/{id}/permissions",...$,headers:{"Content-Type":"application/json",...$.headers}})}getCrmPipelineRows($){return($.client??this.client).get({url:"/crm/pipelines/{id}/rows",...$})}queryCrmPipelineRows($){return($.client??this.client).post({url:"/crm/pipelines/{id}/rows",...$,headers:{"Content-Type":"application/json",...$.headers}})}shareCrmPipeline($){return($.client??this.client).put({url:"/crm/pipelines/{id}/sharing",...$,headers:{"Content-Type":"application/json",...$.headers}})}getCrmPipelineTable($){return($.client??this.client).get({url:"/crm/pipelines/{id}/table",...$})}trashCrmPipeline($){return($.client??this.client).put({url:"/crm/pipelines/{id}/trash",...$,headers:{"Content-Type":"application/json",...$.headers}})}getCrmTeamSettings($){return($?.client??this.client).get({url:"/crm/settings",...$})}putCrmTeamSettings($){return($.client??this.client).put({url:"/crm/settings",...$,headers:{"Content-Type":"application/json",...$.headers}})}resetCrmTeamStages($){return($?.client??this.client).delete({url:"/crm/stages",...$})}putCrmTeamStages($){return($.client??this.client).put({url:"/crm/stages",...$,headers:{"Content-Type":"application/json",...$.headers}})}listDatabases($){return($?.client??this.client).get({url:"/databases",...$})}createDatabase($){return($.client??this.client).post({url:"/databases",...$,headers:{"Content-Type":"application/json",...$.headers}})}saveDatabaseQuery($){return($.client??this.client).post({url:"/databases/queries",...$,headers:{"Content-Type":"application/json",...$.headers}})}getDatabaseQuery($){return($.client??this.client).get({url:"/databases/queries/{query_id}",...$})}queryDatabases($){return($.client??this.client).post({url:"/databases/query",...$,headers:{"Content-Type":"application/json",...$.headers}})}ensureStarterHandler($){return($?.client??this.client).post({url:"/databases/starter",...$})}deliverDatabaseWebhook($){return($.client??this.client).post({url:"/databases/webhooks/{token}",...$,headers:{"Content-Type":"application/json",...$.headers}})}getDatabase($){return($.client??this.client).get({url:"/databases/{id}",...$})}shareDatabaseAwareness($){return($.client??this.client).put({url:"/databases/{id}/awareness",...$,headers:{"Content-Type":"application/json",...$.headers}})}undoDatabaseChange($){return($.client??this.client).post({url:"/databases/{id}/changes/{change}/undo",...$})}importDatabaseTable($){return($.client??this.client).post({url:"/databases/{id}/import",...$,headers:{"Content-Type":"application/json",...$.headers}})}applyDatabaseOps($){return($.client??this.client).post({url:"/databases/{id}/ops",...$,headers:{"Content-Type":"application/json",...$.headers}})}getDatabasePermissions($){return($.client??this.client).get({url:"/databases/{id}/permissions",...$})}updateDatabasePermissions($){return($.client??this.client).patch({url:"/databases/{id}/permissions",...$,headers:{"Content-Type":"application/json",...$.headers}})}getDatabaseTableChanges($){return($.client??this.client).get({url:"/databases/{id}/tables/{table_id}/changes",...$})}listDatabaseColumnCasts($){return($.client??this.client).get({url:"/databases/{id}/tables/{table_id}/columns/{column_id}/casts",...$})}convertDatabaseColumn($){return($.client??this.client).post({url:"/databases/{id}/tables/{table_id}/columns/{column_id}/conversion",...$,headers:{"Content-Type":"application/json",...$.headers}})}inferDatabaseColumnType($){return($.client??this.client).post({url:"/databases/{id}/tables/{table_id}/columns/{column_id}/infer-type",...$,headers:{"Content-Type":"application/json",...$.headers}})}getDatabaseRowHistory($){return($.client??this.client).get({url:"/databases/{id}/tables/{table_id}/rows/{row_id}/history",...$})}getDatabaseViewPositions($){return($.client??this.client).get({url:"/databases/{id}/views/{view_id}/positions",...$})}listDatabaseWebhooks($){return($.client??this.client).get({url:"/databases/{id}/webhooks",...$})}createDatabaseWebhook($){return($.client??this.client).post({url:"/databases/{id}/webhooks",...$,headers:{"Content-Type":"application/json",...$.headers}})}deleteDatabaseWebhook($){return($.client??this.client).delete({url:"/databases/{id}/webhooks/{webhook_id}",...$})}transcribeDictation($){return($.client??this.client).post({bodySerializer:null,url:"/dictation/transcribe",...$,headers:{"Content-Type":"audio/webm",...$.headers}})}getUserDocumentsHandler($){return($.client??this.client).get({url:"/documents",...$})}createDocument($){return($.client??this.client).post({url:"/documents",...$,headers:{"Content-Type":"application/json",...$.headers}})}createMarkdownHandler($){return($.client??this.client).post({url:"/documents/create_markdown",...$,headers:{"Content-Type":"application/json",...$.headers}})}createSkillHandler($){return($.client??this.client).post({url:"/documents/create_skill",...$,headers:{"Content-Type":"application/json",...$.headers}})}createSnippetHandler($){return($.client??this.client).post({url:"/documents/create_snippet",...$,headers:{"Content-Type":"application/json",...$.headers}})}createTaskHandler($){return($.client??this.client).post({url:"/documents/create_task",...$,headers:{"Content-Type":"application/json",...$.headers}})}getGithubPullRequestTasks($){return($.client??this.client).post({url:"/documents/github_prs/tasks",...$,headers:{"Content-Type":"application/json",...$.headers}})}initializeUserDocuments($){return($?.client??this.client).post({url:"/documents/initialize_user_documents",...$})}getDocumentListHandler($){return($?.client??this.client).get({url:"/documents/list",...$})}validateDocumentPermissionsToken($){return($.client??this.client).post({url:"/documents/permissions_token/validate",...$,headers:{"Content-Type":"application/json",...$.headers}})}getDocumentPermissionsToken($){return($.client??this.client).post({url:"/documents/permissions_token/{document_id}",...$})}presaveDocumentHandler($){return($.client??this.client).put({url:"/documents/presave/{document_id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}getBatchPreviewHandler($){return($.client??this.client).post({url:"/documents/preview",...$,headers:{"Content-Type":"application/json",...$.headers}})}getDocumentByTeamSlug($){return($.client??this.client).get({url:"/documents/slug/{slug}",...$})}handler($){return($?.client??this.client).get({url:"/documents/starter_docs",...$})}getSystemSkillsHandler($){return($?.client??this.client).get({url:"/documents/system_skills",...$})}deleteDocument($){return($.client??this.client).delete({url:"/documents/{document_id}",...$})}getDocument($){return($.client??this.client).get({url:"/documents/{document_id}",...$})}editDocument($){return($.client??this.client).patch({url:"/documents/{document_id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}saveDocumentHandler($){return($.client??this.client).put({url:"/documents/{document_id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}getDocumentBranchName($){return($.client??this.client).get({url:"/documents/{document_id}/branch_name",...$})}copyDocument($){return($.client??this.client).post({url:"/documents/{document_id}/copy",...$,headers:{"Content-Type":"application/json",...$.headers}})}exportDocument($){return($.client??this.client).get({url:"/documents/{document_id}/export",...$})}getDocumentGithubPullRequests($){return($.client??this.client).get({url:"/documents/{document_id}/github_prs",...$})}getLocationHandler($){return($.client??this.client).get({url:"/documents/{document_id}/location",...$})}getDocumentLocationV3($){return($.client??this.client).get({url:"/documents/{document_id}/location_v3",...$})}permanentlyDeleteDocument($){return($.client??this.client).delete({url:"/documents/{document_id}/permanent",...$})}getDocumentProcessingResult($){return($.client??this.client).get({url:"/documents/{document_id}/processing",...$})}jobProcessingResultHandler($){return($.client??this.client).get({url:"/documents/{document_id}/processing/{job_id}",...$})}revertDeleteDocument($){return($.client??this.client).put({url:"/documents/{document_id}/revert_delete",...$})}getDocumentShortId($){return($.client??this.client).get({url:"/documents/{document_id}/short_id",...$})}simpleSave($){return($.client??this.client).put({url:"/documents/{document_id}/simple_save",...$})}getDocumentTeamShare($){return($.client??this.client).get({url:"/documents/{document_id}/team_share",...$})}setDocumentTeamShare($){return($.client??this.client).put({url:"/documents/{document_id}/team_share",...$,headers:{"Content-Type":"application/json",...$.headers}})}getDocumentTextContent($){return($.client??this.client).get({url:"/documents/{document_id}/text-content",...$})}getDocumentViewsHandler($){return($.client??this.client).get({url:"/documents/{document_id}/views",...$})}getDocumentVersion($){return($.client??this.client).get({url:"/documents/{document_id}/{document_version_id}",...$})}accessRequestsState($){return($.client??this.client).get({url:"/entities/{entity_type}/{entity_id}/access-requests",...$})}accessRequestsCancel($){return($.client??this.client).delete({url:"/entities/{entity_type}/{entity_id}/access-requests/mine",...$})}accessRequestsSubmit($){return($.client??this.client).put({url:"/entities/{entity_type}/{entity_id}/access-requests/mine",...$,headers:{"Content-Type":"application/json",...$.headers}})}accessRequestsResolve($){return($.client??this.client).post({url:"/entities/{entity_type}/{entity_id}/access-requests/{request_id}/resolve",...$,headers:{"Content-Type":"application/json",...$.headers}})}accessRequestsDirect($){return($.client??this.client).get({url:"/entities/{entity_type}/{entity_id}/direct-access",...$})}accessRequestsRemoveDirect($){return($.client??this.client).delete({url:"/entities/{entity_type}/{entity_id}/direct-access/{user_id}",...$})}accessRequestsSetDirect($){return($.client??this.client).put({url:"/entities/{entity_type}/{entity_id}/direct-access/{user_id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}getEntityPermission($){return($.client??this.client).get({url:"/entity/{entity_type}/{entity_id}/permissions",...$})}listFavorites($){return($?.client??this.client).get({url:"/favorites",...$})}addFavorite($){return($.client??this.client).post({url:"/favorites",...$,headers:{"Content-Type":"application/json",...$.headers}})}reorderFavorites($){return($.client??this.client).patch({url:"/favorites/reorder",...$,headers:{"Content-Type":"application/json",...$.headers}})}removeFavoriteByEntity($){return($.client??this.client).delete({url:"/favorites/{entity_type}/{entity_id}",...$})}getForeignEntityBySource($){return($.client??this.client).get({url:"/foreign_entity/by_source/{source}/{foreign_entity_id}",...$})}getForeignEntity($){return($.client??this.client).get({url:"/foreign_entity/{id}",...$})}listForms($){return($.client??this.client).get({url:"/forms",...$})}createForm($){return($.client??this.client).post({url:"/forms",...$,headers:{"Content-Type":"application/json",...$.headers}})}listAccessibleForms($){return($?.client??this.client).get({url:"/forms/accessible",...$})}getForm($){return($.client??this.client).get({url:"/forms/{id}",...$})}updateForm($){return($.client??this.client).patch({url:"/forms/{id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}collaborateForm($){return($.client??this.client).post({url:"/forms/{id}/collaboration",...$})}putFormLayout($){return($.client??this.client).put({url:"/forms/{id}/layout",...$,headers:{"Content-Type":"application/json",...$.headers}})}getFormPermissions($){return($.client??this.client).get({url:"/forms/{id}/permissions",...$})}updateFormPermissions($){return($.client??this.client).patch({url:"/forms/{id}/permissions",...$,headers:{"Content-Type":"application/json",...$.headers}})}submitFormResponse($){return($.client??this.client).post({url:"/forms/{id}/responses",...$,headers:{"Content-Type":"application/json",...$.headers}})}getMyFormResponse($){return($.client??this.client).get({url:"/forms/{id}/responses/mine",...$})}editMyFormResponse($){return($.client??this.client).put({url:"/forms/{id}/responses/mine",...$,headers:{"Content-Type":"application/json",...$.headers}})}getFormResponseSummary($){return($.client??this.client).get({url:"/forms/{id}/responses/summary",...$})}getFormTally($){return($.client??this.client).get({url:"/forms/{id}/tally",...$})}installSync($){return($?.client??this.client).get({url:"/github/install-sync",...$})}getGithubPullRequestFacets($){return($?.client??this.client).get({url:"/github_pull_requests/facets",...$})}getGithubPullRequest($){return($.client??this.client).get({url:"/github_pull_requests/{id}",...$})}getGithubPullRequestChanges($){return($.client??this.client).get({url:"/github_pull_requests/{id}/changes",...$})}getGithubPullRequestChangesPatch($){return($.client??this.client).get({url:"/github_pull_requests/{id}/changes/patch",...$})}createHarnessPairing($){return($.client??this.client).post({url:"/harness-pairings",...$,headers:{"Content-Type":"application/json",...$.headers}})}getHarnessPairing($){return($.client??this.client).get({url:"/harness-pairings/{code}",...$})}approveHarnessPairing($){return($.client??this.client).post({url:"/harness-pairings/{code}/approve",...$,headers:{"Content-Type":"application/json",...$.headers}})}claimHarnessPairing($){return($.client??this.client).post({url:"/harness-pairings/{pairing_id}/claim",...$,headers:{"Content-Type":"application/json",...$.headers}})}listHarnesses($){return($?.client??this.client).get({url:"/harnesses",...$})}deleteSelfHarness($){return($?.client??this.client).delete({url:"/harnesses/me",...$})}getSelfHarness($){return($?.client??this.client).get({url:"/harnesses/me",...$})}listHarnessAgents($){return($?.client??this.client).get({url:"/harnesses/me/agents",...$})}listHarnessSessions($){return($?.client??this.client).get({url:"/harnesses/me/sessions",...$})}deleteHarness($){return($.client??this.client).delete({url:"/harnesses/{harness_id}",...$})}healthHandler($){return($?.client??this.client).get({url:"/health",...$})}getHistoryHandler($){return($?.client??this.client).get({url:"/history",...$})}deleteHistoryHandler($){return($.client??this.client).delete({url:"/history/{item_type}/{item_id}",...$})}upsertHistoryHandler($){return($.client??this.client).post({url:"/history/{item_type}/{item_id}",...$})}listInitiatives($){return($?.client??this.client).get({url:"/initiatives",...$})}createInitiative($){return($.client??this.client).post({url:"/initiatives",...$,headers:{"Content-Type":"application/json",...$.headers}})}deleteInitiative($){return($.client??this.client).delete({url:"/initiatives/{initiative_id}",...$})}getInitiative($){return($.client??this.client).get({url:"/initiatives/{initiative_id}",...$})}updateInitiative($){return($.client??this.client).patch({url:"/initiatives/{initiative_id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}getInstructionsHandler($){return($?.client??this.client).get({url:"/instructions",...$})}createInstructionsHandler($){return($?.client??this.client).post({url:"/instructions",...$})}getItemsSoup($){return($?.client??this.client).get({url:"/items/soup",...$})}postItemsSoup($){return($.client??this.client).post({url:"/items/soup",...$,headers:{"Content-Type":"application/json",...$.headers}})}postItemsSoupAst($){return($.client??this.client).post({url:"/items/soup/ast",...$,headers:{"Content-Type":"application/json",...$.headers}})}postItemsSoupAstGrouped($){return($.client??this.client).post({url:"/items/soup/ast/grouped",...$,headers:{"Content-Type":"application/json",...$.headers}})}messageTimeline($){return($.client??this.client).get({url:"/messages/{parent_type}/{parent_id}",...$})}entityMessageCreate($){return($.client??this.client).post({url:"/messages/{parent_type}/{parent_id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}entityMessageDeleteMessage($){return($.client??this.client).delete({url:"/messages/{parent_type}/{parent_id}/items/{id}",...$})}entityMessageGetMessage($){return($.client??this.client).get({url:"/messages/{parent_type}/{parent_id}/items/{id}",...$})}entityMessageEdit($){return($.client??this.client).patch({url:"/messages/{parent_type}/{parent_id}/items/{id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}entityMessageReact($){return($.client??this.client).post({url:"/messages/{parent_type}/{parent_id}/items/{id}/reactions",...$,headers:{"Content-Type":"application/json",...$.headers}})}entityMessageLegacy($){return($.client??this.client).get({url:"/messages/{parent_type}/{parent_id}/legacy/{legacy_id}",...$})}entityMessageDeleteThread($){return($.client??this.client).delete({url:"/messages/{parent_type}/{parent_id}/threads/{id}",...$})}entityMessageGetThread($){return($.client??this.client).get({url:"/messages/{parent_type}/{parent_id}/threads/{id}",...$})}entityMessagePatchThread($){return($.client??this.client).patch({url:"/messages/{parent_type}/{parent_id}/threads/{id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}messageTimelineEntries($){return($.client??this.client).get({url:"/messages/{parent_type}/{parent_id}/timeline",...$})}entityMessageTyping($){return($.client??this.client).post({url:"/messages/{parent_type}/{parent_id}/typing",...$,headers:{"Content-Type":"application/json",...$.headers}})}getPinsHandler($){return($?.client??this.client).get({url:"/pins",...$})}reorderPinsHandler($){return($.client??this.client).patch({url:"/pins",...$,headers:{"Content-Type":"application/json",...$.headers}})}removePinHandler($){return($.client??this.client).delete({url:"/pins/{pinned_item_id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}addPinHandler($){return($.client??this.client).post({url:"/pins/{pinned_item_id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}getProjectsHandler($){return($?.client??this.client).get({url:"/projects",...$})}createProjectHandler($){return($.client??this.client).post({url:"/projects",...$,headers:{"Content-Type":"application/json",...$.headers}})}getPendingProjectsHandler($){return($?.client??this.client).get({url:"/projects/pending",...$})}getBatchProjectPreview($){return($.client??this.client).post({url:"/projects/preview",...$,headers:{"Content-Type":"application/json",...$.headers}})}uploadFolderHandler($){return($.client??this.client).post({url:"/projects/upload",...$,headers:{"Content-Type":"application/json",...$.headers}})}uploadExtractFolderHandler($){return($.client??this.client).post({url:"/projects/upload_extract",...$,headers:{"Content-Type":"application/json",...$.headers}})}deleteProjectHandler($){return($.client??this.client).delete({url:"/projects/{id}",...$})}getProjectHandler($){return($.client??this.client).get({url:"/projects/{id}",...$})}getProjectUserAccessLevel($){return($.client??this.client).get({url:"/projects/{id}/access_level",...$})}getProjectContentHandler($){return($.client??this.client).get({url:"/projects/{id}/content",...$})}permanentlyDeleteProject($){return($.client??this.client).delete({url:"/projects/{id}/permanent",...$})}getProjectPermissionsV2($){return($.client??this.client).get({url:"/projects/{id}/permissions",...$})}revertDeleteProject($){return($.client??this.client).put({url:"/projects/{id}/revert_delete",...$})}recentlyDeleted($){return($?.client??this.client).get({url:"/recents/deleted",...$})}listEmailReminders($){return($?.client??this.client).get({url:"/reminders/email/collection",...$})}getEmailFollowup($){return($.client??this.client).get({url:"/reminders/email/{thread_id}",...$})}setEmailFollowup($){return($.client??this.client).put({url:"/reminders/email/{thread_id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}getViewsHandler($){return($?.client??this.client).get({url:"/saved_views",...$})}createViewHandler($){return($.client??this.client).post({url:"/saved_views",...$,headers:{"Content-Type":"application/json",...$.headers}})}excludeDefaultViewHandler($){return($.client??this.client).post({url:"/saved_views/exclude_default",...$,headers:{"Content-Type":"application/json",...$.headers}})}deleteViewHandler($){return($.client??this.client).delete({url:"/saved_views/{saved_view_id}",...$})}patchViewHandler($){return($.client??this.client).patch({url:"/saved_views/{saved_view_id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}listSlackImports($){return($?.client??this.client).get({url:"/slack/imports",...$})}createSlackImport($){return($.client??this.client).post({url:"/slack/imports",...$,headers:{"Content-Type":"application/json",...$.headers}})}getSlackImport($){return($.client??this.client).get({url:"/slack/imports/{job_id}",...$})}cancelSlackImport($){return($.client??this.client).post({url:"/slack/imports/{job_id}/cancel",...$})}finalizeSlackImport($){return($.client??this.client).post({url:"/slack/imports/{job_id}/finalize",...$})}registerSlackImportUploads($){return($.client??this.client).post({url:"/slack/imports/{job_id}/uploads",...$,headers:{"Content-Type":"application/json",...$.headers}})}completeSlackImportUploads($){return($.client??this.client).post({url:"/slack/imports/{job_id}/uploads/complete",...$,headers:{"Content-Type":"application/json",...$.headers}})}bulkWakeupSyncServiceDocuments($){return($.client??this.client).post({url:"/sync_service/wakeup",...$,headers:{"Content-Type":"application/json",...$.headers}})}editThreadV2($){return($.client??this.client).patch({url:"/threads/{thread_id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}listUserApiKeys($){return($?.client??this.client).get({url:"/user-api-keys",...$})}createUserApiKey($){return($.client??this.client).post({url:"/user-api-keys",...$,headers:{"Content-Type":"application/json",...$.headers}})}deleteUserApiKey($){return($.client??this.client).delete({url:"/user-api-keys/{id}",...$})}deleteUserDocumentViewLocation($){return($.client??this.client).delete({url:"/user_document_view_location/{document_id}",...$})}getUserDocumentViewLocation($){return($.client??this.client).get({url:"/user_document_view_location/{document_id}",...$})}upsertUserDocumentViewLocation($){return($.client??this.client).post({url:"/user_document_view_location/{document_id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}getDocumentPermissionsV2($){return($.client??this.client).get({url:"/v2/documents/{document_id}/permissions",...$})}editProjectV2($){return($.client??this.client).patch({url:"/v2/projects/{id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}streamEvents($){return($.client??this.client).sse.get({url:"/webhook/events/stream",...$})}listWebhooks($){return($?.client??this.client).get({url:"/webhook/webhooks",...$})}createWebhook($){return($.client??this.client).post({url:"/webhook/webhooks",...$,headers:{"Content-Type":"application/json",...$.headers}})}deleteWebhook($){return($.client??this.client).delete({url:"/webhook/webhooks/{webhook_id}",...$})}getWebhook($){return($.client??this.client).get({url:"/webhook/webhooks/{webhook_id}",...$})}patchWebhook($){return($.client??this.client).patch({url:"/webhook/webhooks/{webhook_id}",...$,headers:{"Content-Type":"application/json",...$.headers}})}validateWebhook($){return($.client??this.client).post({url:"/webhook/webhooks/{webhook_id}/validate",...$})}}function o2({onRequest:$,onSseError:O,onSseEvent:j,responseTransformer:x,responseValidator:S,sseDefaultRetryDelay:K,sseMaxRetryAttempts:Z,sseMaxRetryDelay:X,sseSleepFn:G,url:L,...Y}){let Q,T=G??((V)=>new Promise((B)=>setTimeout(B,V)));return{stream:async function*(){let V=K??3000,B=0,I=Y.signal??new AbortController().signal;while(!0){if(I.aborted)break;B++;let P=Y.headers instanceof Headers?Y.headers:new Headers(Y.headers);if(Q!==void 0)P.set("Last-Event-ID",Q);try{let D={redirect:"follow",...Y,body:Y.serializedBody,headers:P,signal:I},C=new Request(L,D);if($)C=await $(L,D);let N=await(Y.fetch??globalThis.fetch)(C);if(!N.ok)throw Error(`SSE failed: ${N.status} ${N.statusText}`);if(!N.body)throw Error("No body in SSE response");let H=N.body.pipeThrough(new TextDecoderStream).getReader(),U="",k=()=>{try{H.cancel()}catch{}};I.addEventListener("abort",k);try{while(!0){let{done:d,value:l}=await H.read();if(d)break;U+=l,U=U.replace(/\r\n?/g,`+`);let g=U.split(`++`);U=g.pop()??"";for(let r of g){let p=r.split(`+`),F=[],y;for(let R of p)if(R.startsWith("data:"))F.push(R.replace(/^data:\s*/,""));else if(R.startsWith("event:"))y=R.replace(/^event:\s*/,"");else if(R.startsWith("id:"))Q=R.replace(/^id:\s*/,"");else if(R.startsWith("retry:")){let h=Number.parseInt(R.replace(/^retry:\s*/,""),10);if(!Number.isNaN(h))V=h}let _,v=!1;if(F.length){let R=F.join(`+`);try{_=JSON.parse(R),v=!0}catch{_=R}}if(v){if(S)await S(_);if(x)_=await x(_)}if(j?.({data:_,event:y,id:Q,retry:V}),F.length)yield _}}}finally{I.removeEventListener("abort",k),H.releaseLock()}break}catch(D){if(O?.(D),Z!==void 0&&B>=Z)break;let C=Math.min(V*2**(B-1),X??30000);await T(C)}}}()}}var p5=($)=>{switch($){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},a5=($)=>{switch($){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},i5=($)=>{switch($){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},Cx=({allowReserved:$,explode:O,name:j,style:x,value:S})=>{if(!O){let X=($?S:S.map((G)=>encodeURIComponent(G))).join(a5(x));switch(x){case"label":return`.${X}`;case"matrix":return`;${j}=${X}`;case"simple":return X;default:return`${j}=${X}`}}let K=p5(x),Z=S.map((X)=>{if(x==="label"||x==="simple")return $?X:encodeURIComponent(X);return EO({allowReserved:$,name:j,value:X})}).join(K);return x==="label"||x==="matrix"?K+Z:Z},EO=({allowReserved:$,name:O,value:j})=>{if(j===void 0||j===null)return"";if(typeof j==="object")throw Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${O}=${$?j:encodeURIComponent(j)}`},_x=({allowReserved:$,explode:O,name:j,style:x,value:S,valueOnly:K})=>{if(S instanceof Date)return K?S.toISOString():`${j}=${S.toISOString()}`;if(x!=="deepObject"&&!O){let G=[];Object.entries(S).forEach(([Y,Q])=>{G=[...G,Y,$?Q:encodeURIComponent(Q)]});let L=G.join(",");switch(x){case"form":return`${j}=${L}`;case"label":return`.${L}`;case"matrix":return`;${j}=${L}`;default:return L}}let Z=i5(x),X=Object.entries(S).map(([G,L])=>EO({allowReserved:$,name:x==="deepObject"?`${j}[${G}]`:G,value:L})).join(Z);return x==="label"||x==="matrix"?Z+X:X};var n5=/\{[^{}]+\}/g,s5=({path:$,url:O})=>{let j=O,x=O.match(n5);if(x)for(let S of x){let K=!1,Z=S.substring(1,S.length-1),X="simple";if(Z.endsWith("*"))K=!0,Z=Z.substring(0,Z.length-1);if(Z.startsWith("."))Z=Z.substring(1),X="label";else if(Z.startsWith(";"))Z=Z.substring(1),X="matrix";let G=$[Z];if(G===void 0||G===null)continue;if(Array.isArray(G)){j=j.replace(S,Cx({explode:K,name:Z,style:X,value:G}));continue}if(typeof G==="object"){j=j.replace(S,_x({explode:K,name:Z,style:X,value:G,valueOnly:!0}));continue}if(X==="matrix"){j=j.replace(S,`;${EO({name:Z,value:G})}`);continue}let L=encodeURIComponent(X==="label"?`.${G}`:G);j=j.replace(S,L)}return j},$6=({baseUrl:$,path:O,query:j,querySerializer:x,url:S})=>{let K=S.startsWith("/")?S:`/${S}`,Z=($??"")+K;if(O)Z=s5({path:O,url:Z});let X=j?x(j):"";if(X.startsWith("?"))X=X.substring(1);if(X)Z+=`?${X}`;return Z};function U1($){let O=$.body!==void 0;if(O&&$.bodySerializer){if("serializedBody"in $)return $.serializedBody!==void 0&&$.serializedBody!==""?$.serializedBody:null;return $.body!==""?$.body:null}if(O)return $.body;return}var O6=async($,O)=>{let j=typeof O==="function"?await O($):O;if(!j)return;if($.scheme==="bearer")return`Bearer ${j}`;if($.scheme==="basic")return`Basic ${btoa(j)}`;return j};var j6={bodySerializer:($)=>JSON.stringify($,(O,j)=>typeof j==="bigint"?j.toString():j)};var x6=({parameters:$={},...O}={})=>{return(x)=>{let S=[];if(x&&typeof x==="object")for(let K in x){let Z=x[K];if(Z===void 0||Z===null)continue;let X=$[K]||O;if(Array.isArray(Z)){let G=Cx({allowReserved:X.allowReserved,explode:!0,name:K,style:"form",value:Z,...X.array});if(G)S.push(G)}else if(typeof Z==="object"){let G=_x({allowReserved:X.allowReserved,explode:!0,name:K,style:"deepObject",value:Z,...X.object});if(G)S.push(G)}else{let G=EO({allowReserved:X.allowReserved,name:K,value:Z});if(G)S.push(G)}}return S.join("&")}},S6=($)=>{if(!$)return"stream";let O=$.split(";")[0]?.trim();if(!O)return;if(O.startsWith("application/json")||O.endsWith("+json"))return"json";if(O==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some((j)=>O.startsWith(j)))return"blob";if(O.startsWith("text/"))return"text";return},t5=($,O)=>{if(!O)return!1;if($.headers.has(O)||$.query?.[O]||$.headers.get("Cookie")?.includes(`${O}=`))return!0;return!1};async function Z6($){for(let O of $.security??[]){if(t5($,O.name))continue;let j=await O6(O,$.auth);if(!j)continue;let x=O.name??"Authorization";switch(O.in){case"query":if(!$.query)$.query={};$.query[x]=j;break;case"cookie":$.headers.append("Cookie",`${x}=${j}`);break;case"header":default:$.headers.set(x,j);break}}}var z1=($)=>$6({baseUrl:$.baseUrl,path:$.path,query:$.query,querySerializer:typeof $.querySerializer==="function"?$.querySerializer:x6($.querySerializer),url:$.url}),I1=($,O)=>{let j={...$,...O};if(j.baseUrl?.endsWith("/"))j.baseUrl=j.baseUrl.substring(0,j.baseUrl.length-1);return j.headers=Ax($.headers,O.headers),j},e5=($)=>{let O=[];return $.forEach((j,x)=>{O.push([x,j])}),O},Ax=(...$)=>{let O=new Headers;for(let j of $){if(!j)continue;let x=j instanceof Headers?e5(j):Object.entries(j);for(let[S,K]of x)if(K===null)O.delete(S);else if(Array.isArray(K))for(let Z of K)O.append(S,Z);else if(K!==void 0)O.set(S,typeof K==="object"?JSON.stringify(K):K)}return O};class Mx{fns=[];clear(){this.fns=[]}eject($){let O=this.getInterceptorIndex($);if(this.fns[O])this.fns[O]=null}exists($){let O=this.getInterceptorIndex($);return Boolean(this.fns[O])}getInterceptorIndex($){if(typeof $==="number")return this.fns[$]?$:-1;return this.fns.indexOf($)}update($,O){let j=this.getInterceptorIndex($);if(this.fns[j])return this.fns[j]=O,$;return!1}use($){return this.fns.push($),this.fns.length-1}}var X6=()=>({error:new Mx,request:new Mx,response:new Mx}),o5=x6({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),$4={"Content-Type":"application/json"},Zj=($={})=>({...j6,headers:$4,parseAs:"auto",querySerializer:o5,...$});var T1=($={})=>{let O=I1(Zj(),$),j=()=>({...O}),x=(Y)=>{return O=I1(O,Y),j()},S=X6(),K=async(Y)=>{let Q={...O,...Y,fetch:Y.fetch??O.fetch??globalThis.fetch,headers:Ax(O.headers,Y.headers),serializedBody:void 0};if(Q.security)await Z6(Q);if(Q.requestValidator)await Q.requestValidator(Q);if(Q.body!==void 0&&Q.bodySerializer)Q.serializedBody=Q.bodySerializer(Q.body);if(Q.body===void 0||Q.serializedBody==="")Q.headers.delete("Content-Type");let T=Q,z=z1(T);return{opts:T,url:z}},Z=async(Y)=>{let Q=Y.throwOnError??O.throwOnError,T=Y.responseStyle??O.responseStyle,z,W;try{let{opts:V,url:B}=await K(Y),I={redirect:"follow",...V,body:U1(V)};z=new Request(B,I);for(let N of S.request.fns)if(N)z=await N(z,V);let P=V.fetch;W=await P(z);for(let N of S.response.fns)if(N)W=await N(W,z,V);let D={request:z,response:W};if(W.ok){let N=(V.parseAs==="auto"?S6(W.headers.get("Content-Type")):V.parseAs)??"json";if(W.status===204||W.headers.get("Content-Length")==="0"){let U;switch(N){case"arrayBuffer":case"blob":case"text":U=await W[N]();break;case"formData":U=new FormData;break;case"stream":U=W.body;break;case"json":default:U={};break}return V.responseStyle==="data"?U:{data:U,...D}}let H;switch(N){case"arrayBuffer":case"blob":case"formData":case"text":H=await W[N]();break;case"json":{let U=await W.text();H=U?JSON.parse(U):{};break}case"stream":return V.responseStyle==="data"?W.body:{data:W.body,...D}}if(N==="json"){if(V.responseValidator)await V.responseValidator(H);if(V.responseTransformer)H=await V.responseTransformer(H)}return V.responseStyle==="data"?H:{data:H,...D}}let C=await W.text(),E;try{E=JSON.parse(C)}catch{}throw E??C}catch(V){let B=V;for(let I of S.error.fns)if(I)B=await I(B,W,z,Y);if(B=B||{},Q)throw B;return T==="data"?void 0:{error:B,request:z,response:W}}},X=(Y)=>(Q)=>Z({...Q,method:Y}),G=(Y)=>async(Q)=>{let{opts:T,url:z}=await K(Q);return o2({...T,body:T.body,method:Y,onRequest:async(W,V)=>{let B=new Request(W,V);for(let I of S.request.fns)if(I)B=await I(B,T);return B},serializedBody:U1(T),url:z})};return{buildUrl:(Y)=>z1({...O,...Y}),connect:X("CONNECT"),delete:X("DELETE"),get:X("GET"),getConfig:j,head:X("HEAD"),interceptors:S,options:X("OPTIONS"),patch:X("PATCH"),post:X("POST"),put:X("PUT"),request:Z,setConfig:x,sse:{connect:G("CONNECT"),delete:G("DELETE"),get:G("GET"),head:G("HEAD"),options:G("OPTIONS"),patch:G("PATCH"),post:G("POST"),put:G("PUT"),trace:G("TRACE")},trace:X("TRACE")}};var G6=T1(Zj());class K6{client;constructor($){this.client=$?.client??G6}}class Y6{defaultKey="default";instances=new Map;get($){let O=this.instances.get($??this.defaultKey);if(!O)throw Error('No SDK client found. Create one with "new Sdk()" to fix this error.');return O}set($,O){this.instances.set(O??this.defaultKey,$)}}class Px extends K6{static __registry=new Y6;constructor($){super($);Px.__registry.set(this,$?.key)}proxyRequestHandler($){return($.client??this.client).get({url:"/proxy",...$})}getUnfurl($){return($.client??this.client).get({url:"/unfurl",...$})}getUnfurlBulk($){return($.client??this.client).post({url:"/unfurl/bulk",...$,headers:{"Content-Type":"application/json",...$.headers}})}}var Q6={dev:"https://dev.macro.com",prod:"https://macro.com",local:"http://localhost:3000"},H1={dev:{"agent-harness":"https://dev-gateway.macro.com/agent-harness",storage:"https://dev-gateway.macro.com/dss",auth:"https://dev-gateway.macro.com/auth",email:"https://dev-gateway.macro.com/email",calendar:"https://dev-gateway.macro.com/calendar",cognition:"https://dev-gateway.macro.com/cognition",notification:"https://dev-gateway.macro.com/notification",properties:"https://dev-gateway.macro.com/dss",search:"https://dev-gateway.macro.com/dss","scheduled-action":"https://dev-gateway.macro.com/scheduled-action","static-files":"https://static-file-service-dev.macro.com",connection:"https://dev-gateway.macro.com/connection-gateway",contacts:"https://dev-gateway.macro.com/contacts",unfurl:"https://dev-gateway.macro.com/unfurl"},prod:{"agent-harness":"https://gateway.macro.com/agent-harness",storage:"https://gateway.macro.com/dss",auth:"https://gateway.macro.com/auth",email:"https://gateway.macro.com/email",calendar:"https://gateway.macro.com/calendar",cognition:"https://gateway.macro.com/cognition",notification:"https://gateway.macro.com/notification",properties:"https://gateway.macro.com/dss",search:"https://gateway.macro.com/dss","scheduled-action":"https://gateway.macro.com/scheduled-action","static-files":"https://static-file-service.macro.com",connection:"https://gateway.macro.com/connection-gateway",contacts:"https://gateway.macro.com/contacts",unfurl:"https://gateway.macro.com/unfurl"},local:{"agent-harness":"http://localhost:8101",storage:"http://localhost:8086",auth:"http://localhost:8080",email:"http://localhost:8087",calendar:"http://localhost:8088/calendar",cognition:"http://localhost:8085",notification:"http://localhost:8089",properties:"http://localhost:8086",search:"http://localhost:8086","scheduled-action":"http://localhost:8099","static-files":"http://localhost:8100",connection:"http://localhost:8082",contacts:"http://localhost:8083",unfurl:"http://localhost:8095"}};function O4($,O){let j=O?.channel_id;return O&&j?{channel:f.byId($,j),thread:new g$($,j,O.thread_id)}:{channel:void 0,thread:void 0}}function P$($,O){return{session:i.byId($,O.session_id),owner:M.byId($,O.owner_id),...O4($,O.origin)}}function wO($,O,j){let x=O.origin?.channel_id;return x&&j?e.byId($,x,j):void 0}function qO($,O){return O?M.byId($,O):void 0}function J6($,O){return c(O).with({event_type:"agent_session.opened"},({metadata:j})=>({event_type:"agent_session.opened",metadata:j,...P$($,j.identity)})).with({event_type:"agent_session.turn_started"},({metadata:j})=>({event_type:"agent_session.turn_started",metadata:j,...P$($,j.identity),actor:qO($,j.actor),announcement:wO($,j.identity,j.announcement_message_id)})).with({event_type:"agent_session.turn_ended"},({metadata:j})=>({event_type:"agent_session.turn_ended",metadata:j,...P$($,j.identity),actor:qO($,j.actor),announcement:wO($,j.identity,j.announcement_message_id)})).with({event_type:"agent_session.command_rejected"},({metadata:j})=>({event_type:"agent_session.command_rejected",metadata:j,...P$($,j.identity),actor:qO($,j.actor),announcement:wO($,j.identity,j.announcement_message_id)})).with({event_type:"agent_session.settled"},({metadata:j})=>({event_type:"agent_session.settled",metadata:j,...P$($,j.identity),actor:qO($,j.last_turn?.actor),announcement:wO($,j.identity,j.last_turn?.announcement_message_id)})).with({event_type:"agent_session.waiting_for_input"},({metadata:j})=>({event_type:"agent_session.waiting_for_input",metadata:j,...P$($,j.identity),announcement:wO($,j.identity,j.announcement_message_id)})).with({event_type:"agent_session.input_received"},({metadata:j})=>({event_type:"agent_session.input_received",metadata:j,...P$($,j.identity)})).with({event_type:"agent_session.mentioned"},({metadata:j})=>({event_type:"agent_session.mentioned",metadata:j,...P$($,j.identity),mentionedBy:qO($,j.mentioned_by),mentioned:j.mentioned.map((x)=>M.byId($,x))})).with({event_type:"agent_session.stopped"},({metadata:j})=>({event_type:"agent_session.stopped",metadata:j,...P$($,j.identity),actor:qO($,j.turn_in_flight?.actor),announcement:wO($,j.identity,j.turn_in_flight?.announcement_message_id)})).with({event_type:"agent_session.renamed"},({metadata:j})=>({event_type:"agent_session.renamed",metadata:j,...P$($,j.identity)})).with({event_type:"agent_session.deleted"},({metadata:j})=>({event_type:"agent_session.deleted",metadata:j,...P$($,j.identity)})).exhaustive()}var V6="macro|";function C$($,O){return O.startsWith(V6)&&O.length>V6.length?M.byId($,O.toLowerCase()):void 0}function W6($,O){return c(O).with({event_type:"channel.created"},({metadata:j})=>({event_type:"channel.created",metadata:j,channel:f.byId($,j.channel_id),actor:C$($,j.actor),participants:j.participant_user_ids.map((x)=>M.byId($,x))})).with({event_type:"channel.updated"},({metadata:j})=>({event_type:"channel.updated",metadata:j,channel:f.byId($,j.channel_id),actor:C$($,j.actor)})).with({event_type:"channel.deleted"},({metadata:j})=>({event_type:"channel.deleted",metadata:j,channel:f.byId($,j.channel_id),actor:C$($,j.actor)})).with({event_type:"channel.picture_changed"},({metadata:j})=>({event_type:"channel.picture_changed",metadata:j,channel:f.byId($,j.channel_id),actor:C$($,j.actor)})).with({event_type:"channel.participant_added"},({metadata:j})=>({event_type:"channel.participant_added",metadata:j,channel:f.byId($,j.channel_id),addedBy:C$($,j.added_by),addedUsers:j.added_user_ids.map((x)=>M.byId($,x))})).with({event_type:"channel.participant_removed"},({metadata:j})=>({event_type:"channel.participant_removed",metadata:j,channel:f.byId($,j.channel_id),removedBy:M.byId($,j.removed_by),removedUsers:j.removed_user_ids.map((x)=>M.byId($,x))})).exhaustive()}function B6($,O){return c(O).with({event_type:"document.created"},({metadata:j})=>({event_type:"document.created",metadata:j,document:q.byId($,j.document_id),owner:M.byId($,j.owner),project:j.project_id?n.byId($,j.project_id):void 0})).with({event_type:"document.updated"},({metadata:j})=>({event_type:"document.updated",metadata:j,document:q.byId($,j.document_id),owner:M.byId($,j.owner),actor:j.actor_user_id?M.byId($,j.actor_user_id):void 0,project:j.project_id?n.byId($,j.project_id):void 0,previousProject:j.previous_project_id?n.byId($,j.previous_project_id):void 0})).with({event_type:"document.deleted"},({metadata:j})=>({event_type:"document.deleted",metadata:j,document:q.byId($,j.document_id),actor:j.actor_user_id?M.byId($,j.actor_user_id):void 0,project:j.project_id?n.byId($,j.project_id):void 0})).with({event_type:"document.content_uploaded"},({metadata:j})=>({event_type:"document.content_uploaded",metadata:j,document:q.byId($,j.document_id),owner:M.byId($,j.owner)})).with({event_type:"document.sync_content_updated"},({metadata:j})=>({event_type:"document.sync_content_updated",metadata:j,document:q.byId($,j.document_id)})).with({event_type:"document.purged"},({metadata:j})=>({event_type:"document.purged",metadata:j,document:q.byId($,j.document_id)})).with({event_type:"document.copied"},({metadata:j})=>({event_type:"document.copied",metadata:j,document:q.byId($,j.document_id),sourceDocument:q.byId($,j.source_document_id),owner:M.byId($,j.owner),project:j.project_id?n.byId($,j.project_id):void 0})).with({event_type:"document.interaction"},({metadata:j})=>({event_type:"document.interaction",metadata:j,document:q.byId($,j.document_id)})).exhaustive()}function fO($,O,j=[]){let x=O.parent;if(x.type==="call")return{type:"call",call:K$.byId($,x.id),message:v$.byId($,x.id,O.message_id),threadId:x.id};if(x.type==="channel")return{type:"channel",channel:f.byId($,x.id),message:e.byId($,x.id,O.message_id,j),thread:O.thread_id?new g$($,x.id,O.thread_id):void 0};return{type:"document",document:q.byId($,x.id),comment:c$.byId($,x.id,O.message_id),threadId:O.root_id}}function L6($,O){return c(O).with({event_type:"message.posted"},({metadata:j})=>({event_type:"message.posted",metadata:j,target:fO($,j,j.mentions),sender:C$($,j.sender)})).with({event_type:"message.mentioned"},({metadata:j})=>({event_type:"message.mentioned",metadata:j,target:fO($,j),sender:C$($,j.sender)})).with({event_type:"message.patched"},({metadata:j})=>({event_type:"message.patched",metadata:j,target:fO($,j),actor:C$($,j.actor)})).with({event_type:"message.deleted"},({metadata:j})=>({event_type:"message.deleted",metadata:j,target:fO($,j),actor:C$($,j.actor)})).with({event_type:"message.attachment_created"},({metadata:j})=>({event_type:"message.attachment_created",metadata:j,target:fO($,j),actor:C$($,j.actor)})).with({event_type:"message.attachment_removed"},({metadata:j})=>({event_type:"message.attachment_removed",metadata:j,target:fO($,j),actor:C$($,j.actor)})).exhaustive()}async function N6($){let O=new TextEncoder,j=await crypto.subtle.importKey("raw",O.encode($.secret),{name:"HMAC",hash:"SHA-256"},!1,["sign"]),x=await crypto.subtle.sign("HMAC",j,O.encode(`${$.timestamp}.${$.rawBody}`));return`v1=${new Uint8Array(x).toHex()}`===$.signature}var j4="webhook.validation.test";function x4($,O){return c(O).with({event_type:x$.string.startsWith("document.")},(j)=>B6($,j)).with({event_type:x$.string.startsWith("channel.")},(j)=>W6($,j)).with({event_type:x$.string.startsWith("message.")},(j)=>L6($,j)).with({event_type:x$.string.startsWith("agent_session.")},(j)=>J6($,j)).otherwise(()=>{return})}class R1{client;secret;handlers=new Map;constructor($,O){this.client=$;this.secret=O}on($,O){let j=this.handlers.get($)??new Set;return j.add(O),this.handlers.set($,j),()=>j.delete(O)}onSelfMention($){return this.on("message.mentioned",async(O)=>{if(O.metadata.mentioned.entity_id.toLowerCase()!==(await this.client.myPrincipalId()).toLowerCase())return;await $(O)})}async listen($={}){let O=$.filters??this.filtersFromHandlers();if(O.length===0||O.every((K)=>K.events.length===0))throw new b("listen() needs filters — pass filters or register handlers with .on() first");let j=new AbortController;if($.signal)if($.signal.aborted)j.abort();else $.signal.addEventListener("abort",()=>j.abort(),{once:!0});let{stream:x}=await this.client.storage.streamEvents({query:{scope:$.scope??"user",filters:JSON.stringify(O)},signal:j.signal});return(async()=>{try{for await(let K of x)await this.dispatchEvent(K)}catch{if(j.signal.aborted)return;throw new b("event stream failed")}})().catch(()=>{}),()=>{j.abort()}}async handle($,O){if(!this.secret)throw new b("webhookSecret is required to verify incoming webhook deliveries");if(!await N6({secret:this.secret,timestamp:O.timestamp??"",rawBody:$,signature:O.signature??""}))throw new b("invalid webhook signature");if(O.event===j4)return;await this.dispatchEvent(JSON.parse($))}webhook(){if(!this.secret)throw new b("webhookSecret is required to verify incoming webhook deliveries");return async($)=>{return await this.handle(await $.text(),{event:$.headers.get("x-macro-event")??void 0,eventId:$.headers.get("x-macro-event-id")??void 0,timestamp:$.headers.get("x-macro-timestamp")??void 0,signature:$.headers.get("x-macro-signature")??void 0}),new Response("ok")}}filtersFromHandlers(){let $=[...this.handlers.entries()].filter(([,O])=>O.size>0).map(([O])=>O);return $.length>0?[{events:$}]:[]}async dispatchEvent($){let O=typeof $==="string"?JSON.parse($):$;if(O===null||typeof O!=="object"||!("event_type"in O))return;let j=O,x=this.handlers.get(j.event_type);if(!x||x.size===0)return;let S=x4(this.client,j);if(!S)return;await Promise.all([...x].map((K)=>K(S)))}}function U6(){return}var S4=0,D1;function Z4($){D1=$}function L$($,O,j){if(!j&&!D1)return $;let x=(S)=>{for(let K of[D1,j])try{Promise.resolve(K?.(S)).catch(()=>{})}catch{}};return new Proxy($,{get(S,K,Z){let X=Reflect.get(S,K,Z);if(typeof K!=="string"||typeof X!=="function")return X;return async(...G)=>{let L={id:++S4,service:O,operation:K};x({...L,status:"started"});try{let Y=await Reflect.apply(X,S,G),Q=Y!==null&&typeof Y==="object"&&"error"in Y&&Y.error!=null;return x({...L,status:Q?"failed":"completed"}),Y}catch(Y){throw x({...L,status:"failed"}),Y}}}})}var I6="x-macro-user-api-key",X4="mak_",C1="mbot_";function G4($){return c($).with(x$.string.startsWith(C1),()=>{throw Error("bot token passed as a user credential. Use auth: { type: 'bot', token } or MACRO_BOT_TOKEN.")}).with(x$.string.startsWith(X4),(O)=>[I6,O]).otherwise((O)=>["Authorization",`Bearer ${O}`])}async function z6($){return typeof $==="function"?await $():$}async function K4($,O,j){return c($).with({type:"bot"},async(x)=>{let S=await z6(x.token);if(!S.startsWith(C1))throw Error("user API key passed as a bot token. Use auth: { type: 'user', apiKey } or MACRO_API_KEY.");let K=[["x-macro-bot-token",S]];if(!j?.hasBotScope)K.push(["x-macro-bot-scope",x.scope??(O?"user":"team")]);if(O)K.push(["x-macro-bot-for-macro-user-id",O]);return K}).with({type:"user",apiKey:x$.string},({apiKey:x})=>{if(x.startsWith(C1))throw Error("bot token passed as a user credential. Use auth: { type: 'bot', token } or MACRO_BOT_TOKEN.");return[[I6,x]]}).with({type:"user"},async({token:x})=>{return[G4(await z6(x))]}).exhaustive()}class _1{scheduledAction;unfurl;agentHarness;auth;calendar;cognition;contacts;email;notification;properties;search;storage;webAppUrl;wsVerify;events;authConfig;hosts;localPortmap;requestedAs;selfBotRecord;selfPrincipal;constructor($){let O=Y4($),j=O==="local"?U6():void 0,x={...H1[O],...j?.hosts,...$.hosts};this.hosts=x,this.localPortmap=j;let S=typeof process<"u"?{}.MACRO_WEB_URL:void 0;if(this.webAppUrl=$.webAppUrl??S??j?.webAppUrl??Q6[O],this.authConfig=Q4($),this.requestedAs=$.requestedAs,this.requestedAs&&this.authConfig.type!=="bot")throw Error("requestedAs() requires bot auth — a user token always acts as its own user");this.wsVerify=$.wsVerify,this.scheduledAction=L$(new Wx({client:this.makeClient(x["scheduled-action"])}),"scheduled-action",$.onRequest),this.unfurl=L$(new Px({client:this.makeClient(x.unfurl)}),"unfurl",$.onRequest),this.agentHarness=L$(new Aj({client:this.makeClient(x["agent-harness"])}),"agent-harness",$.onRequest),this.auth=L$(new qj({client:this.makeClient(x.auth)}),"auth",$.onRequest),this.calendar=L$(new yj({client:this.makeClient(x.calendar)}),"calendar",$.onRequest),this.cognition=L$(new uj({client:this.makeClient(x.cognition)}),"cognition",$.onRequest),this.contacts=L$(new aj({client:this.makeClient(x.contacts)}),"contacts",$.onRequest),this.email=L$(new ej({client:this.makeClient(x.email)}),"email",$.onRequest),this.notification=L$(new xx({client:this.makeClient(x.notification)}),"notification",$.onRequest),this.properties=L$(new Kx({client:this.makeClient(x.properties)}),"properties",$.onRequest),this.search=L$(new zx({client:this.makeClient(x.search)}),"search",$.onRequest),this.storage=L$(new Dx({client:this.makeClient(x.storage)}),"storage",$.onRequest);let K=typeof process<"u"?{}.MACRO_WEBHOOK_SECRET:void 0,Z=$.webhookSecret??K;this.events=new R1(this,Z)}hasActingUser(){return this.authConfig.type==="user"||this.requestedAs!==void 0}selfBot(){return this.selfBotRecord??=new yO(this).me().catch(($)=>{throw this.selfBotRecord=void 0,$}),this.selfBotRecord}myPrincipalId(){return this.selfPrincipal??=(this.authConfig.type==="bot"?this.selfBot().then(($)=>`bot|${$.id}`):M.me(this).then(($)=>$.id)).catch(($)=>{throw this.selfPrincipal=void 0,$}),this.selfPrincipal}makeClient($){let O=Sj({baseUrl:$});return O.interceptors.request.use(async(j)=>{let x=await K4(this.authConfig,this.requestedAs,{hasBotScope:j.headers.has("x-macro-bot-scope")});for(let[S,K]of x)j.headers.set(S,K);return j}),O}}function Y4($){if($.env)return $.env;let O=typeof process<"u"?{}.MACRO_ENV:void 0;if(!O)return"prod";if(!(O in H1))throw Error(`invalid MACRO_ENV "${O}" — expected local, dev, or prod`);return O}function Q4($){if($.auth)return $.auth;if($.token)return{type:"user",token:$.token};let O=typeof process<"u"?{}.MACRO_API_KEY:void 0,j=typeof process<"u"?{}.MACRO_BOT_TOKEN:void 0;if(O&&j)throw Error("both MACRO_API_KEY and MACRO_BOT_TOKEN are set — pass auth to new Macro() to pick one");if(j)return{type:"bot",token:j};return{type:"user",token:O??(()=>{throw Error("no Macro credential. Set MACRO_API_KEY (API key or bearer token) or MACRO_BOT_TOKEN, or pass token/auth to new Macro().")})}}class M1{id;constructor($){this.id=$}static byId($){return new M1($)}toJSON(){return{id:this.id}}}class T6{routines;unfurls;agents;initiatives;apiKeys;harnesses;meetings;githubPullRequests;entityMentions;agentSessions;ai;bots;calendar;calls;channels;chats;crm;databases;documents;email;favorites;foreignEntities;forms;notifications;pins;projects;properties;tasks;teams;users;webhooks;workspace;events;webAppUrl;_client;opts;constructor($){this.opts=$;let O=new _1($);this._client=O,this.routines=new z0(O),this.unfurls=new H0(O),this.agents=new fx(O),this.initiatives=new Y0(O),this.apiKeys=new kx(O),this.harnesses=new K0(O),this.meetings=new Q0(O),this.githubPullRequests=new G0(O),this.entityMentions=new j0(O),this.agentSessions=new qx(O),this.ai=new bx(O),this.bots=new yO(O),this.calendar=new gx(O),this.calls=new yx(O),this.channels=new hx(O),this.chats=new mx(O),this.crm=new ux(O),this.databases=new ex(O),this.documents=new ox(O),this.email=new O0(O),this.favorites=new x0(O),this.foreignEntities=new S0(O),this.forms=new Z0(O),this.notifications=new J0(O),this.pins=new V0(O),this.projects=new W0(O),this.properties=new B0(O),this.tasks=new I0(O),this.teams=new T0(O),this.users=new R0(O),this.webhooks=new D0(O),this.workspace=new A0(O),this.events=O.events,this.webAppUrl=O.webAppUrl}myPrincipalId(){return this._client.myPrincipalId()}requestedAs($){return new T6({...this.opts,requestedAs:$.id})}}export{l$ as wrapXml,$$ as toBody,Z4 as observeRequests,D6 as msg,R6 as here,p$ as UserApiKey,gO as ToolApproval,B$ as SessionReview,N0 as RoutineExecution,jO as Routine,wx as ReviewItem,X0 as PullRequestChangeset,Qj as PipelineTable,XO as PipelineRow,Jj as PipelineColumn,W$ as MessageThread,I$ as Meeting,tx as MacroOpRefusedError,T6 as Macro,$O as Initiative,UO as HarnessPairing,V$ as Harness,NO as GithubPullRequest,d$ as FormSection,LO as FormResponse,Tj as FormReference,u$ as FormQuestion,JO as FormOption,k$ as Form,BO as EntityMention,o as EntityAccess,QO as EmailFilter,YO as EmailDraft,rO as DraftAttachment,lO as DocumentVersion,GO as DocumentAnchor,pO as DevicePairing,a$ as CrmPipeline,Ex as ConversationTurn,kO as CodeExecution,mO as ChatMessage,hO as ChatGeneration,M1 as ChannelPicture,ZO as ChannelActivity,Gj as AgentConversation,N$ as Agent,WO as AccessRequest};diff --git a/crates/database_sql/AGENTS.md b/crates/database_sql/AGENTS.mdindex 5d6ca5c49a..e69fbca610 100644--- a/crates/database_sql/AGENTS.md+++ b/crates/database_sql/AGENTS.md@@ -9,6 +9,7 @@ uses the wasm build directly).## Start here+- `openapi` feature: optional derives for the HTTP result contract; keep native transport dependencies out of the engine.- `src/lib.rs`: the pipeline diagram and the public re-exports — read thisbefore any other file.- `src/parse.rs` / `src/resolve.rs` / `src/split.rs` / `src/engine.rs` /diff --git a/crates/database_sql/Cargo.toml b/crates/database_sql/Cargo.tomlindex 303d314a88..4a7b37dbb9 100644--- a/crates/database_sql/Cargo.toml+++ b/crates/database_sql/Cargo.toml@@ -9,6 +9,8 @@ version = "0.1.0"crate-type = ["cdylib", "rlib"][features]+# OpenAPI schemas for the HTTP SQL query response.+openapi = ["dep:utoipa"]# The `database_sql_types` codegen binary: native developer tooling that# writes the TypeScript face of the wire types. Off by default so the wasm# build never compiles the exporter; the derives themselves need only `specta`.@@ -37,6 +39,7 @@ specta-serde = { workspace = true, optional = true }specta-typescript = { workspace = true, optional = true }strum = { workspace = true }thiserror = { workspace = true }+utoipa = { workspace = true, optional = true }uuid = { workspace = true }# The wasm-bindgen shell in `wasm`, which only exists on wasm32. Target-gateddiff --git a/crates/database_sql/src/catalog.rs b/crates/database_sql/src/catalog.rsindex 5aa691c96c..0902a8c602 100644--- a/crates/database_sql/src/catalog.rs+++ b/crates/database_sql/src/catalog.rs@@ -169,6 +169,8 @@ pub enum ColumnKind {/// Spelled as the properties system spells entity types (`USER`,/// `DATABASE_ROW`), on the wire and in SQL, where it parses/// case-insensitively.+#[cfg_attr(feature = "openapi", derive(utoipa::ToSchema))]+#[cfg_attr(feature = "openapi", schema(as = SqlEntityKind))]#[derive(Debug,Clone,@@ -252,6 +254,8 @@ impl TryFrom<EntityKind> for OpEntityKind {}/// One option of a select column.+#[cfg_attr(feature = "openapi", derive(utoipa::ToSchema))]+#[cfg_attr(feature = "openapi", schema(as = SqlSelectOption))]#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Type)]#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]#[serde(rename_all = "camelCase")]diff --git a/crates/database_sql/src/fold.rs b/crates/database_sql/src/fold.rsindex c5c0238fc3..d3c1ce55a1 100644--- a/crates/database_sql/src/fold.rs+++ b/crates/database_sql/src/fold.rs@@ -32,6 +32,8 @@ use crate::split::{Plan, Shape};/// A cell as fetched. An absent cell is `NULL`; an absent multi-valued cell/// is the empty set.+#[cfg_attr(feature = "openapi", derive(utoipa::ToSchema))]+#[cfg_attr(feature = "openapi", schema(as = SqlCell))]#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Type)]#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]#[serde(tag = "type", content = "value", rename_all = "camelCase")]diff --git a/crates/database_sql/src/run.rs b/crates/database_sql/src/run.rsindex 9d037835c2..b2c35240c1 100644--- a/crates/database_sql/src/run.rs+++ b/crates/database_sql/src/run.rs@@ -497,6 +497,8 @@ pub struct OutcomeColumn {}/// The value kind of a result column.+#[cfg_attr(feature = "openapi", derive(utoipa::ToSchema))]+#[cfg_attr(feature = "openapi", schema(as = SqlOutcomeKind))]#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, Type)]#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]#[serde(rename_all = "camelCase")]diff --git a/crates/databases/src/inbound/axum_router.rs b/crates/databases/src/inbound/axum_router.rsindex 4814832aa0..8873fc3050 100644--- a/crates/databases/src/inbound/axum_router.rs+++ b/crates/databases/src/inbound/axum_router.rs@@ -1,6 +1,6 @@//! Axum router for the databases endpoints: typed reads and batched ops,//! the one write surface of a database's schema and data; SQL runs in the-//! browser engine or the `databases_sql` tools.+//! browser engine or the `databases_sql` HTTP/agent adapters./// What a column's values would do under each type (`GET …/casts`), and/// what they become under one (`POST …/conversion`).diff --git a/crates/databases_sql/AGENTS.md b/crates/databases_sql/AGENTS.mdindex b2b8fbbe3f..85d48d5cf3 100644--- a/crates/databases_sql/AGENTS.md+++ b/crates/databases_sql/AGENTS.md@@ -3,12 +3,13 @@## What it isPart of the Databases feature: runs the `database_sql` engine over Macro-databases for agents, as the agent-tool counterpart to the browser's direct+databases for agents and authenticated HTTP clients, alongside the browser's direct`database_sql` wasm usage. Reads go through Soup and contacts, writes gothrough `databases`' typed ops.## Start here+- `src/inbound/axum_router.rs`: `POST /databases/query`, delegating to the same SQL service.- `src/lib.rs`: module list and public re-exports (`DatabasesSql`, `SqlRequest`,`SqlOutcome`).- `src/service.rs`: the entry point — runs a parsed statement's engine@@ -24,8 +25,7 @@ through `databases`' typed ops.## Scope-- Owns: binding the `database_sql` engine to live Macro data for agents, and- the two SQL agent tools.+- Owns: binding the `database_sql` engine to live Macro data for agents, the HTTP query adapter, and the two SQL agent tools.- Not here: the SQL grammar/engine itself → `crates/database_sql`; table/rowpersistence and the ops API → `crates/databases`.@@ -35,7 +35,7 @@ through `databases`' typed ops.`soup`, `contacts`, `entity_access` (all `ports`-only — this crate is anadapter, not a composition root).- Used by: `crates/ai_tools` (wires the `ai_tools` feature's `QueryDatabase`/- `SaveDatabaseQuery` into the agent toolset).+ `SaveDatabaseQuery` into the agent toolset), and DSS (HTTP query composition).## Recipes@@ -47,7 +47,7 @@ through `databases`' typed ops.## Checks-- `cargo test -p databases_sql --features ai_tools`.+- `cargo test -p databases_sql --features ai_tools,inbound`.## Gotchas@@ -55,6 +55,9 @@ through `databases`' typed ops.not import `databases`' or `soup`'s `outbound` adapters directly; thecomposition root supplies those.+- HTTP SQL reads use the viewer catalog; writes mint edit receipts and forward+ version guards into atomic ops. Never retry a statement automatically.+## Related- Skill: `database-core` · Rules: `.agents/rules/rust/architecture.md`diff --git a/crates/databases_sql/Cargo.toml b/crates/databases_sql/Cargo.tomlindex 7e458ef6eb..b661fd1c07 100644--- a/crates/databases_sql/Cargo.toml+++ b/crates/databases_sql/Cargo.toml@@ -6,10 +6,16 @@ version = "0.1.0"[features]default = []+# Authenticated HTTP query adapter.+inbound = ["dep:axum", "dep:macro_authorization", "dep:model-error-response", "dep:utoipa", "database_sql/openapi"]# The SQL agent tools: QueryDatabase and SaveDatabaseQuery.ai_tools = ["dep:ai_toolset", "dep:anyhow", "dep:async-trait", "dep:schemars"][dependencies]+axum = { workspace = true, optional = true }+macro_authorization = { path = "../macro_authorization", default-features = false, features = ["axum"], optional = true }+model-error-response = { path = "../model-error-response", optional = true }+utoipa = { workspace = true, optional = true }ai_toolset = { path = "../ai_toolset", optional = true }anyhow = { workspace = true, optional = true }async-trait = { workspace = true, optional = true }@@ -39,5 +45,6 @@ uuid = { workspace = true }workspace-hack = { version = "0.1", path = "../workspace-hack" }[dev-dependencies]+tower = { workspace = true, features = ["util"] }model_owner = { path = "../model_owner" }tokio = { workspace = true, features = ["macros", "rt-multi-thread"] }diff --git a/crates/databases_sql/src/inbound.rs b/crates/databases_sql/src/inbound.rsnew file mode 100644index 0000000000..c4275ae4c0--- /dev/null+++ b/crates/databases_sql/src/inbound.rs@@ -0,0 +1,2 @@+//! HTTP adapters for SQL over the authenticated viewer's databases.+pub mod axum_router;diff --git a/crates/databases_sql/src/inbound/axum_router.rs b/crates/databases_sql/src/inbound/axum_router.rsnew file mode 100644index 0000000000..542d673dc2--- /dev/null+++ b/crates/databases_sql/src/inbound/axum_router.rs@@ -0,0 +1,163 @@+//! Authenticated SQL execution; visibility and write policy stay in `DatabasesSql`.+use std::collections::HashMap;++use axum::{+ Json, Router,+ extract::{FromRef, State},+ http::StatusCode,+ response::{IntoResponse, Response},+ routing::post,+};+use contacts::domain::ports::ContactsService;+use databases::domain::{+ models::{DatabaseId, TableId, TableVersion, Viewer},+ ports::DatabasesService,+};+use entity_access::domain::ports::EntityAccessService;+use macro_authorization::{+ MacroAuthorizationExtractor, MacroAuthorizationService, MacroAuthorizationState, UserOrInternal,+};+use model_error_response::ErrorResponse;+use serde::Deserialize;+use soup::domain::ports::SoupService;++use crate::{DatabasesSql, SqlError, SqlOutcome, SqlRequest};++/// SQL service and the same principal authentication used by database routes.+pub struct SqlRouterState<Databases, Access, Soup, Contacts, Authorization> {+ sql: DatabasesSql<Databases, Access, Soup, Contacts>,+ authorization: MacroAuthorizationState<Authorization>,+}++impl<D, A, S, C, Auth> Clone for SqlRouterState<D, A, S, C, Auth> {+ fn clone(&self) -> Self {+ Self {+ sql: self.sql.clone(),+ authorization: self.authorization.clone(),+ }+ }+}++impl<D, A, S, C, Auth> SqlRouterState<D, A, S, C, Auth> {+ /// Wire the domain SQL service and authentication at the composition root.+ pub fn new(+ sql: DatabasesSql<D, A, S, C>,+ authorization: MacroAuthorizationState<Auth>,+ ) -> Self {+ Self { sql, authorization }+ }+}++impl<D, A, S, C, Auth> FromRef<SqlRouterState<D, A, S, C, Auth>> for MacroAuthorizationState<Auth> {+ fn from_ref(state: &SqlRouterState<D, A, S, C, Auth>) -> Self {+ state.authorization.clone()+ }+}++/// One SQL statement with an optional default database and optimistic write guards.+#[derive(Debug, Deserialize, utoipa::ToSchema)]+#[serde(rename_all = "camelCase")]+pub struct DatabaseQueryRequest {+ /// One supported SQL statement. Writes execute once, without automatic retries.+ pub sql: String,+ /// Default database for resolving unqualified table names; other visible databases remain joinable.+ pub database_id: Option<DatabaseId>,+ /// Expected version for each table a subsequent statement writes.+ #[serde(default)]+ pub base_versions: HashMap<TableId, TableVersion>,+}++/// SQL failures translated at the HTTP boundary.+#[derive(Debug, thiserror::Error)]+#[error(transparent)]+pub struct QueryError(#[from] SqlError);++impl IntoResponse for QueryError {+ fn into_response(self) -> Response {+ let status = match &self.0 {+ SqlError::NotFound => StatusCode::NOT_FOUND,+ SqlError::TableReadOnly { .. } => StatusCode::FORBIDDEN,+ SqlError::VersionConflict { .. } | SqlError::SchemaVersionConflict { .. } => {+ StatusCode::CONFLICT+ }+ SqlError::Compile(_)+ | SqlError::Run(_)+ | SqlError::WriteRefused { .. }+ | SqlError::TooLong+ | SqlError::SavedQueryNotSelect+ | SqlError::ChartColumnNotReturned { .. }+ | SqlError::ChartValueNotNumeric { .. } => StatusCode::BAD_REQUEST,+ SqlError::Infrastructure(_)+ | SqlError::WrittenTableNotInCatalog { .. }+ | SqlError::AlteredColumnNotInCatalog { .. }+ | SqlError::AlterWithoutAlteredColumn => StatusCode::INTERNAL_SERVER_ERROR,+ };+ let message = if status == StatusCode::INTERNAL_SERVER_ERROR {+ "Query failed".to_owned()+ } else {+ self.0.to_string()+ };+ (+ status,+ Json(ErrorResponse {+ message: message.into(),+ }),+ )+ .into_response()+ }+}++/// Run one statement as the authenticated user. The viewer's catalog authorizes reads;+/// the SQL domain service obtains an edit receipt for every written database.+#[utoipa::path(post, tag = "databases", operation_id = "query_databases", path = "/databases/query",+ request_body = DatabaseQueryRequest,+ responses((status = 200, body = SqlOutcome), (status = 400, body = ErrorResponse),+ (status = 401, body = ErrorResponse), (status = 403, body = ErrorResponse),+ (status = 404, body = ErrorResponse), (status = 409, body = ErrorResponse), (status = 500, body = ErrorResponse)))]+#[tracing::instrument(name = "database.query", skip_all, fields(database_id = ?request.database_id, statement_bytes = request.sql.len()), err)]+pub async fn query_databases_handler<D, A, S, C, Auth>(+ user: MacroAuthorizationExtractor<Auth, UserOrInternal>,+ State(state): State<SqlRouterState<D, A, S, C, Auth>>,+ Json(request): Json<DatabaseQueryRequest>,+) -> Result<Json<SqlOutcome>, QueryError>+where+ D: DatabasesService,+ A: EntityAccessService,+ S: SoupService,+ C: ContactsService,+ Auth: MacroAuthorizationService,+{+ state+ .sql+ .execute(+ Viewer {+ user_id: user.authorization.user.macro_user_id,+ acting_bot: None,+ },+ SqlRequest {+ sql: request.sql,+ scope: request.database_id,+ base_versions: request.base_versions,+ },+ )+ .await+ .map(Json)+ .map_err(QueryError::from)+}++/// Mount under `/databases`, alongside the schema/ops routes.+pub fn sql_router<D, A, S, C, Auth, RouterState>(+ state: SqlRouterState<D, A, S, C, Auth>,+) -> Router<RouterState>+where+ D: DatabasesService,+ A: EntityAccessService,+ S: SoupService,+ C: ContactsService,+ Auth: MacroAuthorizationService,+ RouterState: Clone + Send + Sync + 'static,+{+ Router::new()+ .route("/query", post(query_databases_handler::<D, A, S, C, Auth>))+ .with_state(state)+}diff --git a/crates/databases_sql/src/lib.rs b/crates/databases_sql/src/lib.rsindex cc60822d67..29bfd7da4d 100644--- a/crates/databases_sql/src/lib.rs+++ b/crates/databases_sql/src/lib.rs@@ -1,7 +1,10 @@-//! SQL over Macro databases for agents: the `database_sql` engine run over+//! SQL over Macro databases for authenticated HTTP clients and agents: the `database_sql` engine run over//! Soup, contacts and the databases service's ops, as the viewer.#![deny(missing_docs)]+#[cfg(feature = "inbound")]+pub mod inbound;+mod catalog;mod ops_sink;mod outcome;diff --git a/crates/databases_sql/src/ops_sink.rs b/crates/databases_sql/src/ops_sink.rsindex 46d5847cca..7c36a0a509 100644--- a/crates/databases_sql/src/ops_sink.rs+++ b/crates/databases_sql/src/ops_sink.rs@@ -20,6 +20,8 @@ pub(crate) struct ReceiptOpsSink<'statement, Databases> {/// before the statement ran; `None` for a read.pub(crate) receipt: Option<(DatabaseId, EntityAccessReceipt<EditAccessLevel>)>,pub(crate) viewer: &'statement Viewer,+ /// Version guards applied atomically with the statement write.+ pub(crate) base_versions: &'statement HashMap<TableId, TableVersion>,pub(crate) versions: Mutex<HashMap<TableId, TableVersion>>,}@@ -55,7 +57,19 @@ wherelet tables: Vec<Option<TableId>> = ops.iter().map(DatabaseOp::table).collect();let results = self.databases- .apply_ops(receipt, self.viewer.clone(), OpBatch::from(ops))+ .apply_ops(+ receipt,+ self.viewer.clone(),+ OpBatch {+ base_versions: self+ .base_versions+ .iter()+ .filter(|(table, _)| tables.contains(&Some(**table)))+ .map(|(table, version)| (*table, *version))+ .collect(),+ ops,+ },+ ).await?;// The lock only guards single inserts, so a poisoned map is still whole.let mut versions = self.versions.lock().unwrap_or_else(PoisonError::into_inner);diff --git a/crates/databases_sql/src/outcome.rs b/crates/databases_sql/src/outcome.rsindex 12457b85e9..288a37a427 100644--- a/crates/databases_sql/src/outcome.rs+++ b/crates/databases_sql/src/outcome.rs@@ -1,4 +1,4 @@-//! What a statement did, shaped for agents and the chat that shows them:+//! What a statement did, shaped for SQL clients, agents and chat://! typed cells with what renders them, versions read and written, and changes.use std::collections::HashMap;@@ -14,8 +14,12 @@ use crate::catalog::ViewerCatalog;use crate::service::SqlError;/// The answer to one statement.-#[derive(Debug, Clone, PartialEq)]+#[derive(Debug, Clone, PartialEq, Serialize)]+#[cfg_attr(feature = "inbound", derive(utoipa::ToSchema))]+#[serde(rename_all = "camelCase")]pub struct SqlOutcome {+ /// Owning database of each visible table referenced by this outcome.+ pub table_databases: HashMap<TableId, models_databases::DatabaseId>,/// The rows a `SELECT` returned; `None` for a write.pub result: Option<ResultSet>,/// How many rows a write changed.@@ -36,6 +40,7 @@ pub struct SqlOutcome {/// The statement that ran: a read, or the table (and for a type change, the/// column) it wrote.+#[cfg_attr(feature = "inbound", derive(utoipa::ToSchema))]#[derive(Debug, Clone, PartialEq, Eq, Serialize)]#[cfg_attr(feature = "ai_tools", derive(schemars::JsonSchema))]#[serde(@@ -45,6 +50,7 @@ pub struct SqlOutcome {)]pub enum SqlStatement {/// A committed schema command. IDs remain available even without a follow-up read.+ #[serde(rename_all = "camelCase")]Schema {/// Owning database.database_id: models_databases::DatabaseId,@@ -54,6 +60,7 @@ pub enum SqlStatement {/// A `SELECT`.Select,/// An `INSERT`.+ #[serde(rename_all = "camelCase")]Insert {/// The table written.table_id: TableId,@@ -61,6 +68,7 @@ pub enum SqlStatement {table_name: String,},/// An `UPDATE`.+ #[serde(rename_all = "camelCase")]Update {/// The table written.table_id: TableId,@@ -68,6 +76,7 @@ pub enum SqlStatement {table_name: String,},/// A `DELETE`.+ #[serde(rename_all = "camelCase")]Delete {/// The table written.table_id: TableId,@@ -75,6 +84,7 @@ pub enum SqlStatement {table_name: String,},/// An `ALTER COLUMN … TYPE`.+ #[serde(rename_all = "camelCase")]AlterColumnType {/// The table.table_id: TableId,@@ -90,10 +100,14 @@ pub enum SqlStatement {}/// A `SELECT`'s rows, as the engine's typed cells.+#[cfg_attr(feature = "inbound", derive(utoipa::ToSchema))]#[derive(Debug, Clone, PartialEq, Serialize)]#[cfg_attr(feature = "ai_tools", derive(schemars::JsonSchema))]#[serde(rename_all = "camelCase")]pub struct ResultSet {+ /// Table whose rows the result identities refer to; absent for aggregates.+ #[serde(skip_serializing_if = "Option::is_none")]+ pub source_table: Option<TableId>,/// The columns, in select-list order.pub columns: Vec<ResultColumn>,/// One cell per column per row; `null` is an empty cell.@@ -104,6 +118,7 @@ pub struct ResultSet {}/// One result column, with what its cells mean.+#[cfg_attr(feature = "inbound", derive(utoipa::ToSchema))]#[derive(Debug, Clone, PartialEq, Serialize)]#[cfg_attr(feature = "ai_tools", derive(schemars::JsonSchema))]#[serde(rename_all = "camelCase")]@@ -152,8 +167,36 @@ pub(crate) fn shape(} else {Vec::new()};+ let result = result_set(catalog, query, outcome);+ let written_table = match query {+ Query::Select(_) => None,+ Query::Insert(insert) => Some(insert.table),+ Query::Update(update) => Some(update.table),+ Query::Delete(delete) => Some(delete.table),+ Query::AlterColumnType(alter) => Some(alter.table),+ };+ let table_databases = outcome+ .read_tables+ .iter()+ .copied()+ .chain(new_versions.keys().copied())+ .chain(written_table)+ .chain(outcome.columns.iter().filter_map(|column| column.table))+ .chain(result.iter().flat_map(|result| {+ result+ .columns+ .iter()+ .filter_map(|column| column.related_table)+ }))+ .filter_map(|table| {+ catalog+ .table(table)+ .map(|(database, _)| (table, database.database.id))+ })+ .collect();Ok(SqlOutcome {- result: result_set(catalog, query, outcome),+ table_databases,+ result,changes_applied: outcome.changes_applied as usize,inserted_row_ids: outcome.inserted_row_ids.clone(),new_versions,@@ -234,8 +277,22 @@ fn result_set(catalog: &ViewerCatalog, query: &Query, outcome: &Outcome) -> Opti};Some(select.relations[select.binding(*key)?.relation].table)};- let row_shaped = outcome.row_ids.len() == outcome.rows.len();+ let row_shaped = matches!(query, Query::Select(select)+ if select.group_by.is_none() && !select.items.iter().any(|item| matches!(item, SelectItem::Aggregate { .. })))+ && outcome.row_ids.len() == outcome.rows.len();Some(ResultSet {+ source_table: if row_shaped {+ match query {+ Query::Select(select) => select+ .relations+ .first()+ .map(|relation| relation.table)+ .filter(|table| catalog.table(*table).is_some()),+ _ => None,+ }+ } else {+ None+ },columns: outcome.columns.iter()diff --git a/crates/databases_sql/src/service.rs b/crates/databases_sql/src/service.rsindex 02a9d14eb3..921e6232b3 100644--- a/crates/databases_sql/src/service.rs+++ b/crates/databases_sql/src/service.rs@@ -303,6 +303,7 @@ wheredatabases: self.databases.as_ref(),receipt: write_receipt,viewer: &viewer,+ base_versions: &request.base_versions,versions: Mutex::new(HashMap::new()),};let outcome = database_sql::run(catalog.catalog(), &request.sql, &source, &sink)diff --git a/crates/databases_sql/src/service/schema.rs b/crates/databases_sql/src/service/schema.rsindex f784910232..b10ecd5af6 100644--- a/crates/databases_sql/src/service/schema.rs+++ b/crates/databases_sql/src/service/schema.rs@@ -110,6 +110,7 @@ fn outcome(versions: HashMap<TableId, TableVersion>,) -> SqlOutcome {SqlOutcome {+ table_databases: versions.keys().map(|table| (*table, database_id)).collect(),result: None,changes_applied: 0,inserted_row_ids: Vec::new(),diff --git a/crates/databases_sql/src/service/test.rs b/crates/databases_sql/src/service/test.rsindex 06c0dae0e4..a3e8697439 100644--- a/crates/databases_sql/src/service/test.rs+++ b/crates/databases_sql/src/service/test.rs@@ -622,6 +622,7 @@ async fn a_read_answers_typed_cells_with_what_renders_them() {assert_eq!(outcome.result.as_ref().unwrap(),&ResultSet {+ source_table: Some(GUESTS),columns: vec![ResultColumn {name: "Name".into(),@@ -1281,3 +1282,8 @@ async fn schema_version_conflicts_keep_the_retry_signal() {}mod scopes;++#[cfg(feature = "inbound")]+mod http;++mod query_contract;diff --git a/crates/databases_sql/src/service/test/http.rs b/crates/databases_sql/src/service/test/http.rsnew file mode 100644index 0000000000..e8522a94a4--- /dev/null+++ b/crates/databases_sql/src/service/test/http.rs@@ -0,0 +1,177 @@+use super::*;+use crate::inbound::axum_router::{SqlRouterState, sql_router};+use axum::{+ Router,+ body::{Body, to_bytes},+ http::{Request, StatusCode},+};+use macro_authorization::{+ InternalAuthConfig, JwtValidator, MacroAuthorizationError, MacroAuthorizationServiceImpl,+ MacroAuthorizationState, NoBotAuthorizer, NoUserApiKeyAuthorizer, ValidatedIdentity,+};+use serde_json::{Value, json};+use tower::ServiceExt;++#[derive(Clone, Copy)]+struct Token;++impl JwtValidator for Token {+ fn validate(+ &self,+ jwt: &str,+ ) -> Result<ValidatedIdentity, rootcause::Report<MacroAuthorizationError>> {+ let user_id = match jwt {+ "owner" => OWNER,+ "viewer" => VIEWER,+ _ => {+ return Err(rootcause::Report::new(+ MacroAuthorizationError::InvalidCredentials,+ ));+ }+ };+ Ok(ValidatedIdentity {+ agent_id: None,+ user_id: user_id.into(),+ fusion_user_id: "fusion-sql-test".into(),+ organization_id: None,+ permissions: None,+ })+ }+}++fn app(world: &Shared) -> Router {+ let authorization = MacroAuthorizationState::new(Arc::new(MacroAuthorizationServiceImpl::new(+ Token,+ InternalAuthConfig {+ api_key: "test-internal-key".into(),+ default_user_id: None,+ },+ NoBotAuthorizer,+ NoUserApiKeyAuthorizer,+ )));+ Router::new().nest(+ "/databases",+ sql_router(SqlRouterState::new(sql(world), authorization)),+ )+}++async fn query(router: Router, token: Option<&str>, body: Value) -> (StatusCode, Value) {+ let mut request = Request::post("/databases/query").header("content-type", "application/json");+ if let Some(token) = token {+ request = request.header("authorization", format!("Bearer {token}"));+ }+ let response = router+ .oneshot(request.body(Body::from(body.to_string())).unwrap())+ .await+ .unwrap();+ let status = response.status();+ let body = to_bytes(response.into_body(), 1024 * 1024).await.unwrap();+ (status, serde_json::from_slice(&body).unwrap())+}++#[tokio::test]+async fn sql_http_requires_authentication_before_running_a_statement() {+ let world = world();+ for token in [None, Some("invalid")] {+ let (status, _) = query(app(&world), token, json!({"sql":"SELECT * FROM Guests"})).await;+ assert_eq!(status, StatusCode::UNAUTHORIZED);+ }+ assert!(world.lock().unwrap().soup_reads.is_empty());+ assert!(world.lock().unwrap().applied.is_empty());+}++#[tokio::test]+async fn sql_http_returns_typed_cells_scope_and_versions_for_the_viewer() {+ let world = world();+ let (status, response) = query(+ app(&world),+ Some("viewer"),+ json!({"sql":"SELECT \"Name\" FROM \"Guests\"", "databaseId":OFFSITE}),+ )+ .await;+ assert_eq!(status, StatusCode::OK, "{response}");+ assert_eq!(response["result"]["rows"][0][0]["type"], "text");+ assert_eq!(response["result"]["sourceTable"], json!(GUESTS));+ assert_eq!(+ response["tableDatabases"][GUESTS.to_string()],+ json!(OFFSITE)+ );+ assert_eq!(response["readVersions"][GUESTS.to_string()], 1);+ assert_eq!(response["statement"]["kind"], "select");+ assert!(world.lock().unwrap().applied.is_empty());+}++#[tokio::test]+async fn sql_http_refuses_invisible_scope_viewer_writes_and_stale_versions() {+ let world = world();+ let (status, _) = query(+ app(&world),+ Some("owner"),+ json!({"sql":"SELECT * FROM Plans", "databaseId":SECRET}),+ )+ .await;+ assert_eq!(status, StatusCode::NOT_FOUND);+ let update = "UPDATE \"Offsite\".\"Guests\" SET \"Status\" = 'Going' WHERE \"Name\" = 'Sam'";+ let (status, _) = query(app(&world), Some("viewer"), json!({"sql":update})).await;+ assert_eq!(status, StatusCode::FORBIDDEN);+ let (status, _) = query(+ app(&world),+ Some("owner"),+ json!({"sql":update,"baseVersions":{GUESTS.to_string():0}}),+ )+ .await;+ assert_eq!(status, StatusCode::CONFLICT);+ assert!(world.lock().unwrap().applied.is_empty());+}++#[tokio::test]+async fn sql_http_applies_an_authorized_write_once() {+ let world = world();+ world+ .lock()+ .unwrap()+ .op_answers+ .push_back(Ok(vec![OpResult::Rows {+ table: GUESTS,+ table_version: TableVersion(2),+ change: RowsResult::Updated { affected: 1 },+ }]));+ let (status, response) = query(app(&world), Some("owner"), json!({"sql":"UPDATE \"Offsite\".\"Guests\" SET \"Status\" = 'Going' WHERE \"Name\" = 'Sam'", "baseVersions":{GUESTS.to_string():1}})).await;+ assert_eq!(status, StatusCode::OK, "{response}");+ assert_eq!(response["changesApplied"], 1);+ assert_eq!(response["statement"]["tableId"], json!(GUESTS));+ assert!(response["statement"].get("table_id").is_none());+ assert_eq!(world.lock().unwrap().applied.len(), 1);+}++#[test]+fn sql_openapi_statement_fields_match_the_actual_camel_case_response() {+ // A schema mismatch here generates clients that read undefined write targets.+ let schema =+ serde_json::to_value(<crate::SqlStatement as utoipa::PartialSchema>::schema()).unwrap();+ let schema = schema.to_string();+ for field in [+ "databaseId",+ "tableId",+ "tableName",+ "columnId",+ "columnName",+ ] {+ assert!(+ schema.contains(&format!("\"{field}\"")),+ "{field}: {schema}"+ );+ }+ for field in [+ "database_id",+ "table_id",+ "table_name",+ "column_id",+ "column_name",+ ] {+ assert!(+ !schema.contains(&format!("\"{field}\"")),+ "{field}: {schema}"+ );+ }+}diff --git a/crates/databases_sql/src/service/test/query_contract.rs b/crates/databases_sql/src/service/test/query_contract.rsnew file mode 100644index 0000000000..c954bc122a--- /dev/null+++ b/crates/databases_sql/src/service/test/query_contract.rs@@ -0,0 +1,115 @@+use super::*;++#[tokio::test]+async fn version_guards_reach_the_atomic_write_when_the_table_changes_after_catalog_read() {+ let world = world();+ {+ let mut world = world.lock().unwrap();+ world.current_write_versions.insert(GUESTS, TableVersion(2));+ world.op_answers.push_back(Ok(vec![OpResult::Rows {+ table: GUESTS,+ table_version: TableVersion(3),+ change: RowsResult::Updated { affected: 1 },+ }]));+ }+ let error = sql(&world)+ .execute(+ agent_for(OWNER),+ SqlRequest {+ sql: "UPDATE Offsite.Guests SET Status = 'Going' WHERE Name = 'Sam'".into(),+ scope: Some(OFFSITE),+ base_versions: HashMap::from([(GUESTS, TableVersion(1)), (HALLS, TableVersion(1))]),+ },+ )+ .await+ .unwrap_err();+ assert!(matches!(error, SqlError::VersionConflict { table_id } if table_id == GUESTS));+ let world = world.lock().unwrap();+ assert_eq!(+ world.guarded,+ vec![HashMap::from([(GUESTS, TableVersion(1))])]+ );+ assert!(world.applied.is_empty());+}++#[tokio::test]+async fn empty_reads_keep_the_source_table_but_aggregates_and_platform_rows_do_not() {+ let world = world();+ let empty = sql(&world)+ .execute(+ agent_for(OWNER),+ SqlRequest {+ sql: "SELECT Name FROM Offsite.Guests WHERE Name = 'Nobody'".into(),+ scope: None,+ base_versions: HashMap::new(),+ },+ )+ .await+ .unwrap();+ assert_eq!(empty.result.as_ref().unwrap().source_table, Some(GUESTS));+ assert_eq!(empty.table_databases.get(&GUESTS), Some(&OFFSITE));+ let aggregate = sql(&world)+ .execute(+ agent_for(OWNER),+ SqlRequest {+ sql: "SELECT COUNT(*) FROM Offsite.Guests".into(),+ scope: None,+ base_versions: HashMap::new(),+ },+ )+ .await+ .unwrap();+ assert_eq!(aggregate.result.unwrap().source_table, None);+ let empty_aggregate = sql(&world).execute(agent_for(OWNER), SqlRequest {+ sql: "SELECT Status, COUNT(*) FROM Offsite.Guests WHERE Name = 'Nobody' GROUP BY Status".into(), scope: None, base_versions: HashMap::new(),+ }).await.unwrap();+ assert_eq!(empty_aggregate.result.unwrap().source_table, None);+ let people = sql(&world)+ .execute(+ agent_for(OWNER),+ SqlRequest {+ sql: "SELECT * FROM macro.people".into(),+ scope: None,+ base_versions: HashMap::new(),+ },+ )+ .await+ .unwrap();+ assert_eq!(people.result.unwrap().source_table, None);+}++#[tokio::test]+async fn joins_return_the_owning_database_for_each_read_table() {+ let world = world();+ let outcome = sql(&world).execute(agent_for(OWNER), SqlRequest {+ sql: "SELECT g.Name, h.Name FROM Offsite.Guests g JOIN Venues.Halls h ON g.Hall = h.row_id".into(),+ scope: None, base_versions: HashMap::new(),+ }).await.unwrap();+ assert_eq!(outcome.table_databases.get(&GUESTS), Some(&OFFSITE));+ assert_eq!(outcome.table_databases.get(&HALLS), Some(&VENUES));+ assert_eq!(outcome.result.unwrap().source_table, Some(GUESTS));+}++#[tokio::test]+async fn zero_match_writes_keep_target_ownership_without_applying_ops() {+ let world = world();+ for statement in [+ "UPDATE Offsite.Guests SET Status = 'Going' WHERE Name = 'Nobody'",+ "DELETE FROM Offsite.Guests WHERE Name = 'Nobody'",+ ] {+ let outcome = sql(&world)+ .execute(+ agent_for(OWNER),+ SqlRequest {+ sql: statement.into(),+ scope: None,+ base_versions: HashMap::new(),+ },+ )+ .await+ .unwrap();+ assert_eq!(outcome.changes_applied, 0);+ assert_eq!(outcome.table_databases.get(&GUESTS), Some(&OFFSITE));+ }+ assert!(world.lock().unwrap().applied.is_empty());+}diff --git a/crates/databases_sql/src/test_support.rs b/crates/databases_sql/src/test_support.rsindex d2c2c5ac5e..4b045284f1 100644--- a/crates/databases_sql/src/test_support.rs+++ b/crates/databases_sql/src/test_support.rs@@ -83,6 +83,9 @@ pub(crate) struct World {/// Every question the databases service stored.pub(crate) saved: Vec<(Option<DatabaseId>, QueryDefinition)>,pub(crate) created: Vec<CreateDatabase>,+ /// Versions observed atomically at apply time, which can advance after catalog reads.+ pub(crate) current_write_versions:+ std::collections::HashMap<TableId, databases::domain::models::TableVersion>,pub(crate) guarded:Vec<std::collections::HashMap<TableId, databases::domain::models::TableVersion>>,/// The filter of every Soup read, in order.@@ -200,7 +203,16 @@ impl DatabasesService for FakeDatabases {};let database = receipt.entity().entity_id.parse().expect("a database id");let mut world = self.0.lock().unwrap();+ let conflict = batch.base_versions.iter().any(|(table, expected)| {+ world+ .current_write_versions+ .get(table)+ .is_some_and(|current| current != expected)+ });world.guarded.push(batch.base_versions);+ if conflict {+ return Err(DatabaseError::VersionConflict);+ }world.applied.push(AppliedOps {database,level: *access_level,diff --git a/crates/databases_sql/src/toolset/test.rs b/crates/databases_sql/src/toolset/test.rsindex dec6382c76..45319293b3 100644--- a/crates/databases_sql/src/toolset/test.rs+++ b/crates/databases_sql/src/toolset/test.rs@@ -230,6 +230,7 @@ async fn a_read_answers_typed_cells_row_ids_and_the_versions_it_read() {serde_json::to_value(&response).unwrap(),serde_json::json!({"results": [{+ "sourceTable": GUESTS,"columns": [{"name": "Name", "kind": "text"},{@@ -274,6 +275,7 @@ async fn a_row_id_answers_as_a_row_of_the_table_read_not_an_entity() {assert_eq!(serde_json::to_value(&response).unwrap()["results"],serde_json::json!([{+ "sourceTable": GUESTS,"columns": [{"name": "row_id", "kind": "row", "relatedTable": GUESTS},{"name": "Name", "kind": "text"},diff --git a/docs/agent-guide/databases.md b/docs/agent-guide/databases.mdindex 1f2f95d229..9d275ceddc 100644--- a/docs/agent-guide/databases.md+++ b/docs/agent-guide/databases.md@@ -44,6 +44,13 @@ are needed. `SaveDatabaseView` / `DeleteDatabaseView` manage table and kanbanpresentation; `SaveDatabaseQuery` saves a live answer. Document live-answer agentsremain read-only, including schema commands and database creation.+Programmatic clients use `POST /databases/query` or the SDK's+`database.query(sql)` / `macro.databases.query(sql, options)`. The service runs+one statement as the authenticated user, across their visible databases; writes+require edit access. Pass returned `readVersions` as `baseVersions` to guard a+follow-up write, check `truncatedTables` before reporting aggregate totals, and+never automatically retry a write statement.+## Feature flagDatabases is behind the `enable-databases` PostHog flag. A deployed app reads itdiff --git a/packages/code-mode-sdk/AGENTS.md b/packages/code-mode-sdk/AGENTS.mdindex e65338c6e4..a867200db2 100644--- a/packages/code-mode-sdk/AGENTS.md+++ b/packages/code-mode-sdk/AGENTS.md@@ -10,7 +10,8 @@ HTML worker belong to `packages/sdk-docs`.- `scripts/generate.ts`: bundle and backend artifact generation.- `scripts/typedoc.ts`: collect linked Markdown documentation by entity.-- `scripts/catalog.ts`: compact entity descriptions.+- `scripts/catalog.ts`: compact entity descriptions; agent and harness docs share+ a topic so discovery stays within its 32-question classifier limit.- `src/index.ts`: public SDK exports used by programs.## Checksdiff --git a/packages/code-mode-sdk/README.md b/packages/code-mode-sdk/README.mdindex 08deab88ae..30fabf1fac 100644--- a/packages/code-mode-sdk/README.md+++ b/packages/code-mode-sdk/README.md@@ -30,6 +30,8 @@ The independent `@macro-inc/sdk-docs` package uses TypeDoc and its Markdown plughierarchy and an HTML site from one reflection model. Backend entity sectionsand namespace overviews use those Markdown pages. Compact overviews includelinked local option types and enums; full sections also include linked wire types.+Discovery uses at most 32 topics; agent and host setup share a topic. New SDK+services must also be registered in the generated operation-label catalog.There is no separate declaration parser. Private, protected and internal membersare excluded. `DescribeCodeTools` provides the compact catalog, generated APIdocumentation and workflow guides. See [documentation hosting](../sdk-docs/README.md). Jevdiff --git a/packages/code-mode-sdk/scripts/catalog.ts b/packages/code-mode-sdk/scripts/catalog.tsindex c1a4cb522e..9a62696811 100644--- a/packages/code-mode-sdk/scripts/catalog.ts+++ b/packages/code-mode-sdk/scripts/catalog.ts@@ -2,13 +2,24 @@export const descriptions: Record<string, string> = {'agent-sessions':'Create and inspect agent sessions, saved code executions, and editable email or calendar review stacks.',- ai: 'Generate structured objects and classify supplied content with Jev.',+ agents: 'Configure agents, pair hosts and inspect their sessions.',+ 'api-keys': 'Create, list and revoke user API keys.',+ 'entity-mentions': 'Create and delete typed resource mention relationships.',+ 'github-pull-requests':+ 'Read stored GitHub pull request snapshots and captured diffs.',+ initiatives: 'Group tasks and members into initiatives.',+ meetings:+ 'Create and manage meeting schedules, invitations and sharing links.',+ routines:+ 'Create scheduled and event-triggered agent routines and inspect executions.',+ unfurls: 'Read URL preview metadata.',+ ai: 'Generate structured objects, classify supplied content with Jev and read AI usage.',bots: 'Inspect and manage bots.',calendar: 'Find and manage calendar events.',- calls: 'Read call records and transcripts.',+ calls: 'Read and edit call records, transcripts and meeting links.',channels: 'Read and send channel messages.',- chats: 'Read chat conversations.',- crm: 'Work with CRM records.',+ chats: 'Read and send AI chat messages and stop generations.',+ crm: 'Work with CRM records and pipeline tables, columns, rows and sharing.',databases: 'Read and edit database schemas, rows, and cells.',documents: 'Search, read, create, and manage documents and tasks.',email: 'Search, read, draft, and send email.',diff --git a/packages/code-mode-sdk/scripts/generate.ts b/packages/code-mode-sdk/scripts/generate.tsindex 121bae4d04..2045e1fb5c 100644--- a/packages/code-mode-sdk/scripts/generate.ts+++ b/packages/code-mode-sdk/scripts/generate.ts@@ -87,6 +87,8 @@ for (const [service, directory] of Object.entries({notification: 'notification',properties: 'properties',search: 'search',+ 'scheduled-action': 'scheduled-action',+ unfurl: 'unfurl',storage: 'storage',})) {const { Sdk } = await import(diff --git a/packages/code-mode-sdk/scripts/typedoc.ts b/packages/code-mode-sdk/scripts/typedoc.tsindex a8a858b34e..9f56fa84df 100644--- a/packages/code-mode-sdk/scripts/typedoc.ts+++ b/packages/code-mode-sdk/scripts/typedoc.ts@@ -25,19 +25,27 @@ export function packageEntityDocs('src/mentions/','src/entities/entity/','src/entities/search/',+ 'src/entities/sharing/',+ 'src/entities/messages/',+ 'src/entities/reference/','src/utils/','src/events/',];const sections = [...Object.entries(descriptions).map(([directory, description]) => ({name:- directory === 'agent-sessions'- ? 'agentSessions'- : directory === 'foreign'- ? 'foreignEntities'- : directory,+ directory === 'foreign'+ ? 'foreignEntities'+ : directory.replace(/-([a-z])/g, (_, letter: string) =>+ letter.toUpperCase()+ ),description,- prefixes: [`src/entities/${directory}/`],+ // Agent and host setup share one discovery topic, keeping the classifier+ // request within its 32-question contract as the public API grows.+ prefixes: (directory === 'agents'+ ? ['agents', 'harnesses']+ : [directory]+ ).map((value) => `src/entities/${value}/`),})),{name: 'core',diff --git a/packages/code-mode-sdk/src/documentation.test.ts b/packages/code-mode-sdk/src/documentation.test.tsindex e18046b248..00edeb6a1a 100644--- a/packages/code-mode-sdk/src/documentation.test.ts+++ b/packages/code-mode-sdk/src/documentation.test.ts@@ -116,6 +116,25 @@ describe('TypeDoc documentation packaging', () => {expect(workspace?.overview).toContain('# Type Alias: WorkspaceType');expect(workspace?.overview).toContain('calendar_event');expect(workspace?.overview).toContain('ai_chat');+ expect(docs.length).toBeLessThanOrEqual(32);+ expect(+ docs.find((doc) => doc.name === 'routines')?.documentation+ ).toContain('RoutineOptions');+ expect(docs.find((doc) => doc.name === 'agents')?.documentation).toContain(+ 'HarnessNamespace'+ );+ expect(docs.find((doc) => doc.name === 'apiKeys')?.documentation).toContain(+ 'UserApiKey'+ );+ expect(+ docs.find((doc) => doc.name === 'entityMentions')?.overview+ ).toContain('EntityMentionNamespace');+ expect(+ docs.find((doc) => doc.name === 'githubPullRequests')?.documentation+ ).toContain('PullRequestChangeset');+ expect(docs.find((doc) => doc.name === 'core')?.documentation).toContain(+ 'SharePermissionOptions'+ );for (const doc of docs) {expect(doc.overview.length).toBeGreaterThan(0);expect(Buffer.byteLength(doc.overview)).toBeLessThan(16 * 1024);diff --git a/packages/sdk-docs/pages/home.md b/packages/sdk-docs/pages/home.mdindex 5553f90d23..b32f72c0ff 100644--- a/packages/sdk-docs/pages/home.md+++ b/packages/sdk-docs/pages/home.md@@ -43,7 +43,7 @@ opens the methods and exact request and response types for that namespace.| {@link src/entities/tasks/namespace!TaskNamespace | macro.tasks} | Work to track and complete, with assignees, due dates, and status. || {@link src/entities/projects/namespace!ProjectNamespace | macro.projects} | Collections that organize documents and other workspace items. || {@link src/entities/workspace/namespace!WorkspaceNamespace | macro.workspace} | A view across workspace activity, filtered by entity type, time, properties, or inbox state. |-| {@link src/entities/databases/namespace!DatabaseNamespace | macro.databases} | Structured information in tables, with columns, rows, cells, and views. |+| {@link src/entities/databases/namespace!DatabaseNamespace | macro.databases} | Structured information in tables, with typed handles, SQL queries, atomic version-guarded writes, and views. || {@link src/entities/forms/namespace!FormNamespace | macro.forms} | Questions that collect responses into a database without giving respondents access to its other rows. || {@link src/entities/properties/namespace!PropertiesNamespace | macro.properties} | Custom fields and their options, used to describe and filter entities. || {@link src/entities/foreign/namespace!ForeignEntityNamespace | macro.foreignEntities} | References to items in external systems that are linked into Macro. |@@ -79,6 +79,37 @@ opens the methods and exact request and response types for that namespace.| {@link src/events/receiver!MacroEvents | macro.events} | Live entity events your application can subscribe to through a stream or webhook receiver. || {@link src/entities/webhooks/namespace!WebhooksNamespace | macro.webhooks} | Persistent subscriptions that deliver events to your application's URL. |+### Automation and resource management++Routines, configurable agents and their hosts use typed handles:+{@link src/entities/routines/namespace!RoutineNamespace | macro.routines},+{@link src/entities/agents/namespace!AgentNamespace | macro.agents} and+{@link src/entities/harnesses/namespace!HarnessNamespace | macro.harnesses}.+Routine triggers can reference entities, and executions return transcript handles.+Agent conversations and tool approvals retain channel/session scope.++Use {@link src/entities/initiatives/namespace!InitiativeNamespace | macro.initiatives}+for task initiatives, {@link src/entities/meetings/namespace!MeetingNamespace | macro.meetings}+for schedules and invitations, and+{@link src/entities/api-keys/namespace!ApiKeyNamespace | macro.apiKeys} for credentials.+API key creation returns the secret separately; handles serialize metadata only.++CRM pipelines live at `macro.crm.pipelines`; tables, columns and rows retain their+pipeline authorization boundary. Email supports editable drafts, upload and+forwarded attachment handles, scheduled sends, importance filters and follow-ups.+Draft writes retain the selected inbox, and plain HTML is encoded for the wire.++Shareable resources expose `.access` for revision-aware requests and direct grants.+Message-bearing resources expose `messageThreadById` and `timelinePage`; timeline+messages are seeded handles. Calendar occurrence iteration seeds event handles and+preserves its viewport while paging. Document versions and PDF annotations are+scoped to their parent document.++GitHub pull request snapshots and diffs use `macro.githubPullRequests`. Cross-resource+mentions use `macro.entityMentions`, with typed source and target references.+`macro.unfurls` reads URL metadata; `chat.send` returns a generation with a response+message handle and explicit cancellation. `macro.ai.usage` reads usage summaries.+## How to use entity handles`macro.documents.byId(id)` creates a handle to an existing document. Creatingdiff --git a/packages/sdk-docs/reference/README.md b/packages/sdk-docs/reference/README.mdindex 12e766d266..5fc926c169 100644--- a/packages/sdk-docs/reference/README.md+++ b/packages/sdk-docs/reference/README.md@@ -43,7 +43,7 @@ opens the methods and exact request and response types for that namespace.| [macro.tasks](src/entities/tasks/namespace/classes/TaskNamespace.md) | Work to track and complete, with assignees, due dates, and status. || [macro.projects](src/entities/projects/namespace/classes/ProjectNamespace.md) | Collections that organize documents and other workspace items. || [macro.workspace](src/entities/workspace/namespace/classes/WorkspaceNamespace.md) | A view across workspace activity, filtered by entity type, time, properties, or inbox state. |-| [macro.databases](src/entities/databases/namespace/classes/DatabaseNamespace.md) | Structured information in tables, with columns, rows, cells, and views. |+| [macro.databases](src/entities/databases/namespace/classes/DatabaseNamespace.md) | Structured information in tables, with typed handles, SQL queries, atomic version-guarded writes, and views. || [macro.forms](src/entities/forms/namespace/classes/FormNamespace.md) | Questions that collect responses into a database without giving respondents access to its other rows. || [macro.properties](src/entities/properties/namespace/classes/PropertiesNamespace.md) | Custom fields and their options, used to describe and filter entities. || [macro.foreignEntities](src/entities/foreign/namespace/classes/ForeignEntityNamespace.md) | References to items in external systems that are linked into Macro. |@@ -79,6 +79,37 @@ opens the methods and exact request and response types for that namespace.| [macro.events](src/events/receiver/classes/MacroEvents.md) | Live entity events your application can subscribe to through a stream or webhook receiver. || [macro.webhooks](src/entities/webhooks/namespace/classes/WebhooksNamespace.md) | Persistent subscriptions that deliver events to your application's URL. |+### Automation and resource management++Routines, configurable agents and their hosts use typed handles:+[macro.routines](src/entities/routines/namespace/classes/RoutineNamespace.md),+[macro.agents](src/entities/agents/namespace/classes/AgentNamespace.md) and+[macro.harnesses](src/entities/harnesses/namespace/classes/HarnessNamespace.md).+Routine triggers can reference entities, and executions return transcript handles.+Agent conversations and tool approvals retain channel/session scope.++Use [macro.initiatives](src/entities/initiatives/namespace/classes/InitiativeNamespace.md)+for task initiatives, [macro.meetings](src/entities/meetings/namespace/classes/MeetingNamespace.md)+for schedules and invitations, and+[macro.apiKeys](src/entities/api-keys/namespace/classes/ApiKeyNamespace.md) for credentials.+API key creation returns the secret separately; handles serialize metadata only.++CRM pipelines live at `macro.crm.pipelines`; tables, columns and rows retain their+pipeline authorization boundary. Email supports editable drafts, upload and+forwarded attachment handles, scheduled sends, importance filters and follow-ups.+Draft writes retain the selected inbox, and plain HTML is encoded for the wire.++Shareable resources expose `.access` for revision-aware requests and direct grants.+Message-bearing resources expose `messageThreadById` and `timelinePage`; timeline+messages are seeded handles. Calendar occurrence iteration seeds event handles and+preserves its viewport while paging. Document versions and PDF annotations are+scoped to their parent document.++GitHub pull request snapshots and diffs use `macro.githubPullRequests`. Cross-resource+mentions use `macro.entityMentions`, with typed source and target references.+`macro.unfurls` reads URL metadata; `chat.send` returns a generation with a response+message handle and explicit cancellation. `macro.ai.usage` reads usage summaries.+## How to use entity handles`macro.documents.byId(id)` creates a handle to an existing document. Creatingdiff --git a/packages/sdk-docs/reference/generated/storage/types.gen/README.md b/packages/sdk-docs/reference/generated/storage/types.gen/README.mdindex 77cddfb14b..a0c6354740 100644--- a/packages/sdk-docs/reference/generated/storage/types.gen/README.md+++ b/packages/sdk-docs/reference/generated/storage/types.gen/README.md@@ -225,6 +225,7 @@- [ColumnConversion](type-aliases/ColumnConversion.md)- [ColumnConversionRequest](type-aliases/ColumnConversionRequest.md)- [ColumnDetail](type-aliases/ColumnDetail.md)+- [ColumnId](type-aliases/ColumnId.md)- [ColumnKind](type-aliases/ColumnKind.md)- [ColumnProtection](type-aliases/ColumnProtection.md)- [ColumnResult](type-aliases/ColumnResult.md)@@ -444,7 +445,9 @@- [CustomSpeakerAssignment](type-aliases/CustomSpeakerAssignment.md)- [Database](type-aliases/Database.md)- [DatabaseDetail](type-aliases/DatabaseDetail.md)+- [DatabaseId](type-aliases/DatabaseId.md)- [DatabaseOp](type-aliases/DatabaseOp.md)+- [DatabaseQueryRequest](type-aliases/DatabaseQueryRequest.md)- [DatabaseView](type-aliases/DatabaseView.md)- [DatabaseWebhookDeliveryResponse](type-aliases/DatabaseWebhookDeliveryResponse.md)- [DatabaseWebhookPayloadProblem](type-aliases/DatabaseWebhookPayloadProblem.md)@@ -1554,6 +1557,7 @@- [Operator](type-aliases/Operator.md)- [OpRefusalResponse](type-aliases/OpRefusalResponse.md)- [OpResult](type-aliases/OpResult.md)+- [OptionId](type-aliases/OptionId.md)- [OptionRef](type-aliases/OptionRef.md)- [PairingDetails](type-aliases/PairingDetails.md)- [Params](type-aliases/Params.md)@@ -1681,6 +1685,11 @@- [QueryCrmPipelineRowsData](type-aliases/QueryCrmPipelineRowsData.md)- [QueryCrmPipelineRowsResponse](type-aliases/QueryCrmPipelineRowsResponse.md)- [QueryCrmPipelineRowsResponses](type-aliases/QueryCrmPipelineRowsResponses.md)+- [QueryDatabasesData](type-aliases/QueryDatabasesData.md)+- [QueryDatabasesError](type-aliases/QueryDatabasesError.md)+- [QueryDatabasesErrors](type-aliases/QueryDatabasesErrors.md)+- [QueryDatabasesResponse](type-aliases/QueryDatabasesResponse.md)+- [QueryDatabasesResponses](type-aliases/QueryDatabasesResponses.md)- [QueryDefinition](type-aliases/QueryDefinition.md)- [QuestionLayout](type-aliases/QuestionLayout.md)- [QuestionOption](type-aliases/QuestionOption.md)@@ -1750,6 +1759,8 @@- [ResolveRequest](type-aliases/ResolveRequest.md)- [ResponseStatus](type-aliases/ResponseStatus.md)- [ResponseSummary](type-aliases/ResponseSummary.md)+- [ResultColumn](type-aliases/ResultColumn.md)+- [ResultSet](type-aliases/ResultSet.md)- [RevertDeleteDocumentData](type-aliases/RevertDeleteDocumentData.md)- [RevertDeleteDocumentError](type-aliases/RevertDeleteDocumentError.md)- [RevertDeleteDocumentErrors](type-aliases/RevertDeleteDocumentErrors.md)@@ -1931,6 +1942,12 @@- [SourceBinding](type-aliases/SourceBinding.md)- [SourceId](type-aliases/SourceId.md)- [SourceIdentity](type-aliases/SourceIdentity.md)+- [SqlCell](type-aliases/SqlCell.md)+- [SqlEntityKind](type-aliases/SqlEntityKind.md)+- [SqlOutcome](type-aliases/SqlOutcome.md)+- [SqlOutcomeKind](type-aliases/SqlOutcomeKind.md)+- [SqlSelectOption](type-aliases/SqlSelectOption.md)+- [SqlStatement](type-aliases/SqlStatement.md)- [StarterDatabase](type-aliases/StarterDatabase.md)- [StarterDocumentsResponse](type-aliases/StarterDocumentsResponse.md)- [StorageRow](type-aliases/StorageRow.md)@@ -1959,6 +1976,7 @@- [TableChanged](type-aliases/TableChanged.md)- [TableChanges](type-aliases/TableChanges.md)- [TableDetail](type-aliases/TableDetail.md)+- [TableId](type-aliases/TableId.md)- [TableResult](type-aliases/TableResult.md)- [TableVersion](type-aliases/TableVersion.md)- [TagFilterMode](type-aliases/TagFilterMode.md)diff --git a/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/ColumnId.md b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/ColumnId.mdnew file mode 100644index 0000000000..0a486a8236--- /dev/null+++ b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/ColumnId.md@@ -0,0 +1,5 @@+# Type Alias: ColumnId++> **ColumnId** = `string`++Identifier of a column placement within a table.diff --git a/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/DatabaseId.md b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/DatabaseId.mdnew file mode 100644index 0000000000..1c3d1af76e--- /dev/null+++ b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/DatabaseId.md@@ -0,0 +1,6 @@+# Type Alias: DatabaseId++> **DatabaseId** = `string`++Identifier of reusable database storage. Its optional Macro entity uses+the same identity, so existing routes and grants keep their IDs.diff --git a/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/DatabaseQueryRequest.md b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/DatabaseQueryRequest.mdnew file mode 100644index 0000000000..4481687e21--- /dev/null+++ b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/DatabaseQueryRequest.md@@ -0,0 +1,13 @@+# Type Alias: DatabaseQueryRequest++> **DatabaseQueryRequest** = \{ `baseVersions?`: \{\[`key`: `string`\]: `number`; \}; `databaseId?`: `null` \| [`DatabaseId`](DatabaseId.md); `sql`: `string`; \}++One SQL statement with an optional default database and optimistic write guards.++## Properties++| Property | Type | Description |+| ------ | ------ | ------ |+| <a id="property-baseversions"></a> `baseVersions?` | \{\[`key`: `string`\]: `number`; \} | Expected version for each table a subsequent statement writes. |+| <a id="property-databaseid"></a> `databaseId?` | `null` \| [`DatabaseId`](DatabaseId.md) | - |+| <a id="property-sql"></a> `sql` | `string` | One supported SQL statement. Writes execute once, without automatic retries. |diff --git a/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/OptionId.md b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/OptionId.mdnew file mode 100644index 0000000000..9dee912f31--- /dev/null+++ b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/OptionId.md@@ -0,0 +1,5 @@+# Type Alias: OptionId++> **OptionId** = `string`++Identifier of an option of a select or tag column.diff --git a/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/QueryDatabasesData.md b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/QueryDatabasesData.mdnew file mode 100644index 0000000000..ccd144df3a--- /dev/null+++ b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/QueryDatabasesData.md@@ -0,0 +1,12 @@+# Type Alias: QueryDatabasesData++> **QueryDatabasesData** = \{ `body`: [`DatabaseQueryRequest`](DatabaseQueryRequest.md); `path?`: `never`; `query?`: `never`; `url`: `"/databases/query"`; \}++## Properties++| Property | Type |+| ------ | ------ |+| <a id="property-body"></a> `body` | [`DatabaseQueryRequest`](DatabaseQueryRequest.md) |+| <a id="property-path"></a> `path?` | `never` |+| <a id="property-query"></a> `query?` | `never` |+| <a id="property-url"></a> `url` | `"/databases/query"` |diff --git a/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/QueryDatabasesError.md b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/QueryDatabasesError.mdnew file mode 100644index 0000000000..a0dd535eb3--- /dev/null+++ b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/QueryDatabasesError.md@@ -0,0 +1,3 @@+# Type Alias: QueryDatabasesError++> **QueryDatabasesError** = [`QueryDatabasesErrors`](QueryDatabasesErrors.md)\[keyof [`QueryDatabasesErrors`](QueryDatabasesErrors.md)\]diff --git a/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/QueryDatabasesErrors.md b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/QueryDatabasesErrors.mdnew file mode 100644index 0000000000..0578b43a5d--- /dev/null+++ b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/QueryDatabasesErrors.md@@ -0,0 +1,14 @@+# Type Alias: QueryDatabasesErrors++> **QueryDatabasesErrors** = \{ `400`: [`ErrorResponse`](ErrorResponse.md); `401`: [`ErrorResponse`](ErrorResponse.md); `403`: [`ErrorResponse`](ErrorResponse.md); `404`: [`ErrorResponse`](ErrorResponse.md); `409`: [`ErrorResponse`](ErrorResponse.md); `500`: [`ErrorResponse`](ErrorResponse.md); \}++## Properties++| Property | Type |+| ------ | ------ |+| <a id="property-400"></a> `400` | [`ErrorResponse`](ErrorResponse.md) |+| <a id="property-401"></a> `401` | [`ErrorResponse`](ErrorResponse.md) |+| <a id="property-403"></a> `403` | [`ErrorResponse`](ErrorResponse.md) |+| <a id="property-404"></a> `404` | [`ErrorResponse`](ErrorResponse.md) |+| <a id="property-409"></a> `409` | [`ErrorResponse`](ErrorResponse.md) |+| <a id="property-500"></a> `500` | [`ErrorResponse`](ErrorResponse.md) |diff --git a/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/QueryDatabasesResponse.md b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/QueryDatabasesResponse.mdnew file mode 100644index 0000000000..6e9b2d8ce5--- /dev/null+++ b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/QueryDatabasesResponse.md@@ -0,0 +1,3 @@+# Type Alias: QueryDatabasesResponse++> **QueryDatabasesResponse** = [`QueryDatabasesResponses`](QueryDatabasesResponses.md)\[keyof [`QueryDatabasesResponses`](QueryDatabasesResponses.md)\]diff --git a/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/QueryDatabasesResponses.md b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/QueryDatabasesResponses.mdnew file mode 100644index 0000000000..7872447475--- /dev/null+++ b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/QueryDatabasesResponses.md@@ -0,0 +1,9 @@+# Type Alias: QueryDatabasesResponses++> **QueryDatabasesResponses** = \{ `200`: [`SqlOutcome`](SqlOutcome.md); \}++## Properties++| Property | Type |+| ------ | ------ |+| <a id="property-200"></a> `200` | [`SqlOutcome`](SqlOutcome.md) |diff --git a/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/ResultColumn.md b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/ResultColumn.mdnew file mode 100644index 0000000000..3c177508f9--- /dev/null+++ b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/ResultColumn.md@@ -0,0 +1,15 @@+# Type Alias: ResultColumn++> **ResultColumn** = \{ `kind`: [`SqlOutcomeKind`](SqlOutcomeKind.md); `name`: `string`; `options?`: [`SqlSelectOption`](SqlSelectOption.md)[]; `relatedTable?`: `null` \| [`TableId`](TableId.md); `target?`: `null` \| [`SqlEntityKind`](SqlEntityKind.md); \}++One result column, with what its cells mean.++## Properties++| Property | Type | Description |+| ------ | ------ | ------ |+| <a id="property-kind"></a> `kind` | [`SqlOutcomeKind`](SqlOutcomeKind.md) | What its cells hold. |+| <a id="property-name"></a> `name` | `string` | The name or alias the statement gave it. |+| <a id="property-options"></a> `options?` | [`SqlSelectOption`](SqlSelectOption.md)[] | For a select column, its options: its cells hold their ids. |+| <a id="property-relatedtable"></a> `relatedTable?` | `null` \| [`TableId`](TableId.md) | - |+| <a id="property-target"></a> `target?` | `null` \| [`SqlEntityKind`](SqlEntityKind.md) | - |diff --git a/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/ResultSet.md b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/ResultSet.mdnew file mode 100644index 0000000000..f12b54db79--- /dev/null+++ b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/ResultSet.md@@ -0,0 +1,14 @@+# Type Alias: ResultSet++> **ResultSet** = \{ `columns`: [`ResultColumn`](ResultColumn.md)[]; `rowIds`: [`RowId`](RowId.md)[]; `rows`: (`null` \| [`SqlCell`](SqlCell.md))[][]; `sourceTable?`: `null` \| [`TableId`](TableId.md); \}++A `SELECT`'s rows, as the engine's typed cells.++## Properties++| Property | Type | Description |+| ------ | ------ | ------ |+| <a id="property-columns"></a> `columns` | [`ResultColumn`](ResultColumn.md)[] | The columns, in select-list order. |+| <a id="property-rowids"></a> `rowIds` | [`RowId`](RowId.md)[] | For a row-shaped result, the id of the row behind each result row; empty for an aggregate. |+| <a id="property-rows"></a> `rows` | (`null` \| [`SqlCell`](SqlCell.md))[][] | One cell per column per row; `null` is an empty cell. |+| <a id="property-sourcetable"></a> `sourceTable?` | `null` \| [`TableId`](TableId.md) | - |diff --git a/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/SqlCell.md b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/SqlCell.mdnew file mode 100644index 0000000000..1281a723fc--- /dev/null+++ b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/SqlCell.md@@ -0,0 +1,83 @@+# Type Alias: SqlCell++> **SqlCell** = \{ `type`: `"text"`; `value`: `string`; \} \| \{ `type`: `"number"`; `value`: `number`; \} \| \{ `type`: `"bool"`; `value`: `boolean`; \} \| \{ `type`: `"date"`; `value`: `string`; \} \| \{ `type`: `"options"`; `value`: [`OptionId`](OptionId.md)[]; \} \| \{ `type`: `"entities"`; `value`: `string`[]; \} \| \{ `type`: `"row"`; `value`: [`RowId`](RowId.md); \}++A cell as fetched. An absent cell is `NULL`; an absent multi-valued cell+is the empty set.++## Union Members++### Type Literal++\{ `type`: `"text"`; `value`: `string`; \}++| Name | Type | Description |+| ------ | ------ | ------ |+| `type` | `"text"` | - |+| `value` | `string` | Text or link. |++***++### Type Literal++\{ `type`: `"number"`; `value`: `number`; \}++| Name | Type | Description |+| ------ | ------ | ------ |+| `type` | `"number"` | - |+| `value` | `number` | A number. |++***++### Type Literal++\{ `type`: `"bool"`; `value`: `boolean`; \}++| Name | Type | Description |+| ------ | ------ | ------ |+| `type` | `"bool"` | - |+| `value` | `boolean` | A checkbox. |++***++### Type Literal++\{ `type`: `"date"`; `value`: `string`; \}++| Name | Type | Description |+| ------ | ------ | ------ |+| `type` | `"date"` | - |+| `value` | `string` | A date-time. |++***++### Type Literal++\{ `type`: `"options"`; `value`: [`OptionId`](OptionId.md)[]; \}++| Name | Type | Description |+| ------ | ------ | ------ |+| `type` | `"options"` | - |+| `value` | [`OptionId`](OptionId.md)[] | The selected option ids; one for single-select columns. |++***++### Type Literal++\{ `type`: `"entities"`; `value`: `string`[]; \}++| Name | Type | Description |+| ------ | ------ | ------ |+| `type` | `"entities"` | - |+| `value` | `string`[] | The referenced entity ids; one for single-valued columns. |++***++### Type Literal++\{ `type`: `"row"`; `value`: [`RowId`](RowId.md); \}++| Name | Type | Description |+| ------ | ------ | ------ |+| `type` | `"row"` | - |+| `value` | [`RowId`](RowId.md) | A table row's own id, the `row_id` column. |diff --git a/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/SqlEntityKind.md b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/SqlEntityKind.mdnew file mode 100644index 0000000000..51fe13f088--- /dev/null+++ b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/SqlEntityKind.md@@ -0,0 +1,10 @@+# Type Alias: SqlEntityKind++> **SqlEntityKind** = `"USER"` \| `"DOCUMENT"` \| `"TASK"` \| `"COMPANY"` \| `"CONTACT"` \| `"CALL_RECORD"` \| `"CHANNEL"` \| `"CHAT"` \| `"PROJECT"` \| `"THREAD"` \| `"CALENDAR_EVENT"` \| `"INITIATIVE"` \| `"DATABASE_ROW"`++What an entity column's references point at: a kind of Macro entity, or+the rows of another table for a relation.++Spelled as the properties system spells entity types (`USER`,+`DATABASE_ROW`), on the wire and in SQL, where it parses+case-insensitively.diff --git a/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/SqlOutcome.md b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/SqlOutcome.mdnew file mode 100644index 0000000000..8ad54edabc--- /dev/null+++ b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/SqlOutcome.md@@ -0,0 +1,18 @@+# Type Alias: SqlOutcome++> **SqlOutcome** = \{ `changesApplied`: `number`; `insertedRowIds`: [`RowId`](RowId.md)[]; `newVersions`: \{\[`key`: `string`\]: `number`; \}; `readVersions`: \{\[`key`: `string`\]: `number`; \}; `result?`: `null` \| [`ResultSet`](ResultSet.md); `statement`: [`SqlStatement`](SqlStatement.md); `tableDatabases`: \{\[`key`: `string`\]: `string`; \}; `truncatedTables`: `string`[]; \}++The answer to one statement.++## Properties++| Property | Type | Description |+| ------ | ------ | ------ |+| <a id="property-changesapplied"></a> `changesApplied` | `number` | How many rows a write changed. |+| <a id="property-insertedrowids"></a> `insertedRowIds` | [`RowId`](RowId.md)[] | The rows an `INSERT` created, in statement order. |+| <a id="property-newversions"></a> `newVersions` | \{\[`key`: `string`\]: `number`; \} | The new version of every table written. |+| <a id="property-readversions"></a> `readVersions` | \{\[`key`: `string`\]: `number`; \} | The version of every table read, for a follow-up write to guard on. |+| <a id="property-result"></a> `result?` | `null` \| [`ResultSet`](ResultSet.md) | - |+| <a id="property-statement"></a> `statement` | [`SqlStatement`](SqlStatement.md) | What kind of statement ran, and what it wrote. |+| <a id="property-tabledatabases"></a> `tableDatabases` | \{\[`key`: `string`\]: `string`; \} | Owning database of each visible table referenced by this outcome. |+| <a id="property-truncatedtables"></a> `truncatedTables` | `string`[] | Every table the statement read, when any read hit the engine's row cap: the engine reports the cap per statement, so aggregates over any of them may be partial. |diff --git a/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/SqlOutcomeKind.md b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/SqlOutcomeKind.mdnew file mode 100644index 0000000000..e9e8a5cab4--- /dev/null+++ b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/SqlOutcomeKind.md@@ -0,0 +1,5 @@+# Type Alias: SqlOutcomeKind++> **SqlOutcomeKind** = `"text"` \| `"number"` \| `"boolean"` \| `"date"` \| `"select"` \| `"entity"` \| `"row"`++The value kind of a result column.diff --git a/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/SqlSelectOption.md b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/SqlSelectOption.mdnew file mode 100644index 0000000000..65ab454a85--- /dev/null+++ b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/SqlSelectOption.md@@ -0,0 +1,12 @@+# Type Alias: SqlSelectOption++> **SqlSelectOption** = \{ `id`: [`OptionId`](OptionId.md); `label`: `string`; \}++One option of a select column.++## Properties++| Property | Type | Description |+| ------ | ------ | ------ |+| <a id="property-id"></a> `id` | [`OptionId`](OptionId.md) | The option id. |+| <a id="property-label"></a> `label` | `string` | The label users type in SQL. |diff --git a/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/SqlStatement.md b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/SqlStatement.mdnew file mode 100644index 0000000000..b83e3def07--- /dev/null+++ b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/SqlStatement.md@@ -0,0 +1,75 @@+# Type Alias: SqlStatement++> **SqlStatement** = \{ `databaseId`: [`DatabaseId`](DatabaseId.md); `kind`: `"schema"`; `summary`: `string`; \} \| \{ `kind`: `"select"`; \} \| \{ `kind`: `"insert"`; `tableId`: [`TableId`](TableId.md); `tableName`: `string`; \} \| \{ `kind`: `"update"`; `tableId`: [`TableId`](TableId.md); `tableName`: `string`; \} \| \{ `kind`: `"delete"`; `tableId`: [`TableId`](TableId.md); `tableName`: `string`; \} \| \{ `columnId`: [`ColumnId`](ColumnId.md); `columnName`: `string`; `kind`: `"alterColumnType"`; `tableId`: [`TableId`](TableId.md); `tableName`: `string`; `to`: `string`; \}++The statement that ran: a read, or the table (and for a type change, the+column) it wrote.++## Union Members++### Type Literal++\{ `databaseId`: [`DatabaseId`](DatabaseId.md); `kind`: `"schema"`; `summary`: `string`; \}++| Name | Type | Description |+| ------ | ------ | ------ |+| `databaseId` | [`DatabaseId`](DatabaseId.md) | Owning database. |+| `kind` | `"schema"` | - |+| `summary` | `string` | What changed and how to read the resulting schema. |++***++### Type Literal++\{ `kind`: `"select"`; \}++***++### Type Literal++\{ `kind`: `"insert"`; `tableId`: [`TableId`](TableId.md); `tableName`: `string`; \}++| Name | Type | Description |+| ------ | ------ | ------ |+| `kind` | `"insert"` | - |+| `tableId` | [`TableId`](TableId.md) | The table written. |+| `tableName` | `string` | Its name. |++***++### Type Literal++\{ `kind`: `"update"`; `tableId`: [`TableId`](TableId.md); `tableName`: `string`; \}++| Name | Type | Description |+| ------ | ------ | ------ |+| `kind` | `"update"` | - |+| `tableId` | [`TableId`](TableId.md) | The table written. |+| `tableName` | `string` | Its name. |++***++### Type Literal++\{ `kind`: `"delete"`; `tableId`: [`TableId`](TableId.md); `tableName`: `string`; \}++| Name | Type | Description |+| ------ | ------ | ------ |+| `kind` | `"delete"` | - |+| `tableId` | [`TableId`](TableId.md) | The table written. |+| `tableName` | `string` | Its name. |++***++### Type Literal++\{ `columnId`: [`ColumnId`](ColumnId.md); `columnName`: `string`; `kind`: `"alterColumnType"`; `tableId`: [`TableId`](TableId.md); `tableName`: `string`; `to`: `string`; \}++| Name | Type | Description |+| ------ | ------ | ------ |+| `columnId` | [`ColumnId`](ColumnId.md) | The column placement; its id survives the change. |+| `columnName` | `string` | The column's name. |+| `kind` | `"alterColumnType"` | - |+| `tableId` | [`TableId`](TableId.md) | The table. |+| `tableName` | `string` | Its name. |+| `to` | `string` | The type it became, as SQL spells it, e.g. `select[]`. |diff --git a/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/TableId.md b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/TableId.mdnew file mode 100644index 0000000000..dd2ed3f4f2--- /dev/null+++ b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/TableId.md@@ -0,0 +1,5 @@+# Type Alias: TableId++> **TableId** = `string`++Identifier of one table (tab) within a database.diff --git a/packages/sdk-docs/reference/modules.md b/packages/sdk-docs/reference/modules.mdindex 8d1a29f953..d3639cbcc6 100644--- a/packages/sdk-docs/reference/modules.md+++ b/packages/sdk-docs/reference/modules.md@@ -19,10 +19,16 @@- [src/config](src/config/README.md)- [src/entities/agent-sessions/agent-session](src/entities/agent-sessions/agent-session/README.md)- [src/entities/agent-sessions/code-execution](src/entities/agent-sessions/code-execution/README.md)+- [src/entities/agent-sessions/conversation](src/entities/agent-sessions/conversation/README.md)- [src/entities/agent-sessions/namespace](src/entities/agent-sessions/namespace/README.md)- [src/entities/agent-sessions/queued-action](src/entities/agent-sessions/queued-action/README.md)- [src/entities/agent-sessions/review](src/entities/agent-sessions/review/README.md)+- [src/entities/agent-sessions/tool-approval](src/entities/agent-sessions/tool-approval/README.md)+- [src/entities/agents/agent](src/entities/agents/agent/README.md)+- [src/entities/agents/namespace](src/entities/agents/namespace/README.md)- [src/entities/ai/namespace](src/entities/ai/namespace/README.md)+- [src/entities/api-keys/api-key](src/entities/api-keys/api-key/README.md)+- [src/entities/api-keys/namespace](src/entities/api-keys/namespace/README.md)- [src/entities/bots/namespace](src/entities/bots/namespace/README.md)- [src/entities/calendar/calendar](src/entities/calendar/calendar/README.md)- [src/entities/calendar/event](src/entities/calendar/event/README.md)@@ -31,36 +37,48 @@- [src/entities/calls/call-record](src/entities/calls/call-record/README.md)- [src/entities/calls/message](src/entities/calls/message/README.md)- [src/entities/calls/namespace](src/entities/calls/namespace/README.md)+- [src/entities/channels/activity](src/entities/channels/activity/README.md)- [src/entities/channels/channel](src/entities/channels/channel/README.md)- [src/entities/channels/labels](src/entities/channels/labels/README.md)- [src/entities/channels/message](src/entities/channels/message/README.md)- [src/entities/channels/namespace](src/entities/channels/namespace/README.md)+- [src/entities/channels/picture](src/entities/channels/picture/README.md)- [src/entities/channels/post](src/entities/channels/post/README.md)- [src/entities/channels/thread](src/entities/channels/thread/README.md)- [src/entities/chats/chat](src/entities/chats/chat/README.md)+- [src/entities/chats/generation](src/entities/chats/generation/README.md)- [src/entities/chats/namespace](src/entities/chats/namespace/README.md)- [src/entities/crm/comment](src/entities/crm/comment/README.md)- [src/entities/crm/company](src/entities/crm/company/README.md)- [src/entities/crm/contact](src/entities/crm/contact/README.md)- [src/entities/crm/namespace](src/entities/crm/namespace/README.md)+- [src/entities/crm/pipeline](src/entities/crm/pipeline/README.md)+- [src/entities/crm/pipelines](src/entities/crm/pipelines/README.md)- [src/entities/databases/column](src/entities/databases/column/README.md)- [src/entities/databases/database](src/entities/databases/database/README.md)- [src/entities/databases/namespace](src/entities/databases/namespace/README.md)+- [src/entities/databases/query](src/entities/databases/query/README.md)- [src/entities/databases/row](src/entities/databases/row/README.md)- [src/entities/databases/table](src/entities/databases/table/README.md)- [src/entities/databases/view](src/entities/databases/view/README.md)- [src/entities/databases/webhook](src/entities/databases/webhook/README.md)+- [src/entities/documents/anchor](src/entities/documents/anchor/README.md)- [src/entities/documents/comment](src/entities/documents/comment/README.md)- [src/entities/documents/document](src/entities/documents/document/README.md)- [src/entities/documents/namespace](src/entities/documents/namespace/README.md)- [src/entities/documents/system-skill](src/entities/documents/system-skill/README.md)+- [src/entities/documents/version](src/entities/documents/version/README.md)- [src/entities/email/attachment](src/entities/email/attachment/README.md)+- [src/entities/email/draft](src/entities/email/draft/README.md)+- [src/entities/email/filter](src/entities/email/filter/README.md)- [src/entities/email/label](src/entities/email/label/README.md)- [src/entities/email/link](src/entities/email/link/README.md)- [src/entities/email/message](src/entities/email/message/README.md)- [src/entities/email/namespace](src/entities/email/namespace/README.md)- [src/entities/email/thread](src/entities/email/thread/README.md)- [src/entities/entity](src/entities/entity/README.md)+- [src/entities/entity-mentions/mention](src/entities/entity-mentions/mention/README.md)+- [src/entities/entity-mentions/namespace](src/entities/entity-mentions/namespace/README.md)- [src/entities/favorites/namespace](src/entities/favorites/namespace/README.md)- [src/entities/foreign/foreign-entity](src/entities/foreign/foreign-entity/README.md)- [src/entities/foreign/namespace](src/entities/foreign/namespace/README.md)@@ -69,6 +87,16 @@- [src/entities/forms/question](src/entities/forms/question/README.md)- [src/entities/forms/response](src/entities/forms/response/README.md)- [src/entities/forms/section](src/entities/forms/section/README.md)+- [src/entities/github-pull-requests/namespace](src/entities/github-pull-requests/namespace/README.md)+- [src/entities/github-pull-requests/pull-request](src/entities/github-pull-requests/pull-request/README.md)+- [src/entities/harnesses/harness](src/entities/harnesses/harness/README.md)+- [src/entities/harnesses/namespace](src/entities/harnesses/namespace/README.md)+- [src/entities/harnesses/pairing](src/entities/harnesses/pairing/README.md)+- [src/entities/initiatives/initiative](src/entities/initiatives/initiative/README.md)+- [src/entities/initiatives/namespace](src/entities/initiatives/namespace/README.md)+- [src/entities/meetings/meeting](src/entities/meetings/meeting/README.md)+- [src/entities/meetings/namespace](src/entities/meetings/namespace/README.md)+- [src/entities/messages/thread](src/entities/messages/thread/README.md)- [src/entities/notifications/namespace](src/entities/notifications/namespace/README.md)- [src/entities/notifications/notification](src/entities/notifications/notification/README.md)- [src/entities/pins/namespace](src/entities/pins/namespace/README.md)@@ -77,11 +105,17 @@- [src/entities/properties/namespace](src/entities/properties/namespace/README.md)- [src/entities/properties/property-definition](src/entities/properties/property-definition/README.md)- [src/entities/properties/property-option](src/entities/properties/property-option/README.md)+- [src/entities/reference](src/entities/reference/README.md)+- [src/entities/routines/namespace](src/entities/routines/namespace/README.md)+- [src/entities/routines/routine](src/entities/routines/routine/README.md)- [src/entities/search](src/entities/search/README.md)+- [src/entities/sharing/access](src/entities/sharing/access/README.md)+- [src/entities/sharing/permissions](src/entities/sharing/permissions/README.md)- [src/entities/tasks/namespace](src/entities/tasks/namespace/README.md)- [src/entities/tasks/task](src/entities/tasks/task/README.md)- [src/entities/teams/namespace](src/entities/teams/namespace/README.md)- [src/entities/teams/team](src/entities/teams/team/README.md)+- [src/entities/unfurls/namespace](src/entities/unfurls/namespace/README.md)- [src/entities/users/namespace](src/entities/users/namespace/README.md)- [src/entities/users/user](src/entities/users/user/README.md)- [src/entities/webhooks/namespace](src/entities/webhooks/namespace/README.md)diff --git a/packages/sdk-docs/reference/src/entities/agent-sessions/agent-session/classes/AgentSession.md b/packages/sdk-docs/reference/src/entities/agent-sessions/agent-session/classes/AgentSession.mdindex 65389c7743..748a38aee1 100644--- a/packages/sdk-docs/reference/src/entities/agent-sessions/agent-session/classes/AgentSession.md+++ b/packages/sdk-docs/reference/src/entities/agent-sessions/agent-session/classes/AgentSession.md@@ -10,6 +10,7 @@ A managed or externally hosted coding-agent session.| Property | Modifier | Type | Description | Inherited from || ------ | ------ | ------ | ------ | ------ |+| <a id="property-access"></a> `access` | `readonly` | [`EntityAccess`](../../../sharing/access/classes/EntityAccess.md) | Access requests and direct user grants. | - || <a id="property-codeexecutions"></a> `codeExecutions` | `readonly` | \{ `byId`: (`id`) => [`CodeExecution`](../../code-execution/classes/CodeExecution.md); \} | Saved code executions scoped to this session. Handle construction makes no request. | - || `codeExecutions.byId` | `public` | (`id`) => [`CodeExecution`](../../code-execution/classes/CodeExecution.md) | - | - || <a id="property-createdat"></a> `createdAt` | `readonly` | () => `Promise`\<`string`\> | When the session was created. | - |@@ -229,6 +230,18 @@ Resize this session's sandbox and remember the size as the owner's default.***+### sharePermissions()++> **sharePermissions**(): `Promise`\<[`SharePermissionV2`](../../../../../generated/agent-harness/types.gen/type-aliases/SharePermissionV2.md)\>++Sharing configuration.++#### Returns++`Promise`\<[`SharePermissionV2`](../../../../../generated/agent-harness/types.gen/type-aliases/SharePermissionV2.md)\>++***+### toJSON()> **toJSON**(): \{ `detail?`: [`AgentSessionResponse`](../../../../../generated/agent-harness/types.gen/type-aliases/AgentSessionResponse.md); `id`: `string`; \}@@ -248,6 +261,24 @@ Resize this session's sandbox and remember the size as the owner's default.***+### toolApprovalById()++> **toolApprovalById**(`id`): [`ToolApproval`](../../tool-approval/classes/ToolApproval.md)++Construct an approval handle scoped to this session.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `id` | `string` |++#### Returns++[`ToolApproval`](../../tool-approval/classes/ToolApproval.md)++***+### unarchive()> **unarchive**(): `Promise`\<`void`\>@@ -279,6 +310,24 @@ request the session's agent opened stays linked.***+### updateSharePermissions()++> **updateSharePermissions**(`options`): `Promise`\<[`SharePermissionV2`](../../../../../generated/agent-harness/types.gen/type-aliases/SharePermissionV2.md)\>++Replace sharing grants.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `options` | [`SharePermissionOptions`](../../../sharing/permissions/type-aliases/SharePermissionOptions.md) |++#### Returns++`Promise`\<[`SharePermissionV2`](../../../../../generated/agent-harness/types.gen/type-aliases/SharePermissionV2.md)\>++***+### byId()> `static` **byId**(`client`, `id`): `AgentSession`diff --git a/packages/sdk-docs/reference/src/entities/agent-sessions/conversation/README.md b/packages/sdk-docs/reference/src/entities/agent-sessions/conversation/README.mdnew file mode 100644index 0000000000..1613fabc43--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/agent-sessions/conversation/README.md@@ -0,0 +1,6 @@+# src/entities/agent-sessions/conversation++## Classes++- [AgentConversation](classes/AgentConversation.md)+- [ConversationTurn](classes/ConversationTurn.md)diff --git a/packages/sdk-docs/reference/src/entities/agent-sessions/conversation/classes/AgentConversation.md b/packages/sdk-docs/reference/src/entities/agent-sessions/conversation/classes/AgentConversation.mdnew file mode 100644index 0000000000..6367280648--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/agent-sessions/conversation/classes/AgentConversation.md@@ -0,0 +1,98 @@+# Class: AgentConversation++An agent's conversation in one channel.++## Constructors++### Constructor++> **new AgentConversation**(`client`, `channel`, `record`): `AgentConversation`++#### Parameters++| Parameter | Type | Description |+| ------ | ------ | ------ |+| `client` | `MacroClient` | - |+| `channel` | [`Channel`](../../../channels/channel/classes/Channel.md) | Parent channel. |+| `record` | [`AgentConversationDto`](../../../../../generated/agent-harness/types.gen/type-aliases/AgentConversationDto.md) | - |++#### Returns++`AgentConversation`++## Properties++| Property | Modifier | Type | Description |+| ------ | ------ | ------ | ------ |+| <a id="property-channel"></a> `channel` | `readonly` | [`Channel`](../../../channels/channel/classes/Channel.md) | Parent channel. |++## Methods++### agent()++> **agent**(): [`Agent`](../../../agents/agent/classes/Agent.md)++The agent taking part.++#### Returns++[`Agent`](../../../agents/agent/classes/Agent.md)++***++### sessions()++> **sessions**(): \{ `createdAt`: `string`; `isCurrent`: `boolean`; `session`: [`AgentSession`](../../agent-session/classes/AgentSession.md); \}[]++Conversation sessions with their current flag.++#### Returns++\{ `createdAt`: `string`; `isCurrent`: `boolean`; `session`: [`AgentSession`](../../agent-session/classes/AgentSession.md); \}[]++***++### startFresh()++> **startFresh**(`session`): `Promise`\<`void`\>++Start a fresh conversation from one of its sessions.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `session` | [`AgentSession`](../../agent-session/classes/AgentSession.md) |++#### Returns++`Promise`\<`void`\>++***++### toJSON()++> **toJSON**(): \{ `agentId`: `string`; `channelId`: `string`; \}++Serialize scoped identity.++#### Returns++\{ `agentId`: `string`; `channelId`: `string`; \}++| Name | Type |+| ------ | ------ |+| `agentId` | `string` |+| `channelId` | `string` |++***++### turns()++> **turns**(): [`ConversationTurn`](ConversationTurn.md)[]++Recorded conversation turns.++#### Returns++[`ConversationTurn`](ConversationTurn.md)[]diff --git a/packages/sdk-docs/reference/src/entities/agent-sessions/conversation/classes/ConversationTurn.md b/packages/sdk-docs/reference/src/entities/agent-sessions/conversation/classes/ConversationTurn.mdnew file mode 100644index 0000000000..021c7dbd57--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/agent-sessions/conversation/classes/ConversationTurn.md@@ -0,0 +1,86 @@+# Class: ConversationTurn++One agent conversation turn, identified by its source message.++## Constructors++### Constructor++> **new ConversationTurn**(`client`, `conversation`, `record`): `ConversationTurn`++#### Parameters++| Parameter | Type | Description |+| ------ | ------ | ------ |+| `client` | `MacroClient` | - |+| `conversation` | [`AgentConversation`](AgentConversation.md) | Parent conversation. |+| `record` | [`AgentConversationTurnDto`](../../../../../generated/agent-harness/types.gen/type-aliases/AgentConversationTurnDto.md) | - |++#### Returns++`ConversationTurn`++## Properties++| Property | Modifier | Type | Description |+| ------ | ------ | ------ | ------ |+| <a id="property-conversation"></a> `conversation` | `readonly` | [`AgentConversation`](AgentConversation.md) | Parent conversation. |++## Methods++### retry()++> **retry**(`actionId`): `Promise`\<`void`\>++Retry with a caller persisted action nonce. Never retries automatically.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `actionId` | `string` |++#### Returns++`Promise`\<`void`\>++***++### session()++> **session**(): [`AgentSession`](../../agent-session/classes/AgentSession.md)++Session that handled this turn.++#### Returns++[`AgentSession`](../../agent-session/classes/AgentSession.md)++***++### source()++> **source**(): [`Message`](../../../channels/message/classes/Message.md)++Originating message.++#### Returns++[`Message`](../../../channels/message/classes/Message.md)++***++### toJSON()++> **toJSON**(): \{ `channelId`: `string`; `sourceMessageId`: `string`; \}++Serialize scoped identity.++#### Returns++\{ `channelId`: `string`; `sourceMessageId`: `string`; \}++| Name | Type |+| ------ | ------ |+| `channelId` | `string` |+| `sourceMessageId` | `string` |diff --git a/packages/sdk-docs/reference/src/entities/agent-sessions/tool-approval/README.md b/packages/sdk-docs/reference/src/entities/agent-sessions/tool-approval/README.mdnew file mode 100644index 0000000000..da689fe307--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/agent-sessions/tool-approval/README.md@@ -0,0 +1,5 @@+# src/entities/agent-sessions/tool-approval++## Classes++- [ToolApproval](classes/ToolApproval.md)diff --git a/packages/sdk-docs/reference/src/entities/agent-sessions/tool-approval/classes/ToolApproval.md b/packages/sdk-docs/reference/src/entities/agent-sessions/tool-approval/classes/ToolApproval.mdnew file mode 100644index 0000000000..eb8c14ab73--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/agent-sessions/tool-approval/classes/ToolApproval.md@@ -0,0 +1,65 @@+# Class: ToolApproval++A permission request scoped to its originating agent session.++## Properties++| Property | Modifier | Type | Description |+| ------ | ------ | ------ | ------ |+| <a id="property-id"></a> `id` | `readonly` | `string` | Approval identity. |+| <a id="property-session"></a> `session` | `readonly` | [`AgentSession`](../../agent-session/classes/AgentSession.md) | Owning session. |++## Methods++### answer()++> **answer**(`answer`): `Promise`\<[`AnswerToolApprovalResponse`](../../../../../generated/agent-harness/types.gen/type-aliases/AnswerToolApprovalResponse.md)\>++Answer the approval using the generated discriminated answer contract.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `answer` | [`ToolApprovalAnswerDto`](../../../../../generated/agent-harness/types.gen/type-aliases/ToolApprovalAnswerDto.md) |++#### Returns++`Promise`\<[`AnswerToolApprovalResponse`](../../../../../generated/agent-harness/types.gen/type-aliases/AnswerToolApprovalResponse.md)\>++***++### toJSON()++> **toJSON**(): \{ `id`: `string`; `sessionId`: `string`; \}++Serialize scoped identity only.++#### Returns++\{ `id`: `string`; `sessionId`: `string`; \}++| Name | Type |+| ------ | ------ |+| `id` | `string` |+| `sessionId` | `string` |++***++### byId()++> `static` **byId**(`client`, `session`, `id`): `ToolApproval`++Construct a scoped approval handle.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `client` | `MacroClient` |+| `session` | [`AgentSession`](../../agent-session/classes/AgentSession.md) |+| `id` | `string` |++#### Returns++`ToolApproval`diff --git a/packages/sdk-docs/reference/src/entities/agents/agent/README.md b/packages/sdk-docs/reference/src/entities/agents/agent/README.mdnew file mode 100644index 0000000000..9cf5d3ebd3--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/agents/agent/README.md@@ -0,0 +1,13 @@+# src/entities/agents/agent++## Classes++- [Agent](classes/Agent.md)++## Type Aliases++- [AgentOptions](type-aliases/AgentOptions.md)++## Functions++- [agentBody](functions/agentBody.md)diff --git a/packages/sdk-docs/reference/src/entities/agents/agent/classes/Agent.md b/packages/sdk-docs/reference/src/entities/agents/agent/classes/Agent.mdnew file mode 100644index 0000000000..4f310d53c4--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/agents/agent/classes/Agent.md@@ -0,0 +1,93 @@+# Class: Agent++A configurable agent backed by a bot identity.++## Extends++- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\<[`Agent`](../../../../../generated/storage/types.gen/type-aliases/Agent.md)\>++## Properties++| Property | Modifier | Type | Description | Inherited from |+| ------ | ------ | ------ | ------ | ------ |+| <a id="property-channels"></a> `channels` | `readonly` | () => `Promise`\<[`Channel`](../../../channels/channel/classes/Channel.md)[]\> | Visible channels. | - |+| <a id="property-defaultmodel"></a> `defaultModel` | `readonly` | () => `Promise`\<`string`\> | Default model. | - |+| <a id="property-host"></a> `host` | `readonly` | () => `Promise`\<[`Harness`](../../../harnesses/harness/classes/Harness.md) \| `undefined`\> | Host running this agent. | - |+| <a id="property-id"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |+| <a id="property-instructions"></a> `instructions` | `readonly` | () => `Promise`\<`string`\> | Agent instructions. | - |+| <a id="property-name"></a> `name` | `readonly` | () => `Promise`\<`string`\> | Display name. | - |++## Methods++### toJSON()++> **toJSON**(): \{ `detail?`: [`Agent`](../../../../../generated/storage/types.gen/type-aliases/Agent.md); `id`: `string`; \}++#### Returns++\{ `detail?`: [`Agent`](../../../../../generated/storage/types.gen/type-aliases/Agent.md); `id`: `string`; \}++| Name | Type |+| ------ | ------ |+| `detail?` | [`Agent`](../../../../../generated/storage/types.gen/type-aliases/Agent.md) |+| `id` | `string` |++#### Inherited from++[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)++***++### update()++> **update**(`options`): `Promise`\<`void`\>++Replace agent settings.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `options` | [`AgentOptions`](../type-aliases/AgentOptions.md) |++#### Returns++`Promise`\<`void`\>++***++### byId()++> `static` **byId**(`client`, `id`): `Agent`++Construct a lazy agent handle.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `client` | `MacroClient` |+| `id` | `string` |++#### Returns++`Agent`++***++### from()++> `static` **from**(`client`, `record`): `Agent`++Seed from a listed or created agent.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `client` | `MacroClient` |+| `record` | [`Agent`](../../../../../generated/storage/types.gen/type-aliases/Agent.md) |++#### Returns++`Agent`diff --git a/packages/sdk-docs/reference/src/entities/agents/agent/functions/agentBody.md b/packages/sdk-docs/reference/src/entities/agents/agent/functions/agentBody.mdnew file mode 100644index 0000000000..e2d1304772--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/agents/agent/functions/agentBody.md@@ -0,0 +1,15 @@+# Function: agentBody()++> **agentBody**(`options`): [`CreateAgentRequest`](../../../../../generated/storage/types.gen/type-aliases/CreateAgentRequest.md)++Convert entity references into the generated agent request.++## Parameters++| Parameter | Type |+| ------ | ------ |+| `options` | [`AgentOptions`](../type-aliases/AgentOptions.md) |++## Returns++[`CreateAgentRequest`](../../../../../generated/storage/types.gen/type-aliases/CreateAgentRequest.md)diff --git a/packages/sdk-docs/reference/src/entities/agents/agent/type-aliases/AgentOptions.md b/packages/sdk-docs/reference/src/entities/agents/agent/type-aliases/AgentOptions.mdnew file mode 100644index 0000000000..023ea1929a--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/agents/agent/type-aliases/AgentOptions.md@@ -0,0 +1,18 @@+# Type Alias: AgentOptions++> **AgentOptions** = `Omit`\<[`CreateAgentRequest`](../../../../../generated/storage/types.gen/type-aliases/CreateAgentRequest.md), `"channel_ids"` \| `"team_id"` \| `"harness_id"` \| `"auto_accept_permissions"` \| `"avatar_url"` \| `"channel_scope"` \| `"default_model"` \| `"is_coding"`\> & \{ `autoAcceptPermissions?`: `boolean`; `avatarUrl?`: `string`; `channels?`: [`Channel`](../../../channels/channel/classes/Channel.md)[]; `channelScope`: [`CreateAgentRequest`](../../../../../generated/storage/types.gen/type-aliases/CreateAgentRequest.md)\[`"channel_scope"`\]; `defaultModel`: `string`; `host?`: [`Harness`](../../../harnesses/harness/classes/Harness.md); `isCoding`: `boolean`; `team?`: [`Team`](../../../teams/team/classes/Team.md); \}++Agent creation and replacement settings.++## Type Declaration++| Name | Type | Description |+| ------ | ------ | ------ |+| `autoAcceptPermissions?` | `boolean` | Whether tool permissions are automatically accepted. |+| `avatarUrl?` | `string` | Avatar URL. |+| `channels?` | [`Channel`](../../../channels/channel/classes/Channel.md)[] | Channels the agent can access. |+| `channelScope` | [`CreateAgentRequest`](../../../../../generated/storage/types.gen/type-aliases/CreateAgentRequest.md)\[`"channel_scope"`\] | Channel visibility policy. |+| `defaultModel` | `string` | Default model. |+| `host?` | [`Harness`](../../../harnesses/harness/classes/Harness.md) | Host running the agent. |+| `isCoding` | `boolean` | Whether this is a coding agent. |+| `team?` | [`Team`](../../../teams/team/classes/Team.md) | Owning team. |diff --git a/packages/sdk-docs/reference/src/entities/agents/namespace/README.md b/packages/sdk-docs/reference/src/entities/agents/namespace/README.mdnew file mode 100644index 0000000000..44a8616ee8--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/agents/namespace/README.md@@ -0,0 +1,5 @@+# src/entities/agents/namespace++## Classes++- [AgentNamespace](classes/AgentNamespace.md)diff --git a/packages/sdk-docs/reference/src/entities/agents/namespace/classes/AgentNamespace.md b/packages/sdk-docs/reference/src/entities/agents/namespace/classes/AgentNamespace.mdnew file mode 100644index 0000000000..cf7c5fcbbb--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/agents/namespace/classes/AgentNamespace.md@@ -0,0 +1,67 @@+# Class: AgentNamespace++Configurable agents.++## Constructors++### Constructor++> **new AgentNamespace**(`client`): `AgentNamespace`++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `client` | `MacroClient` |++#### Returns++`AgentNamespace`++## Methods++### byId()++> **byId**(`id`): [`Agent`](../../agent/classes/Agent.md)++Construct a lazy agent handle.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `id` | `string` |++#### Returns++[`Agent`](../../agent/classes/Agent.md)++***++### create()++> **create**(`options`): `Promise`\<[`Agent`](../../agent/classes/Agent.md)\>++Create an agent.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `options` | [`AgentOptions`](../../agent/type-aliases/AgentOptions.md) |++#### Returns++`Promise`\<[`Agent`](../../agent/classes/Agent.md)\>++***++### list()++> **list**(): `Promise`\<[`Agent`](../../agent/classes/Agent.md)[]\>++All accessible agents.++#### Returns++`Promise`\<[`Agent`](../../agent/classes/Agent.md)[]\>diff --git a/packages/sdk-docs/reference/src/entities/ai/namespace/classes/AiNamespace.md b/packages/sdk-docs/reference/src/entities/ai/namespace/classes/AiNamespace.mdindex d34953bd93..d10fd7a114 100644--- a/packages/sdk-docs/reference/src/entities/ai/namespace/classes/AiNamespace.md+++ b/packages/sdk-docs/reference/src/entities/ai/namespace/classes/AiNamespace.md@@ -56,3 +56,21 @@ actions; always inspect outcome and toolActivity, including interruptions.#### Returns`Promise`\<[`StructuredCompletionResponse`](../../../../../generated/cognition/types.gen/type-aliases/StructuredCompletionResponse.md)\>++***++### usage()++> **usage**(`options?`): `Promise`\<[`UsageSummary`](../../../../../generated/cognition/types.gen/type-aliases/UsageSummary.md)\>++Read AI usage over a time range, optionally restricting it to users.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `options?` | `Omit`\<[`UsageRequest`](../../../../../generated/cognition/types.gen/type-aliases/UsageRequest.md), `"include_users"`\> & \{ `users?`: [`User`](../../../users/user/classes/User.md)[]; \} |++#### Returns++`Promise`\<[`UsageSummary`](../../../../../generated/cognition/types.gen/type-aliases/UsageSummary.md)\>diff --git a/packages/sdk-docs/reference/src/entities/api-keys/api-key/README.md b/packages/sdk-docs/reference/src/entities/api-keys/api-key/README.mdnew file mode 100644index 0000000000..d38634bb37--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/api-keys/api-key/README.md@@ -0,0 +1,5 @@+# src/entities/api-keys/api-key++## Classes++- [UserApiKey](classes/UserApiKey.md)diff --git a/packages/sdk-docs/reference/src/entities/api-keys/api-key/classes/UserApiKey.md b/packages/sdk-docs/reference/src/entities/api-keys/api-key/classes/UserApiKey.mdnew file mode 100644index 0000000000..5f12c2835b--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/api-keys/api-key/classes/UserApiKey.md@@ -0,0 +1,84 @@+# Class: UserApiKey++A user API key's metadata. Secrets are returned only at creation.++## Extends++- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\<[`UserApiKeyInfo`](../../../../../generated/storage/types.gen/type-aliases/UserApiKeyInfo.md)\>++## Properties++| Property | Modifier | Type | Description | Inherited from |+| ------ | ------ | ------ | ------ | ------ |+| <a id="property-createdat"></a> `createdAt` | `readonly` | () => `Promise`\<`string`\> | Creation time. | - |+| <a id="property-id"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |+| <a id="property-name"></a> `name` | `readonly` | () => `Promise`\<`string`\> | Human readable label. | - |++## Methods++### delete()++> **delete**(): `Promise`\<`void`\>++Revoke this key.++#### Returns++`Promise`\<`void`\>++***++### toJSON()++> **toJSON**(): \{ `detail?`: [`UserApiKeyInfo`](../../../../../generated/storage/types.gen/type-aliases/UserApiKeyInfo.md); `id`: `string`; \}++#### Returns++\{ `detail?`: [`UserApiKeyInfo`](../../../../../generated/storage/types.gen/type-aliases/UserApiKeyInfo.md); `id`: `string`; \}++| Name | Type |+| ------ | ------ |+| `detail?` | [`UserApiKeyInfo`](../../../../../generated/storage/types.gen/type-aliases/UserApiKeyInfo.md) |+| `id` | `string` |++#### Inherited from++[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)++***++### byId()++> `static` **byId**(`client`, `id`): `UserApiKey`++Construct a lazy key handle.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `client` | `MacroClient` |+| `id` | `string` |++#### Returns++`UserApiKey`++***++### from()++> `static` **from**(`client`, `record`): `UserApiKey`++Seed from metadata, deliberately excluding the secret.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `client` | `MacroClient` |+| `record` | [`UserApiKeyInfo`](../../../../../generated/storage/types.gen/type-aliases/UserApiKeyInfo.md) |++#### Returns++`UserApiKey`diff --git a/packages/sdk-docs/reference/src/entities/api-keys/namespace/README.md b/packages/sdk-docs/reference/src/entities/api-keys/namespace/README.mdnew file mode 100644index 0000000000..2a83358be1--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/api-keys/namespace/README.md@@ -0,0 +1,5 @@+# src/entities/api-keys/namespace++## Classes++- [ApiKeyNamespace](classes/ApiKeyNamespace.md)diff --git a/packages/sdk-docs/reference/src/entities/api-keys/namespace/classes/ApiKeyNamespace.md b/packages/sdk-docs/reference/src/entities/api-keys/namespace/classes/ApiKeyNamespace.mdnew file mode 100644index 0000000000..e49d9fa650--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/api-keys/namespace/classes/ApiKeyNamespace.md@@ -0,0 +1,85 @@+# Class: ApiKeyNamespace++User API key management.++## Constructors++### Constructor++> **new ApiKeyNamespace**(`client`): `ApiKeyNamespace`++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `client` | `MacroClient` |++#### Returns++`ApiKeyNamespace`++## Methods++### byId()++> **byId**(`id`): [`UserApiKey`](../../api-key/classes/UserApiKey.md)++Construct a lazy key handle.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `id` | `string` |++#### Returns++[`UserApiKey`](../../api-key/classes/UserApiKey.md)++***++### create()++> **create**(`name`): `Promise`\<\{ `key`: [`UserApiKey`](../../api-key/classes/UserApiKey.md); `secret`: `string`; \}\>++Create a key. Save the secret now; it cannot be retrieved later.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `name` | `string` |++#### Returns++`Promise`\<\{ `key`: [`UserApiKey`](../../api-key/classes/UserApiKey.md); `secret`: `string`; \}\>++***++### list()++> **list**(): `Promise`\<[`UserApiKey`](../../api-key/classes/UserApiKey.md)[]\>++List metadata for the caller's API keys.++#### Returns++`Promise`\<[`UserApiKey`](../../api-key/classes/UserApiKey.md)[]\>++***++### tokenForEmail()++> **tokenForEmail**(`email`): `Promise`\<[`MacroApiTokenResponse`](../../../../../generated/auth/types.gen/type-aliases/MacroApiTokenResponse.md)\>++Exchange an email address for a Macro API token, subject to server authorization.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `email` | `string` |++#### Returns++`Promise`\<[`MacroApiTokenResponse`](../../../../../generated/auth/types.gen/type-aliases/MacroApiTokenResponse.md)\>diff --git a/packages/sdk-docs/reference/src/entities/calendar/calendar/classes/Calendar.md b/packages/sdk-docs/reference/src/entities/calendar/calendar/classes/Calendar.mdindex 7e677b399a..3a61e883de 100644--- a/packages/sdk-docs/reference/src/entities/calendar/calendar/classes/Calendar.md+++ b/packages/sdk-docs/reference/src/entities/calendar/calendar/classes/Calendar.md@@ -25,6 +25,24 @@ handle loads its detail by listing the caller's calendars and matching on id.## Methods+### setContributesToAvailability()++> **setContributesToAvailability**(`contributesToAvailability`): `Promise`\<`void`\>++Set whether this calendar contributes to the caller's availability.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `contributesToAvailability` | `boolean` |++#### Returns++`Promise`\<`void`\>++***+### toJSON()> **toJSON**(): \{ `detail?`: [`VisibleCalendar`](../../../../../generated/calendar/types.gen/type-aliases/VisibleCalendar.md); `id`: `string`; \}diff --git a/packages/sdk-docs/reference/src/entities/calendar/namespace/classes/CalendarNamespace.md b/packages/sdk-docs/reference/src/entities/calendar/namespace/classes/CalendarNamespace.mdindex 10c47a9f30..f79811c53e 100644--- a/packages/sdk-docs/reference/src/entities/calendar/namespace/classes/CalendarNamespace.md+++ b/packages/sdk-docs/reference/src/entities/calendar/namespace/classes/CalendarNamespace.md@@ -22,6 +22,18 @@ SDK reaches it on the gateway's `/calendar` route).## Methods+### availabilityCalendars()++> **availabilityCalendars**(): `Promise`\<\{ `calendar`: [`Calendar`](../../calendar/classes/Calendar.md); `contributesToAvailability`: `boolean`; `isPrimary`: `boolean`; `name`: `string`; \}[]\>++Calendar availability settings, each referring to a typed calendar.++#### Returns++`Promise`\<\{ `calendar`: [`Calendar`](../../calendar/classes/Calendar.md); `contributesToAvailability`: `boolean`; `isPrimary`: `boolean`; `name`: `string`; \}[]\>++***+### calendar()> **calendar**(`id`): [`Calendar`](../../calendar/classes/Calendar.md)@@ -88,6 +100,24 @@ A handle to a calendar event by id, for driving mutations.***+### occurrences()++> **occurrences**(`options`): `AsyncGenerator`\<\{ `event`: [`CalendarEvent`](../../event/classes/CalendarEvent.md); `occurrence`: [`CalendarOccurrence`](../../../../../generated/storage/types.gen/type-aliases/CalendarOccurrence.md); \}, `any`, `any`\>++Calendar occurrences in a viewport, automatically paginated.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `options` | `Omit`\<[`ListOccurrencesData`](../../../../../generated/storage/types.gen/type-aliases/ListOccurrencesData.md)\[`"query"`\], `"cursor"`\> |++#### Returns++`AsyncGenerator`\<\{ `event`: [`CalendarEvent`](../../event/classes/CalendarEvent.md); `occurrence`: [`CalendarOccurrence`](../../../../../generated/storage/types.gen/type-aliases/CalendarOccurrence.md); \}, `any`, `any`\>++***+### replacement()> **replacement**(`operationId`): [`CalendarReplacement`](../../replacement/classes/CalendarReplacement.md)@@ -103,3 +133,78 @@ Recover a saved replacement, including after its original event was retired.#### Returns[`CalendarReplacement`](../../replacement/classes/CalendarReplacement.md)++***++### setTeamSharing()++> **setTeamSharing**(`sharing`): `Promise`\<[`TeamCalendarSharing`](../../../../../generated/calendar/types.gen/type-aliases/TeamCalendarSharing.md)\>++Replace the team calendar sharing preference.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `sharing` | [`TeamCalendarSharing`](../../../../../generated/calendar/types.gen/type-aliases/TeamCalendarSharing.md) |++#### Returns++`Promise`\<[`TeamCalendarSharing`](../../../../../generated/calendar/types.gen/type-aliases/TeamCalendarSharing.md)\>++***++### teamOutOfOffice()++> **teamOutOfOffice**(`options`): `Promise`\<\{ `hasMore`: `boolean`; `items`: \{ `event`: [`CalendarEvent`](../../event/classes/CalendarEvent.md); `occurrenceKey`: `string`; `owner`: [`User`](../../../users/user/classes/User.md); `time`: [`EventTime`](../../../../../generated/storage/types.gen/type-aliases/EventTime.md); `title`: `string` \| `undefined`; \}[]; \}\>++Teammates' out-of-office occurrences in a bounded viewport. Check hasMore for truncation.++#### Parameters++| Parameter | Type | Description |+| ------ | ------ | ------ |+| `options` | \{ `end`: `string`; `endDate?`: `string`; `limit?`: `number`; `start`: `string`; `startDate?`: `string`; \} | - |+| `options.end` | `string` | Exclusive UTC viewport end. |+| `options.endDate?` | `string` | Exclusive local date boundary for all-day events. |+| `options.limit?` | `number` | Maximum number of occurrences, from 1 through 2,000. |+| `options.start` | `string` | Inclusive UTC viewport start. |+| `options.startDate?` | `string` | Inclusive local date boundary for all-day events. |++#### Returns++`Promise`\<\{ `hasMore`: `boolean`; `items`: \{ `event`: [`CalendarEvent`](../../event/classes/CalendarEvent.md); `occurrenceKey`: `string`; `owner`: [`User`](../../../users/user/classes/User.md); `time`: [`EventTime`](../../../../../generated/storage/types.gen/type-aliases/EventTime.md); `title`: `string` \| `undefined`; \}[]; \}\>++***++### teamPage()++> **teamPage**(`options`): `Promise`\<\{ `items`: (\{ `contributesToAvailability`: `boolean`; `id`: `string`; `kind`: `"busy"`; `owner`: [`User`](../../../users/user/classes/User.md); `time`: [`EventTime`](../../../../../generated/storage/types.gen/type-aliases/EventTime.md); \} \| \{ `contributesToAvailability`: `boolean`; `details`: [`TeamCalendarDetails`](../../../../../generated/storage/types.gen/type-aliases/TeamCalendarDetails.md); `id`: `string`; `kind`: `"details"`; `owner`: [`User`](../../../users/user/classes/User.md); `time`: [`EventTime`](../../../../../generated/storage/types.gen/type-aliases/EventTime.md); \})[]; `members`: \{ `coverage`: [`TeamCalendarCoverage`](../../../../../generated/storage/types.gen/type-aliases/TeamCalendarCoverage.md); `sharing`: [`TeamCalendarSharing`](../../../../../generated/storage/types.gen/type-aliases/TeamCalendarSharing.md); `user`: [`User`](../../../users/user/classes/User.md); \}[]; `nextCursor`: `string` \| `undefined`; \}\>++A page of team availability, including its roster and continuation cursor.++#### Parameters++| Parameter | Type | Description |+| ------ | ------ | ------ |+| `options` | \{ `cursor?`: `string` \| `null`; `end`: `string`; `limit?`: `number` \| `null`; `start`: `string`; \} | - |+| `options.cursor?` | `string` \| `null` | Continuation returned by the preceding page. |+| `options.end` | `string` | Exclusive instant. |+| `options.limit?` | `number` \| `null` | Maximum source occurrences, at most 2,000. Zero returns the roster only. |+| `options.start` | `string` | Inclusive instant. |++#### Returns++`Promise`\<\{ `items`: (\{ `contributesToAvailability`: `boolean`; `id`: `string`; `kind`: `"busy"`; `owner`: [`User`](../../../users/user/classes/User.md); `time`: [`EventTime`](../../../../../generated/storage/types.gen/type-aliases/EventTime.md); \} \| \{ `contributesToAvailability`: `boolean`; `details`: [`TeamCalendarDetails`](../../../../../generated/storage/types.gen/type-aliases/TeamCalendarDetails.md); `id`: `string`; `kind`: `"details"`; `owner`: [`User`](../../../users/user/classes/User.md); `time`: [`EventTime`](../../../../../generated/storage/types.gen/type-aliases/EventTime.md); \})[]; `members`: \{ `coverage`: [`TeamCalendarCoverage`](../../../../../generated/storage/types.gen/type-aliases/TeamCalendarCoverage.md); `sharing`: [`TeamCalendarSharing`](../../../../../generated/storage/types.gen/type-aliases/TeamCalendarSharing.md); `user`: [`User`](../../../users/user/classes/User.md); \}[]; `nextCursor`: `string` \| `undefined`; \}\>++***++### teamSharing()++> **teamSharing**(): `Promise`\<[`TeamCalendarSharing`](../../../../../generated/calendar/types.gen/type-aliases/TeamCalendarSharing.md)\>++Current sharing preference for the team calendar.++#### Returns++`Promise`\<[`TeamCalendarSharing`](../../../../../generated/calendar/types.gen/type-aliases/TeamCalendarSharing.md)\>diff --git a/packages/sdk-docs/reference/src/entities/calls/call-record/classes/CallRecord.md b/packages/sdk-docs/reference/src/entities/calls/call-record/classes/CallRecord.mdindex 681621b424..405e733cd3 100644--- a/packages/sdk-docs/reference/src/entities/calls/call-record/classes/CallRecord.md+++ b/packages/sdk-docs/reference/src/entities/calls/call-record/classes/CallRecord.md@@ -10,6 +10,7 @@ A Macro call record (an archived or still active call).| Property | Modifier | Type | Default value | Description | Overrides | Inherited from || ------ | ------ | ------ | ------ | ------ | ------ | ------ |+| <a id="property-access"></a> `access` | `readonly` | [`EntityAccess`](../../../sharing/access/classes/EntityAccess.md) | `...` | Access requests and direct user grants. | - | - || <a id="property-channel"></a> `channel` | `readonly` | () => `Promise`\<[`Channel`](../../../channels/channel/classes/Channel.md) \| `undefined`\> | `...` | The channel the call belongs to, if it is a channel call. | - | - || <a id="property-channelname"></a> `channelName` | `readonly` | () => `Promise`\<`string` \| `undefined`\> | `...` | The display name of the channel the call belongs to. | - | - || <a id="property-creator"></a> `creator` | `readonly` | () => `Promise`\<[`User`](../../../users/user/classes/User.md)\> | `...` | The user who started the call. | - | - |@@ -47,6 +48,24 @@ Delete the call record.***+### editTranscript()++> **editTranscript**(`assignments`): `Promise`\<`void`\>++Update custom speaker assignments in the transcript.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `assignments` | [`CustomSpeakerAssignment`](../../../../../generated/storage/types.gen/type-aliases/CustomSpeakerAssignment.md)[] |++#### Returns++`Promise`\<`void`\>++***+### favorite()> **favorite**(): `Promise`\<`CallRecord`\>@@ -65,6 +84,18 @@ entity's own detail, so there's nothing cached to invalidate.***+### meeting()++> **meeting**(): `Promise`\<[`Meeting`](../../../meetings/meeting/classes/Meeting.md)\>++Get or create a shareable meeting for this call.++#### Returns++`Promise`\<[`Meeting`](../../../meetings/meeting/classes/Meeting.md)\>++***+### message()> **message**(`id`): [`CallMessage`](../../message/classes/CallMessage.md)@@ -83,6 +114,40 @@ A message in this call's persistent chat. Fields load on first access.***+### messageThreadById()++> **messageThreadById**(`id`): [`MessageThread`](../../../messages/thread/classes/MessageThread.md)++A shared message thread scoped to this resource.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `id` | `string` |++#### Returns++[`MessageThread`](../../../messages/thread/classes/MessageThread.md)++***++### permission()++> **permission**(): `Promise`\<\{ `permission`: [`EntityPermission`](../../../../../generated/storage/types.gen/type-aliases/EntityPermission.md); `status`: `"access"`; \} \| \{ `status`: `"no_access"`; \}\>++Read the caller's effective permission on this entity.++#### Returns++`Promise`\<\{ `permission`: [`EntityPermission`](../../../../../generated/storage/types.gen/type-aliases/EntityPermission.md); `status`: `"access"`; \} \| \{ `status`: `"no_access"`; \}\>++#### Inherited from++[`FavoritableEntity`](../../../entity/classes/FavoritableEntity.md).[`permission`](../../../entity/classes/FavoritableEntity.md#permission)++***+### rename()> **rename**(`name`): `Promise`\<`void`\>@@ -122,6 +187,36 @@ it and the API answers 403 otherwise.***+### timelinePage()++> **timelinePage**(`selection?`): `Promise`\<\{ `entries`: (\{ `activity`: \{ `action`: `string`; `actor`: [`User`](../../../users/user/classes/User.md); `actor_id`: `string`; `id`: `string`; `occurred_at`: `string`; `payload?`: `unknown`; \}; `message?`: `undefined`; `type`: `"activity"`; \} \| \{ `activity?`: `undefined`; `message`: [`CallMessage`](../../message/classes/CallMessage.md); `type`: `"message"`; \})[]; `nextCursor`: [`MessageCursor`](../../../../../generated/storage/types.gen/type-aliases/MessageCursor.md) \| `undefined`; `previousCursor`: [`MessageCursor`](../../../../../generated/storage/types.gen/type-aliases/MessageCursor.md) \| `undefined`; \}\>++A mixed message and activity timeline page.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `selection?` | [`TimelineOptions`](../../../messages/thread/interfaces/TimelineOptions.md)\<[`CallMessage`](../../message/classes/CallMessage.md)\> |++#### Returns++`Promise`\<\{ `entries`: (\{ `activity`: \{ `action`: `string`; `actor`: [`User`](../../../users/user/classes/User.md); `actor_id`: `string`; `id`: `string`; `occurred_at`: `string`; `payload?`: `unknown`; \}; `message?`: `undefined`; `type`: `"activity"`; \} \| \{ `activity?`: `undefined`; `message`: [`CallMessage`](../../message/classes/CallMessage.md); `type`: `"message"`; \})[]; `nextCursor`: [`MessageCursor`](../../../../../generated/storage/types.gen/type-aliases/MessageCursor.md) \| `undefined`; `previousCursor`: [`MessageCursor`](../../../../../generated/storage/types.gen/type-aliases/MessageCursor.md) \| `undefined`; \}\>++***++### toggleTeamShare()++> **toggleTeamShare**(): `Promise`\<`boolean`\>++Toggle the server's share-with-team setting and return its new value.++#### Returns++`Promise`\<`boolean`\>++***+### toJSON()> **toJSON**(): \{ `detail?`: [`CallRecord`](../../../../../generated/storage/types.gen/type-aliases/CallRecord.md); `id`: `string`; \}diff --git a/packages/sdk-docs/reference/src/entities/channels/activity/README.md b/packages/sdk-docs/reference/src/entities/channels/activity/README.mdnew file mode 100644index 0000000000..cdf7137c13--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/channels/activity/README.md@@ -0,0 +1,5 @@+# src/entities/channels/activity++## Classes++- [ChannelActivity](classes/ChannelActivity.md)diff --git a/packages/sdk-docs/reference/src/entities/channels/activity/classes/ChannelActivity.md b/packages/sdk-docs/reference/src/entities/channels/activity/classes/ChannelActivity.mdnew file mode 100644index 0000000000..18003b7aca--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/channels/activity/classes/ChannelActivity.md@@ -0,0 +1,95 @@+# Class: ChannelActivity++A user's channel activity marker.++## Constructors++### Constructor++> **new ChannelActivity**(`client`, `channel`, `record`): `ChannelActivity`++#### Parameters++| Parameter | Type | Description |+| ------ | ------ | ------ |+| `client` | `MacroClient` | - |+| `channel` | [`Channel`](../../channel/classes/Channel.md) | Related channel. |+| `record` | [`ApiActivity`](../../../../../generated/storage/types.gen/type-aliases/ApiActivity.md) | - |++#### Returns++`ChannelActivity`++## Properties++| Property | Modifier | Type | Description |+| ------ | ------ | ------ | ------ |+| <a id="property-channel"></a> `channel` | `readonly` | [`Channel`](../../channel/classes/Channel.md) | Related channel. |++## Accessors++### id++#### Get Signature++> **get** **id**(): `string`++Activity identity.++##### Returns++`string`++## Methods++### createdAt()++> **createdAt**(): `string`++Creation time.++#### Returns++`string`++***++### recordInteraction()++> **recordInteraction**(`type`): `Promise`\<`ChannelActivity`\>++Record a view or interaction in this channel.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `type` | [`ActivityType`](../../../../../generated/storage/types.gen/type-aliases/ActivityType.md) |++#### Returns++`Promise`\<`ChannelActivity`\>++***++### toJSON()++> **toJSON**(): [`ApiActivity`](../../../../../generated/storage/types.gen/type-aliases/ApiActivity.md)++Serialize activity without credentials.++#### Returns++[`ApiActivity`](../../../../../generated/storage/types.gen/type-aliases/ApiActivity.md)++***++### user()++> **user**(): [`User`](../../../users/user/classes/User.md)++User who interacted.++#### Returns++[`User`](../../../users/user/classes/User.md)diff --git a/packages/sdk-docs/reference/src/entities/channels/channel/classes/Channel.md b/packages/sdk-docs/reference/src/entities/channels/channel/classes/Channel.mdindex baa5574e00..3034c2a39e 100644--- a/packages/sdk-docs/reference/src/entities/channels/channel/classes/Channel.md+++ b/packages/sdk-docs/reference/src/entities/channels/channel/classes/Channel.md@@ -36,6 +36,18 @@ Add users to the channel.***+### agentConversations()++> **agentConversations**(): `Promise`\<[`AgentConversation`](../../../agent-sessions/conversation/classes/AgentConversation.md)[]\>++Conversations maintained by agents in this channel.++#### Returns++`Promise`\<[`AgentConversation`](../../../agent-sessions/conversation/classes/AgentConversation.md)[]\>++***+### attachments()> **attachments**(`opts?`): `AsyncGenerator`\<[`ApiChannelAttachment`](../../../../../generated/storage/types.gen/type-aliases/ApiChannelAttachment.md)\>@@ -202,6 +214,24 @@ first, auto-paginated. Use it to catch up after a disconnect.***+### messageThreadById()++> **messageThreadById**(`id`): [`MessageThread`](../../../messages/thread/classes/MessageThread.md)++A shared message thread scoped to this resource.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `id` | `string` |++#### Returns++[`MessageThread`](../../../messages/thread/classes/MessageThread.md)++***+### participants()> **participants**(): `Promise`\<[`ApiChannelParticipant`](../../../../../generated/storage/types.gen/type-aliases/ApiChannelParticipant.md)[]\>@@ -214,6 +244,22 @@ The channel's members, with their roles and join times.***+### permission()++> **permission**(): `Promise`\<\{ `permission`: [`EntityPermission`](../../../../../generated/storage/types.gen/type-aliases/EntityPermission.md); `status`: `"access"`; \} \| \{ `status`: `"no_access"`; \}\>++Read the caller's effective permission on this entity.++#### Returns++`Promise`\<\{ `permission`: [`EntityPermission`](../../../../../generated/storage/types.gen/type-aliases/EntityPermission.md); `status`: `"access"`; \} \| \{ `status`: `"no_access"`; \}\>++#### Inherited from++[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`permission`](../../../entity/classes/PropertiedEntity.md#permission)++***+### properties()> **properties**(`opts?`): `Promise`\<[`EntityPropertyWithDefinition`](../../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md)[]\>@@ -253,6 +299,24 @@ This entity's reference for bulk property operations.***+### recordActivity()++> **recordActivity**(`type`): `Promise`\<[`ChannelActivity`](../../activity/classes/ChannelActivity.md)\>++Record a view or interaction in this channel.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `type` | [`ActivityType`](../../../../../generated/storage/types.gen/type-aliases/ActivityType.md) |++#### Returns++`Promise`\<[`ChannelActivity`](../../activity/classes/ChannelActivity.md)\>++***+### removeParticipants()> **removeParticipants**(`users`): `Promise`\<`void`\>@@ -312,6 +376,24 @@ Works with a channel webhook token as well as a normal one — see***+### setPicture()++> **setPicture**(`picture?`): `Promise`\<`void`\>++Set an uploaded profile picture, or clear it.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `picture?` | [`ChannelPicture`](../../picture/classes/ChannelPicture.md) |++#### Returns++`Promise`\<`void`\>++***+### setProperty()> **setProperty**(`property`, `value?`): `Promise`\<`void`\>@@ -336,6 +418,24 @@ value when `value` is omitted.***+### timelinePage()++> **timelinePage**(`selection?`): `Promise`\<\{ `entries`: (\{ `activity`: \{ `action`: `string`; `actor`: [`User`](../../../users/user/classes/User.md); `actor_id`: `string`; `id`: `string`; `occurred_at`: `string`; `payload?`: `unknown`; \}; `message?`: `undefined`; `type`: `"activity"`; \} \| \{ `activity?`: `undefined`; `message`: [`Message`](../../message/classes/Message.md); `type`: `"message"`; \})[]; `nextCursor`: [`MessageCursor`](../../../../../generated/storage/types.gen/type-aliases/MessageCursor.md) \| `undefined`; `previousCursor`: [`MessageCursor`](../../../../../generated/storage/types.gen/type-aliases/MessageCursor.md) \| `undefined`; \}\>++A mixed message and activity timeline page.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `selection?` | [`TimelineOptions`](../../../messages/thread/interfaces/TimelineOptions.md)\<[`Message`](../../message/classes/Message.md)\> |++#### Returns++`Promise`\<\{ `entries`: (\{ `activity`: \{ `action`: `string`; `actor`: [`User`](../../../users/user/classes/User.md); `actor_id`: `string`; `id`: `string`; `occurred_at`: `string`; `payload?`: `unknown`; \}; `message?`: `undefined`; `type`: `"activity"`; \} \| \{ `activity?`: `undefined`; `message`: [`Message`](../../message/classes/Message.md); `type`: `"message"`; \})[]; `nextCursor`: [`MessageCursor`](../../../../../generated/storage/types.gen/type-aliases/MessageCursor.md) \| `undefined`; `previousCursor`: [`MessageCursor`](../../../../../generated/storage/types.gen/type-aliases/MessageCursor.md) \| `undefined`; \}\>++***+### toJSON()> **toJSON**(): \{ `detail?`: [`ApiChannelDetail`](../../../../../generated/storage/types.gen/type-aliases/ApiChannelDetail.md); `id`: `string`; \}diff --git a/packages/sdk-docs/reference/src/entities/channels/message/classes/Message.md b/packages/sdk-docs/reference/src/entities/channels/message/classes/Message.mdindex a4ee19ae21..83b089163c 100644--- a/packages/sdk-docs/reference/src/entities/channels/message/classes/Message.md+++ b/packages/sdk-docs/reference/src/entities/channels/message/classes/Message.md@@ -95,6 +95,22 @@ entity's own detail, so there's nothing cached to invalidate.***+### permission()++> **permission**(): `Promise`\<\{ `permission`: [`EntityPermission`](../../../../../generated/storage/types.gen/type-aliases/EntityPermission.md); `status`: `"access"`; \} \| \{ `status`: `"no_access"`; \}\>++Read the caller's effective permission on this entity.++#### Returns++`Promise`\<\{ `permission`: [`EntityPermission`](../../../../../generated/storage/types.gen/type-aliases/EntityPermission.md); `status`: `"access"`; \} \| \{ `status`: `"no_access"`; \}\>++#### Inherited from++[`FavoritableEntity`](../../../entity/classes/FavoritableEntity.md).[`permission`](../../../entity/classes/FavoritableEntity.md#permission)++***+### react()> **react**(`emoji`): `Promise`\<`Message`\>diff --git a/packages/sdk-docs/reference/src/entities/channels/namespace/classes/ChannelNamespace.md b/packages/sdk-docs/reference/src/entities/channels/namespace/classes/ChannelNamespace.mdindex 58e7bc87d6..d450c5927c 100644--- a/packages/sdk-docs/reference/src/entities/channels/namespace/classes/ChannelNamespace.md+++ b/packages/sdk-docs/reference/src/entities/channels/namespace/classes/ChannelNamespace.md@@ -24,6 +24,18 @@## Methods+### activity()++> **activity**(): `Promise`\<[`ChannelActivity`](../../activity/classes/ChannelActivity.md)[]\>++Recent channel activity, with channel and user handles.++#### Returns++`Promise`\<[`ChannelActivity`](../../activity/classes/ChannelActivity.md)[]\>++***+### byId()> **byId**(`id`): [`Channel`](../../channel/classes/Channel.md)diff --git a/packages/sdk-docs/reference/src/entities/channels/picture/README.md b/packages/sdk-docs/reference/src/entities/channels/picture/README.mdnew file mode 100644index 0000000000..10865d3728--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/channels/picture/README.md@@ -0,0 +1,5 @@+# src/entities/channels/picture++## Classes++- [ChannelPicture](classes/ChannelPicture.md)diff --git a/packages/sdk-docs/reference/src/entities/channels/picture/classes/ChannelPicture.md b/packages/sdk-docs/reference/src/entities/channels/picture/classes/ChannelPicture.mdnew file mode 100644index 0000000000..259a0b0cef--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/channels/picture/classes/ChannelPicture.md@@ -0,0 +1,43 @@+# Class: ChannelPicture++An uploaded channel profile picture in static file storage.++## Properties++| Property | Modifier | Type |+| ------ | ------ | ------ |+| <a id="property-id"></a> `id` | `readonly` | `string` |++## Methods++### toJSON()++> **toJSON**(): \{ `id`: `string`; \}++Serialize the uploaded picture reference.++#### Returns++\{ `id`: `string`; \}++| Name | Type |+| ------ | ------ |+| `id` | `string` |++***++### byId()++> `static` **byId**(`id`): `ChannelPicture`++Construct a reference from the upload receipt.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `id` | `string` |++#### Returns++`ChannelPicture`diff --git a/packages/sdk-docs/reference/src/entities/chats/chat/classes/Chat.md b/packages/sdk-docs/reference/src/entities/chats/chat/classes/Chat.mdindex ce73e0fb1b..66288f6e99 100644--- a/packages/sdk-docs/reference/src/entities/chats/chat/classes/Chat.md+++ b/packages/sdk-docs/reference/src/entities/chats/chat/classes/Chat.md@@ -14,6 +14,7 @@ A Macro AI chat.| Property | Modifier | Type | Default value | Description | Overrides | Inherited from || ------ | ------ | ------ | ------ | ------ | ------ | ------ |+| <a id="property-access"></a> `access` | `readonly` | [`EntityAccess`](../../../sharing/access/classes/EntityAccess.md) | `...` | Access requests and direct user grants. | - | - || <a id="property-createdat"></a> `createdAt` | `readonly` | () => `Promise`\<`string` \| `undefined`\> | `...` | When the chat was created. | - | - || <a id="property-entitytype"></a> `entityType` | `readonly` | `"chat"` | `'chat'` | Favorites identify chats as `chat`. | [`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`entityType`](../../../entity/classes/PropertiedEntity.md#property-entitytype) | - || <a id="property-id"></a> `id` | `public readonly` | `string` | `undefined` | - | - | [`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`id`](../../../entity/classes/PropertiedEntity.md#property-id) |@@ -110,6 +111,22 @@ The chat's conversation history: titled records of messages with attachment ids.***+### permission()++> **permission**(): `Promise`\<\{ `permission`: [`EntityPermission`](../../../../../generated/storage/types.gen/type-aliases/EntityPermission.md); `status`: `"access"`; \} \| \{ `status`: `"no_access"`; \}\>++Read the caller's effective permission on this entity.++#### Returns++`Promise`\<\{ `permission`: [`EntityPermission`](../../../../../generated/storage/types.gen/type-aliases/EntityPermission.md); `status`: `"access"`; \} \| \{ `status`: `"no_access"`; \}\>++#### Inherited from++[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`permission`](../../../entity/classes/PropertiedEntity.md#permission)++***+### properties()> **properties**(`opts?`): `Promise`\<[`EntityPropertyWithDefinition`](../../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md)[]\>@@ -179,6 +196,24 @@ Restore a soft-deleted chat.***+### send()++> **send**(`options`): `Promise`\<[`ChatGeneration`](../../generation/classes/ChatGeneration.md)\>++Send a message and start a background generation. Tools may perform writes.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `options` | `Omit`\<[`HttpSendChatMessageRequest`](../../../../../generated/cognition/types.gen/type-aliases/HttpSendChatMessageRequest.md), `"chat_id"` \| `"attachments"` \| `"additional_instructions"`\> & \{ `additionalInstructions?`: `string`; `attachments?`: [`EntityReference`](../../../reference/type-aliases/EntityReference.md)[]; \} |++#### Returns++`Promise`\<[`ChatGeneration`](../../generation/classes/ChatGeneration.md)\>++***+### setProperty()> **setProperty**(`property`, `value?`): `Promise`\<`void`\>diff --git a/packages/sdk-docs/reference/src/entities/chats/generation/README.md b/packages/sdk-docs/reference/src/entities/chats/generation/README.mdnew file mode 100644index 0000000000..95941fe10a--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/chats/generation/README.md@@ -0,0 +1,6 @@+# src/entities/chats/generation++## Classes++- [ChatGeneration](classes/ChatGeneration.md)+- [ChatMessage](classes/ChatMessage.md)diff --git a/packages/sdk-docs/reference/src/entities/chats/generation/classes/ChatGeneration.md b/packages/sdk-docs/reference/src/entities/chats/generation/classes/ChatGeneration.mdnew file mode 100644index 0000000000..d5f0e4c75c--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/chats/generation/classes/ChatGeneration.md@@ -0,0 +1,62 @@+# Class: ChatGeneration++A background chat generation. The stream belongs to exactly one chat.++## Properties++| Property | Modifier | Type | Description |+| ------ | ------ | ------ | ------ |+| <a id="property-chat"></a> `chat` | `readonly` | [`Chat`](../../chat/classes/Chat.md) | Parent chat. |+| <a id="property-id"></a> `id` | `readonly` | `string` | Stream identity. |+| <a id="property-message"></a> `message` | `readonly` | [`ChatMessage`](ChatMessage.md) | AI response message for this generation. |++## Methods++### stop()++> **stop**(): `Promise`\<`void`\>++Request cancellation of this generation.++#### Returns++`Promise`\<`void`\>++***++### toJSON()++> **toJSON**(): \{ `chatId`: `string`; `id`: `string`; `messageId`: `string`; \}++Serialize scoped identity.++#### Returns++\{ `chatId`: `string`; `id`: `string`; `messageId`: `string`; \}++| Name | Type |+| ------ | ------ |+| `chatId` | `string` |+| `id` | `string` |+| `messageId` | `string` |++***++### byId()++> `static` **byId**(`client`, `chat`, `id`, `message`): `ChatGeneration`++Construct from a send receipt.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `client` | `MacroClient` |+| `chat` | [`Chat`](../../chat/classes/Chat.md) |+| `id` | `string` |+| `message` | [`ChatMessage`](ChatMessage.md) |++#### Returns++`ChatGeneration`diff --git a/packages/sdk-docs/reference/src/entities/chats/generation/classes/ChatMessage.md b/packages/sdk-docs/reference/src/entities/chats/generation/classes/ChatMessage.mdnew file mode 100644index 0000000000..19c475d559--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/chats/generation/classes/ChatMessage.md@@ -0,0 +1,70 @@+# Class: ChatMessage++A message scoped to an AI chat.++## Extends++- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\<[`ChatMessageWithAttachments`](../../../../../generated/cognition/types.gen/type-aliases/ChatMessageWithAttachments.md)\>++## Properties++| Property | Modifier | Type | Description | Inherited from |+| ------ | ------ | ------ | ------ | ------ |+| <a id="property-chat"></a> `chat` | `readonly` | [`Chat`](../../chat/classes/Chat.md) | Parent chat. | - |+| <a id="property-content"></a> `content` | `readonly` | () => `Promise`\<[`ChatMessageContent`](../../../../../generated/cognition/types.gen/type-aliases/ChatMessageContent.md)\> | The message's generated content. | - |+| <a id="property-id"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |+| <a id="property-role"></a> `role` | `readonly` | () => `Promise`\<[`Role`](../../../../../generated/cognition/types.gen/type-aliases/Role.md)\> | Role of the message author. | - |++## Methods++### refresh()++> **refresh**(): `Promise`\<`void`\>++Reload after a running generation changes or finishes.++#### Returns++`Promise`\<`void`\>++***++### toJSON()++> **toJSON**(): \{ `chatId`: `string`; `detail?`: [`ChatMessageWithAttachments`](../../../../../generated/cognition/types.gen/type-aliases/ChatMessageWithAttachments.md); `id`: `string`; \}++Serialize scoped identity and any loaded message.++#### Returns++\{ `chatId`: `string`; `detail?`: [`ChatMessageWithAttachments`](../../../../../generated/cognition/types.gen/type-aliases/ChatMessageWithAttachments.md); `id`: `string`; \}++| Name | Type |+| ------ | ------ |+| `chatId` | `string` |+| `detail?` | [`ChatMessageWithAttachments`](../../../../../generated/cognition/types.gen/type-aliases/ChatMessageWithAttachments.md) |+| `id` | `string` |++#### Overrides++[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)++***++### byId()++> `static` **byId**(`client`, `chat`, `id`): `ChatMessage`++Construct a chat message handle.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `client` | `MacroClient` |+| `chat` | [`Chat`](../../chat/classes/Chat.md) |+| `id` | `string` |++#### Returns++`ChatMessage`diff --git a/packages/sdk-docs/reference/src/entities/crm/company/classes/Company.md b/packages/sdk-docs/reference/src/entities/crm/company/classes/Company.mdindex cebd6195aa..cc162abacf 100644--- a/packages/sdk-docs/reference/src/entities/crm/company/classes/Company.md+++ b/packages/sdk-docs/reference/src/entities/crm/company/classes/Company.md@@ -183,6 +183,40 @@ its contacts. Reversible with [unhide](#unhide).***+### messageThreadById()++> **messageThreadById**(`id`): [`MessageThread`](../../../messages/thread/classes/MessageThread.md)++A shared message thread scoped to this resource.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `id` | `string` |++#### Returns++[`MessageThread`](../../../messages/thread/classes/MessageThread.md)++***++### permission()++> **permission**(): `Promise`\<\{ `permission`: [`EntityPermission`](../../../../../generated/storage/types.gen/type-aliases/EntityPermission.md); `status`: `"access"`; \} \| \{ `status`: `"no_access"`; \}\>++Read the caller's effective permission on this entity.++#### Returns++`Promise`\<\{ `permission`: [`EntityPermission`](../../../../../generated/storage/types.gen/type-aliases/EntityPermission.md); `status`: `"access"`; \} \| \{ `status`: `"no_access"`; \}\>++#### Inherited from++[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`permission`](../../../entity/classes/PropertiedEntity.md#permission)++***+### properties()> **properties**(`opts?`): `Promise`\<[`EntityPropertyWithDefinition`](../../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md)[]\>@@ -283,6 +317,24 @@ value when `value` is omitted.***+### timelinePage()++> **timelinePage**(`selection?`): `Promise`\<\{ `entries`: (\{ `activity`: \{ `action`: `string`; `actor`: [`User`](../../../users/user/classes/User.md); `actor_id`: `string`; `id`: `string`; `occurred_at`: `string`; `payload?`: `unknown`; \}; `message?`: `undefined`; `type`: `"activity"`; \} \| \{ `activity?`: `undefined`; `message`: [`CrmComment`](../../comment/classes/CrmComment.md); `type`: `"message"`; \})[]; `nextCursor`: [`MessageCursor`](../../../../../generated/storage/types.gen/type-aliases/MessageCursor.md) \| `undefined`; `previousCursor`: [`MessageCursor`](../../../../../generated/storage/types.gen/type-aliases/MessageCursor.md) \| `undefined`; \}\>++A mixed message and activity timeline page.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `selection?` | [`TimelineOptions`](../../../messages/thread/interfaces/TimelineOptions.md)\<[`CrmComment`](../../comment/classes/CrmComment.md)\> |++#### Returns++`Promise`\<\{ `entries`: (\{ `activity`: \{ `action`: `string`; `actor`: [`User`](../../../users/user/classes/User.md); `actor_id`: `string`; `id`: `string`; `occurred_at`: `string`; `payload?`: `unknown`; \}; `message?`: `undefined`; `type`: `"activity"`; \} \| \{ `activity?`: `undefined`; `message`: [`CrmComment`](../../comment/classes/CrmComment.md); `type`: `"message"`; \})[]; `nextCursor`: [`MessageCursor`](../../../../../generated/storage/types.gen/type-aliases/MessageCursor.md) \| `undefined`; `previousCursor`: [`MessageCursor`](../../../../../generated/storage/types.gen/type-aliases/MessageCursor.md) \| `undefined`; \}\>++***+### toJSON()> **toJSON**(): \{ `detail?`: [`CrmCompanyResponse`](../../../../../generated/storage/types.gen/type-aliases/CrmCompanyResponse.md); `id`: `string`; \}diff --git a/packages/sdk-docs/reference/src/entities/crm/contact/classes/Contact.md b/packages/sdk-docs/reference/src/entities/crm/contact/classes/Contact.mdindex 2814252b0a..f5a457cb9e 100644--- a/packages/sdk-docs/reference/src/entities/crm/contact/classes/Contact.md+++ b/packages/sdk-docs/reference/src/entities/crm/contact/classes/Contact.md@@ -104,6 +104,40 @@ Hide the contact from CRM listings. Display-only; reversible with [unhide](#unhi***+### messageThreadById()++> **messageThreadById**(`id`): [`MessageThread`](../../../messages/thread/classes/MessageThread.md)++A shared message thread scoped to this resource.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `id` | `string` |++#### Returns++[`MessageThread`](../../../messages/thread/classes/MessageThread.md)++***++### permission()++> **permission**(): `Promise`\<\{ `permission`: [`EntityPermission`](../../../../../generated/storage/types.gen/type-aliases/EntityPermission.md); `status`: `"access"`; \} \| \{ `status`: `"no_access"`; \}\>++Read the caller's effective permission on this entity.++#### Returns++`Promise`\<\{ `permission`: [`EntityPermission`](../../../../../generated/storage/types.gen/type-aliases/EntityPermission.md); `status`: `"access"`; \} \| \{ `status`: `"no_access"`; \}\>++#### Inherited from++[`FavoritableEntity`](../../../entity/classes/FavoritableEntity.md).[`permission`](../../../entity/classes/FavoritableEntity.md#permission)++***+### rename()> **rename**(`name`): `Promise`\<`void`\>@@ -122,6 +156,24 @@ Rename the contact for the caller's current team.***+### timelinePage()++> **timelinePage**(`selection?`): `Promise`\<\{ `entries`: (\{ `activity`: \{ `action`: `string`; `actor`: [`User`](../../../users/user/classes/User.md); `actor_id`: `string`; `id`: `string`; `occurred_at`: `string`; `payload?`: `unknown`; \}; `message?`: `undefined`; `type`: `"activity"`; \} \| \{ `activity?`: `undefined`; `message`: [`CrmComment`](../../comment/classes/CrmComment.md); `type`: `"message"`; \})[]; `nextCursor`: [`MessageCursor`](../../../../../generated/storage/types.gen/type-aliases/MessageCursor.md) \| `undefined`; `previousCursor`: [`MessageCursor`](../../../../../generated/storage/types.gen/type-aliases/MessageCursor.md) \| `undefined`; \}\>++A mixed message and activity timeline page.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `selection?` | [`TimelineOptions`](../../../messages/thread/interfaces/TimelineOptions.md)\<[`CrmComment`](../../comment/classes/CrmComment.md)\> |++#### Returns++`Promise`\<\{ `entries`: (\{ `activity`: \{ `action`: `string`; `actor`: [`User`](../../../users/user/classes/User.md); `actor_id`: `string`; `id`: `string`; `occurred_at`: `string`; `payload?`: `unknown`; \}; `message?`: `undefined`; `type`: `"activity"`; \} \| \{ `activity?`: `undefined`; `message`: [`CrmComment`](../../comment/classes/CrmComment.md); `type`: `"message"`; \})[]; `nextCursor`: [`MessageCursor`](../../../../../generated/storage/types.gen/type-aliases/MessageCursor.md) \| `undefined`; `previousCursor`: [`MessageCursor`](../../../../../generated/storage/types.gen/type-aliases/MessageCursor.md) \| `undefined`; \}\>++***+### toJSON()> **toJSON**(): \{ `detail?`: [`CrmContactResponse`](../../../../../generated/storage/types.gen/type-aliases/CrmContactResponse.md); `id`: `string`; \}diff --git a/packages/sdk-docs/reference/src/entities/crm/namespace/classes/CrmNamespace.md b/packages/sdk-docs/reference/src/entities/crm/namespace/classes/CrmNamespace.mdindex 824a394186..2930bcd7c4 100644--- a/packages/sdk-docs/reference/src/entities/crm/namespace/classes/CrmNamespace.md+++ b/packages/sdk-docs/reference/src/entities/crm/namespace/classes/CrmNamespace.md@@ -16,6 +16,12 @@`CrmNamespace`+## Properties++| Property | Modifier | Type | Description |+| ------ | ------ | ------ | ------ |+| <a id="property-pipelines"></a> `pipelines` | `readonly` | [`PipelineNamespace`](../../pipelines/classes/PipelineNamespace.md) | Pipelines, their records and sharing settings. |+## Methods### companyById()diff --git a/packages/sdk-docs/reference/src/entities/crm/pipeline/README.md b/packages/sdk-docs/reference/src/entities/crm/pipeline/README.mdnew file mode 100644index 0000000000..dc1dc5f7f1--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/crm/pipeline/README.md@@ -0,0 +1,8 @@+# src/entities/crm/pipeline++## Classes++- [CrmPipeline](classes/CrmPipeline.md)+- [PipelineColumn](classes/PipelineColumn.md)+- [PipelineRow](classes/PipelineRow.md)+- [PipelineTable](classes/PipelineTable.md)diff --git a/packages/sdk-docs/reference/src/entities/crm/pipeline/classes/CrmPipeline.md b/packages/sdk-docs/reference/src/entities/crm/pipeline/classes/CrmPipeline.mdnew file mode 100644index 0000000000..43fcce59f8--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/crm/pipeline/classes/CrmPipeline.md@@ -0,0 +1,225 @@+# Class: CrmPipeline++A CRM pipeline with its own sharing boundary and backing table.++## Extends++- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\<[`AccessiblePipeline`](../../../../../generated/storage/types.gen/type-aliases/AccessiblePipeline.md)\>++## Properties++| Property | Modifier | Type | Description | Inherited from |+| ------ | ------ | ------ | ------ | ------ |+| <a id="property-accesslevel"></a> `accessLevel` | `readonly` | () => `Promise`\<[`AccessLevel`](../../../../../generated/storage/types.gen/type-aliases/AccessLevel.md)\> | Current caller's access level. | - |+| <a id="property-id"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |+| <a id="property-name"></a> `name` | `readonly` | () => `Promise`\<`string`\> | Display name. | - |+| <a id="property-owner"></a> `owner` | `readonly` | () => `Promise`\<[`User`](../../../users/user/classes/User.md)\> | Owner. | - |+| <a id="property-recordtype"></a> `recordType` | `readonly` | () => `Promise`\<[`PipelineRecordType`](../../../../../generated/storage/types.gen/type-aliases/PipelineRecordType.md)\> | CRM record type. | - |+| <a id="property-sharing"></a> `sharing` | `readonly` | () => `Promise`\<[`PipelineSharing`](../../../../../generated/storage/types.gen/type-aliases/PipelineSharing.md)\> | Sharing scope. | - |+| <a id="property-team"></a> `team` | `readonly` | () => `Promise`\<[`Team`](../../../teams/team/classes/Team.md)\> | Owning team. | - |++## Methods++### applyOps()++> **applyOps**(`ops`, `options?`): `Promise`\<[`AppliedOps`](../../../../../generated/storage/types.gen/type-aliases/AppliedOps.md)\>++Apply an atomic generated database operation batch through this pipeline.+As with Database.applyOps, batch-local UUIDs may name resources minted earlier in the batch.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `ops` | [`DatabaseOp`](../../../../../generated/storage/types.gen/type-aliases/DatabaseOp.md)[] |+| `options?` | \{ `baseVersions?`: \{ `table`: [`PipelineTable`](PipelineTable.md); `version`: `number`; \}[]; \} |+| `options.baseVersions?` | \{ `table`: [`PipelineTable`](PipelineTable.md); `version`: `number`; \}[] |++#### Returns++`Promise`\<[`AppliedOps`](../../../../../generated/storage/types.gen/type-aliases/AppliedOps.md)\>++***++### queryRows()++> **queryRows**(`options?`): `AsyncGenerator`\<[`PipelineRow`](PipelineRow.md)\>++Query pipeline rows, optionally restricting the query to typed row handles.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `options?` | \{ `query?`: [`ViewQuery`](../../../../../generated/storage/types.gen/type-aliases/ViewQuery.md); `rows?`: [`PipelineRow`](PipelineRow.md)[]; \} |+| `options.query?` | [`ViewQuery`](../../../../../generated/storage/types.gen/type-aliases/ViewQuery.md) |+| `options.rows?` | [`PipelineRow`](PipelineRow.md)[] |++#### Returns++`AsyncGenerator`\<[`PipelineRow`](PipelineRow.md)\>++***++### rename()++> **rename**(`name`): `Promise`\<`void`\>++Rename this pipeline.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `name` | `string` |++#### Returns++`Promise`\<`void`\>++***++### rows()++> **rows**(): `AsyncGenerator`\<[`PipelineRow`](PipelineRow.md)\>++Rows in pipeline order, automatically paginated.++#### Returns++`AsyncGenerator`\<[`PipelineRow`](PipelineRow.md)\>++***++### setSharing()++> **setSharing**(`sharing`): `Promise`\<`void`\>++Change its sharing scope.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `sharing` | [`PipelineSharing`](../../../../../generated/storage/types.gen/type-aliases/PipelineSharing.md) \| `undefined` |++#### Returns++`Promise`\<`void`\>++***++### setTrashed()++> **setTrashed**(`trashed`): `Promise`\<`void`\>++Trash or restore the pipeline.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `trashed` | `boolean` |++#### Returns++`Promise`\<`void`\>++***++### sharePermissions()++> **sharePermissions**(): `Promise`\<[`SharePermissionV2`](../../../../../generated/storage/types.gen/type-aliases/SharePermissionV2.md)\>++Read sharing grants.++#### Returns++`Promise`\<[`SharePermissionV2`](../../../../../generated/storage/types.gen/type-aliases/SharePermissionV2.md)\>++***++### table()++> **table**(): `Promise`\<[`PipelineTable`](PipelineTable.md)\>++Read the backing table through the pipeline's authorization boundary.++#### Returns++`Promise`\<[`PipelineTable`](PipelineTable.md)\>++***++### toJSON()++> **toJSON**(): \{ `detail?`: [`AccessiblePipeline`](../../../../../generated/storage/types.gen/type-aliases/AccessiblePipeline.md); `id`: `string`; \}++#### Returns++\{ `detail?`: [`AccessiblePipeline`](../../../../../generated/storage/types.gen/type-aliases/AccessiblePipeline.md); `id`: `string`; \}++| Name | Type |+| ------ | ------ |+| `detail?` | [`AccessiblePipeline`](../../../../../generated/storage/types.gen/type-aliases/AccessiblePipeline.md) |+| `id` | `string` |++#### Inherited from++[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)++***++### updateSharePermissions()++> **updateSharePermissions**(`options`): `Promise`\<[`SharePermissionV2`](../../../../../generated/storage/types.gen/type-aliases/SharePermissionV2.md)\>++Update sharing grants.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `options` | [`SharePermissionOptions`](../../../sharing/permissions/type-aliases/SharePermissionOptions.md) |++#### Returns++`Promise`\<[`SharePermissionV2`](../../../../../generated/storage/types.gen/type-aliases/SharePermissionV2.md)\>++***++### byId()++> `static` **byId**(`client`, `id`): `CrmPipeline`++Construct a lazy pipeline handle.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `client` | `MacroClient` |+| `id` | `string` |++#### Returns++`CrmPipeline`++***++### from()++> `static` **from**(`client`, `record`): `CrmPipeline`++Seed from a server record.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `client` | `MacroClient` |+| `record` | [`AccessiblePipeline`](../../../../../generated/storage/types.gen/type-aliases/AccessiblePipeline.md) |++#### Returns++`CrmPipeline`diff --git a/packages/sdk-docs/reference/src/entities/crm/pipeline/classes/PipelineColumn.md b/packages/sdk-docs/reference/src/entities/crm/pipeline/classes/PipelineColumn.mdnew file mode 100644index 0000000000..fd3ab5e28d--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/crm/pipeline/classes/PipelineColumn.md@@ -0,0 +1,81 @@+# Class: PipelineColumn++A column belonging to a pipeline table.++## Extends++- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\<[`ColumnDetail`](../../../../../generated/storage/types.gen/type-aliases/ColumnDetail.md)\>++## Properties++| Property | Modifier | Type | Description | Inherited from |+| ------ | ------ | ------ | ------ | ------ |+| <a id="property-id"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |+| <a id="property-table"></a> `table` | `readonly` | [`PipelineTable`](PipelineTable.md) | Parent table. | - |++## Methods++### name()++> **name**(): `Promise`\<`string`\>++Current column label.++#### Returns++`Promise`\<`string`\>++***++### toJSON()++> **toJSON**(): \{ `detail?`: [`ColumnDetail`](../../../../../generated/storage/types.gen/type-aliases/ColumnDetail.md); `id`: `string`; `pipelineId`: `string`; `tableId`: `string`; \}++Serialize identity within its pipeline.++#### Returns++\{ `detail?`: [`ColumnDetail`](../../../../../generated/storage/types.gen/type-aliases/ColumnDetail.md); `id`: `string`; `pipelineId`: `string`; `tableId`: `string`; \}++| Name | Type |+| ------ | ------ |+| `detail?` | [`ColumnDetail`](../../../../../generated/storage/types.gen/type-aliases/ColumnDetail.md) |+| `id` | `string` |+| `pipelineId` | `string` |+| `tableId` | `string` |++#### Overrides++[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)++***++### writable()++> **writable**(): `Promise`\<`boolean`\>++Whether the caller can write this column.++#### Returns++`Promise`\<`boolean`\>++***++### from()++> `static` **from**(`client`, `table`, `record`): `PipelineColumn`++Seed a column handle.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `client` | `MacroClient` |+| `table` | [`PipelineTable`](PipelineTable.md) |+| `record` | [`ColumnDetail`](../../../../../generated/storage/types.gen/type-aliases/ColumnDetail.md) |++#### Returns++`PipelineColumn`diff --git a/packages/sdk-docs/reference/src/entities/crm/pipeline/classes/PipelineRow.md b/packages/sdk-docs/reference/src/entities/crm/pipeline/classes/PipelineRow.mdnew file mode 100644index 0000000000..febaf81a80--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/crm/pipeline/classes/PipelineRow.md@@ -0,0 +1,89 @@+# Class: PipelineRow++One pipeline row.++## Extends++- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\<[`StorageRow`](../../../../../generated/storage/types.gen/type-aliases/StorageRow.md)\>++## Properties++| Property | Modifier | Type | Description | Inherited from |+| ------ | ------ | ------ | ------ | ------ |+| <a id="property-cells"></a> `cells` | `readonly` | () => `Promise`\<\{\[`key`: `string`\]: [`PropertyValue`](../../../../../generated/storage/types.gen/type-aliases/PropertyValue.md); \}\> | Values keyed by property definition. | - |+| <a id="property-id"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |+| <a id="property-pipeline"></a> `pipeline` | `readonly` | [`CrmPipeline`](CrmPipeline.md) | Parent pipeline. | - |++## Methods++### refresh()++> **refresh**(): `Promise`\<`void`\>++Reload this row after an operation batch.++#### Returns++`Promise`\<`void`\>++***++### toJSON()++> **toJSON**(): \{ `detail?`: [`StorageRow`](../../../../../generated/storage/types.gen/type-aliases/StorageRow.md); `id`: `string`; `pipelineId`: `string`; \}++Serialize identity within its pipeline.++#### Returns++\{ `detail?`: [`StorageRow`](../../../../../generated/storage/types.gen/type-aliases/StorageRow.md); `id`: `string`; `pipelineId`: `string`; \}++| Name | Type |+| ------ | ------ |+| `detail?` | [`StorageRow`](../../../../../generated/storage/types.gen/type-aliases/StorageRow.md) |+| `id` | `string` |+| `pipelineId` | `string` |++#### Overrides++[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)++***++### byId()++> `static` **byId**(`client`, `pipeline`, `id`): `PipelineRow`++Construct a scoped row handle.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `client` | `MacroClient` |+| `pipeline` | [`CrmPipeline`](CrmPipeline.md) |+| `id` | `string` |++#### Returns++`PipelineRow`++***++### from()++> `static` **from**(`client`, `pipeline`, `record`): `PipelineRow`++Seed a listed row.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `client` | `MacroClient` |+| `pipeline` | [`CrmPipeline`](CrmPipeline.md) |+| `record` | [`StorageRow`](../../../../../generated/storage/types.gen/type-aliases/StorageRow.md) |++#### Returns++`PipelineRow`diff --git a/packages/sdk-docs/reference/src/entities/crm/pipeline/classes/PipelineTable.md b/packages/sdk-docs/reference/src/entities/crm/pipeline/classes/PipelineTable.mdnew file mode 100644index 0000000000..e17c966435--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/crm/pipeline/classes/PipelineTable.md@@ -0,0 +1,110 @@+# Class: PipelineTable++Backing table of a CRM pipeline.++## Extends++- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\<[`TableDetail`](../../../../../generated/storage/types.gen/type-aliases/TableDetail.md)\>++## Properties++| Property | Modifier | Type | Description | Inherited from |+| ------ | ------ | ------ | ------ | ------ |+| <a id="property-id"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |+| <a id="property-pipeline"></a> `pipeline` | `readonly` | [`CrmPipeline`](CrmPipeline.md) | Parent pipeline. | - |++## Methods++### columns()++> **columns**(): `Promise`\<[`PipelineColumn`](PipelineColumn.md)[]\>++Columns in this table.++#### Returns++`Promise`\<[`PipelineColumn`](PipelineColumn.md)[]\>++***++### rowById()++> **rowById**(`id`): [`PipelineRow`](PipelineRow.md)++A scoped row handle.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `id` | `string` |++#### Returns++[`PipelineRow`](PipelineRow.md)++***++### rows()++> **rows**(): `AsyncGenerator`\<[`PipelineRow`](PipelineRow.md)\>++Rows from the authorized pipeline surface.++#### Returns++`AsyncGenerator`\<[`PipelineRow`](PipelineRow.md)\>++***++### toJSON()++> **toJSON**(): \{ `detail?`: [`TableDetail`](../../../../../generated/storage/types.gen/type-aliases/TableDetail.md); `id`: `string`; `pipelineId`: `string`; \}++Serialize identity within its pipeline.++#### Returns++\{ `detail?`: [`TableDetail`](../../../../../generated/storage/types.gen/type-aliases/TableDetail.md); `id`: `string`; `pipelineId`: `string`; \}++| Name | Type |+| ------ | ------ |+| `detail?` | [`TableDetail`](../../../../../generated/storage/types.gen/type-aliases/TableDetail.md) |+| `id` | `string` |+| `pipelineId` | `string` |++#### Overrides++[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)++***++### version()++> **version**(): `Promise`\<`number`\>++Table version for optimistic operation batches.++#### Returns++`Promise`\<`number`\>++***++### from()++> `static` **from**(`client`, `pipeline`, `record`): `PipelineTable`++Seed a table from a pipeline table response.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `client` | `MacroClient` |+| `pipeline` | [`CrmPipeline`](CrmPipeline.md) |+| `record` | [`TableDetail`](../../../../../generated/storage/types.gen/type-aliases/TableDetail.md) |++#### Returns++`PipelineTable`diff --git a/packages/sdk-docs/reference/src/entities/crm/pipelines/README.md b/packages/sdk-docs/reference/src/entities/crm/pipelines/README.mdnew file mode 100644index 0000000000..dde17a425e--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/crm/pipelines/README.md@@ -0,0 +1,5 @@+# src/entities/crm/pipelines++## Classes++- [PipelineNamespace](classes/PipelineNamespace.md)diff --git a/packages/sdk-docs/reference/src/entities/crm/pipelines/classes/PipelineNamespace.md b/packages/sdk-docs/reference/src/entities/crm/pipelines/classes/PipelineNamespace.mdnew file mode 100644index 0000000000..aa4c8129cb--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/crm/pipelines/classes/PipelineNamespace.md@@ -0,0 +1,67 @@+# Class: PipelineNamespace++CRM pipelines in the caller's team.++## Constructors++### Constructor++> **new PipelineNamespace**(`client`): `PipelineNamespace`++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `client` | `MacroClient` |++#### Returns++`PipelineNamespace`++## Methods++### byId()++> **byId**(`id`): [`CrmPipeline`](../../pipeline/classes/CrmPipeline.md)++Construct a lazy pipeline handle.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `id` | `string` |++#### Returns++[`CrmPipeline`](../../pipeline/classes/CrmPipeline.md)++***++### create()++> **create**(`options`): `Promise`\<[`CrmPipeline`](../../pipeline/classes/CrmPipeline.md)\>++Create a pipeline and its backing storage.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `options` | [`CreatePipeline`](../../../../../generated/storage/types.gen/type-aliases/CreatePipeline.md) |++#### Returns++`Promise`\<[`CrmPipeline`](../../pipeline/classes/CrmPipeline.md)\>++***++### list()++> **list**(): `Promise`\<[`CrmPipeline`](../../pipeline/classes/CrmPipeline.md)[]\>++List accessible pipelines.++#### Returns++`Promise`\<[`CrmPipeline`](../../pipeline/classes/CrmPipeline.md)[]\>diff --git a/packages/sdk-docs/reference/src/entities/databases/database/classes/Database.md b/packages/sdk-docs/reference/src/entities/databases/database/classes/Database.mdindex 4d5dec7003..2b7f9db7df 100644--- a/packages/sdk-docs/reference/src/entities/databases/database/classes/Database.md+++ b/packages/sdk-docs/reference/src/entities/databases/database/classes/Database.md@@ -14,6 +14,7 @@ loads lazily on first field access and is dropped after any mutation.| Property | Modifier | Type | Description | Inherited from || ------ | ------ | ------ | ------ | ------ |+| <a id="property-access"></a> `access` | `readonly` | [`EntityAccess`](../../../sharing/access/classes/EntityAccess.md) | Access requests and direct user grants. | - || <a id="property-createdat"></a> `createdAt` | `readonly` | () => `Promise`\<`string`\> | When the database was created. | - || <a id="property-grant"></a> `grant` | `readonly` | () => `Promise`\<[`AccessLevel`](../../../../../generated/storage/types.gen/type-aliases/AccessLevel.md)\> | The caller's access on the database. | - || <a id="property-id"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |@@ -310,6 +311,25 @@ Adopt a first-value type only while the owned column is empty and inferable.***+### query()++> **query**(`sql`, `options?`): `Promise`\<[`DatabaseQueryResult`](../../query/interfaces/DatabaseQueryResult.md)\>++Run one SQL statement with this database as the default name scope.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `sql` | `string` |+| `options?` | `Omit`\<[`DatabaseQueryOptions`](../../query/interfaces/DatabaseQueryOptions.md), `"database"`\> |++#### Returns++`Promise`\<[`DatabaseQueryResult`](../../query/interfaces/DatabaseQueryResult.md)\>++***+### renameColumn()> **renameColumn**(`column`, `name`): `Promise`\<`number`\>diff --git a/packages/sdk-docs/reference/src/entities/databases/namespace/classes/DatabaseNamespace.md b/packages/sdk-docs/reference/src/entities/databases/namespace/classes/DatabaseNamespace.mdindex 4241d3df5f..788c421734 100644--- a/packages/sdk-docs/reference/src/entities/databases/namespace/classes/DatabaseNamespace.md+++ b/packages/sdk-docs/reference/src/entities/databases/namespace/classes/DatabaseNamespace.md@@ -67,3 +67,22 @@ The databases the caller can see.#### Returns`Promise`\<[`Database`](../../database/classes/Database.md)[]\>++***++### query()++> **query**(`sql`, `options?`): `Promise`\<[`DatabaseQueryResult`](../../query/interfaces/DatabaseQueryResult.md)\>++Run one SQL statement over the caller's visible databases. Writes execute once.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `sql` | `string` |+| `options?` | [`DatabaseQueryOptions`](../../query/interfaces/DatabaseQueryOptions.md) |++#### Returns++`Promise`\<[`DatabaseQueryResult`](../../query/interfaces/DatabaseQueryResult.md)\>diff --git a/packages/sdk-docs/reference/src/entities/databases/query/README.md b/packages/sdk-docs/reference/src/entities/databases/query/README.mdnew file mode 100644index 0000000000..8cec8dd30c--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/databases/query/README.md@@ -0,0 +1,13 @@+# src/entities/databases/query++## Interfaces++- [DatabaseQueryOptions](interfaces/DatabaseQueryOptions.md)+- [DatabaseQueryResult](interfaces/DatabaseQueryResult.md)+- [QueryResultSet](interfaces/QueryResultSet.md)+- [QueryTableVersion](interfaces/QueryTableVersion.md)++## Type Aliases++- [QueryColumn](type-aliases/QueryColumn.md)+- [QueryStatement](type-aliases/QueryStatement.md)diff --git a/packages/sdk-docs/reference/src/entities/databases/query/interfaces/DatabaseQueryOptions.md b/packages/sdk-docs/reference/src/entities/databases/query/interfaces/DatabaseQueryOptions.mdnew file mode 100644index 0000000000..a9f7995353--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/databases/query/interfaces/DatabaseQueryOptions.md@@ -0,0 +1,10 @@+# Interface: DatabaseQueryOptions++Scope and optimistic concurrency for one SQL statement.++## Properties++| Property | Type | Description |+| ------ | ------ | ------ |+| <a id="property-baseversions"></a> `baseVersions?` | [`QueryTableVersion`](QueryTableVersion.md)[] | Refuse writes if these tables changed since they were read. |+| <a id="property-database"></a> `database?` | [`Database`](../../database/classes/Database.md) | Default database for unqualified table names; visible databases remain joinable. |diff --git a/packages/sdk-docs/reference/src/entities/databases/query/interfaces/DatabaseQueryResult.md b/packages/sdk-docs/reference/src/entities/databases/query/interfaces/DatabaseQueryResult.mdnew file mode 100644index 0000000000..be7c70d611--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/databases/query/interfaces/DatabaseQueryResult.md@@ -0,0 +1,15 @@+# Interface: DatabaseQueryResult++The committed outcome of one statement; write calls are never automatically retried.++## Properties++| Property | Type | Description |+| ------ | ------ | ------ |+| <a id="property-changesapplied"></a> `changesApplied` | `number` | Number of changes committed by the statement. |+| <a id="property-insertedrows"></a> `insertedRows` | [`DatabaseRow`](../../row/classes/DatabaseRow.md)[] | Handles for newly inserted rows, in insertion order. |+| <a id="property-newversions"></a> `newVersions` | [`QueryTableVersion`](QueryTableVersion.md)[] | Versions of tables after committed writes. |+| <a id="property-readversions"></a> `readVersions` | [`QueryTableVersion`](QueryTableVersion.md)[] | Observed table versions, reusable as guards for a later write. |+| <a id="property-result"></a> `result?` | [`QueryResultSet`](QueryResultSet.md) | Returned result set, when the statement produces one. |+| <a id="property-statement"></a> `statement` | [`QueryStatement`](../type-aliases/QueryStatement.md) | Statement classification with typed handles for its targets. |+| <a id="property-truncatedtables"></a> `truncatedTables` | `string`[] | SQL table names whose input hit the server row cap; aggregates may be partial. |diff --git a/packages/sdk-docs/reference/src/entities/databases/query/interfaces/QueryResultSet.md b/packages/sdk-docs/reference/src/entities/databases/query/interfaces/QueryResultSet.mdnew file mode 100644index 0000000000..d225945a92--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/databases/query/interfaces/QueryResultSet.md@@ -0,0 +1,12 @@+# Interface: QueryResultSet++SQL returns dynamically shaped, discriminated cells and optional source row handles.++## Properties++| Property | Type | Description |+| ------ | ------ | ------ |+| <a id="property-columns"></a> `columns` | [`QueryColumn`](../type-aliases/QueryColumn.md)[] | Ordered metadata corresponding to each cell in a result row. |+| <a id="property-rowhandles"></a> `rowHandles` | [`DatabaseRow`](../../row/classes/DatabaseRow.md)[] | Source row handles in result order; empty for aggregates and virtual tables. |+| <a id="property-rows"></a> `rows` | ([`SqlCell`](../../../../../generated/storage/types.gen/type-aliases/SqlCell.md) \| `null`)[][] | Dynamic tagged cells in column order; empty cells are null. |+| <a id="property-sourcetable"></a> `sourceTable?` | [`DatabaseTable`](../../table/classes/DatabaseTable.md) | Persisted source table when results correspond to individual rows. |diff --git a/packages/sdk-docs/reference/src/entities/databases/query/interfaces/QueryTableVersion.md b/packages/sdk-docs/reference/src/entities/databases/query/interfaces/QueryTableVersion.mdnew file mode 100644index 0000000000..fb07ac4369--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/databases/query/interfaces/QueryTableVersion.md@@ -0,0 +1,10 @@+# Interface: QueryTableVersion++A version observed on a typed table handle, reusable as a write guard.++## Properties++| Property | Type | Description |+| ------ | ------ | ------ |+| <a id="property-table"></a> `table` | [`DatabaseTable`](../../table/classes/DatabaseTable.md) | Table whose version was observed. |+| <a id="property-version"></a> `version` | `number` | Opaque version to pass back as an optimistic write guard. |diff --git a/packages/sdk-docs/reference/src/entities/databases/query/type-aliases/QueryColumn.md b/packages/sdk-docs/reference/src/entities/databases/query/type-aliases/QueryColumn.mdnew file mode 100644index 0000000000..2685a135cb--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/databases/query/type-aliases/QueryColumn.md@@ -0,0 +1,11 @@+# Type Alias: QueryColumn++> **QueryColumn** = `Omit`\<[`ResultColumn`](../../../../../generated/storage/types.gen/type-aliases/ResultColumn.md), `"relatedTable"`\> & \{ `relatedTable?`: [`DatabaseTable`](../../table/classes/DatabaseTable.md); \}++Result column metadata, including a typed relation target when visible.++## Type Declaration++| Name | Type | Description |+| ------ | ------ | ------ |+| `relatedTable?` | [`DatabaseTable`](../../table/classes/DatabaseTable.md) | Visible target table for a relation column. |diff --git a/packages/sdk-docs/reference/src/entities/databases/query/type-aliases/QueryStatement.md b/packages/sdk-docs/reference/src/entities/databases/query/type-aliases/QueryStatement.mdnew file mode 100644index 0000000000..066c9a0a2b--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/databases/query/type-aliases/QueryStatement.md@@ -0,0 +1,48 @@+# Type Alias: QueryStatement++> **QueryStatement** = `Extract`\<[`SqlStatement`](../../../../../generated/storage/types.gen/type-aliases/SqlStatement.md), \{ `kind`: `"select"`; \}\> \| \{ `database`: [`Database`](../../database/classes/Database.md); `kind`: `"schema"`; `summary`: `string`; \} \| \{ `kind`: `"insert"` \| `"update"` \| `"delete"`; `table`: [`DatabaseTable`](../../table/classes/DatabaseTable.md); `tableName`: `string`; \} \| \{ `column`: [`DatabaseColumn`](../../column/classes/DatabaseColumn.md); `columnName`: `string`; `kind`: `"alterColumnType"`; `table`: [`DatabaseTable`](../../table/classes/DatabaseTable.md); `tableName`: `string`; `to`: `string`; \}++What ran, with typed handles for resources written by the statement.++## Union Members++`Extract`\<[`SqlStatement`](../../../../../generated/storage/types.gen/type-aliases/SqlStatement.md), \{ `kind`: `"select"`; \}\>++***++### Type Literal++\{ `database`: [`Database`](../../database/classes/Database.md); `kind`: `"schema"`; `summary`: `string`; \}++| Name | Type | Description |+| ------ | ------ | ------ |+| `database` | [`Database`](../../database/classes/Database.md) | Database whose schema changed. |+| `kind` | `"schema"` | Schema change discriminator. |+| `summary` | `string` | Human-readable description of the schema change. |++***++### Type Literal++\{ `kind`: `"insert"` \| `"update"` \| `"delete"`; `table`: [`DatabaseTable`](../../table/classes/DatabaseTable.md); `tableName`: `string`; \}++| Name | Type | Description |+| ------ | ------ | ------ |+| `kind` | `"insert"` \| `"update"` \| `"delete"` | Row mutation discriminator. |+| `table` | [`DatabaseTable`](../../table/classes/DatabaseTable.md) | Table targeted by the mutation, including zero-match writes. |+| `tableName` | `string` | SQL name of the target table. |++***++### Type Literal++\{ `column`: [`DatabaseColumn`](../../column/classes/DatabaseColumn.md); `columnName`: `string`; `kind`: `"alterColumnType"`; `table`: [`DatabaseTable`](../../table/classes/DatabaseTable.md); `tableName`: `string`; `to`: `string`; \}++| Name | Type | Description |+| ------ | ------ | ------ |+| `column` | [`DatabaseColumn`](../../column/classes/DatabaseColumn.md) | Column whose type changed. |+| `columnName` | `string` | SQL name of the changed column. |+| `kind` | `"alterColumnType"` | Column type change discriminator. |+| `table` | [`DatabaseTable`](../../table/classes/DatabaseTable.md) | Table containing the changed column. |+| `tableName` | `string` | SQL name of the target table. |+| `to` | `string` | SQL type requested by the statement. |diff --git a/packages/sdk-docs/reference/src/entities/documents/anchor/README.md b/packages/sdk-docs/reference/src/entities/documents/anchor/README.mdnew file mode 100644index 0000000000..3d2b3b36ef--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/documents/anchor/README.md@@ -0,0 +1,5 @@+# src/entities/documents/anchor++## Classes++- [DocumentAnchor](classes/DocumentAnchor.md)diff --git a/packages/sdk-docs/reference/src/entities/documents/anchor/classes/DocumentAnchor.md b/packages/sdk-docs/reference/src/entities/documents/anchor/classes/DocumentAnchor.mdnew file mode 100644index 0000000000..d38ecf92b0--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/documents/anchor/classes/DocumentAnchor.md@@ -0,0 +1,108 @@+# Class: DocumentAnchor++A PDF annotation scoped to its document.++## Extends++- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\<[`Anchor`](../../../../../generated/storage/types.gen/type-aliases/Anchor.md)\>++## Properties++| Property | Modifier | Type | Description | Inherited from |+| ------ | ------ | ------ | ------ | ------ |+| <a id="property-document"></a> `document` | `readonly` | [`Document`](../../document/classes/Document.md) | Owning document. | - |+| <a id="property-id"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |+| <a id="property-kind"></a> `kind` | `readonly` | () => `Promise`\<`"highlight"` \| `"placeable"`\> | Annotation kind. | - |+| <a id="property-page"></a> `page` | `readonly` | () => `Promise`\<`number`\> | Page containing the annotation. | - |++## Methods++### delete()++> **delete**(): `Promise`\<`void`\>++Delete a standalone highlight annotation.++#### Returns++`Promise`\<`void`\>++***++### edit()++> **edit**(`options`): `Promise`\<`void`\>++Edit a placeable comment's position and display settings.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `options` | `Omit`\<[`EditPdfPlaceableCommentAnchorRequest`](../../../../../generated/storage/types.gen/type-aliases/EditPdfPlaceableCommentAnchorRequest.md), `"uuid"`\> |++#### Returns++`Promise`\<`void`\>++***++### toJSON()++> **toJSON**(): \{ `detail?`: [`PdfAnchor`](../../../../../generated/storage/types.gen/type-aliases/PdfAnchor.md); `documentId`: `string`; `id`: `string`; \}++Serialize identity with its owning resource.++#### Returns++\{ `detail?`: [`PdfAnchor`](../../../../../generated/storage/types.gen/type-aliases/PdfAnchor.md); `documentId`: `string`; `id`: `string`; \}++| Name | Type |+| ------ | ------ |+| `detail?` | [`PdfAnchor`](../../../../../generated/storage/types.gen/type-aliases/PdfAnchor.md) |+| `documentId` | `string` |+| `id` | `string` |++#### Overrides++[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)++***++### byId()++> `static` **byId**(`client`, `document`, `id`): `DocumentAnchor`++Construct a document scoped annotation handle.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `client` | `MacroClient` |+| `document` | [`Document`](../../document/classes/Document.md) |+| `id` | `string` |++#### Returns++`DocumentAnchor`++***++### from()++> `static` **from**(`client`, `document`, `record`): `DocumentAnchor`++Seed an annotation from a document annotation listing.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `client` | `MacroClient` |+| `document` | [`Document`](../../document/classes/Document.md) |+| `record` | [`PdfAnchor`](../../../../../generated/storage/types.gen/type-aliases/PdfAnchor.md) |++#### Returns++`DocumentAnchor`diff --git a/packages/sdk-docs/reference/src/entities/documents/document/classes/Document.md b/packages/sdk-docs/reference/src/entities/documents/document/classes/Document.mdindex ba402fde76..e18c21a1b9 100644--- a/packages/sdk-docs/reference/src/entities/documents/document/classes/Document.md+++ b/packages/sdk-docs/reference/src/entities/documents/document/classes/Document.md@@ -19,6 +19,7 @@ inline link to the document.| Property | Modifier | Type | Default value | Description | Overrides | Inherited from || ------ | ------ | ------ | ------ | ------ | ------ | ------ |+| <a id="property-access"></a> `access` | `readonly` | [`EntityAccess`](../../../sharing/access/classes/EntityAccess.md) | `...` | Access requests and direct user grants. | - | - || <a id="property-branchedfrom"></a> `branchedFrom` | `readonly` | () => `Promise`\<`Document` \| `undefined`\> | `...` | The document this one was branched from, if any. | - | - || <a id="property-createdat"></a> `createdAt` | `readonly` | () => `Promise`\<`string` \| `undefined`\> | `...` | When the document was created. | - | - || <a id="property-deletedat"></a> `deletedAt` | `readonly` | () => `Promise`\<`string` \| `undefined`\> | `...` | When the document was deleted, if it has been. | - | - |@@ -33,6 +34,18 @@ inline link to the document.## Methods+### anchors()++> **anchors**(): `Promise`\<[`DocumentAnchor`](../../anchor/classes/DocumentAnchor.md)[]\>++PDF annotations in this document.++#### Returns++`Promise`\<[`DocumentAnchor`](../../anchor/classes/DocumentAnchor.md)[]\>++***+### branchName()> **branchName**(): `Promise`\<`string`\>@@ -114,6 +127,24 @@ Returns a handle to the new document.***+### createHighlight()++> **createHighlight**(`options`): `Promise`\<[`DocumentAnchor`](../../anchor/classes/DocumentAnchor.md)\>++Create a standalone PDF highlight.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `options` | `Omit`\<[`PdfHighlightAnchorRequest`](../../../../../generated/storage/types.gen/type-aliases/PdfHighlightAnchorRequest.md), `"uuid"`\> |++#### Returns++`Promise`\<[`DocumentAnchor`](../../anchor/classes/DocumentAnchor.md)\>++***+### delete()> **delete**(`opts?`): `Promise`\<`void`\>@@ -186,6 +217,24 @@ GitHub pull requests associated with the document.***+### messageThreadById()++> **messageThreadById**(`id`): [`MessageThread`](../../../messages/thread/classes/MessageThread.md)++A shared message thread scoped to this resource.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `id` | `string` |++#### Returns++[`MessageThread`](../../../messages/thread/classes/MessageThread.md)++***+### move()> **move**(`project`): `Promise`\<`void`\>@@ -204,6 +253,52 @@ Move the document into a project (or out of one, with `null`).***+### permission()++> **permission**(): `Promise`\<\{ `permission`: [`EntityPermission`](../../../../../generated/storage/types.gen/type-aliases/EntityPermission.md); `status`: `"access"`; \} \| \{ `status`: `"no_access"`; \}\>++Read the caller's effective permission on this entity.++#### Returns++`Promise`\<\{ `permission`: [`EntityPermission`](../../../../../generated/storage/types.gen/type-aliases/EntityPermission.md); `status`: `"access"`; \} \| \{ `status`: `"no_access"`; \}\>++#### Inherited from++[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`permission`](../../../entity/classes/PropertiedEntity.md#permission)++***++### permissionsToken()++> **permissionsToken**(): `Promise`\<`string`\>++Mint a scoped permissions token.++#### Returns++`Promise`\<`string`\>++***++### prepareSave()++> **prepareSave**(`parts`): `Promise`\<[`PreSaveDocumentResponseData`](../../../../../generated/storage/types.gen/type-aliases/PreSaveDocumentResponseData.md)\>++Prepare multipart content saving and return the service's upload instructions.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `parts` | [`SaveBomPart`](../../../../../generated/storage/types.gen/type-aliases/SaveBomPart.md)[] |++#### Returns++`Promise`\<[`PreSaveDocumentResponseData`](../../../../../generated/storage/types.gen/type-aliases/PreSaveDocumentResponseData.md)\>++***+### properties()> **properties**(`opts?`): `Promise`\<[`EntityPropertyWithDefinition`](../../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md)[]\>@@ -273,6 +368,24 @@ Restore a soft-deleted document.***+### save()++> **save**(`options`): `Promise`\<[`SaveDocumentResponseData`](../../../../../generated/storage/types.gen/type-aliases/SaveDocumentResponseData.md)\>++Commit uploaded content. Does not retry uncertain writes.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `options` | [`SaveDocumentRequest`](../../../../../generated/storage/types.gen/type-aliases/SaveDocumentRequest.md) |++#### Returns++`Promise`\<[`SaveDocumentResponseData`](../../../../../generated/storage/types.gen/type-aliases/SaveDocumentResponseData.md)\>++***+### setProperty()> **setProperty**(`property`, `value?`): `Promise`\<`void`\>@@ -315,6 +428,18 @@ Share the document with the owner's team, or unshare it.***+### sharePermissions()++> **sharePermissions**(): `Promise`\<[`SharePermissionV2`](../../../../../generated/storage/types.gen/type-aliases/SharePermissionV2.md)\>++Sharing configuration.++#### Returns++`Promise`\<[`SharePermissionV2`](../../../../../generated/storage/types.gen/type-aliases/SharePermissionV2.md)\>++***+### shortId()> **shortId**(): `Promise`\<`string`\>@@ -327,6 +452,18 @@ The document's short id (used in compact links and branch names).***+### simpleSave()++> **simpleSave**(): `Promise`\<[`SaveDocumentResponseData`](../../../../../generated/storage/types.gen/type-aliases/SaveDocumentResponseData.md)\>++Commit a simple document save.++#### Returns++`Promise`\<[`SaveDocumentResponseData`](../../../../../generated/storage/types.gen/type-aliases/SaveDocumentResponseData.md)\>++***+### teamShare()> **teamShare**(): `Promise`\<[`DocumentTeamShareResponse`](../../../../../generated/storage/types.gen/type-aliases/DocumentTeamShareResponse.md)\>@@ -339,6 +476,24 @@ Whether the document is shared with the owner's team, and which team.***+### timelinePage()++> **timelinePage**(`selection?`): `Promise`\<\{ `entries`: (\{ `activity`: \{ `action`: `string`; `actor`: [`User`](../../../users/user/classes/User.md); `actor_id`: `string`; `id`: `string`; `occurred_at`: `string`; `payload?`: `unknown`; \}; `message?`: `undefined`; `type`: `"activity"`; \} \| \{ `activity?`: `undefined`; `message`: [`Comment`](../../comment/classes/Comment.md); `type`: `"message"`; \})[]; `nextCursor`: [`MessageCursor`](../../../../../generated/storage/types.gen/type-aliases/MessageCursor.md) \| `undefined`; `previousCursor`: [`MessageCursor`](../../../../../generated/storage/types.gen/type-aliases/MessageCursor.md) \| `undefined`; \}\>++A mixed message and activity timeline page.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `selection?` | [`TimelineOptions`](../../../messages/thread/interfaces/TimelineOptions.md)\<[`Comment`](../../comment/classes/Comment.md)\> |++#### Returns++`Promise`\<\{ `entries`: (\{ `activity`: \{ `action`: `string`; `actor`: [`User`](../../../users/user/classes/User.md); `actor_id`: `string`; `id`: `string`; `occurred_at`: `string`; `payload?`: `unknown`; \}; `message?`: `undefined`; `type`: `"activity"`; \} \| \{ `activity?`: `undefined`; `message`: [`Comment`](../../comment/classes/Comment.md); `type`: `"message"`; \})[]; `nextCursor`: [`MessageCursor`](../../../../../generated/storage/types.gen/type-aliases/MessageCursor.md) \| `undefined`; `previousCursor`: [`MessageCursor`](../../../../../generated/storage/types.gen/type-aliases/MessageCursor.md) \| `undefined`; \}\>++***+### toJSON()> **toJSON**(): \{ `detail?`: [`DocumentMetadataWithContent`](../../../../../generated/storage/types.gen/type-aliases/DocumentMetadataWithContent.md); `id`: `string`; \}@@ -410,6 +565,24 @@ Apply multi-select option deltas atomically across this entity's properties.***+### version()++> **version**(`version`): [`DocumentVersion`](../../version/classes/DocumentVersion.md)++A handle to an immutable version.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `version` | `number` |++#### Returns++[`DocumentVersion`](../../version/classes/DocumentVersion.md)++***+### webUrl()> **webUrl**(): `string`diff --git a/packages/sdk-docs/reference/src/entities/documents/namespace/classes/DocumentNamespace.md b/packages/sdk-docs/reference/src/entities/documents/namespace/classes/DocumentNamespace.mdindex 8ba35a926e..67dc0dba3f 100644--- a/packages/sdk-docs/reference/src/entities/documents/namespace/classes/DocumentNamespace.md+++ b/packages/sdk-docs/reference/src/entities/documents/namespace/classes/DocumentNamespace.md@@ -36,6 +36,24 @@ A handle to a document by id. Details load on first access.***+### byTeamSlug()++> **byTeamSlug**(`slug`): `Promise`\<[`Document`](../../document/classes/Document.md)\>++Resolve a team task reference such as ENG-42.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `slug` | `string` |++#### Returns++`Promise`\<[`Document`](../../document/classes/Document.md)\>++***+### create()> **create**(`opts`): `Promise`\<[`Document`](../../document/classes/Document.md)\>@@ -99,6 +117,33 @@ Create a snippet: a reusable markdown document.***+### createUpload()++> **createUpload**(`options`): `Promise`\<\{ `content`: [`DocumentContent`](../../../../../generated/storage/types.gen/type-aliases/DocumentContent.md); `contentType`: `string`; `document`: [`Document`](../../document/classes/Document.md); `uploadUrl`: `string` \| `undefined`; \}\>++Reserve a binary document and return upload instructions. Upload content before saving.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `options` | \{ `attachment?`: [`EmailAttachment`](../../../email/attachment/classes/EmailAttachment.md); `branchedFrom?`: [`Document`](../../document/classes/Document.md); `fileType?`: `string`; `isTask?`: `boolean`; `mimeType?`: `string`; `name`: `string`; `project?`: [`Project`](../../../projects/project/classes/Project.md); `sha`: `string`; `team?`: [`Team`](../../../teams/team/classes/Team.md); \} |+| `options.attachment?` | [`EmailAttachment`](../../../email/attachment/classes/EmailAttachment.md) |+| `options.branchedFrom?` | [`Document`](../../document/classes/Document.md) |+| `options.fileType?` | `string` |+| `options.isTask?` | `boolean` |+| `options.mimeType?` | `string` |+| `options.name` | `string` |+| `options.project?` | [`Project`](../../../projects/project/classes/Project.md) |+| `options.sha` | `string` |+| `options.team?` | [`Team`](../../../teams/team/classes/Team.md) |++#### Returns++`Promise`\<\{ `content`: [`DocumentContent`](../../../../../generated/storage/types.gen/type-aliases/DocumentContent.md); `contentType`: `string`; `document`: [`Document`](../../document/classes/Document.md); `uploadUrl`: `string` \| `undefined`; \}\>++***+### recent()> **recent**(`opts?`): `AsyncGenerator`\<[`Document`](../../document/classes/Document.md)\>@@ -160,3 +205,21 @@ behind them. Unlike user skills they cannot be opened or edited.#### Returns`Promise`\<[`SystemSkill`](../../system-skill/classes/SystemSkill.md)[]\>++***++### validatePermissionsToken()++> **validatePermissionsToken**(`token`): `Promise`\<\{ `accessLevel`: [`AccessLevel`](../../../../../generated/storage/types.gen/type-aliases/AccessLevel.md); `document`: [`Document`](../../document/classes/Document.md); `expiresAt`: `number`; `issuer`: `string`; `user`: [`User`](../../../users/user/classes/User.md) \| `undefined`; \}\>++Validate a permissions token, returning its document and optional user handles.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `token` | `string` |++#### Returns++`Promise`\<\{ `accessLevel`: [`AccessLevel`](../../../../../generated/storage/types.gen/type-aliases/AccessLevel.md); `document`: [`Document`](../../document/classes/Document.md); `expiresAt`: `number`; `issuer`: `string`; `user`: [`User`](../../../users/user/classes/User.md) \| `undefined`; \}\>diff --git a/packages/sdk-docs/reference/src/entities/documents/version/README.md b/packages/sdk-docs/reference/src/entities/documents/version/README.mdnew file mode 100644index 0000000000..13faf902d5--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/documents/version/README.md@@ -0,0 +1,5 @@+# src/entities/documents/version++## Classes++- [DocumentVersion](classes/DocumentVersion.md)diff --git a/packages/sdk-docs/reference/src/entities/documents/version/classes/DocumentVersion.md b/packages/sdk-docs/reference/src/entities/documents/version/classes/DocumentVersion.mdnew file mode 100644index 0000000000..7f12b1fb21--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/documents/version/classes/DocumentVersion.md@@ -0,0 +1,59 @@+# Class: DocumentVersion++An immutable document version, scoped to its document.++## Properties++| Property | Modifier | Type | Description |+| ------ | ------ | ------ | ------ |+| <a id="property-document"></a> `document` | `readonly` | [`Document`](../../document/classes/Document.md) | Parent document. |+| <a id="property-id"></a> `id` | `readonly` | `number` | Version number. |++## Methods++### read()++> **read**(): `Promise`\<[`GetDocumentResponseData`](../../../../../generated/storage/types.gen/type-aliases/GetDocumentResponseData.md)\>++Version metadata and the caller's access.++#### Returns++`Promise`\<[`GetDocumentResponseData`](../../../../../generated/storage/types.gen/type-aliases/GetDocumentResponseData.md)\>++***++### toJSON()++> **toJSON**(): \{ `documentId`: `string`; `id`: `number`; \}++Serialize only scoped identity.++#### Returns++\{ `documentId`: `string`; `id`: `number`; \}++| Name | Type |+| ------ | ------ |+| `documentId` | `string` |+| `id` | `number` |++***++### byId()++> `static` **byId**(`client`, `document`, `id`): `DocumentVersion`++Construct a version handle.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `client` | `MacroClient` |+| `document` | [`Document`](../../document/classes/Document.md) |+| `id` | `number` |++#### Returns++`DocumentVersion`diff --git a/packages/sdk-docs/reference/src/entities/email/draft/README.md b/packages/sdk-docs/reference/src/entities/email/draft/README.mdnew file mode 100644index 0000000000..ff48de81eb--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/email/draft/README.md@@ -0,0 +1,14 @@+# src/entities/email/draft++## Classes++- [DraftAttachment](classes/DraftAttachment.md)+- [EmailDraft](classes/EmailDraft.md)++## Type Aliases++- [DraftOptions](type-aliases/DraftOptions.md)++## Functions++- [draftBody](functions/draftBody.md)diff --git a/packages/sdk-docs/reference/src/entities/email/draft/classes/DraftAttachment.md b/packages/sdk-docs/reference/src/entities/email/draft/classes/DraftAttachment.mdnew file mode 100644index 0000000000..523fe42568--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/email/draft/classes/DraftAttachment.md@@ -0,0 +1,74 @@+# Class: DraftAttachment++An uploaded or forwarded attachment belonging to a draft.++## Properties++| Property | Modifier | Type | Description |+| ------ | ------ | ------ | ------ |+| <a id="property-draft"></a> `draft` | `readonly` | [`EmailDraft`](EmailDraft.md) | Parent draft. |+| <a id="property-forwarded"></a> `forwarded` | `readonly` | `boolean` | Whether this attachment was forwarded. |+| <a id="property-id"></a> `id` | `readonly` | `string` | Attachment identity. |++## Methods++### complete()++> **complete**(): `Promise`\<`void`\>++Complete verification after uploading the file.++#### Returns++`Promise`\<`void`\>++***++### remove()++> **remove**(): `Promise`\<`void`\>++Remove this attachment from its draft.++#### Returns++`Promise`\<`void`\>++***++### toJSON()++> **toJSON**(): \{ `draftId`: `string`; `forwarded`: `boolean`; `id`: `string`; \}++Serialize identity without credentials.++#### Returns++\{ `draftId`: `string`; `forwarded`: `boolean`; `id`: `string`; \}++| Name | Type |+| ------ | ------ |+| `draftId` | `string` |+| `forwarded` | `boolean` |+| `id` | `string` |++***++### byId()++> `static` **byId**(`_client`, `draft`, `id`, `forwarded?`): `DraftAttachment`++Construct a draft scoped attachment handle.++#### Parameters++| Parameter | Type | Default value |+| ------ | ------ | ------ |+| `_client` | `MacroClient` | `undefined` |+| `draft` | [`EmailDraft`](EmailDraft.md) | `undefined` |+| `id` | `string` | `undefined` |+| `forwarded?` | `boolean` | `false` |++#### Returns++`DraftAttachment`diff --git a/packages/sdk-docs/reference/src/entities/email/draft/classes/EmailDraft.md b/packages/sdk-docs/reference/src/entities/email/draft/classes/EmailDraft.mdnew file mode 100644index 0000000000..2b1d6136b3--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/email/draft/classes/EmailDraft.md@@ -0,0 +1,393 @@+# Class: EmailDraft++A draft email. Sending remains an explicit separate operation.++## Extends++- [`EmailMessage`](../../message/classes/EmailMessage.md)++## Properties++| Property | Modifier | Type | Description | Inherited from |+| ------ | ------ | ------ | ------ | ------ |+| <a id="property-bcc"></a> `bcc` | `readonly` | () => `Promise`\<[`ContactInfo`](../../../../../generated/email/types.gen/type-aliases/ContactInfo.md)[]\> | The Bcc recipients. | [`EmailMessage`](../../message/classes/EmailMessage.md).[`bcc`](../../message/classes/EmailMessage.md#property-bcc) |+| <a id="property-body"></a> `body` | `readonly` | () => `Promise`\<`string` \| `undefined`\> | The parsed message body, as the API returns it. | [`EmailMessage`](../../message/classes/EmailMessage.md).[`body`](../../message/classes/EmailMessage.md#property-body) |+| <a id="property-cc"></a> `cc` | `readonly` | () => `Promise`\<[`ContactInfo`](../../../../../generated/email/types.gen/type-aliases/ContactInfo.md)[]\> | The Cc recipients. | [`EmailMessage`](../../message/classes/EmailMessage.md).[`cc`](../../message/classes/EmailMessage.md#property-cc) |+| <a id="property-from"></a> `from` | `readonly` | () => `Promise`\<[`ContactInfo`](../../../../../generated/email/types.gen/type-aliases/ContactInfo.md) \| `undefined`\> | The sender. | [`EmailMessage`](../../message/classes/EmailMessage.md).[`from`](../../message/classes/EmailMessage.md#property-from) |+| <a id="property-id"></a> `id` | `public readonly` | `string` | - | [`EmailMessage`](../../message/classes/EmailMessage.md).[`id`](../../message/classes/EmailMessage.md#property-id) |+| <a id="property-labels"></a> `labels` | `readonly` | () => `Promise`\<[`LabelInfo`](../../../../../generated/email/types.gen/type-aliases/LabelInfo.md)[]\> | Labels on this message. | [`EmailMessage`](../../message/classes/EmailMessage.md).[`labels`](../../message/classes/EmailMessage.md#property-labels) |+| <a id="property-link"></a> `link` | `readonly` | () => `Promise`\<[`Link`](../../link/classes/Link.md)\> | The inbox (email link) this message belongs to. | [`EmailMessage`](../../message/classes/EmailMessage.md).[`link`](../../message/classes/EmailMessage.md#property-link) |+| <a id="property-sentat"></a> `sentAt` | `readonly` | () => `Promise`\<`string` \| `undefined`\> | The provider-internal date of the message. | [`EmailMessage`](../../message/classes/EmailMessage.md).[`sentAt`](../../message/classes/EmailMessage.md#property-sentat) |+| <a id="property-subject"></a> `subject` | `readonly` | () => `Promise`\<`string` \| `undefined`\> | The message's subject line. | [`EmailMessage`](../../message/classes/EmailMessage.md).[`subject`](../../message/classes/EmailMessage.md#property-subject) |+| <a id="property-to"></a> `to` | `readonly` | () => `Promise`\<[`ContactInfo`](../../../../../generated/email/types.gen/type-aliases/ContactInfo.md)[]\> | The To recipients. | [`EmailMessage`](../../message/classes/EmailMessage.md).[`to`](../../message/classes/EmailMessage.md#property-to) |++## Methods++### addAttachment()++> **addAttachment**(`options`): `Promise`\<\{ `attachment`: [`DraftAttachment`](DraftAttachment.md); `contentType`: `string`; `uploadUrl`: `string`; \}\>++Reserve an attachment upload. Upload to the returned URL, then call complete().++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `options` | \{ `fileName`: `string`; `sha`: `string`; `size`: `number`; `uploadId?`: `string`; \} |+| `options.fileName` | `string` |+| `options.sha` | `string` |+| `options.size` | `number` |+| `options.uploadId?` | `string` |++#### Returns++`Promise`\<\{ `attachment`: [`DraftAttachment`](DraftAttachment.md); `contentType`: `string`; `uploadUrl`: `string`; \}\>++***++### addLabel()++> **addLabel**(`label`): `Promise`\<`void`\>++Add a label to this message.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `label` | [`Label`](../../label/classes/Label.md) |++#### Returns++`Promise`\<`void`\>++#### Inherited from++[`EmailMessage`](../../message/classes/EmailMessage.md).[`addLabel`](../../message/classes/EmailMessage.md#addlabel)++***++### completeDraftAttachment()++> **completeDraftAttachment**(`attachmentId`): `Promise`\<`void`\>++Verify an uploaded draft attachment before it can be sent.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `attachmentId` | `string` |++#### Returns++`Promise`\<`void`\>++#### Inherited from++[`EmailMessage`](../../message/classes/EmailMessage.md).[`completeDraftAttachment`](../../message/classes/EmailMessage.md#completedraftattachment)++***++### delete()++> **delete**(): `Promise`\<`void`\>++Delete the draft.++#### Returns++`Promise`\<`void`\>++***++### forwardAttachment()++> **forwardAttachment**(`attachment`): `Promise`\<[`DraftAttachment`](DraftAttachment.md)\>++Forward an existing attachment into this draft.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `attachment` | [`EmailAttachment`](../../attachment/classes/EmailAttachment.md) |++#### Returns++`Promise`\<[`DraftAttachment`](DraftAttachment.md)\>++***++### operationStatus()++> **operationStatus**(): `Promise`\<[`MessageOperationResponse`](../../../../../generated/email/types.gen/type-aliases/MessageOperationResponse.md)\>++Read the draft's durable send, upload, or conflict status without retrying it.++#### Returns++`Promise`\<[`MessageOperationResponse`](../../../../../generated/email/types.gen/type-aliases/MessageOperationResponse.md)\>++#### Inherited from++[`EmailMessage`](../../message/classes/EmailMessage.md).[`operationStatus`](../../message/classes/EmailMessage.md#operationstatus)++***++### removeAttachment()++> **removeAttachment**(`attachment`): `Promise`\<`void`\>++Remove a draft attachment.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `attachment` | [`DraftAttachment`](DraftAttachment.md) |++#### Returns++`Promise`\<`void`\>++***++### removeLabel()++> **removeLabel**(`label`): `Promise`\<`void`\>++Remove a label from this message.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `label` | [`Label`](../../label/classes/Label.md) |++#### Returns++`Promise`\<`void`\>++#### Inherited from++[`EmailMessage`](../../message/classes/EmailMessage.md).[`removeLabel`](../../message/classes/EmailMessage.md#removelabel)++***++### resolveOperation()++> **resolveOperation**(`request`): `Promise`\<`void`\>++Resolve the displayed operation revision after the user chooses an action.+Retrying an uncertain send requires explicit duplicate-risk acceptance.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `request` | [`ResolveMessageOperationRequest`](../../../../../generated/email/types.gen/type-aliases/ResolveMessageOperationRequest.md) |++#### Returns++`Promise`\<`void`\>++#### Inherited from++[`EmailMessage`](../../message/classes/EmailMessage.md).[`resolveOperation`](../../message/classes/EmailMessage.md#resolveoperation)++***++### schedule()++> **schedule**(`sendTime`, `options?`): `Promise`\<`void`\>++Schedule this draft for sending.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `sendTime` | `string` |+| `options?` | \{ `includeSignature?`: `boolean`; \} |+| `options.includeSignature?` | `boolean` |++#### Returns++`Promise`\<`void`\>++***++### thread()++> **thread**(): `Promise`\<[`EmailThread`](../../thread/classes/EmailThread.md)\>++The thread this message belongs to.++#### Returns++`Promise`\<[`EmailThread`](../../thread/classes/EmailThread.md)\>++#### Inherited from++[`EmailMessage`](../../message/classes/EmailMessage.md).[`thread`](../../message/classes/EmailMessage.md#thread)++***++### toJSON()++> **toJSON**(): \{ `detail?`: [`ParsedMessage`](../../../../../generated/email/types.gen/type-aliases/ParsedMessage.md); `id`: `string`; \}++#### Returns++\{ `detail?`: [`ParsedMessage`](../../../../../generated/email/types.gen/type-aliases/ParsedMessage.md); `id`: `string`; \}++| Name | Type |+| ------ | ------ |+| `detail?` | [`ParsedMessage`](../../../../../generated/email/types.gen/type-aliases/ParsedMessage.md) |+| `id` | `string` |++#### Inherited from++[`EmailMessage`](../../message/classes/EmailMessage.md).[`toJSON`](../../message/classes/EmailMessage.md#tojson)++***++### transferDraft()++> **transferDraft**(`request`): `Promise`\<[`TransferDraftResponse`](../../../../../generated/email/types.gen/type-aliases/TransferDraftResponse.md)\>++Move a draft to another inbox using a caller-persisted operation UUID.+Continue editing the returned message_id; the original identity is retired.+On an interrupted response, use email.recoverDraftTransfer(operation_id).++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `request` | [`TransferDraftRequest`](../../../../../generated/email/types.gen/type-aliases/TransferDraftRequest.md) |++#### Returns++`Promise`\<[`TransferDraftResponse`](../../../../../generated/email/types.gen/type-aliases/TransferDraftResponse.md)\>++#### Inherited from++[`EmailMessage`](../../message/classes/EmailMessage.md).[`transferDraft`](../../message/classes/EmailMessage.md#transferdraft)++***++### unschedule()++> **unschedule**(): `Promise`\<`void`\>++Remove a scheduled send.++#### Returns++`Promise`\<`void`\>++***++### update()++> **update**(`options`): `Promise`\<`void`\>++Replace draft content without changing its identity or sending it.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `options` | [`DraftOptions`](../type-aliases/DraftOptions.md) |++#### Returns++`Promise`\<`void`\>++***++### verifyAttachment()++> **verifyAttachment**(`attachment`): `Promise`\<`void`\>++Complete verification of an uploaded attachment.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `attachment` | [`DraftAttachment`](DraftAttachment.md) |++#### Returns++`Promise`\<`void`\>++***++### byId()++> `static` **byId**(`client`, `id`): `EmailDraft`++Construct a lazy draft handle.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `client` | `MacroClient` |+| `id` | `string` |++#### Returns++`EmailDraft`++#### Overrides++[`EmailMessage`](../../message/classes/EmailMessage.md).[`byId`](../../message/classes/EmailMessage.md#byid)++***++### from()++> `static` **from**(`client`, `data`): [`EmailMessage`](../../message/classes/EmailMessage.md)++Build a message from an already-fetched record (pre-seeded, no fetch).++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `client` | `MacroClient` |+| `data` | [`ParsedMessage`](../../../../../generated/email/types.gen/type-aliases/ParsedMessage.md) |++#### Returns++[`EmailMessage`](../../message/classes/EmailMessage.md)++#### Inherited from++[`EmailMessage`](../../message/classes/EmailMessage.md).[`from`](../../message/classes/EmailMessage.md#from)++***++### send()++> `static` **send**(`client`, `opts`): `Promise`\<[`EmailMessage`](../../message/classes/EmailMessage.md) \| `undefined`\>++Send a new email message. Returns a handle when the API reports the created message's id.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `client` | `MacroClient` |+| `opts` | [`SendEmailOptions`](../../message/interfaces/SendEmailOptions.md) |++#### Returns++`Promise`\<[`EmailMessage`](../../message/classes/EmailMessage.md) \| `undefined`\>++#### Inherited from++[`EmailMessage`](../../message/classes/EmailMessage.md).[`send`](../../message/classes/EmailMessage.md#send)diff --git a/packages/sdk-docs/reference/src/entities/email/draft/functions/draftBody.md b/packages/sdk-docs/reference/src/entities/email/draft/functions/draftBody.mdnew file mode 100644index 0000000000..35e35eac93--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/email/draft/functions/draftBody.md@@ -0,0 +1,15 @@+# Function: draftBody()++> **draftBody**(`options`): [`ApiDraftInput`](../../../../../generated/email/types.gen/type-aliases/ApiDraftInput.md)++Translate draft content to the generated contract.++## Parameters++| Parameter | Type |+| ------ | ------ |+| `options` | [`DraftOptions`](../type-aliases/DraftOptions.md) |++## Returns++[`ApiDraftInput`](../../../../../generated/email/types.gen/type-aliases/ApiDraftInput.md)diff --git a/packages/sdk-docs/reference/src/entities/email/draft/type-aliases/DraftOptions.md b/packages/sdk-docs/reference/src/entities/email/draft/type-aliases/DraftOptions.mdnew file mode 100644index 0000000000..b6d0c1bfd0--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/email/draft/type-aliases/DraftOptions.md@@ -0,0 +1,17 @@+# Type Alias: DraftOptions++> **DraftOptions** = `Omit`\<[`ApiDraftInput`](../../../../../generated/email/types.gen/type-aliases/ApiDraftInput.md), `"db_id"` \| `"provider_id"` \| `"provider_thread_id"` \| `"replying_to_id"` \| `"thread_db_id"` \| `"body_text"` \| `"body_html"` \| `"body_macro"` \| `"headers_json"` \| `"include_signature"`\> & \{ `bodyHtml?`: `string`; `bodyMacro?`: `string`; `bodyText?`: `string`; `headers?`: [`ApiDraftInput`](../../../../../generated/email/types.gen/type-aliases/ApiDraftInput.md)\[`"headers_json"`\]; `includeSignature?`: `boolean`; `replyingTo?`: [`EmailMessage`](../../message/classes/EmailMessage.md); `thread?`: [`EmailThread`](../../thread/classes/EmailThread.md); \}++Draft content; relationships use message and thread handles.++## Type Declaration++| Name | Type | Description |+| ------ | ------ | ------ |+| `bodyHtml?` | `string` | HTML body. |+| `bodyMacro?` | `string` | Macro body. |+| `bodyText?` | `string` | Plain text body. |+| `headers?` | [`ApiDraftInput`](../../../../../generated/email/types.gen/type-aliases/ApiDraftInput.md)\[`"headers_json"`\] | Extra headers. |+| `includeSignature?` | `boolean` | Include the inbox signature. |+| `replyingTo?` | [`EmailMessage`](../../message/classes/EmailMessage.md) | Message being replied to. |+| `thread?` | [`EmailThread`](../../thread/classes/EmailThread.md) | Thread receiving this draft. |diff --git a/packages/sdk-docs/reference/src/entities/email/filter/README.md b/packages/sdk-docs/reference/src/entities/email/filter/README.mdnew file mode 100644index 0000000000..b6acfa0734--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/email/filter/README.md@@ -0,0 +1,9 @@+# src/entities/email/filter++## Classes++- [EmailFilter](classes/EmailFilter.md)++## Interfaces++- [EmailFilterOptions](interfaces/EmailFilterOptions.md)diff --git a/packages/sdk-docs/reference/src/entities/email/filter/classes/EmailFilter.md b/packages/sdk-docs/reference/src/entities/email/filter/classes/EmailFilter.mdnew file mode 100644index 0000000000..a16c229500--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/email/filter/classes/EmailFilter.md@@ -0,0 +1,105 @@+# Class: EmailFilter++An importance filter matched by sender address or domain.++## Extends++- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\<[`ApiEmailFilter`](../../../../../generated/email/types.gen/type-aliases/ApiEmailFilter.md)\>++## Properties++| Property | Modifier | Type | Description | Inherited from |+| ------ | ------ | ------ | ------ | ------ |+| <a id="property-emailaddress"></a> `emailAddress` | `readonly` | () => `Promise`\<`string` \| `undefined`\> | Matched address. | - |+| <a id="property-emaildomain"></a> `emailDomain` | `readonly` | () => `Promise`\<`string` \| `undefined`\> | Matched domain. | - |+| <a id="property-id"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |+| <a id="property-isimportant"></a> `isImportant` | `readonly` | () => `Promise`\<`boolean`\> | Importance assigned by this filter. | - |++## Methods++### delete()++> **delete**(): `Promise`\<`void`\>++Delete this filter.++#### Returns++`Promise`\<`void`\>++***++### setImportant()++> **setImportant**(`isImportant`): `Promise`\<`void`\>++Change the importance for the same sender selector.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `isImportant` | `boolean` |++#### Returns++`Promise`\<`void`\>++***++### toJSON()++> **toJSON**(): \{ `detail?`: [`ApiEmailFilter`](../../../../../generated/email/types.gen/type-aliases/ApiEmailFilter.md); `id`: `string`; \}++#### Returns++\{ `detail?`: [`ApiEmailFilter`](../../../../../generated/email/types.gen/type-aliases/ApiEmailFilter.md); `id`: `string`; \}++| Name | Type |+| ------ | ------ |+| `detail?` | [`ApiEmailFilter`](../../../../../generated/email/types.gen/type-aliases/ApiEmailFilter.md) |+| `id` | `string` |++#### Inherited from++[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)++***++### byId()++> `static` **byId**(`client`, `id`, `inbox?`): `EmailFilter`++Construct a lazy filter handle.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `client` | `MacroClient` |+| `id` | `string` |+| `inbox?` | [`Link`](../../link/classes/Link.md) |++#### Returns++`EmailFilter`++***++### from()++> `static` **from**(`client`, `record`, `inbox?`): `EmailFilter`++Seed from a server record.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `client` | `MacroClient` |+| `record` | [`ApiEmailFilter`](../../../../../generated/email/types.gen/type-aliases/ApiEmailFilter.md) |+| `inbox?` | [`Link`](../../link/classes/Link.md) |++#### Returns++`EmailFilter`diff --git a/packages/sdk-docs/reference/src/entities/email/filter/interfaces/EmailFilterOptions.md b/packages/sdk-docs/reference/src/entities/email/filter/interfaces/EmailFilterOptions.mdnew file mode 100644index 0000000000..2542d20686--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/email/filter/interfaces/EmailFilterOptions.md@@ -0,0 +1,11 @@+# Interface: EmailFilterOptions++Sender importance rule.++## Properties++| Property | Type | Description |+| ------ | ------ | ------ |+| <a id="property-emailaddress"></a> `emailAddress?` | `string` | Match an address. |+| <a id="property-emaildomain"></a> `emailDomain?` | `string` | Match a domain. |+| <a id="property-isimportant"></a> `isImportant` | `boolean` | Whether matches are important. |diff --git a/packages/sdk-docs/reference/src/entities/email/message/classes/EmailMessage.md b/packages/sdk-docs/reference/src/entities/email/message/classes/EmailMessage.mdindex 763bfa4439..2ae2cb5fb5 100644--- a/packages/sdk-docs/reference/src/entities/email/message/classes/EmailMessage.md+++ b/packages/sdk-docs/reference/src/entities/email/message/classes/EmailMessage.md@@ -7,6 +7,10 @@ record loads lazily on first field access.- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\<[`EmailMessageData`](../type-aliases/EmailMessageData.md)\>+## Extended by++- [`EmailDraft`](../../draft/classes/EmailDraft.md)+## Properties| Property | Modifier | Type | Description | Inherited from |diff --git a/packages/sdk-docs/reference/src/entities/email/namespace/classes/EmailNamespace.md b/packages/sdk-docs/reference/src/entities/email/namespace/classes/EmailNamespace.mdindex a65980b21f..d2d7beab9f 100644--- a/packages/sdk-docs/reference/src/entities/email/namespace/classes/EmailNamespace.md+++ b/packages/sdk-docs/reference/src/entities/email/namespace/classes/EmailNamespace.md@@ -96,6 +96,37 @@ Providers the server currently permits this caller to connect.***+### contacts()++> **contacts**(): `Promise`\<\{\[`key`: `string`\]: [`ContactInfoWithInteraction`](../../../../../generated/email/types.gen/type-aliases/ContactInfoWithInteraction.md)[]; \}\>++Address book contacts grouped by the service's interaction buckets.++#### Returns++`Promise`\<\{\[`key`: `string`\]: [`ContactInfoWithInteraction`](../../../../../generated/email/types.gen/type-aliases/ContactInfoWithInteraction.md)[]; \}\>++***++### createDraft()++> **createDraft**(`options`, `inbox?`): `Promise`\<[`EmailDraft`](../../draft/classes/EmailDraft.md)\>++Create a draft without sending it; the inbox defaults to the caller's primary.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `options` | [`DraftOptions`](../../draft/type-aliases/DraftOptions.md) |+| `inbox?` | [`Link`](../../link/classes/Link.md) |++#### Returns++`Promise`\<[`EmailDraft`](../../draft/classes/EmailDraft.md)\>++***+### createLabel()> **createLabel**(`name`): `Promise`\<[`Label`](../../label/classes/Label.md)\>@@ -132,6 +163,42 @@ Delete a label.***+### draftById()++> **draftById**(`id`): [`EmailDraft`](../../draft/classes/EmailDraft.md)++Construct a lazy draft handle.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `id` | `string` |++#### Returns++[`EmailDraft`](../../draft/classes/EmailDraft.md)++***++### filters()++> **filters**(`inbox?`): `Promise`\<[`EmailFilter`](../../filter/classes/EmailFilter.md)[]\>++Importance filters.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `inbox?` | [`Link`](../../link/classes/Link.md) |++#### Returns++`Promise`\<[`EmailFilter`](../../filter/classes/EmailFilter.md)[]\>++***+### inbox()> **inbox**(`opts?`): `AsyncGenerator`\<[`EmailThread`](../../thread/classes/EmailThread.md)\>@@ -247,6 +314,44 @@ An empty committed result fences the old move so it cannot commit later.***+### reminders()++> **reminders**(`options?`): `AsyncGenerator`\<\{ `followup`: [`EmailFollowup`](../../../../../generated/storage/types.gen/type-aliases/EmailFollowup.md); `thread`: [`EmailThread`](../../thread/classes/EmailThread.md); \}, `any`, `any`\>++Follow-up reminders with thread handles, automatically paginated.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `options?` | `Omit`\<\{ `attachments?`: `string`[] \| `null`; `calendar?`: `boolean` \| `null`; `cursor?`: `string` \| `null`; `done?`: `boolean` \| `null`; `inboxIds?`: `string`[] \| `null`; `limit?`: `number` \| `null`; `noInboxes?`: `boolean` \| `null`; `read?`: `boolean` \| `null`; `tags?`: `string`[] \| `null`; \}, `"cursor"` \| `"inboxIds"`\> & \{ `inboxes?`: [`Link`](../../link/classes/Link.md)[]; \} |++#### Returns++`AsyncGenerator`\<\{ `followup`: [`EmailFollowup`](../../../../../generated/storage/types.gen/type-aliases/EmailFollowup.md); `thread`: [`EmailThread`](../../thread/classes/EmailThread.md); \}, `any`, `any`\>++***++### scheduled()++> **scheduled**(`options?`): `AsyncGenerator`\<[`EmailDraft`](../../draft/classes/EmailDraft.md)\>++Scheduled drafts, fetched lazily in bounded pages.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `options?` | \{ `inbox?`: [`Link`](../../link/classes/Link.md); `pageSize?`: `number`; \} |+| `options.inbox?` | [`Link`](../../link/classes/Link.md) |+| `options.pageSize?` | `number` |++#### Returns++`AsyncGenerator`\<[`EmailDraft`](../../draft/classes/EmailDraft.md)\>++***+### search()> **search**(`query`, `opts?`): `AsyncGenerator`\<[`EmailThread`](../../thread/classes/EmailThread.md)\>@@ -299,3 +404,22 @@ Unblock a previously blocked sender.#### Returns`Promise`\<`void`\>++***++### upsertFilter()++> **upsertFilter**(`options`, `inbox?`): `Promise`\<[`EmailFilter`](../../filter/classes/EmailFilter.md)\>++Create or replace a filter matching an address or domain.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `options` | [`EmailFilterOptions`](../../filter/interfaces/EmailFilterOptions.md) |+| `inbox?` | [`Link`](../../link/classes/Link.md) |++#### Returns++`Promise`\<[`EmailFilter`](../../filter/classes/EmailFilter.md)\>diff --git a/packages/sdk-docs/reference/src/entities/email/thread/classes/EmailThread.md b/packages/sdk-docs/reference/src/entities/email/thread/classes/EmailThread.mdindex 6cab3b00f8..beacd0bb06 100644--- a/packages/sdk-docs/reference/src/entities/email/thread/classes/EmailThread.md+++ b/packages/sdk-docs/reference/src/entities/email/thread/classes/EmailThread.md@@ -11,6 +11,7 @@ up to the first 100 messages) loads lazily on first field access.| Property | Modifier | Type | Default value | Description | Overrides | Inherited from || ------ | ------ | ------ | ------ | ------ | ------ | ------ |+| <a id="property-access"></a> `access` | `readonly` | [`EntityAccess`](../../../sharing/access/classes/EntityAccess.md) | `...` | Access requests and direct user grants. | - | - || <a id="property-accesslevel"></a> `accessLevel` | `readonly` | () => `Promise`\<[`AccessLevel`](../../../../../generated/email/types.gen/type-aliases/AccessLevel.md)\> | `...` | The viewer's access level to this thread. | - | - || <a id="property-createdat"></a> `createdAt` | `readonly` | () => `Promise`\<`string`\> | `...` | When the thread was created. | - | - || <a id="property-entitytype"></a> `entityType` | `readonly` | `"email_thread"` | `'email_thread'` | Favorites identify email threads as `email_thread`. | [`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`entityType`](../../../entity/classes/PropertiedEntity.md#property-entitytype) | - |@@ -76,6 +77,18 @@ The attachments across this thread's first 100 messages, pre-seeded from the thr***+### calendarInvitations()++> **calendarInvitations**(): `Promise`\<\{\[`key`: `string`\]: [`InvitationResolution`](../../../../../generated/email/types.gen/type-aliases/InvitationResolution.md); \}\>++Calendar invitations resolved from this thread's messages.++#### Returns++`Promise`\<\{\[`key`: `string`\]: [`InvitationResolution`](../../../../../generated/email/types.gen/type-aliases/InvitationResolution.md); \}\>++***+### deleteProperty()> **deleteProperty**(`assignment`): `Promise`\<`void`\>@@ -116,6 +129,18 @@ entity's own detail, so there's nothing cached to invalidate.***+### followup()++> **followup**(): `Promise`\<[`EmailFollowupResponse`](../../../../../generated/storage/types.gen/type-aliases/EmailFollowupResponse.md)\>++Read follow-up state for this thread.++#### Returns++`Promise`\<[`EmailFollowupResponse`](../../../../../generated/storage/types.gen/type-aliases/EmailFollowupResponse.md)\>++***+### markSeen()> **markSeen**(): `Promise`\<`void`\>@@ -191,6 +216,22 @@ Derived from the thread's first 100 messages.***+### permission()++> **permission**(): `Promise`\<\{ `permission`: [`EntityPermission`](../../../../../generated/storage/types.gen/type-aliases/EntityPermission.md); `status`: `"access"`; \} \| \{ `status`: `"no_access"`; \}\>++Read the caller's effective permission on this entity.++#### Returns++`Promise`\<\{ `permission`: [`EntityPermission`](../../../../../generated/storage/types.gen/type-aliases/EntityPermission.md); `status`: `"access"`; \} \| \{ `status`: `"no_access"`; \}\>++#### Inherited from++[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`permission`](../../../entity/classes/PropertiedEntity.md#permission)++***+### properties()> **properties**(`opts?`): `Promise`\<[`EntityPropertyWithDefinition`](../../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md)[]\>@@ -266,6 +307,24 @@ Send a reply within this thread. Returns a handle when the API reports the creat***+### setFollowup()++> **setFollowup**(`command`): `Promise`\<[`EmailFollowup`](../../../../../generated/storage/types.gen/type-aliases/EmailFollowup.md)\>++Set or remove a follow-up using a persisted operation id and revision.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `command` | [`EmailFollowupCommand`](../../../../../generated/storage/types.gen/type-aliases/EmailFollowupCommand.md) |++#### Returns++`Promise`\<[`EmailFollowup`](../../../../../generated/storage/types.gen/type-aliases/EmailFollowup.md)\>++***+### setProperty()> **setProperty**(`property`, `value?`): `Promise`\<`void`\>@@ -337,6 +396,26 @@ Remove this entity from the user's favorites. Returns this handle for chaining.***+### update()++> **update**(`options`): `Promise`\<`void`\>++Change project membership or share permissions for this thread.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `options` | \{ `project?`: [`Project`](../../../projects/project/classes/Project.md) \| `null`; `sharePermission?`: [`SharePermissionOptions`](../../../sharing/permissions/type-aliases/SharePermissionOptions.md); \} |+| `options.project?` | [`Project`](../../../projects/project/classes/Project.md) \| `null` |+| `options.sharePermission?` | [`SharePermissionOptions`](../../../sharing/permissions/type-aliases/SharePermissionOptions.md) |++#### Returns++`Promise`\<`void`\>++***+### updatePropertyOptions()> **updatePropertyOptions**(`changes`): `Promise`\<[`BulkUpdateEntityPropertyOptionsResponse`](../../../../../generated/properties/types.gen/type-aliases/BulkUpdateEntityPropertyOptionsResponse.md)\>diff --git a/packages/sdk-docs/reference/src/entities/entity-mentions/mention/README.md b/packages/sdk-docs/reference/src/entities/entity-mentions/mention/README.mdnew file mode 100644index 0000000000..16a25f0658--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/entity-mentions/mention/README.md@@ -0,0 +1,5 @@+# src/entities/entity-mentions/mention++## Classes++- [EntityMention](classes/EntityMention.md)diff --git a/packages/sdk-docs/reference/src/entities/entity-mentions/mention/classes/EntityMention.md b/packages/sdk-docs/reference/src/entities/entity-mentions/mention/classes/EntityMention.mdnew file mode 100644index 0000000000..930e0b681e--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/entity-mentions/mention/classes/EntityMention.md@@ -0,0 +1,56 @@+# Class: EntityMention++A stored mention connecting two resources.++## Properties++| Property | Modifier | Type | Description |+| ------ | ------ | ------ | ------ |+| <a id="property-id"></a> `id` | `readonly` | `string` | Mention identity. |++## Methods++### delete()++> **delete**(): `Promise`\<`void`\>++Remove this mention.++#### Returns++`Promise`\<`void`\>++***++### toJSON()++> **toJSON**(): \{ `id`: `string`; \}++Serialize identity only.++#### Returns++\{ `id`: `string`; \}++| Name | Type |+| ------ | ------ |+| `id` | `string` |++***++### byId()++> `static` **byId**(`client`, `id`): `EntityMention`++Construct a mention handle for removal.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `client` | `MacroClient` |+| `id` | `string` |++#### Returns++`EntityMention`diff --git a/packages/sdk-docs/reference/src/entities/entity-mentions/namespace/README.md b/packages/sdk-docs/reference/src/entities/entity-mentions/namespace/README.mdnew file mode 100644index 0000000000..50d60acd62--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/entity-mentions/namespace/README.md@@ -0,0 +1,5 @@+# src/entities/entity-mentions/namespace++## Classes++- [EntityMentionNamespace](classes/EntityMentionNamespace.md)diff --git a/packages/sdk-docs/reference/src/entities/entity-mentions/namespace/classes/EntityMentionNamespace.md b/packages/sdk-docs/reference/src/entities/entity-mentions/namespace/classes/EntityMentionNamespace.mdnew file mode 100644index 0000000000..ce926c3047--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/entity-mentions/namespace/classes/EntityMentionNamespace.md@@ -0,0 +1,56 @@+# Class: EntityMentionNamespace++Stored entity mention relationships.++## Constructors++### Constructor++> **new EntityMentionNamespace**(`client`): `EntityMentionNamespace`++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `client` | `MacroClient` |++#### Returns++`EntityMentionNamespace`++## Methods++### byId()++> **byId**(`id`): [`EntityMention`](../../mention/classes/EntityMention.md)++Construct a stored mention handle.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `id` | `string` |++#### Returns++[`EntityMention`](../../mention/classes/EntityMention.md)++***++### create()++> **create**(`source`, `target`): `Promise`\<[`EntityMention`](../../mention/classes/EntityMention.md)\>++Create a mention from a source resource to a target resource.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `source` | [`EntityReference`](../../../reference/type-aliases/EntityReference.md) |+| `target` | [`EntityReference`](../../../reference/type-aliases/EntityReference.md) |++#### Returns++`Promise`\<[`EntityMention`](../../mention/classes/EntityMention.md)\>diff --git a/packages/sdk-docs/reference/src/entities/entity/classes/FavoritableEntity.md b/packages/sdk-docs/reference/src/entities/entity/classes/FavoritableEntity.mdindex ca27f43d8b..a4b63d35f2 100644--- a/packages/sdk-docs/reference/src/entities/entity/classes/FavoritableEntity.md+++ b/packages/sdk-docs/reference/src/entities/entity/classes/FavoritableEntity.md@@ -51,6 +51,18 @@ entity's own detail, so there's nothing cached to invalidate.***+### permission()++> **permission**(): `Promise`\<\{ `permission`: [`EntityPermission`](../../../../generated/storage/types.gen/type-aliases/EntityPermission.md); `status`: `"access"`; \} \| \{ `status`: `"no_access"`; \}\>++Read the caller's effective permission on this entity.++#### Returns++`Promise`\<\{ `permission`: [`EntityPermission`](../../../../generated/storage/types.gen/type-aliases/EntityPermission.md); `status`: `"access"`; \} \| \{ `status`: `"no_access"`; \}\>++***+### toJSON()> **toJSON**(): \{ `detail?`: `Detail`; `id`: `string`; \}diff --git a/packages/sdk-docs/reference/src/entities/entity/classes/MacroEntity.md b/packages/sdk-docs/reference/src/entities/entity/classes/MacroEntity.mdindex 7b1bd0f9f9..ea5156d82a 100644--- a/packages/sdk-docs/reference/src/entities/entity/classes/MacroEntity.md+++ b/packages/sdk-docs/reference/src/entities/entity/classes/MacroEntity.md@@ -10,19 +10,36 @@ field and mutate.- [`AgentSession`](../../agent-sessions/agent-session/classes/AgentSession.md)- [`CodeExecution`](../../agent-sessions/code-execution/classes/CodeExecution.md)- [`SessionReview`](../../agent-sessions/review/classes/SessionReview.md)+- [`Agent`](../../agents/agent/classes/Agent.md)+- [`UserApiKey`](../../api-keys/api-key/classes/UserApiKey.md)- [`Calendar`](../../calendar/calendar/classes/Calendar.md)- [`CalendarEvent`](../../calendar/event/classes/CalendarEvent.md)- [`CallMessage`](../../calls/message/classes/CallMessage.md)+- [`ChatMessage`](../../chats/generation/classes/ChatMessage.md)- [`CrmComment`](../../crm/comment/classes/CrmComment.md)+- [`CrmPipeline`](../../crm/pipeline/classes/CrmPipeline.md)+- [`PipelineTable`](../../crm/pipeline/classes/PipelineTable.md)+- [`PipelineRow`](../../crm/pipeline/classes/PipelineRow.md)+- [`PipelineColumn`](../../crm/pipeline/classes/PipelineColumn.md)- [`Database`](../../databases/database/classes/Database.md)+- [`DocumentAnchor`](../../documents/anchor/classes/DocumentAnchor.md)- [`Comment`](../../documents/comment/classes/Comment.md)- [`EmailAttachment`](../../email/attachment/classes/EmailAttachment.md)+- [`EmailFilter`](../../email/filter/classes/EmailFilter.md)- [`Label`](../../email/label/classes/Label.md)- [`Link`](../../email/link/classes/Link.md)- [`EmailMessage`](../../email/message/classes/EmailMessage.md)- [`FavoritableEntity`](FavoritableEntity.md)- [`Form`](../../forms/form/classes/Form.md)+- [`GithubPullRequest`](../../github-pull-requests/pull-request/classes/GithubPullRequest.md)+- [`Harness`](../../harnesses/harness/classes/Harness.md)+- [`HarnessPairing`](../../harnesses/pairing/classes/HarnessPairing.md)+- [`Initiative`](../../initiatives/initiative/classes/Initiative.md)+- [`Meeting`](../../meetings/meeting/classes/Meeting.md)+- [`MessageThread`](../../messages/thread/classes/MessageThread.md)- [`Notification`](../../notifications/notification/classes/Notification.md)+- [`Routine`](../../routines/routine/classes/Routine.md)+- [`AccessRequest`](../../sharing/access/classes/AccessRequest.md)- [`Team`](../../teams/team/classes/Team.md)- [`Webhook`](../../webhooks/webhook/classes/Webhook.md)diff --git a/packages/sdk-docs/reference/src/entities/entity/classes/PropertiedEntity.md b/packages/sdk-docs/reference/src/entities/entity/classes/PropertiedEntity.mdindex 432691fd0b..3e7efa91d0 100644--- a/packages/sdk-docs/reference/src/entities/entity/classes/PropertiedEntity.md+++ b/packages/sdk-docs/reference/src/entities/entity/classes/PropertiedEntity.md@@ -79,6 +79,22 @@ entity's own detail, so there's nothing cached to invalidate.***+### permission()++> **permission**(): `Promise`\<\{ `permission`: [`EntityPermission`](../../../../generated/storage/types.gen/type-aliases/EntityPermission.md); `status`: `"access"`; \} \| \{ `status`: `"no_access"`; \}\>++Read the caller's effective permission on this entity.++#### Returns++`Promise`\<\{ `permission`: [`EntityPermission`](../../../../generated/storage/types.gen/type-aliases/EntityPermission.md); `status`: `"access"`; \} \| \{ `status`: `"no_access"`; \}\>++#### Inherited from++[`FavoritableEntity`](FavoritableEntity.md).[`permission`](FavoritableEntity.md#permission)++***+### properties()> **properties**(`opts?`): `Promise`\<[`EntityPropertyWithDefinition`](../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md)[]\>diff --git a/packages/sdk-docs/reference/src/entities/foreign/foreign-entity/classes/ForeignEntity.md b/packages/sdk-docs/reference/src/entities/foreign/foreign-entity/classes/ForeignEntity.mdindex 852e940597..2b6b23c555 100644--- a/packages/sdk-docs/reference/src/entities/foreign/foreign-entity/classes/ForeignEntity.md+++ b/packages/sdk-docs/reference/src/entities/foreign/foreign-entity/classes/ForeignEntity.md@@ -52,6 +52,22 @@ Arbitrary source-specific metadata stored with the mapping.***+### permission()++> **permission**(): `Promise`\<\{ `permission`: [`EntityPermission`](../../../../../generated/storage/types.gen/type-aliases/EntityPermission.md); `status`: `"access"`; \} \| \{ `status`: `"no_access"`; \}\>++Read the caller's effective permission on this entity.++#### Returns++`Promise`\<\{ `permission`: [`EntityPermission`](../../../../../generated/storage/types.gen/type-aliases/EntityPermission.md); `status`: `"access"`; \} \| \{ `status`: `"no_access"`; \}\>++#### Inherited from++[`FavoritableEntity`](../../../entity/classes/FavoritableEntity.md).[`permission`](../../../entity/classes/FavoritableEntity.md#permission)++***+### toJSON()> **toJSON**(): \{ `detail?`: [`ForeignEntity`](../../../../../generated/storage/types.gen/type-aliases/ForeignEntity.md); `id`: `string`; \}diff --git a/packages/sdk-docs/reference/src/entities/github-pull-requests/namespace/README.md b/packages/sdk-docs/reference/src/entities/github-pull-requests/namespace/README.mdnew file mode 100644index 0000000000..4161c8cb1d--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/github-pull-requests/namespace/README.md@@ -0,0 +1,5 @@+# src/entities/github-pull-requests/namespace++## Classes++- [GithubPullRequestNamespace](classes/GithubPullRequestNamespace.md)diff --git a/packages/sdk-docs/reference/src/entities/github-pull-requests/namespace/classes/GithubPullRequestNamespace.md b/packages/sdk-docs/reference/src/entities/github-pull-requests/namespace/classes/GithubPullRequestNamespace.mdnew file mode 100644index 0000000000..92714c2310--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/github-pull-requests/namespace/classes/GithubPullRequestNamespace.md@@ -0,0 +1,55 @@+# Class: GithubPullRequestNamespace++GitHub pull request snapshots and captured diffs.++## Constructors++### Constructor++> **new GithubPullRequestNamespace**(`client`): `GithubPullRequestNamespace`++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `client` | `MacroClient` |++#### Returns++`GithubPullRequestNamespace`++## Methods++### byId()++> **byId**(`id`): [`GithubPullRequest`](../../pull-request/classes/GithubPullRequest.md)++Construct from a Macro foreign entity's identity.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `id` | `string` |++#### Returns++[`GithubPullRequest`](../../pull-request/classes/GithubPullRequest.md)++***++### forEntity()++> **forEntity**(`entity`): [`GithubPullRequest`](../../pull-request/classes/GithubPullRequest.md)++Resolve a foreign entity as a pull request.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `entity` | [`ForeignEntity`](../../../foreign/foreign-entity/classes/ForeignEntity.md) |++#### Returns++[`GithubPullRequest`](../../pull-request/classes/GithubPullRequest.md)diff --git a/packages/sdk-docs/reference/src/entities/github-pull-requests/pull-request/README.md b/packages/sdk-docs/reference/src/entities/github-pull-requests/pull-request/README.mdnew file mode 100644index 0000000000..b3f70dd080--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/github-pull-requests/pull-request/README.md@@ -0,0 +1,6 @@+# src/entities/github-pull-requests/pull-request++## Classes++- [GithubPullRequest](classes/GithubPullRequest.md)+- [PullRequestChangeset](classes/PullRequestChangeset.md)diff --git a/packages/sdk-docs/reference/src/entities/github-pull-requests/pull-request/classes/GithubPullRequest.md b/packages/sdk-docs/reference/src/entities/github-pull-requests/pull-request/classes/GithubPullRequest.mdnew file mode 100644index 0000000000..e6d70ec96e--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/github-pull-requests/pull-request/classes/GithubPullRequest.md@@ -0,0 +1,66 @@+# Class: GithubPullRequest++A stored GitHub pull request addressed by its Macro foreign entity.++## Extends++- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\<[`StoredGithubPullRequest`](../../../../../generated/storage/types.gen/type-aliases/StoredGithubPullRequest.md)\>++## Properties++| Property | Modifier | Type | Description | Inherited from |+| ------ | ------ | ------ | ------ | ------ |+| <a id="property-id"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |+| <a id="property-status"></a> `status` | `readonly` | () => `Promise`\<`NonNullable`\<`"open"` \| `"closed"` \| `"merged"` \| `null` \| `undefined`\> \| `undefined`\> | Current state. | - |+| <a id="property-title"></a> `title` | `readonly` | () => `Promise`\<`string` \| `undefined`\> | Pull request title. | - |+| <a id="property-url"></a> `url` | `readonly` | () => `Promise`\<`string`\> | GitHub URL. | - |++## Methods++### changes()++> **changes**(): `Promise`\<\{ `changeset?`: [`PullRequestChangeset`](PullRequestChangeset.md); `error?`: `string`; \}\>++Captured change metadata, when available.++#### Returns++`Promise`\<\{ `changeset?`: [`PullRequestChangeset`](PullRequestChangeset.md); `error?`: `string`; \}\>++***++### toJSON()++> **toJSON**(): \{ `detail?`: [`StoredGithubPullRequest`](../../../../../generated/storage/types.gen/type-aliases/StoredGithubPullRequest.md); `id`: `string`; \}++#### Returns++\{ `detail?`: [`StoredGithubPullRequest`](../../../../../generated/storage/types.gen/type-aliases/StoredGithubPullRequest.md); `id`: `string`; \}++| Name | Type |+| ------ | ------ |+| `detail?` | [`StoredGithubPullRequest`](../../../../../generated/storage/types.gen/type-aliases/StoredGithubPullRequest.md) |+| `id` | `string` |++#### Inherited from++[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)++***++### byId()++> `static` **byId**(`client`, `id`): `GithubPullRequest`++Construct a lazy pull request handle.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `client` | `MacroClient` |+| `id` | `string` |++#### Returns++`GithubPullRequest`diff --git a/packages/sdk-docs/reference/src/entities/github-pull-requests/pull-request/classes/PullRequestChangeset.md b/packages/sdk-docs/reference/src/entities/github-pull-requests/pull-request/classes/PullRequestChangeset.mdnew file mode 100644index 0000000000..efad2d7ecc--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/github-pull-requests/pull-request/classes/PullRequestChangeset.md@@ -0,0 +1,79 @@+# Class: PullRequestChangeset++One captured diff belonging to a pull request.++## Constructors++### Constructor++> **new PullRequestChangeset**(`client`, `pullRequest`, `record`): `PullRequestChangeset`++#### Parameters++| Parameter | Type | Description |+| ------ | ------ | ------ |+| `client` | `MacroClient` | - |+| `pullRequest` | [`GithubPullRequest`](GithubPullRequest.md) | Parent pull request. |+| `record` | [`ChangesetDto`](../../../../../generated/storage/types.gen/type-aliases/ChangesetDto.md) | Captured metadata. |++#### Returns++`PullRequestChangeset`++## Properties++| Property | Modifier | Type | Description |+| ------ | ------ | ------ | ------ |+| <a id="property-pullrequest"></a> `pullRequest` | `readonly` | [`GithubPullRequest`](GithubPullRequest.md) | Parent pull request. |+| <a id="property-record"></a> `record` | `readonly` | [`ChangesetDto`](../../../../../generated/storage/types.gen/type-aliases/ChangesetDto.md) | Captured metadata. |++## Accessors++### id++#### Get Signature++> **get** **id**(): `string`++Captured identity.++##### Returns++`string`++## Methods++### patch()++> **patch**(): `Promise`\<`string`\>++Read the captured unified patch.++#### Returns++`Promise`\<`string`\>++***++### toJSON()++> **toJSON**(): \{ `additions`: `number`; `base`: [`GitRefDto`](../../../../../generated/storage/types.gen/type-aliases/GitRefDto.md); `capturedAt`: `string`; `deletions`: `number`; `files`: [`ChangedFileDto`](../../../../../generated/storage/types.gen/type-aliases/ChangedFileDto.md)[]; `head`: [`GitRefDto`](../../../../../generated/storage/types.gen/type-aliases/GitRefDto.md); `id`: `string`; `patchBytes`: `number`; `pullRequestId`: `string`; `repository?`: `string` \| `null`; `source`: `"github_pull_request"`; `truncated`: `boolean`; \}++Serialize captured metadata and parent identity.++#### Returns++| Name | Type | Description |+| ------ | ------ | ------ |+| `additions` | `number` | Lines added across all files. |+| `base` | [`GitRefDto`](../../../../../generated/storage/types.gen/type-aliases/GitRefDto.md) | The side the work started from. |+| `capturedAt` | `string` | When the diff was taken. |+| `deletions` | `number` | Lines removed across all files. |+| `files` | [`ChangedFileDto`](../../../../../generated/storage/types.gen/type-aliases/ChangedFileDto.md)[] | Every changed file, in patch order. |+| `head` | [`GitRefDto`](../../../../../generated/storage/types.gen/type-aliases/GitRefDto.md) | The side carrying the work. |+| `id` | `string` | The changeset's id; a different id means different changes. |+| `patchBytes` | `number` | Size of the patch the matching patch route serves; zero when nothing changed. |+| `pullRequestId` | `string` | - |+| `repository?` | `string` \| `null` | `https://github.com/owner/name`, when known. |+| `source` | `"github_pull_request"` | Where the diff was read from. |+| `truncated` | `boolean` | Some files' hunks were left out of the patch. |diff --git a/packages/sdk-docs/reference/src/entities/harnesses/harness/README.md b/packages/sdk-docs/reference/src/entities/harnesses/harness/README.mdnew file mode 100644index 0000000000..e4c67dfc98--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/harnesses/harness/README.md@@ -0,0 +1,5 @@+# src/entities/harnesses/harness++## Classes++- [Harness](classes/Harness.md)diff --git a/packages/sdk-docs/reference/src/entities/harnesses/harness/classes/Harness.md b/packages/sdk-docs/reference/src/entities/harnesses/harness/classes/Harness.mdnew file mode 100644index 0000000000..f64c272c39--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/harnesses/harness/classes/Harness.md@@ -0,0 +1,85 @@+# Class: Harness++A registered host for coding agents.++## Extends++- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\<[`Harness`](../../../../../generated/storage/types.gen/type-aliases/Harness.md)\>++## Properties++| Property | Modifier | Type | Description | Inherited from |+| ------ | ------ | ------ | ------ | ------ |+| <a id="property-connected"></a> `connected` | `readonly` | () => `Promise`\<`boolean`\> | Whether the host is connected. | - |+| <a id="property-id"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |+| <a id="property-kind"></a> `kind` | `readonly` | () => `Promise`\<`string`\> | Runtime kind. | - |+| <a id="property-name"></a> `name` | `readonly` | () => `Promise`\<`string`\> | Display name. | - |++## Methods++### delete()++> **delete**(): `Promise`\<`void`\>++Remove the host.++#### Returns++`Promise`\<`void`\>++***++### toJSON()++> **toJSON**(): \{ `detail?`: [`Harness`](../../../../../generated/storage/types.gen/type-aliases/Harness.md); `id`: `string`; \}++#### Returns++\{ `detail?`: [`Harness`](../../../../../generated/storage/types.gen/type-aliases/Harness.md); `id`: `string`; \}++| Name | Type |+| ------ | ------ |+| `detail?` | [`Harness`](../../../../../generated/storage/types.gen/type-aliases/Harness.md) |+| `id` | `string` |++#### Inherited from++[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)++***++### byId()++> `static` **byId**(`client`, `id`): `Harness`++Construct a lazy host handle.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `client` | `MacroClient` |+| `id` | `string` |++#### Returns++`Harness`++***++### from()++> `static` **from**(`client`, `record`): `Harness`++Seed from a listed host.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `client` | `MacroClient` |+| `record` | [`Harness`](../../../../../generated/storage/types.gen/type-aliases/Harness.md) |++#### Returns++`Harness`diff --git a/packages/sdk-docs/reference/src/entities/harnesses/namespace/README.md b/packages/sdk-docs/reference/src/entities/harnesses/namespace/README.mdnew file mode 100644index 0000000000..087555b66f--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/harnesses/namespace/README.md@@ -0,0 +1,5 @@+# src/entities/harnesses/namespace++## Classes++- [HarnessNamespace](classes/HarnessNamespace.md)diff --git a/packages/sdk-docs/reference/src/entities/harnesses/namespace/classes/HarnessNamespace.md b/packages/sdk-docs/reference/src/entities/harnesses/namespace/classes/HarnessNamespace.mdnew file mode 100644index 0000000000..fbcd114fb9--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/harnesses/namespace/classes/HarnessNamespace.md@@ -0,0 +1,133 @@+# Class: HarnessNamespace++Hosts and device pairing. Self operations require host credentials.++## Constructors++### Constructor++> **new HarnessNamespace**(`client`): `HarnessNamespace`++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `client` | `MacroClient` |++#### Returns++`HarnessNamespace`++## Methods++### agents()++> **agents**(): `Promise`\<[`Agent`](../../../agents/agent/classes/Agent.md)[]\>++Agent handles for the currently authenticated host.++#### Returns++`Promise`\<[`Agent`](../../../agents/agent/classes/Agent.md)[]\>++***++### byId()++> **byId**(`id`): [`Harness`](../../harness/classes/Harness.md)++Construct a lazy host handle.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `id` | `string` |++#### Returns++[`Harness`](../../harness/classes/Harness.md)++***++### createPairing()++> **createPairing**(`options`): `Promise`\<\{ `device`: [`DevicePairing`](../../pairing/classes/DevicePairing.md); `deviceSecret`: `string`; `expiresAt`: `string`; `pairing`: [`HarnessPairing`](../../pairing/classes/HarnessPairing.md); `pollIntervalSeconds`: `number`; \}\>++Start pairing a device; persist the secret separately from the handles.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `options` | [`CreatePairingRequest`](../../../../../generated/storage/types.gen/type-aliases/CreatePairingRequest.md) |++#### Returns++`Promise`\<\{ `device`: [`DevicePairing`](../../pairing/classes/DevicePairing.md); `deviceSecret`: `string`; `expiresAt`: `string`; `pairing`: [`HarnessPairing`](../../pairing/classes/HarnessPairing.md); `pollIntervalSeconds`: `number`; \}\>++***++### deleteSelf()++> **deleteSelf**(): `Promise`\<`void`\>++Revoke the currently authenticated host.++#### Returns++`Promise`\<`void`\>++***++### list()++> **list**(): `Promise`\<[`Harness`](../../harness/classes/Harness.md)[]\>++All hosts visible to the caller.++#### Returns++`Promise`\<[`Harness`](../../harness/classes/Harness.md)[]\>++***++### me()++> **me**(): `Promise`\<[`Harness`](../../harness/classes/Harness.md)\>++The currently authenticated host.++#### Returns++`Promise`\<[`Harness`](../../harness/classes/Harness.md)\>++***++### pairing()++> **pairing**(`code`): [`HarnessPairing`](../../pairing/classes/HarnessPairing.md)++Construct a lazy pairing from its displayed code.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `code` | `string` |++#### Returns++[`HarnessPairing`](../../pairing/classes/HarnessPairing.md)++***++### sessions()++> **sessions**(): `Promise`\<[`AgentSession`](../../../agent-sessions/agent-session/classes/AgentSession.md)[]\>++Session handles for the currently authenticated host.++#### Returns++`Promise`\<[`AgentSession`](../../../agent-sessions/agent-session/classes/AgentSession.md)[]\>diff --git a/packages/sdk-docs/reference/src/entities/harnesses/pairing/README.md b/packages/sdk-docs/reference/src/entities/harnesses/pairing/README.mdnew file mode 100644index 0000000000..c01cd9e492--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/harnesses/pairing/README.md@@ -0,0 +1,6 @@+# src/entities/harnesses/pairing++## Classes++- [DevicePairing](classes/DevicePairing.md)+- [HarnessPairing](classes/HarnessPairing.md)diff --git a/packages/sdk-docs/reference/src/entities/harnesses/pairing/classes/DevicePairing.md b/packages/sdk-docs/reference/src/entities/harnesses/pairing/classes/DevicePairing.mdnew file mode 100644index 0000000000..af38a11c46--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/harnesses/pairing/classes/DevicePairing.md@@ -0,0 +1,62 @@+# Class: DevicePairing++Device side pairing identity. Keep the device secret outside the handle.++## Properties++| Property | Modifier | Type | Description |+| ------ | ------ | ------ | ------ |+| <a id="property-id"></a> `id` | `readonly` | `string` | Pairing identifier. |++## Methods++### claim()++> **claim**(`deviceSecret`): `Promise`\<\{ `harness`: [`Harness`](../../harness/classes/Harness.md); `token`: `string`; \} \| `undefined`\>++Attempt to claim an approved pairing. Pending claims return undefined.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `deviceSecret` | `string` |++#### Returns++`Promise`\<\{ `harness`: [`Harness`](../../harness/classes/Harness.md); `token`: `string`; \} \| `undefined`\>++***++### toJSON()++> **toJSON**(): \{ `id`: `string`; \}++Serialize identity only.++#### Returns++\{ `id`: `string`; \}++| Name | Type |+| ------ | ------ |+| `id` | `string` |++***++### byId()++> `static` **byId**(`client`, `id`): `DevicePairing`++Construct the device side handle.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `client` | `MacroClient` |+| `id` | `string` |++#### Returns++`DevicePairing`diff --git a/packages/sdk-docs/reference/src/entities/harnesses/pairing/classes/HarnessPairing.md b/packages/sdk-docs/reference/src/entities/harnesses/pairing/classes/HarnessPairing.mdnew file mode 100644index 0000000000..d97a5d2510--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/harnesses/pairing/classes/HarnessPairing.md@@ -0,0 +1,74 @@+# Class: HarnessPairing++A short lived host pairing, addressed by its displayed code.++## Extends++- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\<[`PairingDetails`](../../../../../generated/storage/types.gen/type-aliases/PairingDetails.md)\>++## Properties++| Property | Modifier | Type | Description | Inherited from |+| ------ | ------ | ------ | ------ | ------ |+| <a id="property-expiresat"></a> `expiresAt` | `readonly` | () => `Promise`\<`string`\> | Expiration time. | - |+| <a id="property-id"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |+| <a id="property-name"></a> `name` | `readonly` | () => `Promise`\<`string`\> | Requested name. | - |++## Methods++### approve()++> **approve**(`options?`): `Promise`\<[`Harness`](../../harness/classes/Harness.md)\>++Approve this pairing.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `options?` | \{ `allowPermissionBypass?`: `boolean`; `name?`: `string`; `team?`: [`Team`](../../../teams/team/classes/Team.md); \} |+| `options.allowPermissionBypass?` | `boolean` |+| `options.name?` | `string` |+| `options.team?` | [`Team`](../../../teams/team/classes/Team.md) |++#### Returns++`Promise`\<[`Harness`](../../harness/classes/Harness.md)\>++***++### toJSON()++> **toJSON**(): \{ `detail?`: [`PairingDetails`](../../../../../generated/storage/types.gen/type-aliases/PairingDetails.md); `id`: `string`; \}++#### Returns++\{ `detail?`: [`PairingDetails`](../../../../../generated/storage/types.gen/type-aliases/PairingDetails.md); `id`: `string`; \}++| Name | Type |+| ------ | ------ |+| `detail?` | [`PairingDetails`](../../../../../generated/storage/types.gen/type-aliases/PairingDetails.md) |+| `id` | `string` |++#### Inherited from++[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)++***++### byId()++> `static` **byId**(`client`, `code`): `HarnessPairing`++Construct a lazy pairing from a pairing code.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `client` | `MacroClient` |+| `code` | `string` |++#### Returns++`HarnessPairing`diff --git a/packages/sdk-docs/reference/src/entities/initiatives/initiative/README.md b/packages/sdk-docs/reference/src/entities/initiatives/initiative/README.mdnew file mode 100644index 0000000000..d262364971--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/initiatives/initiative/README.md@@ -0,0 +1,9 @@+# src/entities/initiatives/initiative++## Classes++- [Initiative](classes/Initiative.md)++## Interfaces++- [InitiativeOptions](interfaces/InitiativeOptions.md)diff --git a/packages/sdk-docs/reference/src/entities/initiatives/initiative/classes/Initiative.md b/packages/sdk-docs/reference/src/entities/initiatives/initiative/classes/Initiative.mdnew file mode 100644index 0000000000..67c6922afe--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/initiatives/initiative/classes/Initiative.md@@ -0,0 +1,110 @@+# Class: Initiative++A group of tasks and members working toward an outcome.++## Extends++- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\<[`InitiativeDetail`](../../../../../generated/storage/types.gen/type-aliases/InitiativeDetail.md)\>++## Properties++| Property | Modifier | Type | Description | Inherited from |+| ------ | ------ | ------ | ------ | ------ |+| <a id="property-access"></a> `access` | `readonly` | [`EntityAccess`](../../../sharing/access/classes/EntityAccess.md) | Access requests and direct user grants. | - |+| <a id="property-accesslevel"></a> `accessLevel` | `readonly` | () => `Promise`\<[`AccessLevel`](../../../../../generated/storage/types.gen/type-aliases/AccessLevel.md)\> | Current user's access. | - |+| <a id="property-id"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |+| <a id="property-members"></a> `members` | `readonly` | () => `Promise`\<[`User`](../../../users/user/classes/User.md)[]\> | Assigned members. | - |+| <a id="property-name"></a> `name` | `readonly` | () => `Promise`\<`string`\> | Display name. | - |+| <a id="property-owner"></a> `owner` | `readonly` | () => `Promise`\<[`User`](../../../users/user/classes/User.md)\> | Owner. | - |+| <a id="property-sharepermissions"></a> `sharePermissions` | `readonly` | () => `Promise`\<[`SharePermissionV2`](../../../../../generated/storage/types.gen/type-aliases/SharePermissionV2.md)\> | Sharing configuration. | - |+| <a id="property-tasks"></a> `tasks` | `readonly` | () => `Promise`\<[`Task`](../../../tasks/task/classes/Task.md)[]\> | Tasks in this initiative. | - |++## Methods++### delete()++> **delete**(): `Promise`\<`void`\>++Delete this initiative.++#### Returns++`Promise`\<`void`\>++***++### toJSON()++> **toJSON**(): \{ `detail?`: [`InitiativeDetail`](../../../../../generated/storage/types.gen/type-aliases/InitiativeDetail.md); `id`: `string`; \}++#### Returns++\{ `detail?`: [`InitiativeDetail`](../../../../../generated/storage/types.gen/type-aliases/InitiativeDetail.md); `id`: `string`; \}++| Name | Type |+| ------ | ------ |+| `detail?` | [`InitiativeDetail`](../../../../../generated/storage/types.gen/type-aliases/InitiativeDetail.md) |+| `id` | `string` |++#### Inherited from++[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)++***++### update()++> **update**(`options`): `Promise`\<`void`\>++Update the name, membership or sharing configuration.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `options` | \{ `members?`: [`User`](../../../users/user/classes/User.md)[]; `name?`: `string`; `sharePermission?`: [`SharePermissionOptions`](../../../sharing/permissions/type-aliases/SharePermissionOptions.md); \} |+| `options.members?` | [`User`](../../../users/user/classes/User.md)[] |+| `options.name?` | `string` |+| `options.sharePermission?` | [`SharePermissionOptions`](../../../sharing/permissions/type-aliases/SharePermissionOptions.md) |++#### Returns++`Promise`\<`void`\>++***++### byId()++> `static` **byId**(`client`, `id`): `Initiative`++Construct a lazy initiative handle.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `client` | `MacroClient` |+| `id` | `string` |++#### Returns++`Initiative`++***++### from()++> `static` **from**(`client`, `record`): `Initiative`++Seed from an initiative detail response.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `client` | `MacroClient` |+| `record` | [`InitiativeDetail`](../../../../../generated/storage/types.gen/type-aliases/InitiativeDetail.md) |++#### Returns++`Initiative`diff --git a/packages/sdk-docs/reference/src/entities/initiatives/initiative/interfaces/InitiativeOptions.md b/packages/sdk-docs/reference/src/entities/initiatives/initiative/interfaces/InitiativeOptions.mdnew file mode 100644index 0000000000..1e8323b556--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/initiatives/initiative/interfaces/InitiativeOptions.md@@ -0,0 +1,13 @@+# Interface: InitiativeOptions++Initiative creation settings.++## Properties++| Property | Type | Description |+| ------ | ------ | ------ |+| <a id="property-description"></a> `description?` | `string` | Collaborative description. |+| <a id="property-members"></a> `members?` | [`User`](../../../users/user/classes/User.md)[] | Members assigned to this initiative. |+| <a id="property-name"></a> `name` | `string` | Initiative name. |+| <a id="property-propertyvalues"></a> `propertyValues?` | [`InitialPropertyValue`](../../../../../generated/storage/types.gen/type-aliases/InitialPropertyValue.md)[] | Initial properties. |+| <a id="property-sharewithteam"></a> `shareWithTeam?` | `boolean` | Whether the current team can access it. |diff --git a/packages/sdk-docs/reference/src/entities/initiatives/namespace/README.md b/packages/sdk-docs/reference/src/entities/initiatives/namespace/README.mdnew file mode 100644index 0000000000..bc0725c6b7--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/initiatives/namespace/README.md@@ -0,0 +1,5 @@+# src/entities/initiatives/namespace++## Classes++- [InitiativeNamespace](classes/InitiativeNamespace.md)diff --git a/packages/sdk-docs/reference/src/entities/initiatives/namespace/classes/InitiativeNamespace.md b/packages/sdk-docs/reference/src/entities/initiatives/namespace/classes/InitiativeNamespace.mdnew file mode 100644index 0000000000..ab80c4ebb5--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/initiatives/namespace/classes/InitiativeNamespace.md@@ -0,0 +1,67 @@+# Class: InitiativeNamespace++Initiatives in the caller's workspace.++## Constructors++### Constructor++> **new InitiativeNamespace**(`client`): `InitiativeNamespace`++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `client` | `MacroClient` |++#### Returns++`InitiativeNamespace`++## Methods++### byId()++> **byId**(`id`): [`Initiative`](../../initiative/classes/Initiative.md)++Construct a lazy initiative handle.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `id` | `string` |++#### Returns++[`Initiative`](../../initiative/classes/Initiative.md)++***++### create()++> **create**(`options`): `Promise`\<[`Initiative`](../../initiative/classes/Initiative.md)\>++Create an initiative.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `options` | [`InitiativeOptions`](../../initiative/interfaces/InitiativeOptions.md) |++#### Returns++`Promise`\<[`Initiative`](../../initiative/classes/Initiative.md)\>++***++### list()++> **list**(): `Promise`\<[`Initiative`](../../initiative/classes/Initiative.md)[]\>++List accessible initiatives.++#### Returns++`Promise`\<[`Initiative`](../../initiative/classes/Initiative.md)[]\>diff --git a/packages/sdk-docs/reference/src/entities/meetings/meeting/README.md b/packages/sdk-docs/reference/src/entities/meetings/meeting/README.mdnew file mode 100644index 0000000000..846b258209--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/meetings/meeting/README.md@@ -0,0 +1,5 @@+# src/entities/meetings/meeting++## Classes++- [Meeting](classes/Meeting.md)diff --git a/packages/sdk-docs/reference/src/entities/meetings/meeting/classes/Meeting.md b/packages/sdk-docs/reference/src/entities/meetings/meeting/classes/Meeting.mdnew file mode 100644index 0000000000..818b9c06e8--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/meetings/meeting/classes/Meeting.md@@ -0,0 +1,165 @@+# Class: Meeting++A meeting's schedule and invitation link.++## Extends++- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\<[`Meeting`](../../../../../generated/storage/types.gen/type-aliases/Meeting.md)\>++## Properties++| Property | Modifier | Type | Description | Inherited from |+| ------ | ------ | ------ | ------ | ------ |+| <a id="property-call"></a> `call` | `readonly` | () => `Promise`\<[`CallRecord`](../../../calls/call-record/classes/CallRecord.md) \| `undefined`\> | Associated call record. | - |+| <a id="property-channel"></a> `channel` | `readonly` | () => `Promise`\<[`Channel`](../../../channels/channel/classes/Channel.md) \| `undefined`\> | Associated channel. | - |+| <a id="property-id"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |+| <a id="property-scheduledend"></a> `scheduledEnd` | `readonly` | () => `Promise`\<`string` \| `undefined`\> | Scheduled end. | - |+| <a id="property-scheduledstart"></a> `scheduledStart` | `readonly` | () => `Promise`\<`string` \| `undefined`\> | Scheduled start. | - |+| <a id="property-title"></a> `title` | `readonly` | () => `Promise`\<`string`\> | Display title. | - |++## Methods++### cancel()++> **cancel**(): `Promise`\<`void`\>++Cancel this meeting.++#### Returns++`Promise`\<`void`\>++***++### invite()++> **invite**(`email`): `Promise`\<`void`\>++Invite an email address.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `email` | `string` |++#### Returns++`Promise`\<`void`\>++***++### invitePermissions()++> **invitePermissions**(): `Promise`\<[`MeetingInvitePermissions`](../../../../../generated/storage/types.gen/type-aliases/MeetingInvitePermissions.md)\>++Whether the caller can send invitations.++#### Returns++`Promise`\<[`MeetingInvitePermissions`](../../../../../generated/storage/types.gen/type-aliases/MeetingInvitePermissions.md)\>++***++### inviteUsers()++> **inviteUsers**(`users`): `Promise`\<`void`\>++Invite Macro users.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `users` | [`User`](../../../users/user/classes/User.md)[] |++#### Returns++`Promise`\<`void`\>++***++### toJSON()++> **toJSON**(): \{ `detail?`: [`Meeting`](../../../../../generated/storage/types.gen/type-aliases/Meeting.md); `id`: `string`; \}++#### Returns++\{ `detail?`: [`Meeting`](../../../../../generated/storage/types.gen/type-aliases/Meeting.md); `id`: `string`; \}++| Name | Type |+| ------ | ------ |+| `detail?` | [`Meeting`](../../../../../generated/storage/types.gen/type-aliases/Meeting.md) |+| `id` | `string` |++#### Inherited from++[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)++***++### update()++> **update**(`options`): `Promise`\<`void`\>++Update schedule or title.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `options` | [`UpdateMeetingRequest`](../../../../../generated/storage/types.gen/type-aliases/UpdateMeetingRequest.md) |++#### Returns++`Promise`\<`void`\>++***++### webUrl()++> **webUrl**(): `Promise`\<`string`\>++Shareable meeting link.++#### Returns++`Promise`\<`string`\>++***++### byId()++> `static` **byId**(`client`, `id`): `Meeting`++Construct a lazy meeting handle.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `client` | `MacroClient` |+| `id` | `string` |++#### Returns++`Meeting`++***++### from()++> `static` **from**(`client`, `record`): `Meeting`++Seed a meeting from a server response.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `client` | `MacroClient` |+| `record` | [`Meeting`](../../../../../generated/storage/types.gen/type-aliases/Meeting.md) |++#### Returns++`Meeting`diff --git a/packages/sdk-docs/reference/src/entities/meetings/namespace/README.md b/packages/sdk-docs/reference/src/entities/meetings/namespace/README.mdnew file mode 100644index 0000000000..3d3703185e--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/meetings/namespace/README.md@@ -0,0 +1,5 @@+# src/entities/meetings/namespace++## Classes++- [MeetingNamespace](classes/MeetingNamespace.md)diff --git a/packages/sdk-docs/reference/src/entities/meetings/namespace/classes/MeetingNamespace.md b/packages/sdk-docs/reference/src/entities/meetings/namespace/classes/MeetingNamespace.mdnew file mode 100644index 0000000000..d746b69e32--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/meetings/namespace/classes/MeetingNamespace.md@@ -0,0 +1,97 @@+# Class: MeetingNamespace++Meeting schedules and invitation lookup.++## Constructors++### Constructor++> **new MeetingNamespace**(`client`): `MeetingNamespace`++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `client` | `MacroClient` |++#### Returns++`MeetingNamespace`++## Methods++### active()++> **active**(): `Promise`\<[`Meeting`](../../meeting/classes/Meeting.md)[]\>++List active meetings.++#### Returns++`Promise`\<[`Meeting`](../../meeting/classes/Meeting.md)[]\>++***++### byId()++> **byId**(`id`): [`Meeting`](../../meeting/classes/Meeting.md)++Construct a handle to one of the caller's newest 100 standalone meetings. Use lookup for invitations.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `id` | `string` |++#### Returns++[`Meeting`](../../meeting/classes/Meeting.md)++***++### create()++> **create**(`options`): `Promise`\<[`Meeting`](../../meeting/classes/Meeting.md)\>++Create a meeting.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `options` | `Omit`\<[`CreateMeetingRequest`](../../../../../generated/storage/types.gen/type-aliases/CreateMeetingRequest.md), `"preparationId"`\> |++#### Returns++`Promise`\<[`Meeting`](../../meeting/classes/Meeting.md)\>++***++### list()++> **list**(): `Promise`\<[`Meeting`](../../meeting/classes/Meeting.md)[]\>++List the caller's newest 100 standalone meetings.++#### Returns++`Promise`\<[`Meeting`](../../meeting/classes/Meeting.md)[]\>++***++### lookup()++> **lookup**(`token`): `Promise`\<[`Meeting`](../../meeting/classes/Meeting.md)\>++Resolve a meeting's invitation token.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `token` | `string` |++#### Returns++`Promise`\<[`Meeting`](../../meeting/classes/Meeting.md)\>diff --git a/packages/sdk-docs/reference/src/entities/messages/thread/README.md b/packages/sdk-docs/reference/src/entities/messages/thread/README.mdnew file mode 100644index 0000000000..c6c5678d5a--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/messages/thread/README.md@@ -0,0 +1,18 @@+# src/entities/messages/thread++## Classes++- [MessageThread](classes/MessageThread.md)++## Interfaces++- [TimelineOptions](interfaces/TimelineOptions.md)++## Type Aliases++- [MessageParent](type-aliases/MessageParent.md)+- [TimelineMessage](type-aliases/TimelineMessage.md)++## Functions++- [timeline](functions/timeline.md)diff --git a/packages/sdk-docs/reference/src/entities/messages/thread/classes/MessageThread.md b/packages/sdk-docs/reference/src/entities/messages/thread/classes/MessageThread.mdnew file mode 100644index 0000000000..84c6f4bde1--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/messages/thread/classes/MessageThread.md@@ -0,0 +1,97 @@+# Class: MessageThread++A shared message thread with resolution and deletion operations.++## Extends++- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\<[`ThreadState`](../../../../../generated/storage/types.gen/type-aliases/ThreadState.md)\>++## Properties++| Property | Modifier | Type | Description | Inherited from |+| ------ | ------ | ------ | ------ | ------ |+| <a id="property-id"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |+| <a id="property-parent"></a> `parent` | `readonly` | [`MessageParent`](../type-aliases/MessageParent.md) | The entity containing this thread. | - |+| <a id="property-resolved"></a> `resolved` | `readonly` | () => `Promise`\<`boolean`\> | Whether the thread is resolved. | - |++## Methods++### delete()++> **delete**(`nonce?`): `Promise`\<`void`\>++Delete the entire thread, including replies.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `nonce?` | `string` |++#### Returns++`Promise`\<`void`\>++***++### toJSON()++> **toJSON**(): \{ `detail?`: [`ThreadState`](../../../../../generated/storage/types.gen/type-aliases/ThreadState.md); `id`: `string`; `parentId`: `string`; `parentType`: `"channel"` \| `"document"` \| `"call"` \| `"crm_company"` \| `"crm_contact"`; \}++Serialize identity with its owning resource.++#### Returns++\{ `detail?`: [`ThreadState`](../../../../../generated/storage/types.gen/type-aliases/ThreadState.md); `id`: `string`; `parentId`: `string`; `parentType`: `"channel"` \| `"document"` \| `"call"` \| `"crm_company"` \| `"crm_contact"`; \}++| Name | Type |+| ------ | ------ |+| `detail?` | [`ThreadState`](../../../../../generated/storage/types.gen/type-aliases/ThreadState.md) |+| `id` | `string` |+| `parentId` | `string` |+| `parentType` | `"channel"` \| `"document"` \| `"call"` \| `"crm_company"` \| `"crm_contact"` |++#### Overrides++[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)++***++### update()++> **update**(`options`): `Promise`\<`void`\>++Resolve the thread or detach its annotation anchor.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `options` | \{ `detachAnchor?`: `boolean`; `nonce?`: `string`; `resolved?`: `boolean`; \} |+| `options.detachAnchor?` | `boolean` |+| `options.nonce?` | `string` |+| `options.resolved?` | `boolean` |++#### Returns++`Promise`\<`void`\>++***++### byId()++> `static` **byId**(`client`, `parent`, `id`): `MessageThread`++Construct a scoped thread handle.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `client` | `MacroClient` |+| `parent` | [`MessageParent`](../type-aliases/MessageParent.md) |+| `id` | `string` |++#### Returns++`MessageThread`diff --git a/packages/sdk-docs/reference/src/entities/messages/thread/functions/timeline.md b/packages/sdk-docs/reference/src/entities/messages/thread/functions/timeline.mdnew file mode 100644index 0000000000..02283877a4--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/messages/thread/functions/timeline.md@@ -0,0 +1,24 @@+# Function: timeline()++> **timeline**\<`TMessage`\>(`client`, `parent`, `map`, `selection?`): `Promise`\<\{ `entries`: (\{ `activity`: \{ `action`: `string`; `actor`: [`User`](../../../users/user/classes/User.md); `actor_id`: `string`; `id`: `string`; `occurred_at`: `string`; `payload?`: `unknown`; \}; `message?`: `undefined`; `type`: `"activity"`; \} \| \{ `activity?`: `undefined`; `message`: `TMessage`; `type`: `"message"`; \})[]; `nextCursor`: [`MessageCursor`](../../../../../generated/storage/types.gen/type-aliases/MessageCursor.md) \| `undefined`; `previousCursor`: [`MessageCursor`](../../../../../generated/storage/types.gen/type-aliases/MessageCursor.md) \| `undefined`; \}\>++A bounded mixed message/activity page with typed message handles.++## Type Parameters++| Type Parameter |+| ------ |+| <a id="type-parameter-tmessage"></a> `TMessage` *extends* [`TimelineMessage`](../type-aliases/TimelineMessage.md) |++## Parameters++| Parameter | Type |+| ------ | ------ |+| `client` | `MacroClient` |+| `parent` | [`MessageParent`](../type-aliases/MessageParent.md) |+| `map` | (`record`) => `TMessage` |+| `selection?` | [`TimelineOptions`](../interfaces/TimelineOptions.md)\<`TMessage`\> |++## Returns++`Promise`\<\{ `entries`: (\{ `activity`: \{ `action`: `string`; `actor`: [`User`](../../../users/user/classes/User.md); `actor_id`: `string`; `id`: `string`; `occurred_at`: `string`; `payload?`: `unknown`; \}; `message?`: `undefined`; `type`: `"activity"`; \} \| \{ `activity?`: `undefined`; `message`: `TMessage`; `type`: `"message"`; \})[]; `nextCursor`: [`MessageCursor`](../../../../../generated/storage/types.gen/type-aliases/MessageCursor.md) \| `undefined`; `previousCursor`: [`MessageCursor`](../../../../../generated/storage/types.gen/type-aliases/MessageCursor.md) \| `undefined`; \}\>diff --git a/packages/sdk-docs/reference/src/entities/messages/thread/interfaces/TimelineOptions.md b/packages/sdk-docs/reference/src/entities/messages/thread/interfaces/TimelineOptions.mdnew file mode 100644index 0000000000..97b274099f--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/messages/thread/interfaces/TimelineOptions.md@@ -0,0 +1,23 @@+# Interface: TimelineOptions\<TMessage\>++Timeline selection with typed message references and camel case options.++## Type Parameters++| Type Parameter | Default type |+| ------ | ------ |+| <a id="type-parameter-tmessage"></a> `TMessage` *extends* [`TimelineMessage`](../type-aliases/TimelineMessage.md) | [`TimelineMessage`](../type-aliases/TimelineMessage.md) |++## Properties++| Property | Type | Description |+| ------ | ------ | ------ |+| <a id="property-activityafter"></a> `activityAfter?` | `string` | Inclusive activity lower bound. |+| <a id="property-activitybefore"></a> `activityBefore?` | `string` | Exclusive activity upper bound. |+| <a id="property-anchored"></a> `anchored?` | `boolean` | Select anchored threads. |+| <a id="property-around"></a> `around?` | `TMessage` | Fetch around this message. |+| <a id="property-cursor"></a> `cursor?` | [`MessageCursor`](../../../../../generated/storage/types.gen/type-aliases/MessageCursor.md) \| `null` | Opaque continuation cursor from a previous page. |+| <a id="property-direction"></a> `direction?` | [`MessageDirection`](../../../../../generated/storage/types.gen/type-aliases/MessageDirection.md) | Page direction. |+| <a id="property-includedeletedthreads"></a> `includeDeletedThreads?` | `boolean` | Include deleted threads. |+| <a id="property-limit"></a> `limit?` | `number` | Page size. |+| <a id="property-messages"></a> `messages?` | `TMessage`[] | Restrict selection to these messages. |diff --git a/packages/sdk-docs/reference/src/entities/messages/thread/type-aliases/MessageParent.md b/packages/sdk-docs/reference/src/entities/messages/thread/type-aliases/MessageParent.mdnew file mode 100644index 0000000000..7ed20d7c0b--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/messages/thread/type-aliases/MessageParent.md@@ -0,0 +1,5 @@+# Type Alias: MessageParent++> **MessageParent** = \{ `entity`: [`Channel`](../../../channels/channel/classes/Channel.md); `type`: `"channel"`; \} \| \{ `entity`: [`Document`](../../../documents/document/classes/Document.md); `type`: `"document"`; \} \| \{ `entity`: [`Company`](../../../crm/company/classes/Company.md); `type`: `"crm_company"`; \} \| \{ `entity`: [`Contact`](../../../crm/contact/classes/Contact.md); `type`: `"crm_contact"`; \} \| \{ `entity`: [`CallRecord`](../../../calls/call-record/classes/CallRecord.md); `type`: `"call"`; \}++The typed parent of a shared message thread.diff --git a/packages/sdk-docs/reference/src/entities/messages/thread/type-aliases/TimelineMessage.md b/packages/sdk-docs/reference/src/entities/messages/thread/type-aliases/TimelineMessage.mdnew file mode 100644index 0000000000..3a8679eb31--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/messages/thread/type-aliases/TimelineMessage.md@@ -0,0 +1,5 @@+# Type Alias: TimelineMessage++> **TimelineMessage** = [`Message`](../../../channels/message/classes/Message.md) \| [`Comment`](../../../documents/comment/classes/Comment.md) \| [`CrmComment`](../../../crm/comment/classes/CrmComment.md) \| [`CallMessage`](../../../calls/message/classes/CallMessage.md)++A message handle accepted by a mixed timeline selector.diff --git a/packages/sdk-docs/reference/src/entities/projects/project/classes/Project.md b/packages/sdk-docs/reference/src/entities/projects/project/classes/Project.mdindex 26fe779cd9..d12f2bdd3d 100644--- a/packages/sdk-docs/reference/src/entities/projects/project/classes/Project.md+++ b/packages/sdk-docs/reference/src/entities/projects/project/classes/Project.md@@ -10,6 +10,7 @@ A Macro project: a folder-like container for documents, chats, and subprojects.| Property | Modifier | Type | Default value | Description | Overrides | Inherited from || ------ | ------ | ------ | ------ | ------ | ------ | ------ |+| <a id="property-access"></a> `access` | `readonly` | [`EntityAccess`](../../../sharing/access/classes/EntityAccess.md) | `...` | Access requests and direct user grants. | - | - || <a id="property-createdat"></a> `createdAt` | `readonly` | () => `Promise`\<`string` \| `undefined`\> | `...` | When the project was created (RFC 3339 timestamp). | - | - || <a id="property-entitytype"></a> `entityType` | `readonly` | `"project"` | `'project'` | Favorites identify projects as `project`. | [`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`entityType`](../../../entity/classes/PropertiedEntity.md#property-entitytype) | - || <a id="property-id"></a> `id` | `public readonly` | `string` | `undefined` | - | - | [`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`id`](../../../entity/classes/PropertiedEntity.md#property-id) |@@ -19,6 +20,18 @@ A Macro project: a folder-like container for documents, chats, and subprojects.## Methods+### accessLevel()++> **accessLevel**(): `Promise`\<`"view"` \| `"comment"` \| `"edit"` \| `"owner"`\>++Read the caller's effective access level.++#### Returns++`Promise`\<`"view"` \| `"comment"` \| `"edit"` \| `"owner"`\>++***+### delete()> **delete**(`opts?`): `Promise`\<`void`\>@@ -91,6 +104,22 @@ The items (documents, chats, subprojects) directly inside this project.***+### permission()++> **permission**(): `Promise`\<\{ `permission`: [`EntityPermission`](../../../../../generated/storage/types.gen/type-aliases/EntityPermission.md); `status`: `"access"`; \} \| \{ `status`: `"no_access"`; \}\>++Read the caller's effective permission on this entity.++#### Returns++`Promise`\<\{ `permission`: [`EntityPermission`](../../../../../generated/storage/types.gen/type-aliases/EntityPermission.md); `status`: `"access"`; \} \| \{ `status`: `"no_access"`; \}\>++#### Inherited from++[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`permission`](../../../entity/classes/PropertiedEntity.md#permission)++***+### properties()> **properties**(`opts?`): `Promise`\<[`EntityPropertyWithDefinition`](../../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md)[]\>@@ -184,6 +213,18 @@ value when `value` is omitted.***+### sharePermissions()++> **sharePermissions**(): `Promise`\<[`SharePermissionV2`](../../../../../generated/storage/types.gen/type-aliases/SharePermissionV2.md)\>++Read this project's sharing configuration.++#### Returns++`Promise`\<[`SharePermissionV2`](../../../../../generated/storage/types.gen/type-aliases/SharePermissionV2.md)\>++***+### toJSON()> **toJSON**(): \{ `detail?`: [`Project`](../../../../../generated/storage/types.gen/type-aliases/Project.md); `id`: `string`; \}diff --git a/packages/sdk-docs/reference/src/entities/reference/README.md b/packages/sdk-docs/reference/src/entities/reference/README.mdnew file mode 100644index 0000000000..02c6a5b43c--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/reference/README.md@@ -0,0 +1,5 @@+# src/entities/reference++## Type Aliases++- [EntityReference](type-aliases/EntityReference.md)diff --git a/packages/sdk-docs/reference/src/entities/reference/type-aliases/EntityReference.md b/packages/sdk-docs/reference/src/entities/reference/type-aliases/EntityReference.mdnew file mode 100644index 0000000000..0c76dcb831--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/reference/type-aliases/EntityReference.md@@ -0,0 +1,5 @@+# Type Alias: EntityReference++> **EntityReference** = \{ `entity`: [`User`](../../users/user/classes/User.md); `type`: `"user"`; \} \| \{ `entity`: [`Team`](../../teams/team/classes/Team.md); `type`: `"team"`; \} \| \{ `entity`: [`Document`](../../documents/document/classes/Document.md); `type`: `"document"`; \} \| \{ `entity`: [`Chat`](../../chats/chat/classes/Chat.md); `type`: `"chat"`; \} \| \{ `entity`: [`Channel`](../../channels/channel/classes/Channel.md); `type`: `"channel"`; \} \| \{ `entity`: [`Message`](../../channels/message/classes/Message.md); `type`: `"channel_message"`; \} \| \{ `entity`: [`Project`](../../projects/project/classes/Project.md); `type`: `"project"`; \} \| \{ `entity`: [`EmailThread`](../../email/thread/classes/EmailThread.md); `type`: `"email_thread"`; \} \| \{ `entity`: [`CalendarEvent`](../../calendar/event/classes/CalendarEvent.md); `type`: `"calendar_event"`; \} \| \{ `entity`: [`CallRecord`](../../calls/call-record/classes/CallRecord.md); `type`: `"call"`; \} \| \{ `entity`: [`ForeignEntity`](../../foreign/foreign-entity/classes/ForeignEntity.md); `type`: `"foreign_entity"`; \} \| \{ `entity`: [`Company`](../../crm/company/classes/Company.md); `type`: `"crm_company"`; \} \| \{ `entity`: [`Contact`](../../crm/contact/classes/Contact.md); `type`: `"crm_contact"`; \} \| \{ `entity`: [`CrmPipeline`](../../crm/pipeline/classes/CrmPipeline.md); `type`: `"crm_pipeline"`; \} \| \{ `entity`: [`AgentSession`](../../agent-sessions/agent-session/classes/AgentSession.md); `type`: `"agent_session"`; \} \| \{ `entity`: [`Routine`](../../routines/routine/classes/Routine.md); `type`: `"scheduled_action"`; \} \| \{ `entity`: [`Initiative`](../../initiatives/initiative/classes/Initiative.md); `type`: `"initiative"`; \} \| \{ `entity`: [`Database`](../../databases/database/classes/Database.md); `type`: `"database"`; \} \| \{ `entity`: [`DatabaseRow`](../../databases/row/classes/DatabaseRow.md); `type`: `"database_row"`; \} \| \{ `entity`: [`Form`](../../forms/form/classes/Form.md); `type`: `"form"`; \}++Typed entity references accepted by cross-resource APIs.diff --git a/packages/sdk-docs/reference/src/entities/routines/namespace/README.md b/packages/sdk-docs/reference/src/entities/routines/namespace/README.mdnew file mode 100644index 0000000000..ee0f8febc5--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/routines/namespace/README.md@@ -0,0 +1,5 @@+# src/entities/routines/namespace++## Classes++- [RoutineNamespace](classes/RoutineNamespace.md)diff --git a/packages/sdk-docs/reference/src/entities/routines/namespace/classes/RoutineNamespace.md b/packages/sdk-docs/reference/src/entities/routines/namespace/classes/RoutineNamespace.mdnew file mode 100644index 0000000000..741aa5d8ea--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/routines/namespace/classes/RoutineNamespace.md@@ -0,0 +1,74 @@+# Class: RoutineNamespace++Scheduled and event-triggered routines.++## Constructors++### Constructor++> **new RoutineNamespace**(`client`): `RoutineNamespace`++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `client` | `MacroClient` |++#### Returns++`RoutineNamespace`++## Methods++### byId()++> **byId**(`id`): [`Routine`](../../routine/classes/Routine.md)++Construct a lazy routine handle.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `id` | `string` |++#### Returns++[`Routine`](../../routine/classes/Routine.md)++***++### create()++> **create**(`options`): `Promise`\<[`Routine`](../../routine/classes/Routine.md)\>++Create an agent routine.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `options` | [`RoutineOptions`](../../routine/interfaces/RoutineOptions.md) |++#### Returns++`Promise`\<[`Routine`](../../routine/classes/Routine.md)\>++***++### list()++> **list**(`options?`): `Promise`\<[`Routine`](../../routine/classes/Routine.md)[]\>++List routines, optionally including event triggers.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `options?` | \{ `includeEvents?`: `boolean`; \} |+| `options.includeEvents?` | `boolean` |++#### Returns++`Promise`\<[`Routine`](../../routine/classes/Routine.md)[]\>diff --git a/packages/sdk-docs/reference/src/entities/routines/routine/README.md b/packages/sdk-docs/reference/src/entities/routines/routine/README.mdnew file mode 100644index 0000000000..21c2a9af3c--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/routines/routine/README.md@@ -0,0 +1,20 @@+# src/entities/routines/routine++## Classes++- [Routine](classes/Routine.md)+- [RoutineExecution](classes/RoutineExecution.md)++## Interfaces++- [RoutineOptions](interfaces/RoutineOptions.md)++## Type Aliases++- [RoutineEventFilter](type-aliases/RoutineEventFilter.md)+- [RoutineTriggerOptions](type-aliases/RoutineTriggerOptions.md)+- [SingleRoutineTrigger](type-aliases/SingleRoutineTrigger.md)++## Functions++- [routineBody](functions/routineBody.md)diff --git a/packages/sdk-docs/reference/src/entities/routines/routine/classes/Routine.md b/packages/sdk-docs/reference/src/entities/routines/routine/classes/Routine.mdnew file mode 100644index 0000000000..48ee0ae1d1--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/routines/routine/classes/Routine.md@@ -0,0 +1,148 @@+# Class: Routine++A scheduled or event-triggered agent task.++## Extends++- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\<[`ScheduledActionResponse`](../../../../../generated/scheduled-action/types.gen/type-aliases/ScheduledActionResponse.md)\>++## Properties++| Property | Modifier | Type | Description | Inherited from |+| ------ | ------ | ------ | ------ | ------ |+| <a id="property-enabled"></a> `enabled` | `readonly` | () => `Promise`\<`boolean`\> | Whether the routine is enabled. | - |+| <a id="property-id"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |+| <a id="property-name"></a> `name` | `readonly` | () => `Promise`\<`string`\> | Routine name. | - |+| <a id="property-nextrunat"></a> `nextRunAt` | `readonly` | () => `Promise`\<`string` \| `undefined`\> | Next scheduled execution. | - |+| <a id="property-owner"></a> `owner` | `readonly` | () => `Promise`\<[`User`](../../../users/user/classes/User.md)\> | Routine owner. | - |+| <a id="property-revision"></a> `revision` | `readonly` | () => `Promise`\<`number`\> | Configuration revision. | - |+| <a id="property-trigger"></a> `trigger` | `readonly` | () => `Promise`\<[`ActionTrigger`](../../../../../generated/scheduled-action/types.gen/type-aliases/ActionTrigger.md)\> | Configured triggers. | - |++## Methods++### delete()++> **delete**(): `Promise`\<`void`\>++Delete the routine.++#### Returns++`Promise`\<`void`\>++***++### execute()++> **execute**(): `Promise`\<[`AgentSession`](../../../agent-sessions/agent-session/classes/AgentSession.md) \| [`Chat`](../../../chats/chat/classes/Chat.md) \| `undefined`\>++Start an execution immediately and return its transcript handle if available.++#### Returns++`Promise`\<[`AgentSession`](../../../agent-sessions/agent-session/classes/AgentSession.md) \| [`Chat`](../../../chats/chat/classes/Chat.md) \| `undefined`\>++***++### history()++> **history**(): `Promise`\<[`RoutineExecution`](RoutineExecution.md)[]\>++Completed executions, with their routine scoped identity.++#### Returns++`Promise`\<[`RoutineExecution`](RoutineExecution.md)[]\>++***++### setEnabled()++> **setEnabled**(`enabled`): `Promise`\<`void`\>++Enable or disable triggering.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `enabled` | `boolean` |++#### Returns++`Promise`\<`void`\>++***++### toJSON()++> **toJSON**(): \{ `detail?`: [`ScheduledActionResponse`](../../../../../generated/scheduled-action/types.gen/type-aliases/ScheduledActionResponse.md); `id`: `string`; \}++#### Returns++\{ `detail?`: [`ScheduledActionResponse`](../../../../../generated/scheduled-action/types.gen/type-aliases/ScheduledActionResponse.md); `id`: `string`; \}++| Name | Type |+| ------ | ------ |+| `detail?` | [`ScheduledActionResponse`](../../../../../generated/scheduled-action/types.gen/type-aliases/ScheduledActionResponse.md) |+| `id` | `string` |++#### Inherited from++[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)++***++### update()++> **update**(`options`): `Promise`\<`void`\>++Replace the routine's task and trigger configuration.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `options` | [`RoutineOptions`](../interfaces/RoutineOptions.md) |++#### Returns++`Promise`\<`void`\>++***++### byId()++> `static` **byId**(`client`, `id`): `Routine`++Construct a lazy routine handle.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `client` | `MacroClient` |+| `id` | `string` |++#### Returns++`Routine`++***++### from()++> `static` **from**(`client`, `record`): `Routine`++Seed a handle from a server record.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `client` | `MacroClient` |+| `record` | [`ScheduledActionResponse`](../../../../../generated/scheduled-action/types.gen/type-aliases/ScheduledActionResponse.md) |++#### Returns++`Routine`diff --git a/packages/sdk-docs/reference/src/entities/routines/routine/classes/RoutineExecution.md b/packages/sdk-docs/reference/src/entities/routines/routine/classes/RoutineExecution.mdnew file mode 100644index 0000000000..e5ca567385--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/routines/routine/classes/RoutineExecution.md@@ -0,0 +1,63 @@+# Class: RoutineExecution++A completed routine execution, as recorded by the service.++## Constructors++### Constructor++> **new RoutineExecution**(`routine`, `record`): `RoutineExecution`++#### Parameters++| Parameter | Type | Description |+| ------ | ------ | ------ |+| `routine` | [`Routine`](Routine.md) | Parent routine. |+| `record` | [`ActionExecutionRecord`](../../../../../generated/scheduled-action/types.gen/type-aliases/ActionExecutionRecord.md) | Execution snapshot. |++#### Returns++`RoutineExecution`++## Properties++| Property | Modifier | Type | Description |+| ------ | ------ | ------ | ------ |+| <a id="property-record"></a> `record` | `readonly` | [`ActionExecutionRecord`](../../../../../generated/scheduled-action/types.gen/type-aliases/ActionExecutionRecord.md) | Execution snapshot. |+| <a id="property-routine"></a> `routine` | `readonly` | [`Routine`](Routine.md) | Parent routine. |++## Accessors++### id++#### Get Signature++> **get** **id**(): `string` \| `undefined`++Execution identity, when assigned.++##### Returns++`string` \| `undefined`++## Methods++### toJSON()++> **toJSON**(): \{ `action_id`: `string`; `created_at`: `string`; `end_time`: `string`; `id?`: `string` \| `null`; `is_success`: `boolean`; `resource_id?`: `string` \| `null`; `result`: \{\[`key`: `string`\]: `unknown`; \}; `routine`: `string`; `start_time`: `string`; \}++Serialize without the authenticated client.++#### Returns++| Name | Type | Description |+| ------ | ------ | ------ |+| `action_id` | `string` | - |+| `created_at` | `string` | - |+| `end_time` | `string` | - |+| `id?` | `string` \| `null` | - |+| `is_success` | `boolean` | - |+| `resource_id?` | `string` \| `null` | ID of the primary resource produced by this run. Its type is recorded in `result`, independently of the routine's current configuration. |+| `result` | \{\[`key`: `string`\]: `unknown`; \} | - |+| `routine` | `string` | - |+| `start_time` | `string` | - |diff --git a/packages/sdk-docs/reference/src/entities/routines/routine/functions/routineBody.md b/packages/sdk-docs/reference/src/entities/routines/routine/functions/routineBody.mdnew file mode 100644index 0000000000..31b7f75411--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/routines/routine/functions/routineBody.md@@ -0,0 +1,27 @@+# Function: routineBody()++> **routineBody**(`options`): \{ `enabled`: `boolean` \| `undefined`; `kind`: `"Agent"`; `name`: `string`; `task`: \{ `agent?`: [`AgentTaskAgent`](../../../../../generated/scheduled-action/types.gen/type-aliases/AgentTaskAgent.md) \| `null`; `model?`: `string` \| `null`; `prompt`: `string`; `user_prompt`: `string`; \}; `trigger`: [`ActionTrigger`](../../../../../generated/scheduled-action/types.gen/type-aliases/ActionTrigger.md); \}++Translate typed routine options into the generated wire contract.++## Parameters++| Parameter | Type |+| ------ | ------ |+| `options` | [`RoutineOptions`](../interfaces/RoutineOptions.md) |++## Returns++\{ `enabled`: `boolean` \| `undefined`; `kind`: `"Agent"`; `name`: `string`; `task`: \{ `agent?`: [`AgentTaskAgent`](../../../../../generated/scheduled-action/types.gen/type-aliases/AgentTaskAgent.md) \| `null`; `model?`: `string` \| `null`; `prompt`: `string`; `user_prompt`: `string`; \}; `trigger`: [`ActionTrigger`](../../../../../generated/scheduled-action/types.gen/type-aliases/ActionTrigger.md); \}++| Name | Type | Default value |+| ------ | ------ | ------ |+| `enabled` | `boolean` \| `undefined` | `options.enabled` |+| `kind` | `"Agent"` | - |+| `name` | `string` | `options.name` |+| `task` | \{ `agent?`: [`AgentTaskAgent`](../../../../../generated/scheduled-action/types.gen/type-aliases/AgentTaskAgent.md) \| `null`; `model?`: `string` \| `null`; `prompt`: `string`; `user_prompt`: `string`; \} | - |+| `task.agent?` | [`AgentTaskAgent`](../../../../../generated/scheduled-action/types.gen/type-aliases/AgentTaskAgent.md) \| `null` | - |+| `task.model?` | `string` \| `null` | - |+| `task.prompt` | `string` | - |+| `task.user_prompt` | `string` | - |+| `trigger` | [`ActionTrigger`](../../../../../generated/scheduled-action/types.gen/type-aliases/ActionTrigger.md) | - |diff --git a/packages/sdk-docs/reference/src/entities/routines/routine/interfaces/RoutineOptions.md b/packages/sdk-docs/reference/src/entities/routines/routine/interfaces/RoutineOptions.mdnew file mode 100644index 0000000000..49b86b3c15--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/routines/routine/interfaces/RoutineOptions.md@@ -0,0 +1,15 @@+# Interface: RoutineOptions++Configuration of an agent routine.++## Properties++| Property | Type | Description |+| ------ | ------ | ------ |+| <a id="property-agent"></a> `agent?` | [`Agent`](../../../agents/agent/classes/Agent.md) | Agent to run the task. |+| <a id="property-enabled"></a> `enabled?` | `boolean` | Whether triggers can start executions. Defaults to true on creation. |+| <a id="property-model"></a> `model?` | `string` | Model override. |+| <a id="property-name"></a> `name` | `string` | Display name. |+| <a id="property-prompt"></a> `prompt` | `string` | Instructions delivered to the agent. |+| <a id="property-trigger"></a> `trigger` | [`RoutineTriggerOptions`](../type-aliases/RoutineTriggerOptions.md) | Schedules or Macro events that start the routine. |+| <a id="property-userprompt"></a> `userPrompt` | `string` | Original user instructions. |diff --git a/packages/sdk-docs/reference/src/entities/routines/routine/type-aliases/RoutineEventFilter.md b/packages/sdk-docs/reference/src/entities/routines/routine/type-aliases/RoutineEventFilter.mdnew file mode 100644index 0000000000..05d2b26ff4--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/routines/routine/type-aliases/RoutineEventFilter.md@@ -0,0 +1,12 @@+# Type Alias: RoutineEventFilter++> **RoutineEventFilter** = `Omit`\<[`EventFilter`](../../../../../generated/scheduled-action/types.gen/type-aliases/EventFilter.md), `"ids"` \| `"condition"`\> & \{ `condition?`: `string`; `entities?`: [`EntityReference`](../../../reference/type-aliases/EntityReference.md)[]; \}++An event selector references resources by typed handles.++## Type Declaration++| Name | Type | Description |+| ------ | ------ | ------ |+| `condition?` | `string` | Optional yes/no condition on the triggering content. |+| `entities?` | [`EntityReference`](../../../reference/type-aliases/EntityReference.md)[] | Resource selectors for these events. Omit to match all resources. |diff --git a/packages/sdk-docs/reference/src/entities/routines/routine/type-aliases/RoutineTriggerOptions.md b/packages/sdk-docs/reference/src/entities/routines/routine/type-aliases/RoutineTriggerOptions.mdnew file mode 100644index 0000000000..4ab1537eeb--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/routines/routine/type-aliases/RoutineTriggerOptions.md@@ -0,0 +1,5 @@+# Type Alias: RoutineTriggerOptions++> **RoutineTriggerOptions** = [`SingleRoutineTrigger`](SingleRoutineTrigger.md) \| \{ `triggers`: [`SingleRoutineTrigger`](SingleRoutineTrigger.md)[]; `type`: `"multiple"`; \}++One or multiple routine triggers.diff --git a/packages/sdk-docs/reference/src/entities/routines/routine/type-aliases/SingleRoutineTrigger.md b/packages/sdk-docs/reference/src/entities/routines/routine/type-aliases/SingleRoutineTrigger.mdnew file mode 100644index 0000000000..818ee1f1be--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/routines/routine/type-aliases/SingleRoutineTrigger.md@@ -0,0 +1,5 @@+# Type Alias: SingleRoutineTrigger++> **SingleRoutineTrigger** = `Extract`\<[`RoutineTrigger`](../../../../../generated/scheduled-action/types.gen/type-aliases/RoutineTrigger.md), \{ `type`: `"cron"`; \}\> \| \{ `filters`: [`RoutineEventFilter`](RoutineEventFilter.md)[]; `type`: `"events"`; \}++One schedule or set of event selectors.diff --git a/packages/sdk-docs/reference/src/entities/sharing/access/README.md b/packages/sdk-docs/reference/src/entities/sharing/access/README.mdnew file mode 100644index 0000000000..d3bc4a06b8--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/sharing/access/README.md@@ -0,0 +1,6 @@+# src/entities/sharing/access++## Classes++- [AccessRequest](classes/AccessRequest.md)+- [EntityAccess](classes/EntityAccess.md)diff --git a/packages/sdk-docs/reference/src/entities/sharing/access/classes/AccessRequest.md b/packages/sdk-docs/reference/src/entities/sharing/access/classes/AccessRequest.mdnew file mode 100644index 0000000000..a82ca9745e--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/sharing/access/classes/AccessRequest.md@@ -0,0 +1,75 @@+# Class: AccessRequest++One access request; resolutions preserve optimistic concurrency.++## Extends++- [`MacroEntity`](../../../entity/classes/MacroEntity.md)\<[`AccessRequest`](../../../../../generated/storage/types.gen/type-aliases/AccessRequest.md)\>++## Properties++| Property | Modifier | Type | Description | Inherited from |+| ------ | ------ | ------ | ------ | ------ |+| <a id="property-access"></a> `access` | `readonly` | [`EntityAccess`](EntityAccess.md) | Entity access surface owning the request. | - |+| <a id="property-id"></a> `id` | `public readonly` | `string` | - | [`MacroEntity`](../../../entity/classes/MacroEntity.md).[`id`](../../../entity/classes/MacroEntity.md#property-id) |+| <a id="property-requestedlevel"></a> `requestedLevel` | `readonly` | () => `Promise`\<[`AccessLevel`](../../../../../generated/storage/types.gen/type-aliases/AccessLevel.md)\> | Requested access. | - |+| <a id="property-requester"></a> `requester` | `readonly` | () => `Promise`\<[`User`](../../../users/user/classes/User.md)\> | Requesting user. | - |+| <a id="property-revision"></a> `revision` | `readonly` | () => `Promise`\<`number`\> | Request revision. | - |+| <a id="property-status"></a> `status` | `readonly` | () => `Promise`\<[`RequestStatus`](../../../../../generated/storage/types.gen/type-aliases/RequestStatus.md)\> | Current request state. | - |++## Methods++### resolve()++> **resolve**(`grantedLevel?`): `Promise`\<`void`\>++Approve with an access level, or decline by omitting it.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `grantedLevel?` | [`AccessLevel`](../../../../../generated/storage/types.gen/type-aliases/AccessLevel.md) |++#### Returns++`Promise`\<`void`\>++***++### toJSON()++> **toJSON**(): \{ `detail?`: [`AccessRequest`](../../../../../generated/storage/types.gen/type-aliases/AccessRequest.md); `id`: `string`; \}++#### Returns++\{ `detail?`: [`AccessRequest`](../../../../../generated/storage/types.gen/type-aliases/AccessRequest.md); `id`: `string`; \}++| Name | Type |+| ------ | ------ |+| `detail?` | [`AccessRequest`](../../../../../generated/storage/types.gen/type-aliases/AccessRequest.md) |+| `id` | `string` |++#### Inherited from++[`MacroEntity`](../../../entity/classes/MacroEntity.md).[`toJSON`](../../../entity/classes/MacroEntity.md#tojson)++***++### from()++> `static` **from**(`client`, `access`, `record`): `AccessRequest`++Seed a request from a state or submission response.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `client` | `MacroClient` |+| `access` | [`EntityAccess`](EntityAccess.md) |+| `record` | [`AccessRequest`](../../../../../generated/storage/types.gen/type-aliases/AccessRequest.md) |++#### Returns++`AccessRequest`diff --git a/packages/sdk-docs/reference/src/entities/sharing/access/classes/EntityAccess.md b/packages/sdk-docs/reference/src/entities/sharing/access/classes/EntityAccess.mdnew file mode 100644index 0000000000..c47ae0d148--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/sharing/access/classes/EntityAccess.md@@ -0,0 +1,162 @@+# Class: EntityAccess++Access requests and direct grants scoped to a shareable entity.++## Constructors++### Constructor++> **new EntityAccess**(`client`, `entityType`, `entity`): `EntityAccess`++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `client` | `MacroClient` |+| `entityType` | [`ShareEntityType`](../../../../../generated/storage/types.gen/type-aliases/ShareEntityType.md) |+| `entity` | \{ `id`: `string`; \} |+| `entity.id` | `string` |++#### Returns++`EntityAccess`++## Methods++### cancel()++> **cancel**(`revision`): `Promise`\<`void`\>++Cancel the caller's own request at its observed revision.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `revision` | `number` |++#### Returns++`Promise`\<`void`\>++***++### direct()++> **direct**(): `Promise`\<\{ `accessLevel`: [`AccessLevel`](../../../../../generated/storage/types.gen/type-aliases/AccessLevel.md); `user`: [`User`](../../../users/user/classes/User.md); \}[]\>++Direct grants expressed as user handles.++#### Returns++`Promise`\<\{ `accessLevel`: [`AccessLevel`](../../../../../generated/storage/types.gen/type-aliases/AccessLevel.md); `user`: [`User`](../../../users/user/classes/User.md); \}[]\>++***++### grant()++> **grant**(`user`, `accessLevel?`): `Promise`\<`void`\>++Grant direct access, or remove it by omitting the access level.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `user` | [`User`](../../../users/user/classes/User.md) |+| `accessLevel?` | [`AccessLevel`](../../../../../generated/storage/types.gen/type-aliases/AccessLevel.md) |++#### Returns++`Promise`\<`void`\>++***++### remove()++> **remove**(`user`): `Promise`\<`void`\>++Remove one user's direct grant.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `user` | [`User`](../../../users/user/classes/User.md) |++#### Returns++`Promise`\<`void`\>++***++### resolve()++> **resolve**(`request`, `resolution`): `Promise`\<[`AccessRequest`](../../../../../generated/storage/types.gen/type-aliases/AccessRequest.md)\>++Resolve a request belonging to this entity at an observed revision.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `request` | [`AccessRequest`](AccessRequest.md) |+| `resolution` | [`ResolveRequest`](../../../../../generated/storage/types.gen/type-aliases/ResolveRequest.md) |++#### Returns++`Promise`\<[`AccessRequest`](../../../../../generated/storage/types.gen/type-aliases/AccessRequest.md)\>++***++### state()++> **state**(`offset?`): `Promise`\<\{ `accessLevel`: [`AccessLevel`](../../../../../generated/storage/types.gen/type-aliases/AccessLevel.md) \| `undefined`; `canReview`: `boolean`; `mine`: [`AccessRequest`](AccessRequest.md) \| `undefined`; `nextOffset`: `number` \| `undefined`; `owner`: [`User`](../../../users/user/classes/User.md) \| `undefined`; `pendingCount`: `number`; `requests`: [`AccessRequest`](AccessRequest.md)[]; `supportedLevels`: [`AccessLevel`](../../../../../generated/storage/types.gen/type-aliases/AccessLevel.md)[]; \}\>++A page of access requests, including the caller's own request and review rights.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `offset?` | `number` |++#### Returns++`Promise`\<\{ `accessLevel`: [`AccessLevel`](../../../../../generated/storage/types.gen/type-aliases/AccessLevel.md) \| `undefined`; `canReview`: `boolean`; `mine`: [`AccessRequest`](AccessRequest.md) \| `undefined`; `nextOffset`: `number` \| `undefined`; `owner`: [`User`](../../../users/user/classes/User.md) \| `undefined`; `pendingCount`: `number`; `requests`: [`AccessRequest`](AccessRequest.md)[]; `supportedLevels`: [`AccessLevel`](../../../../../generated/storage/types.gen/type-aliases/AccessLevel.md)[]; \}\>++***++### submit()++> **submit**(`requestedLevel`, `revision?`): `Promise`\<[`AccessRequest`](AccessRequest.md)\>++Request access, optionally naming the revision of an earlier request.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `requestedLevel` | [`AccessLevel`](../../../../../generated/storage/types.gen/type-aliases/AccessLevel.md) |+| `revision?` | `number` |++#### Returns++`Promise`\<[`AccessRequest`](AccessRequest.md)\>++***++### toJSON()++> **toJSON**(): \{ `entity_id`: `string`; `entity_type`: [`ShareEntityType`](../../../../../generated/storage/types.gen/type-aliases/ShareEntityType.md); \}++Serialize the entity reference without credentials.++#### Returns++\{ `entity_id`: `string`; `entity_type`: [`ShareEntityType`](../../../../../generated/storage/types.gen/type-aliases/ShareEntityType.md); \}++| Name | Type |+| ------ | ------ |+| `entity_id` | `string` |+| `entity_type` | [`ShareEntityType`](../../../../../generated/storage/types.gen/type-aliases/ShareEntityType.md) |diff --git a/packages/sdk-docs/reference/src/entities/sharing/permissions/README.md b/packages/sdk-docs/reference/src/entities/sharing/permissions/README.mdnew file mode 100644index 0000000000..9fcbedf435--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/sharing/permissions/README.md@@ -0,0 +1,9 @@+# src/entities/sharing/permissions++## Type Aliases++- [SharePermissionOptions](type-aliases/SharePermissionOptions.md)++## Functions++- [sharePermissionBody](functions/sharePermissionBody.md)diff --git a/packages/sdk-docs/reference/src/entities/sharing/permissions/functions/sharePermissionBody.md b/packages/sdk-docs/reference/src/entities/sharing/permissions/functions/sharePermissionBody.mdnew file mode 100644index 0000000000..3be6be96e4--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/sharing/permissions/functions/sharePermissionBody.md@@ -0,0 +1,15 @@+# Function: sharePermissionBody()++> **sharePermissionBody**(`options`): [`UpdateSharePermissionRequestV2`](../../../../../generated/storage/types.gen/type-aliases/UpdateSharePermissionRequestV2.md)++Convert sharing options into the generated backend contract.++## Parameters++| Parameter | Type |+| ------ | ------ |+| `options` | [`SharePermissionOptions`](../type-aliases/SharePermissionOptions.md) |++## Returns++[`UpdateSharePermissionRequestV2`](../../../../../generated/storage/types.gen/type-aliases/UpdateSharePermissionRequestV2.md)diff --git a/packages/sdk-docs/reference/src/entities/sharing/permissions/type-aliases/SharePermissionOptions.md b/packages/sdk-docs/reference/src/entities/sharing/permissions/type-aliases/SharePermissionOptions.mdnew file mode 100644index 0000000000..f889c8f341--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/sharing/permissions/type-aliases/SharePermissionOptions.md@@ -0,0 +1,11 @@+# Type Alias: SharePermissionOptions++> **SharePermissionOptions** = `Omit`\<[`UpdateSharePermissionRequestV2`](../../../../../generated/storage/types.gen/type-aliases/UpdateSharePermissionRequestV2.md), `"channelSharePermissions"`\> & \{ `channelSharePermissions?`: \{ `accessLevel?`: [`AccessLevel`](../../../../../generated/storage/types.gen/type-aliases/AccessLevel.md); `channel`: [`Channel`](../../../channels/channel/classes/Channel.md); `operation`: [`UpdateChannelSharePermission`](../../../../../generated/storage/types.gen/type-aliases/UpdateChannelSharePermission.md)\[`"operation"`\]; \}[] \| `null`; \}++Sharing updates reference channels by handle. Null clears the corresponding grant collection.++## Type Declaration++| Name | Type | Description |+| ------ | ------ | ------ |+| `channelSharePermissions?` | \{ `accessLevel?`: [`AccessLevel`](../../../../../generated/storage/types.gen/type-aliases/AccessLevel.md); `channel`: [`Channel`](../../../channels/channel/classes/Channel.md); `operation`: [`UpdateChannelSharePermission`](../../../../../generated/storage/types.gen/type-aliases/UpdateChannelSharePermission.md)\[`"operation"`\]; \}[] \| `null` | Channel grants to create or replace. |diff --git a/packages/sdk-docs/reference/src/entities/tasks/task/classes/Task.md b/packages/sdk-docs/reference/src/entities/tasks/task/classes/Task.mdindex 1e42a171e8..f75900583b 100644--- a/packages/sdk-docs/reference/src/entities/tasks/task/classes/Task.md+++ b/packages/sdk-docs/reference/src/entities/tasks/task/classes/Task.md@@ -12,6 +12,7 @@ and adds task-specific state.| Property | Modifier | Type | Default value | Description | Overrides | Inherited from || ------ | ------ | ------ | ------ | ------ | ------ | ------ |+| <a id="property-access"></a> `access` | `readonly` | [`EntityAccess`](../../../sharing/access/classes/EntityAccess.md) | `...` | Access requests and direct user grants. | - | [`Document`](../../../documents/document/classes/Document.md).[`access`](../../../documents/document/classes/Document.md#property-access) || <a id="property-branchedfrom"></a> `branchedFrom` | `readonly` | () => `Promise`\<[`Document`](../../../documents/document/classes/Document.md) \| `undefined`\> | `...` | The document this one was branched from, if any. | - | [`Document`](../../../documents/document/classes/Document.md).[`branchedFrom`](../../../documents/document/classes/Document.md#property-branchedfrom) || <a id="property-createdat"></a> `createdAt` | `readonly` | () => `Promise`\<`string` \| `undefined`\> | `...` | When the document was created. | - | [`Document`](../../../documents/document/classes/Document.md).[`createdAt`](../../../documents/document/classes/Document.md#property-createdat) || <a id="property-deletedat"></a> `deletedAt` | `readonly` | () => `Promise`\<`string` \| `undefined`\> | `...` | When the document was deleted, if it has been. | - | [`Document`](../../../documents/document/classes/Document.md).[`deletedAt`](../../../documents/document/classes/Document.md#property-deletedat) |@@ -26,6 +27,22 @@ and adds task-specific state.## Methods+### anchors()++> **anchors**(): `Promise`\<[`DocumentAnchor`](../../../documents/anchor/classes/DocumentAnchor.md)[]\>++PDF annotations in this document.++#### Returns++`Promise`\<[`DocumentAnchor`](../../../documents/anchor/classes/DocumentAnchor.md)[]\>++#### Inherited from++[`Document`](../../../documents/document/classes/Document.md).[`anchors`](../../../documents/document/classes/Document.md#anchors)++***+### branchName()> **branchName**(): `Promise`\<`string`\>@@ -140,6 +157,28 @@ Returns a handle to the new document.***+### createHighlight()++> **createHighlight**(`options`): `Promise`\<[`DocumentAnchor`](../../../documents/anchor/classes/DocumentAnchor.md)\>++Create a standalone PDF highlight.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `options` | `Omit`\<[`PdfHighlightAnchorRequest`](../../../../../generated/storage/types.gen/type-aliases/PdfHighlightAnchorRequest.md), `"uuid"`\> |++#### Returns++`Promise`\<[`DocumentAnchor`](../../../documents/anchor/classes/DocumentAnchor.md)\>++#### Inherited from++[`Document`](../../../documents/document/classes/Document.md).[`createHighlight`](../../../documents/document/classes/Document.md#createhighlight)++***+### delete()> **delete**(`opts?`): `Promise`\<`void`\>@@ -220,6 +259,28 @@ GitHub pull requests associated with the document.***+### messageThreadById()++> **messageThreadById**(`id`): [`MessageThread`](../../../messages/thread/classes/MessageThread.md)++A shared message thread scoped to this resource.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `id` | `string` |++#### Returns++[`MessageThread`](../../../messages/thread/classes/MessageThread.md)++#### Inherited from++[`Document`](../../../documents/document/classes/Document.md).[`messageThreadById`](../../../documents/document/classes/Document.md#messagethreadbyid)++***+### move()> **move**(`project`): `Promise`\<`void`\>@@ -242,6 +303,60 @@ Move the document into a project (or out of one, with `null`).***+### permission()++> **permission**(): `Promise`\<\{ `permission`: [`EntityPermission`](../../../../../generated/storage/types.gen/type-aliases/EntityPermission.md); `status`: `"access"`; \} \| \{ `status`: `"no_access"`; \}\>++Read the caller's effective permission on this entity.++#### Returns++`Promise`\<\{ `permission`: [`EntityPermission`](../../../../../generated/storage/types.gen/type-aliases/EntityPermission.md); `status`: `"access"`; \} \| \{ `status`: `"no_access"`; \}\>++#### Inherited from++[`Document`](../../../documents/document/classes/Document.md).[`permission`](../../../documents/document/classes/Document.md#permission)++***++### permissionsToken()++> **permissionsToken**(): `Promise`\<`string`\>++Mint a scoped permissions token.++#### Returns++`Promise`\<`string`\>++#### Inherited from++[`Document`](../../../documents/document/classes/Document.md).[`permissionsToken`](../../../documents/document/classes/Document.md#permissionstoken)++***++### prepareSave()++> **prepareSave**(`parts`): `Promise`\<[`PreSaveDocumentResponseData`](../../../../../generated/storage/types.gen/type-aliases/PreSaveDocumentResponseData.md)\>++Prepare multipart content saving and return the service's upload instructions.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `parts` | [`SaveBomPart`](../../../../../generated/storage/types.gen/type-aliases/SaveBomPart.md)[] |++#### Returns++`Promise`\<[`PreSaveDocumentResponseData`](../../../../../generated/storage/types.gen/type-aliases/PreSaveDocumentResponseData.md)\>++#### Inherited from++[`Document`](../../../documents/document/classes/Document.md).[`prepareSave`](../../../documents/document/classes/Document.md#preparesave)++***+### properties()> **properties**(`opts?`): `Promise`\<[`EntityPropertyWithDefinition`](../../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md)[]\>@@ -319,6 +434,28 @@ Restore a soft-deleted document.***+### save()++> **save**(`options`): `Promise`\<[`SaveDocumentResponseData`](../../../../../generated/storage/types.gen/type-aliases/SaveDocumentResponseData.md)\>++Commit uploaded content. Does not retry uncertain writes.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `options` | [`SaveDocumentRequest`](../../../../../generated/storage/types.gen/type-aliases/SaveDocumentRequest.md) |++#### Returns++`Promise`\<[`SaveDocumentResponseData`](../../../../../generated/storage/types.gen/type-aliases/SaveDocumentResponseData.md)\>++#### Inherited from++[`Document`](../../../documents/document/classes/Document.md).[`save`](../../../documents/document/classes/Document.md#save)++***+### setProperty()> **setProperty**(`property`, `value?`): `Promise`\<`void`\>@@ -365,6 +502,22 @@ Share the document with the owner's team, or unshare it.***+### sharePermissions()++> **sharePermissions**(): `Promise`\<[`SharePermissionV2`](../../../../../generated/storage/types.gen/type-aliases/SharePermissionV2.md)\>++Sharing configuration.++#### Returns++`Promise`\<[`SharePermissionV2`](../../../../../generated/storage/types.gen/type-aliases/SharePermissionV2.md)\>++#### Inherited from++[`Document`](../../../documents/document/classes/Document.md).[`sharePermissions`](../../../documents/document/classes/Document.md#sharepermissions)++***+### shortId()> **shortId**(): `Promise`\<`string`\>@@ -381,6 +534,22 @@ The document's short id (used in compact links and branch names).***+### simpleSave()++> **simpleSave**(): `Promise`\<[`SaveDocumentResponseData`](../../../../../generated/storage/types.gen/type-aliases/SaveDocumentResponseData.md)\>++Commit a simple document save.++#### Returns++`Promise`\<[`SaveDocumentResponseData`](../../../../../generated/storage/types.gen/type-aliases/SaveDocumentResponseData.md)\>++#### Inherited from++[`Document`](../../../documents/document/classes/Document.md).[`simpleSave`](../../../documents/document/classes/Document.md#simplesave)++***+### teamShare()> **teamShare**(): `Promise`\<[`DocumentTeamShareResponse`](../../../../../generated/storage/types.gen/type-aliases/DocumentTeamShareResponse.md)\>@@ -397,6 +566,28 @@ Whether the document is shared with the owner's team, and which team.***+### timelinePage()++> **timelinePage**(`selection?`): `Promise`\<\{ `entries`: (\{ `activity`: \{ `action`: `string`; `actor`: [`User`](../../../users/user/classes/User.md); `actor_id`: `string`; `id`: `string`; `occurred_at`: `string`; `payload?`: `unknown`; \}; `message?`: `undefined`; `type`: `"activity"`; \} \| \{ `activity?`: `undefined`; `message`: [`Comment`](../../../documents/comment/classes/Comment.md); `type`: `"message"`; \})[]; `nextCursor`: [`MessageCursor`](../../../../../generated/storage/types.gen/type-aliases/MessageCursor.md) \| `undefined`; `previousCursor`: [`MessageCursor`](../../../../../generated/storage/types.gen/type-aliases/MessageCursor.md) \| `undefined`; \}\>++A mixed message and activity timeline page.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `selection?` | [`TimelineOptions`](../../../messages/thread/interfaces/TimelineOptions.md)\<[`Comment`](../../../documents/comment/classes/Comment.md)\> |++#### Returns++`Promise`\<\{ `entries`: (\{ `activity`: \{ `action`: `string`; `actor`: [`User`](../../../users/user/classes/User.md); `actor_id`: `string`; `id`: `string`; `occurred_at`: `string`; `payload?`: `unknown`; \}; `message?`: `undefined`; `type`: `"activity"`; \} \| \{ `activity?`: `undefined`; `message`: [`Comment`](../../../documents/comment/classes/Comment.md); `type`: `"message"`; \})[]; `nextCursor`: [`MessageCursor`](../../../../../generated/storage/types.gen/type-aliases/MessageCursor.md) \| `undefined`; `previousCursor`: [`MessageCursor`](../../../../../generated/storage/types.gen/type-aliases/MessageCursor.md) \| `undefined`; \}\>++#### Inherited from++[`Document`](../../../documents/document/classes/Document.md).[`timelinePage`](../../../documents/document/classes/Document.md#timelinepage)++***+### toJSON()> **toJSON**(): \{ `detail?`: [`DocumentMetadataWithContent`](../../../../../generated/storage/types.gen/type-aliases/DocumentMetadataWithContent.md); `id`: `string`; \}@@ -468,6 +659,28 @@ Apply multi-select option deltas atomically across this entity's properties.***+### version()++> **version**(`version`): [`DocumentVersion`](../../../documents/version/classes/DocumentVersion.md)++A handle to an immutable version.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `version` | `number` |++#### Returns++[`DocumentVersion`](../../../documents/version/classes/DocumentVersion.md)++#### Inherited from++[`Document`](../../../documents/document/classes/Document.md).[`version`](../../../documents/document/classes/Document.md#version)++***+### webUrl()> **webUrl**(): `string`diff --git a/packages/sdk-docs/reference/src/entities/unfurls/namespace/README.md b/packages/sdk-docs/reference/src/entities/unfurls/namespace/README.mdnew file mode 100644index 0000000000..146eba8de8--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/unfurls/namespace/README.md@@ -0,0 +1,5 @@+# src/entities/unfurls/namespace++## Classes++- [UnfurlNamespace](classes/UnfurlNamespace.md)diff --git a/packages/sdk-docs/reference/src/entities/unfurls/namespace/classes/UnfurlNamespace.md b/packages/sdk-docs/reference/src/entities/unfurls/namespace/classes/UnfurlNamespace.mdnew file mode 100644index 0000000000..e9983cdb48--- /dev/null+++ b/packages/sdk-docs/reference/src/entities/unfurls/namespace/classes/UnfurlNamespace.md@@ -0,0 +1,55 @@+# Class: UnfurlNamespace++URL metadata lookup.++## Constructors++### Constructor++> **new UnfurlNamespace**(`client`): `UnfurlNamespace`++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `client` | `MacroClient` |++#### Returns++`UnfurlNamespace`++## Methods++### bulk()++> **bulk**(`urls`): `Promise`\<[`GetUnfurlBulkResponse`](../../../../../generated/unfurl/types.gen/type-aliases/GetUnfurlBulkResponse.md)\>++Read metadata for multiple URLs in one request.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `urls` | `string`[] |++#### Returns++`Promise`\<[`GetUnfurlBulkResponse`](../../../../../generated/unfurl/types.gen/type-aliases/GetUnfurlBulkResponse.md)\>++***++### get()++> **get**(`url`): `Promise`\<[`GetUnfurlResponse`](../../../../../generated/unfurl/types.gen/type-aliases/GetUnfurlResponse.md)\>++Read title, description and preview metadata for a URL.++#### Parameters++| Parameter | Type |+| ------ | ------ |+| `url` | `string` |++#### Returns++`Promise`\<[`GetUnfurlResponse`](../../../../../generated/unfurl/types.gen/type-aliases/GetUnfurlResponse.md)\>diff --git a/packages/sdk-docs/reference/src/entities/users/user/classes/User.md b/packages/sdk-docs/reference/src/entities/users/user/classes/User.mdindex 49f62488ed..80a776a98d 100644--- a/packages/sdk-docs/reference/src/entities/users/user/classes/User.md+++ b/packages/sdk-docs/reference/src/entities/users/user/classes/User.md@@ -106,6 +106,22 @@ The full name, or `undefined` if the user has no name on record.***+### permission()++> **permission**(): `Promise`\<\{ `permission`: [`EntityPermission`](../../../../../generated/storage/types.gen/type-aliases/EntityPermission.md); `status`: `"access"`; \} \| \{ `status`: `"no_access"`; \}\>++Read the caller's effective permission on this entity.++#### Returns++`Promise`\<\{ `permission`: [`EntityPermission`](../../../../../generated/storage/types.gen/type-aliases/EntityPermission.md); `status`: `"access"`; \} \| \{ `status`: `"no_access"`; \}\>++#### Inherited from++[`PropertiedEntity`](../../../entity/classes/PropertiedEntity.md).[`permission`](../../../entity/classes/PropertiedEntity.md#permission)++***+### properties()> **properties**(`opts?`): `Promise`\<[`EntityPropertyWithDefinition`](../../../../../generated/properties/types.gen/type-aliases/EntityPropertyWithDefinition.md)[]\>diff --git a/packages/sdk-docs/reference/src/macro/README.md b/packages/sdk-docs/reference/src/macro/README.mdindex ba47a0ce55..04809c6f1a 100644--- a/packages/sdk-docs/reference/src/macro/README.md+++ b/packages/sdk-docs/reference/src/macro/README.md@@ -10,12 +10,36 @@## References+### AccessRequest++Re-exports [AccessRequest](../entities/sharing/access/classes/AccessRequest.md)++***+### AddColumnOptionsRe-exports [AddColumnOptions](../entities/databases/database/type-aliases/AddColumnOptions.md)***+### Agent++Re-exports [Agent](../entities/agents/agent/classes/Agent.md)++***++### AgentConversation++Re-exports [AgentConversation](../entities/agent-sessions/conversation/classes/AgentConversation.md)++***++### AgentOptions++Re-exports [AgentOptions](../entities/agents/agent/type-aliases/AgentOptions.md)++***+### ApplyOpsOptionsRe-exports [ApplyOpsOptions](../entities/databases/database/type-aliases/ApplyOpsOptions.md)@@ -34,6 +58,30 @@ Re-exports [ChangeColumnTypeOptions](../entities/databases/database/type-aliases***+### ChannelActivity++Re-exports [ChannelActivity](../entities/channels/activity/classes/ChannelActivity.md)++***++### ChannelPicture++Re-exports [ChannelPicture](../entities/channels/picture/classes/ChannelPicture.md)++***++### ChatGeneration++Re-exports [ChatGeneration](../entities/chats/generation/classes/ChatGeneration.md)++***++### ChatMessage++Re-exports [ChatMessage](../entities/chats/generation/classes/ChatMessage.md)++***+### CodeExecutionRe-exports [CodeExecution](../entities/agent-sessions/code-execution/classes/CodeExecution.md)@@ -52,6 +100,12 @@ Re-exports [ColumnType](../entities/databases/database/type-aliases/ColumnType.m***+### ConversationTurn++Re-exports [ConversationTurn](../entities/agent-sessions/conversation/classes/ConversationTurn.md)++***+### ConvertIntoNewColumnOptionsRe-exports [ConvertIntoNewColumnOptions](../entities/databases/database/type-aliases/ConvertIntoNewColumnOptions.md)@@ -64,6 +118,24 @@ Re-exports [CreateReviewOptions](../entities/agent-sessions/review/type-aliases/***+### CrmPipeline++Re-exports [CrmPipeline](../entities/crm/pipeline/classes/CrmPipeline.md)++***++### DatabaseQueryOptions++Re-exports [DatabaseQueryOptions](../entities/databases/query/interfaces/DatabaseQueryOptions.md)++***++### DatabaseQueryResult++Re-exports [DatabaseQueryResult](../entities/databases/query/interfaces/DatabaseQueryResult.md)++***+### DecisionRequestRe-exports [DecisionRequest](../../generated/cognition/types.gen/type-aliases/DecisionRequest.md)@@ -76,6 +148,72 @@ Re-exports [DecisionResponse](../../generated/cognition/types.gen/type-aliases/D***+### DevicePairing++Re-exports [DevicePairing](../entities/harnesses/pairing/classes/DevicePairing.md)++***++### DocumentAnchor++Re-exports [DocumentAnchor](../entities/documents/anchor/classes/DocumentAnchor.md)++***++### DocumentVersion++Re-exports [DocumentVersion](../entities/documents/version/classes/DocumentVersion.md)++***++### DraftAttachment++Re-exports [DraftAttachment](../entities/email/draft/classes/DraftAttachment.md)++***++### DraftOptions++Re-exports [DraftOptions](../entities/email/draft/type-aliases/DraftOptions.md)++***++### EmailDraft++Re-exports [EmailDraft](../entities/email/draft/classes/EmailDraft.md)++***++### EmailFilter++Re-exports [EmailFilter](../entities/email/filter/classes/EmailFilter.md)++***++### EmailFilterOptions++Re-exports [EmailFilterOptions](../entities/email/filter/interfaces/EmailFilterOptions.md)++***++### EntityAccess++Re-exports [EntityAccess](../entities/sharing/access/classes/EntityAccess.md)++***++### EntityMention++Re-exports [EntityMention](../entities/entity-mentions/mention/classes/EntityMention.md)++***++### EntityReference++Re-exports [EntityReference](../entities/reference/type-aliases/EntityReference.md)++***+### FormRe-exports [Form](../entities/forms/form/classes/Form.md)@@ -190,12 +328,42 @@ Re-exports [FormSubmissionOutcome](../entities/forms/form/type-aliases/FormSubmi***+### GithubPullRequest++Re-exports [GithubPullRequest](../entities/github-pull-requests/pull-request/classes/GithubPullRequest.md)++***++### Harness++Re-exports [Harness](../entities/harnesses/harness/classes/Harness.md)++***++### HarnessPairing++Re-exports [HarnessPairing](../entities/harnesses/pairing/classes/HarnessPairing.md)++***+### hereRe-exports [here](../mentions/variables/here.md)***+### Initiative++Re-exports [Initiative](../entities/initiatives/initiative/classes/Initiative.md)++***++### InitiativeOptions++Re-exports [InitiativeOptions](../entities/initiatives/initiative/interfaces/InitiativeOptions.md)++***+### InterpolationRe-exports [Interpolation](../mentions/type-aliases/Interpolation.md)@@ -226,6 +394,12 @@ Re-exports [MacroOpts](../config/interfaces/MacroOpts.md)***+### Meeting++Re-exports [Meeting](../entities/meetings/meeting/classes/Meeting.md)++***+### MentionableRe-exports [Mentionable](../mentions/interfaces/Mentionable.md)@@ -238,6 +412,18 @@ Re-exports [MentionPart](../mentions/interfaces/MentionPart.md)***+### MessageParent++Re-exports [MessageParent](../entities/messages/thread/type-aliases/MessageParent.md)++***++### MessageThread++Re-exports [MessageThread](../entities/messages/thread/classes/MessageThread.md)++***+### msgRe-exports [msg](../mentions/functions/msg.md)@@ -256,6 +442,54 @@ Re-exports [OpResultOf](../entities/databases/database/type-aliases/OpResultOf.m***+### PipelineColumn++Re-exports [PipelineColumn](../entities/crm/pipeline/classes/PipelineColumn.md)++***++### PipelineRow++Re-exports [PipelineRow](../entities/crm/pipeline/classes/PipelineRow.md)++***++### PipelineTable++Re-exports [PipelineTable](../entities/crm/pipeline/classes/PipelineTable.md)++***++### PullRequestChangeset++Re-exports [PullRequestChangeset](../entities/github-pull-requests/pull-request/classes/PullRequestChangeset.md)++***++### QueryColumn++Re-exports [QueryColumn](../entities/databases/query/type-aliases/QueryColumn.md)++***++### QueryResultSet++Re-exports [QueryResultSet](../entities/databases/query/interfaces/QueryResultSet.md)++***++### QueryStatement++Re-exports [QueryStatement](../entities/databases/query/type-aliases/QueryStatement.md)++***++### QueryTableVersion++Re-exports [QueryTableVersion](../entities/databases/query/interfaces/QueryTableVersion.md)++***+### ReviewCalendarDraftRe-exports [ReviewCalendarDraft](../entities/agent-sessions/review/type-aliases/ReviewCalendarDraft.md)@@ -280,18 +514,60 @@ Re-exports [RichMessage](../mentions/interfaces/RichMessage.md)***+### Routine++Re-exports [Routine](../entities/routines/routine/classes/Routine.md)++***++### RoutineEventFilter++Re-exports [RoutineEventFilter](../entities/routines/routine/type-aliases/RoutineEventFilter.md)++***++### RoutineExecution++Re-exports [RoutineExecution](../entities/routines/routine/classes/RoutineExecution.md)++***++### RoutineOptions++Re-exports [RoutineOptions](../entities/routines/routine/interfaces/RoutineOptions.md)++***++### RoutineTriggerOptions++Re-exports [RoutineTriggerOptions](../entities/routines/routine/type-aliases/RoutineTriggerOptions.md)++***+### SessionReviewRe-exports [SessionReview](../entities/agent-sessions/review/classes/SessionReview.md)***+### SharePermissionOptions++Re-exports [SharePermissionOptions](../entities/sharing/permissions/type-aliases/SharePermissionOptions.md)++***+### SimpleMentionRe-exports [SimpleMention](../../generated/storage/types.gen/type-aliases/SimpleMention.md)***+### SingleRoutineTrigger++Re-exports [SingleRoutineTrigger](../entities/routines/routine/type-aliases/SingleRoutineTrigger.md)++***+### StructuredCompletionRequestRe-exports [StructuredCompletionRequest](../../generated/cognition/types.gen/type-aliases/StructuredCompletionRequest.md)@@ -304,12 +580,30 @@ Re-exports [StructuredCompletionResponse](../../generated/cognition/types.gen/ty***+### TimelineOptions++Re-exports [TimelineOptions](../entities/messages/thread/interfaces/TimelineOptions.md)++***+### toBodyRe-exports [toBody](../mentions/functions/toBody.md)***+### ToolApproval++Re-exports [ToolApproval](../entities/agent-sessions/tool-approval/classes/ToolApproval.md)++***++### UserApiKey++Re-exports [UserApiKey](../entities/api-keys/api-key/classes/UserApiKey.md)++***+### WorkspaceFiltersRe-exports [WorkspaceFilters](../entities/workspace/types/type-aliases/WorkspaceFilters.md)diff --git a/packages/sdk-docs/reference/src/macro/classes/Macro.md b/packages/sdk-docs/reference/src/macro/classes/Macro.mdindex 9420c2d8a7..963bd78080 100644--- a/packages/sdk-docs/reference/src/macro/classes/Macro.md+++ b/packages/sdk-docs/reference/src/macro/classes/Macro.md@@ -27,8 +27,10 @@| Property | Modifier | Type | Description || ------ | ------ | ------ | ------ || <a id="property-_client"></a> `_client` | `readonly` | `MacroClient` | Direct access to the underlying hey-api service clients. |+| <a id="property-agents"></a> `agents` | `readonly` | [`AgentNamespace`](../../entities/agents/namespace/classes/AgentNamespace.md) | agents resources and operations. || <a id="property-agentsessions"></a> `agentSessions` | `readonly` | [`AgentSessionNamespace`](../../entities/agent-sessions/namespace/classes/AgentSessionNamespace.md) | - || <a id="property-ai"></a> `ai` | `readonly` | [`AiNamespace`](../../entities/ai/namespace/classes/AiNamespace.md) | - |+| <a id="property-apikeys"></a> `apiKeys` | `readonly` | [`ApiKeyNamespace`](../../entities/api-keys/namespace/classes/ApiKeyNamespace.md) | apiKeys resources and operations. || <a id="property-bots"></a> `bots` | `readonly` | [`BotsNamespace`](../../entities/bots/namespace/classes/BotsNamespace.md) | - || <a id="property-calendar"></a> `calendar` | `readonly` | [`CalendarNamespace`](../../entities/calendar/namespace/classes/CalendarNamespace.md) | - || <a id="property-calls"></a> `calls` | `readonly` | [`CallRecordNamespace`](../../entities/calls/namespace/classes/CallRecordNamespace.md) | - |@@ -38,16 +40,23 @@| <a id="property-databases"></a> `databases` | `readonly` | [`DatabaseNamespace`](../../entities/databases/namespace/classes/DatabaseNamespace.md) | - || <a id="property-documents"></a> `documents` | `readonly` | [`DocumentNamespace`](../../entities/documents/namespace/classes/DocumentNamespace.md) | - || <a id="property-email"></a> `email` | `readonly` | [`EmailNamespace`](../../entities/email/namespace/classes/EmailNamespace.md) | - |+| <a id="property-entitymentions"></a> `entityMentions` | `readonly` | [`EntityMentionNamespace`](../../entities/entity-mentions/namespace/classes/EntityMentionNamespace.md) | entityMentions resources and operations. || <a id="property-events"></a> `events` | `readonly` | [`MacroEvents`](../../events/receiver/classes/MacroEvents.md) | - || <a id="property-favorites"></a> `favorites` | `readonly` | [`FavoritesNamespace`](../../entities/favorites/namespace/classes/FavoritesNamespace.md) | - || <a id="property-foreignentities"></a> `foreignEntities` | `readonly` | [`ForeignEntityNamespace`](../../entities/foreign/namespace/classes/ForeignEntityNamespace.md) | - || <a id="property-forms"></a> `forms` | `readonly` | [`FormNamespace`](../../entities/forms/namespace/classes/FormNamespace.md) | Build forms and submit answers without granting respondents database access. |+| <a id="property-githubpullrequests"></a> `githubPullRequests` | `readonly` | [`GithubPullRequestNamespace`](../../entities/github-pull-requests/namespace/classes/GithubPullRequestNamespace.md) | githubPullRequests resources and operations. |+| <a id="property-harnesses"></a> `harnesses` | `readonly` | [`HarnessNamespace`](../../entities/harnesses/namespace/classes/HarnessNamespace.md) | harnesses resources and operations. |+| <a id="property-initiatives"></a> `initiatives` | `readonly` | [`InitiativeNamespace`](../../entities/initiatives/namespace/classes/InitiativeNamespace.md) | initiatives resources and operations. |+| <a id="property-meetings"></a> `meetings` | `readonly` | [`MeetingNamespace`](../../entities/meetings/namespace/classes/MeetingNamespace.md) | meetings resources and operations. || <a id="property-notifications"></a> `notifications` | `readonly` | [`NotificationNamespace`](../../entities/notifications/namespace/classes/NotificationNamespace.md) | - || <a id="property-pins"></a> `pins` | `readonly` | [`PinsNamespace`](../../entities/pins/namespace/classes/PinsNamespace.md) | - || <a id="property-projects"></a> `projects` | `readonly` | [`ProjectNamespace`](../../entities/projects/namespace/classes/ProjectNamespace.md) | - || <a id="property-properties"></a> `properties` | `readonly` | [`PropertiesNamespace`](../../entities/properties/namespace/classes/PropertiesNamespace.md) | - |+| <a id="property-routines"></a> `routines` | `readonly` | [`RoutineNamespace`](../../entities/routines/namespace/classes/RoutineNamespace.md) | routines resources and operations. || <a id="property-tasks"></a> `tasks` | `readonly` | [`TaskNamespace`](../../entities/tasks/namespace/classes/TaskNamespace.md) | - || <a id="property-teams"></a> `teams` | `readonly` | [`TeamNamespace`](../../entities/teams/namespace/classes/TeamNamespace.md) | - |+| <a id="property-unfurls"></a> `unfurls` | `readonly` | [`UnfurlNamespace`](../../entities/unfurls/namespace/classes/UnfurlNamespace.md) | unfurls resources and operations. || <a id="property-users"></a> `users` | `readonly` | [`UserNamespace`](../../entities/users/namespace/classes/UserNamespace.md) | - || <a id="property-webappurl"></a> `webAppUrl` | `readonly` | `string` | Base URL of the Macro web app, used to build entity URLs. || <a id="property-webhooks"></a> `webhooks` | `readonly` | [`WebhooksNamespace`](../../entities/webhooks/namespace/classes/WebhooksNamespace.md) | - |diff --git a/packages/sdk/AGENTS.md b/packages/sdk/AGENTS.mdindex 5faae2e377..397b1c48d8 100644--- a/packages/sdk/AGENTS.md+++ b/packages/sdk/AGENTS.md@@ -11,6 +11,10 @@ enforced by the ordinary backend APIs.- `src/macro.ts`: public exports and namespace registration.- `src/entities/entity.ts`: lazy detail reads, mutation invalidation and safe JSON.- `src/entities/workspace/namespace.ts`: filtered activity pages and iteration.+- `src/entities/routines/`, `agents/`, `harnesses/`: automation and agent hosts.+- `src/entities/sharing/`, `messages/`: scoped access requests and message threads.+- `src/entities/databases/query.ts`: SQL statements, typed table/row references and version guards.+- `src/entities/crm/pipeline.ts`: pipeline-authorized table/row handles.- `services.ts`, `openapi-ts.config.ts`: generated service contract inputs.## Boundaries@@ -25,7 +29,8 @@ enforced by the ordinary backend APIs.Run from this directory: `bun test`, `bun run check`, `bun run coverage`, and`bun run lint`. Coverage requires each generated endpoint to be wrapped or-explicitly classified in `src/coverage/skipped.ts`.+explicitly classified in `src/coverage/skipped.ts`. Build output in `dist/` is+excluded from source linting.## Gotchas@@ -36,5 +41,13 @@ explicitly classified in `src/coverage/skipped.ts`.- Async iterators are lazy; `limit` is page size. Preserve filters on every pageand do not fetch another page after the caller breaks the loop.- Handles must serialize identity or loaded detail, never authenticated clients.+- Draft writes must select the draft's inbox with `X-Email-Link-Id`; callers+ supply plain HTML and the SDK encodes it for the draft wire contract.+- Meeting list lookup only covers the owner's newest 100 standalone meetings;+ handles seeded from invitations retain their token for refetching after writes.+- Keep access-request resolution snapshots: resolved requests leave pending lists.+- Pipeline schema reads share the parent's cache; successful op batches clear it.- Email sends and other writes against hosted data are real actions; use mocksfor automated SDK mutation tests.++- SQL result schemas are dynamic typed-cell unions; inspect `truncatedTables` before interpreting aggregates. Queries can write and are never retried automatically.diff --git a/packages/sdk/README.md b/packages/sdk/README.mdindex c560fb4c44..41a8b94d7e 100644--- a/packages/sdk/README.md+++ b/packages/sdk/README.md@@ -186,7 +186,27 @@ Databases are collections of tables. Tables, columns, and views are parts ofa database, not entities of their own, so they come back as handles thatresolve through the database's schema.-Every write to a database's schema or rows is an op sent to one endpoint,+SQL is available through `database.query(sql)` or+`macro.databases.query(sql, { database })`. The scoped database resolves+unqualified names; joins can reach any other database the caller can view.+Results contain discriminated cell values, typed source rows and table-version+handles. SQL can also write; a statement executes once without automatic retries.++```ts+const database = macro.databases.byId('database-id');+const result = await database.query('SELECT "Name" FROM "Guests"');+console.log(result.result?.rows);+await database.query(`UPDATE "Guests" SET "Status" = 'Going' WHERE "Name" = 'Sam'`, {+ baseVersions: result.readVersions,+});+```++`baseVersions` guards written tables atomically. Check `truncatedTables`:+nonempty means a read hit the row cap and aggregates may be partial. SQL schemas+are dynamic, so result cells use a generated tagged union rather than an inferred+TypeScript interface for each table. The HTTP route is `POST /databases/query`.++The SDK's schema methods write typed ops through one endpoint,`POST /databases/{id}/ops`. The methods below each send a one-op batch: theSDK mints the new table, column, and option ids (UUIDv7) itself and builds thehandle it returns from the op's result.@@ -334,6 +354,155 @@ await macro.channels.send(msg`Deploy ${sha} finished. ${here}`);```+### Routines++Create scheduled or event-triggered agent tasks through `macro.routines`.+Routine configuration takes typed agent and event resource handles:++```ts+const routine = await macro.routines.create({+ name: 'Daily summary',+ prompt: 'Summarize my open tasks.',+ userPrompt: 'A daily task summary',+ trigger: { type: 'cron', schedule: '0 9 * * *', timezone: 'America/New_York' },+});+await routine.setEnabled(false);+const transcript = await routine.execute(); // Chat or AgentSession, if available+const executions = await routine.history(); // Each retains its parent routine+```++Event triggers use `{ type: 'events', filters: [{ events, entities, condition }] }`;+`entities` takes typed references such as `{ type: 'document', entity: doc }`.+Use `{ type: 'multiple', triggers: [...] }` to combine schedules and events.+`routine.update(options)` replaces task and trigger settings; `delete()` removes it.++### Agents, conversations and hosts++`macro.agents.list/create/byId` manage agent configuration. `AgentOptions` takes+channel, team and host handles. Updates replace the configuration.+`channel.agentConversations()` returns conversations with session and turn handles;+`conversation.startFresh(session)` and `turn.retry(actionId)` expose explicit+conversation controls. `session.toolApprovalById(id).answer(answer)` answers a+permission request scoped to that session.++`macro.harnesses.list/me/byId` manages agent hosts. `createPairing(options)` returns+separate pairing and device handles plus a device secret. Approve through+`pairing.approve(...)`, then `device.claim(deviceSecret)`; a pending claim returns+`undefined`. Host tokens and device secrets are never stored in entity handles.+Self-host operations (`me`, `agents`, `sessions`, `deleteSelf`) require the backend's+host authentication; ordinary user or bot credentials do not grant those rights.++### Drafts, filters and follow-ups++```ts+const inbox = (await macro.email.links())[0];+const draft = await macro.email.createDraft({+ subject: 'Follow-up',+ to: [{ email: '[email protected]' }],+ bodyHtml: '<p>Thanks for meeting.</p>',+}, inbox);+await draft.update({ subject: 'Follow-up notes', bodyText: 'Thanks for meeting.' });+const upload = await draft.addAttachment({ fileName: 'notes.txt', sha, size });+// Upload bytes to upload.uploadUrl, then verify before sending:+await upload.attachment.complete();+await draft.schedule('2026-11-01T09:00:00Z');+await draft.unschedule();+```++HTML input is UTF-8 encoded for the wire contract. Draft writes retain the draft's+inbox selection, including delegated inboxes. `update` replaces content; omitted+recipients and body fields follow the server's replacement semantics.+`draft.forwardAttachment(attachment)` returns a draft-scoped attachment handle.+Use its `remove()` method to detach it. `email.scheduled({ inbox, pageSize })`+automatically pages; breaking iteration stops further requests.++`email.filters(inbox)` and `email.upsertFilter(options, inbox)` return filter handles+with `setImportant` and `delete`. Omit the inbox to select the caller's primary.+`email.contacts()` returns the service's address/interaction buckets.+`thread.calendarInvitations()` reads resolved invitations. `thread.followup()` and+`thread.setFollowup(command)` expose revision-aware reminder state; commands require+caller-persisted operation IDs. `email.reminders({ inboxes })` auto-paginates and+returns thread handles alongside reminder snapshots.++### CRM pipelines and initiatives++`macro.crm.pipelines.create/list/byId` returns pipeline handles. Rename, sharing,+permissions and trash operations live on the pipeline. `pipeline.table()` returns+its table handle, with column and row handles. `rows()` and `queryRows({ rows, query })`+fetch through the pipeline's authorization boundary and auto-paginate.+`pipeline.applyOps(ops, { baseVersions: [{ table, version }] })` accepts the generated+atomic database operation contract, including batch-local UUIDs, like+`Database.applyOps`. Table and column reads share a schema cache invalidated by+successful batches. Call `row.refresh()` to reload a row after a batch changes it.++`macro.initiatives.create/list/byId` groups tasks and members. Relations return user+and task handles; `initiative.update({ name, members, sharePermission })` and+`delete()` manage it.++### Access requests and message threads++Documents, chats, projects, initiatives, databases, calls, email threads and agent+sessions expose `.access`. `access.state()` returns review rights, typed requests,+and an optional continuation offset. `submit(level)`, `cancel(revision)`,+`request.resolve(level)`, `direct()`, `grant(user, level)`, and `remove(user)` use+server authorization and optimistic request revisions. Omit the level on+`request.resolve()` to decline. Resolved request handles retain their result even+after they leave the pending listing.++New sharing updates use `SharePermissionOptions`: channel grants name a channel+handle, operation (`add`, `replace`, `remove`) and optional access level.++Channels, documents, CRM companies/contacts and calls expose+`messageThreadById(id)` for thread resolution, anchor detachment and deletion.+`timelinePage({ messages, around, cursor, limit })` returns a mixed timeline with+seeded message handles and typed activity actors. Selectors must belong to the same+parent. Cursors are opaque; pass the returned cursor on the next request.+`channel.recordActivity(type)` records a view or interaction; `channels.activity()`+reads activity handles. `ChannelPicture.byId(uploadId)` references an uploaded+picture for `channel.setPicture(picture)`; omit it to clear the picture.++### Meetings and calendar browsing++`macro.meetings.create/list/active/lookup` returns meeting handles. `list()` contains+the caller's newest 100 standalone meetings; use `lookup(invitationToken)` for+channel meetings and other invitations. A seeded meeting retains its lookup token+when mutations invalidate metadata. `update`, `cancel`, `invite(email)`,+`inviteUsers(users)`, `invitePermissions` and `webUrl` live on the meeting.+`call.meeting()` creates or reads its shareable meeting; calls also expose+`editTranscript(assignments)` and `toggleTeamShare()`.++`calendar.occurrences(viewport)` auto-paginates and seeds event handles.+`calendar.teamPage(viewport)` includes the roster and an optional next cursor;+`teamOutOfOffice(viewport)` reports `hasMore` when its bounded results are truncated.+`availabilityCalendars`, `calendar.setContributesToAvailability`, `teamSharing` and+`setTeamSharing` manage availability and sharing preferences.++### Document lifecycle and other resources++`documents.createUpload(options)` reserves a binary document and returns upload+instructions. `document.prepareSave(parts)`, `save(options)` and `simpleSave()` expose+the existing content lifecycle; upload bytes before committing. Version handles+come from `document.version(number)`. PDF highlights and comment anchors are scoped+handles from `anchors()` / `createHighlight(options)`, with kind-checked edits and+deletion. `documents.byTeamSlug('ENG-42')` resolves a task reference.+`sharePermissions`, `permissionsToken` and `documents.validatePermissionsToken`+expose document access contracts.++`macro.githubPullRequests.byId(foreignEntityId)` reads stored GitHub snapshots;+`changes()` returns a changeset handle with `patch()`. `macro.entityMentions.create`+takes typed source/target references and returns a deletable mention handle.+`macro.unfurls.get(url)` and `bulk(urls)` read URL preview metadata.++`macro.apiKeys.create(name)` returns `{ key, secret }`. Save the secret immediately;+the handle only retains metadata. `list()` and `key.delete()` manage keys.+`tokenForEmail(email)` exchanges credentials subject to ordinary server authorization.++`chat.send({ content, model, attachments, toolset })` starts a generation and returns+its chat, response message and cancellable stream handle. Use+`generation.message.refresh()` after it changes; reading an unfinished response+may report that it is not yet available. Tools can perform writes unless disabled.+`macro.ai.usage({ from, until, users, features })` reads AI usage.+# Events`macro.events` is always available. The default transport is a live SSEdiff --git a/packages/sdk/biome.jsonc b/packages/sdk/biome.jsoncindex 72e66d2275..57471e2239 100644--- a/packages/sdk/biome.jsonc+++ b/packages/sdk/biome.jsonc@@ -5,6 +5,7 @@"**/*.ts",// orval output and copied specs are build artifacts, not style-checked."!generated",+ "!dist","!specs","!node_modules"]diff --git a/packages/sdk/examples/channel-webhook.ts b/packages/sdk/examples/channel-webhook.tsindex 2f7844d4bd..0d48ce9021 100644--- a/packages/sdk/examples/channel-webhook.ts+++ b/packages/sdk/examples/channel-webhook.ts@@ -8,7 +8,7 @@** usage: MACRO_WEBHOOK_TOKEN=mbot_... bun examples/channel-webhook.ts <channel-id> [mention-user-id]*/-import { Env } from '../src/config';+import type { Env } from '../src/config';import { here, Macro, msg } from '../src/macro';const token = process.env.MACRO_WEBHOOK_TOKEN;diff --git a/packages/sdk/generated/storage/index.ts b/packages/sdk/generated/storage/index.tsindex 48c2f1a934..dbfb966eae 100644--- a/packages/sdk/generated/storage/index.ts+++ b/packages/sdk/generated/storage/index.ts@@ -1,4 +1,4 @@// This file is auto-generated by @hey-api/openapi-tsexport { type Options, Sdk } from './sdk.gen';-export type { AccessiblePipeline, AccessLevel, AccessRequest, AccessRequestsCancelData, AccessRequestsCancelErrors, AccessRequestsCancelResponses, AccessRequestsDirectData, AccessRequestsDirectErrors, AccessRequestsDirectResponse, AccessRequestsDirectResponses, AccessRequestsRemoveDirectData, AccessRequestsRemoveDirectErrors, AccessRequestsRemoveDirectResponses, AccessRequestsResolveData, AccessRequestsResolveErrors, AccessRequestsResolveResponse, AccessRequestsResolveResponses, AccessRequestsSetDirectData, AccessRequestsSetDirectErrors, AccessRequestsSetDirectResponses, AccessRequestsStateData, AccessRequestsStateErrors, AccessRequestsStateResponse, AccessRequestsStateResponses, AccessRequestsSubmitData, AccessRequestsSubmitErrors, AccessRequestsSubmitResponse, AccessRequestsSubmitResponses, AccessRequestState, ActiveCallsResponse, ActiveCallSummary, ActiveMeeting, ActiveMeetingsResponse, ActivityType, AddFavoriteData, AddFavoriteError, AddFavoriteErrors, AddFavoriteRequest, AddFavoriteResponse, AddFavoriteResponses, AddParticipantsData, AddParticipantsError, AddParticipantsErrors, AddParticipantsRequest, AddParticipantsResponses, AddPinHandlerData, AddPinHandlerError, AddPinHandlerErrors, AddPinHandlerResponse, AddPinHandlerResponses, AddPinRequest, Agent, AgentActionId, AgentChannelScope, AgentDmProfile, AgentMcpServer, AgentMcpServers, AgentPullRequestState, AgentSessionFilters, AgentSessionLifecycleEvent, AgentTyping, AgentTypingPhase, Anchor, AnchorId, AnchorResponse, AnnotationIncrementalUpdate, Answer, ApiActivity, ApiAttachmentChannelReference, ApiAttachmentEntityReference, ApiAttachmentGenericReference, ApiChannelAttachment, ApiChannelAttachmentsPage, ApiChannelDetail, ApiChannelListMessage, ApiChannelListPage, ApiChannelListParticipant, ApiChannelListType, ApiChannelParticipant, ApiChannelWithLatest, ApiEntityFilterAst, ApiGroupByField, ApiGroupMeta, ApiParticipantListRole, ApiParticipantRole, ApiPropertyEntityType, AppliedOps, ApplyCrmPipelineOpsData, ApplyCrmPipelineOpsResponse, ApplyCrmPipelineOpsResponses, ApplyDatabaseOpsData, ApplyDatabaseOpsError, ApplyDatabaseOpsErrors, ApplyDatabaseOpsResponse, ApplyDatabaseOpsResponses, ApplyOpsRequest, ApplyOpsResponse, ApproveHarnessPairingData, ApproveHarnessPairingError, ApproveHarnessPairingErrors, ApproveHarnessPairingResponse, ApproveHarnessPairingResponses, ApprovePairingRequest, AttachmentChange, AttendeeResponseStatus, Audience, Awareness, AwarenessRelay, BasicDocument, BasicDocumentSubType, BomPart, BookingTarget, Bot, BotChannel, BotChannelType, BotId, BotKind, BotOwner, BotOwnerProfile, BotSenderProfile, BotToken, BranchNameResponse, BTreeMap, BulkWakeupRequest, BulkWakeupResponse, BulkWakeupSyncServiceDocumentsData, BulkWakeupSyncServiceDocumentsErrors, BulkWakeupSyncServiceDocumentsResponse, BulkWakeupSyncServiceDocumentsResponses, CalendarAttendee, CalendarEvent, CalendarEventFilters, CalendarEventSourceContent, CalendarMentionEvent, CalendarMentionPreviewItem, CalendarMentionPreviewKind, CalendarMentionPreviewRequest, CalendarMentionPreviewRequestItem, CalendarMentionPreviewResponse, CalendarOccurrence, CalendarOccurrenceItem, CalendarOccurrenceResponse, CalendarSyncStatus, CallActiveResponse, CallFilters, CallRecord, CallRecordGuest, CallRecordParticipant, CallRecordPreview, CallRecordPreviewData, CallRecordTranscriptSegment, CallStatus, CallTokenResponse, CallWebhookData, CallWebhookError, CallWebhookErrors, CallWebhookResponses, CancelSlackImportData, CancelSlackImportErrors, CancelSlackImportResponse, CancelSlackImportResponses, CardPosition, CastVerdict, CellValue, CellWrite, ChangedFileDto, ChangesetDto, ChangesetSourceDto, Channel, ChannelCreatedMetadata, ChannelDeletedMetadata, ChannelFilters, ChannelJoinCodeResponse, ChannelLabel, ChannelLabelRule, ChannelLabelsList, ChannelMessage, ChannelParticipant, ChannelParticipantAddedMetadata, ChannelParticipantRemovedMetadata, ChannelPictureChangedMetadata, ChannelPreview, ChannelPreviewData, ChannelSender, ChannelSharePermission, ChannelThreadFilters, ChannelTopicEvent, ChannelType, ChannelUpdatedMetadata, ChannelWebhookRequest, ChannelWebhookResponse, ChannelWithParticipants, Chat, ChatFilters, CheckActiveCallData, CheckActiveCallError, CheckActiveCallErrors, CheckActiveCallResponse, CheckActiveCallResponses, ClaimedPairing, ClaimHarnessPairingData, ClaimHarnessPairingError, ClaimHarnessPairingErrors, ClaimHarnessPairingResponse, ClaimHarnessPairingResponses, ClaimPairingRequest, ClientOptions, CloudStorageItemType, CollaborateFormData, CollaborateFormError, CollaborateFormErrors, CollaborateFormResponse, CollaborateFormResponses, CollabSurfaceResponse, CollabSurfaceTokenResponse, Column, ColumnCast, ColumnChange, ColumnChangeKind, ColumnConfig, ColumnConversion, ColumnConversionRequest, ColumnDetail, ColumnKind, ColumnProtection, ColumnResult, CommandFailure, CommandRejectedMetadata, CommittedChange, CompleteSlackImportUploadsData, CompleteSlackImportUploadsErrors, CompleteSlackImportUploadsResponse, CompleteSlackImportUploadsResponses, CompleteUploads, ConferenceProvider, Conjunction, ConversationId, ConversationKind, ConversationMetadata, ConversationProgress, ConversationSeal, ConversationStatus, ConvertDatabaseColumnData, ConvertDatabaseColumnError, ConvertDatabaseColumnErrors, ConvertDatabaseColumnResponse, ConvertDatabaseColumnResponses, ConvertedCell, CopyDocumentData, CopyDocumentError, CopyDocumentErrors, CopyDocumentQueryParams, CopyDocumentRequest, CopyDocumentResponse, CopyDocumentResponse2, CopyDocumentResponses, CountedReaction, CreateAgentData, CreateAgentError, CreateAgentErrors, CreateAgentRequest, CreateAgentResponse, CreateAgentResponses, CreateAnchorData, CreateAnchorError, CreateAnchorErrors, CreateAnchorResponse, CreateAnchorResponses, CreateBotRequest, CreateBulkDocumentResponse, CreateBulkDocumentResponseData, CreateChannelData, CreateChannelError, CreateChannelErrors, CreateChannelLabelData, CreateChannelLabelError, CreateChannelLabelErrors, CreateChannelLabelRequest, CreateChannelLabelResponse, CreateChannelLabelResponses, CreateChannelRequest, CreateChannelResponse, CreateChannelResponse2, CreateChannelResponses, CreateChannelScopedBotData, CreateChannelScopedBotError, CreateChannelScopedBotErrors, CreateChannelScopedBotRequest, CreateChannelScopedBotResponse, CreateChannelScopedBotResponse2, CreateChannelScopedBotResponses, CreateCollabSurfaceTokenData, CreateCollabSurfaceTokenError, CreateCollabSurfaceTokenErrors, CreateCollabSurfaceTokenResponse, CreateCollabSurfaceTokenResponses, CreateCrmCompanyData, CreateCrmCompanyError, CreateCrmCompanyErrors, CreateCrmCompanyRequest, CreateCrmCompanyResponse, CreateCrmCompanyResponses, CreateCrmContactData, CreateCrmContactError, CreateCrmContactErrors, CreateCrmContactRequest, CreateCrmContactResponse, CreateCrmContactResponses, CreateCrmPipelineData, CreateCrmPipelineResponse, CreateCrmPipelineResponses, CreateDatabaseData, CreateDatabaseError, CreateDatabaseErrors, CreateDatabaseRequest, CreateDatabaseResponse, CreateDatabaseResponses, CreateDatabaseWebhookData, CreateDatabaseWebhookError, CreateDatabaseWebhookErrors, CreateDatabaseWebhookRequest, CreateDatabaseWebhookResponse, CreateDatabaseWebhookResponses, CreatedDatabaseWebhookResponse, CreateDocumentData, CreateDocumentError, CreateDocumentErrors, CreateDocumentRequest, CreateDocumentResponse, CreateDocumentResponseData, CreateDocumentResponses, CreatedPairing, CreatedUserApiKey, CreateEntityMentionData, CreateEntityMentionError, CreateEntityMentionErrors, CreateEntityMentionRequest, CreateEntityMentionResponse, CreateEntityMentionResponse2, CreateEntityMentionResponses, CreateForm, CreateFormData, CreateFormError, CreateFormErrors, CreateFormResponse, CreateFormResponses, CreateHarnessPairingData, CreateHarnessPairingError, CreateHarnessPairingErrors, CreateHarnessPairingResponse, CreateHarnessPairingResponses, CreateImport, CreateInitiativeData, CreateInitiativeError, CreateInitiativeErrors, CreateInitiativeRequest, CreateInitiativeResponse, CreateInitiativeResponses, CreateInstructionsDocumentResponse, CreateInstructionsHandlerData, CreateInstructionsHandlerError, CreateInstructionsHandlerErrors, CreateInstructionsHandlerResponse, CreateInstructionsHandlerResponses, CreateMarkdownDocumentRequest, CreateMarkdownDocumentResponse, CreateMarkdownHandlerData, CreateMarkdownHandlerError, CreateMarkdownHandlerErrors, CreateMarkdownHandlerResponse, CreateMarkdownHandlerResponses, CreateMeetingRequest, CreatePairingRequest, CreatePipeline, CreateProjectHandlerData, CreateProjectHandlerError, CreateProjectHandlerErrors, CreateProjectHandlerResponse, CreateProjectHandlerResponses, CreateProjectRequest, CreateProjectResponse, CreateSkillHandlerData, CreateSkillHandlerError, CreateSkillHandlerErrors, CreateSkillHandlerResponse, CreateSkillHandlerResponses, CreateSkillRequest, CreateSkillResponse, CreateSlackImportData, CreateSlackImportErrors, CreateSlackImportResponse, CreateSlackImportResponses, CreateSnippetHandlerData, CreateSnippetHandlerError, CreateSnippetHandlerErrors, CreateSnippetHandlerResponse, CreateSnippetHandlerResponses, CreateSnippetRequest, CreateSnippetResponse, CreateTaskHandlerData, CreateTaskHandlerError, CreateTaskHandlerErrors, CreateTaskHandlerResponse, CreateTaskHandlerResponses, CreateTaskRequest, CreateTaskResponse, CreateToken, CreateUnthreadedAnchorRequest, CreateUnthreadedAnchorResponse, CreateUnthreadedPdfAnchorRequest, CreateUserApiKeyData, CreateUserApiKeyError, CreateUserApiKeyErrors, CreateUserApiKeyRequest, CreateUserApiKeyResponse, CreateUserApiKeyResponses, CreateViewHandlerData, CreateViewHandlerError, CreateViewHandlerErrors, CreateViewHandlerResponse, CreateViewHandlerResponses, CreateViewRequest, CreateWebhookData, CreateWebhookError, CreateWebhookErrors, CreateWebhookRequest, CreateWebhookResponse, CreateWebhookResponse2, CreateWebhookResponses, CrmAssociation, CrmCompanyFilters, CrmCompanyResponse, CrmContactResponse, CrmDomainResponse, CrmPermissionRole, CrmStageInput, CrmStageResponse, CrmStagesResponse, CrmTeamSettingsResponse, CustomSpeakerAssignment, Database, DatabaseDetail, DatabaseOp, DatabaseView, DatabaseWebhookDeliveryResponse, DatabaseWebhookPayloadProblem, DatabaseWebhookResponse, DataType, DateOperator, DeclineCallData, DeclineCallError, DeclineCallErrors, DeclineCallResponse, DeclineCallResponses, DeclineRingData, DeclineRingError, DeclineRingErrors, DeclineRingResponse, DeclineRingResponses, DeleteAnchorData, DeleteAnchorError, DeleteAnchorErrors, DeleteAnchorResponse, DeleteAnchorResponses, DeleteCallRecordData, DeleteCallRecordError, DeleteCallRecordErrors, DeleteCallRecordResponse, DeleteCallRecordResponses, DeleteChannelData, DeleteChannelError, DeleteChannelErrors, DeleteChannelLabelData, DeleteChannelLabelError, DeleteChannelLabelErrors, DeleteChannelLabelResponse, DeleteChannelLabelResponses, DeleteChannelResponse, DeleteChannelResponses, DeleteCollabSurfaceData, DeleteCollabSurfaceError, DeleteCollabSurfaceErrors, DeleteCollabSurfaceResponse, DeleteCollabSurfaceResponses, DeleteDatabaseWebhookData, DeleteDatabaseWebhookError, DeleteDatabaseWebhookErrors, DeleteDatabaseWebhookResponse, DeleteDatabaseWebhookResponses, DeleteDocumentData, DeleteDocumentError, DeleteDocumentErrors, DeleteDocumentResponse, DeleteDocumentResponses, DeleteEntityMentionData, DeleteEntityMentionError, DeleteEntityMentionErrors, DeleteEntityMentionResponse, DeleteEntityMentionResponse2, DeleteEntityMentionResponses, DeleteHarnessData, DeleteHarnessError, DeleteHarnessErrors, DeleteHarnessResponse, DeleteHarnessResponses, DeleteHistoryHandlerData, DeleteHistoryHandlerError, DeleteHistoryHandlerErrors, DeleteHistoryHandlerResponse, DeleteHistoryHandlerResponses, DeleteInitiativeData, DeleteInitiativeError, DeleteInitiativeErrors, DeleteInitiativeResponse, DeleteInitiativeResponses, DeleteProjectHandlerData, DeleteProjectHandlerError, DeleteProjectHandlerErrors, DeleteProjectHandlerResponse, DeleteProjectHandlerResponses, DeleteSelfHarnessData, DeleteSelfHarnessError, DeleteSelfHarnessErrors, DeleteSelfHarnessResponse, DeleteSelfHarnessResponses, DeleteUnthreadedAnchorRequest, DeleteUnthreadedAnchorResponse, DeleteUnthreadedPdfAnchorRequest, DeleteUserApiKeyData, DeleteUserApiKeyError, DeleteUserApiKeyErrors, DeleteUserApiKeyResponse, DeleteUserApiKeyResponses, DeleteUserDocumentViewLocationData, DeleteUserDocumentViewLocationError, DeleteUserDocumentViewLocationErrors, DeleteUserDocumentViewLocationResponse, DeleteUserDocumentViewLocationResponses, DeleteViewHandlerData, DeleteViewHandlerError, DeleteViewHandlerErrors, DeleteViewHandlerResponses, DeleteWebhookData, DeleteWebhookError, DeleteWebhookErrors, DeleteWebhookResponse, DeleteWebhookResponses, DeliverDatabaseWebhookData, DeliverDatabaseWebhookError, DeliverDatabaseWebhookErrors, DeliverDatabaseWebhookResponse, DeliverDatabaseWebhookResponses, DirectAccess, DocumentBasic, DocumentContent, DocumentContentLocation, DocumentContentState, DocumentContentUploadedMetadata, DocumentCopiedMetadata, DocumentCreatedMetadata, DocumentDeletedMetadata, DocumentFilters, DocumentId, DocumentInteractionMetadata, DocumentMetadata, DocumentMetadataWithContent, DocumentPermissionsToken, DocumentPermissionsTokenRequest, DocumentPermissionsTokenResponse, DocumentPreview, DocumentPreviewData, DocumentPreviewDataSubType, DocumentPurgedMetadata, DocumentResponse, DocumentResponseMetadata, DocumentResponseMetadataWithContent, DocumentStorageServiceApiVersion, DocumentSubType, DocumentSyncContentUpdatedMetadata, DocumentSyncEditor, DocumentTeamShareResponse, DocumentTextContent, DocumentTopicEvent, DocumentUpdatedMetadata, EditAnchorData, EditAnchorError, EditAnchorErrors, EditAnchorRequest, EditAnchorResponse, EditAnchorResponse2, EditAnchorResponses, EditCallRecordData, EditCallRecordError, EditCallRecordErrors, EditCallRecordRequest, EditCallRecordResponse, EditCallRecordResponses, EditCallTranscriptData, EditCallTranscriptError, EditCallTranscriptErrors, EditCallTranscriptRequest, EditCallTranscriptResponse, EditCallTranscriptResponses, EditDocumentData, EditDocumentError, EditDocumentErrors, EditDocumentResponse, EditDocumentResponse2, EditDocumentResponses, EditDocumentServiceArgs, EditMyFormResponseData, EditMyFormResponseError, EditMyFormResponseErrors, EditMyFormResponseResponse, EditMyFormResponseResponses, EditPdfAnchorRequest, EditPdfPlaceableCommentAnchorRequest, EditProjectV2Data, EditProjectV2Error, EditProjectV2Errors, EditProjectV2Response, EditProjectV2Responses, EditThreadV2Data, EditThreadV2Error, EditThreadV2Errors, EditThreadV2Response, EditThreadV2Responses, EmailFilters, EmailFollowup, EmailFollowupCommand, EmailFollowupResponse, EmailReminderCondition, EmailReminderPage, EmailReminderSummary, EmptyResponse, EnsureCollabSurfaceData, EnsureCollabSurfaceError, EnsureCollabSurfaceErrors, EnsureCollabSurfaceRequest, EnsureCollabSurfaceResponse, EnsureCollabSurfaceResponses, EnsureStarterHandlerData, EnsureStarterHandlerErrors, EnsureStarterHandlerResponse, EnsureStarterHandlerResponses, EntityFilters, EntityKind, EntityMessageCreateData, EntityMessageCreateResponse, EntityMessageCreateResponses, EntityMessageDeleteMessageData, EntityMessageDeleteMessageResponse, EntityMessageDeleteMessageResponses, EntityMessageDeleteThreadData, EntityMessageDeleteThreadResponse, EntityMessageDeleteThreadResponses, EntityMessageEditData, EntityMessageEditResponse, EntityMessageEditResponses, EntityMessageGetMessageData, EntityMessageGetMessageResponse, EntityMessageGetMessageResponses, EntityMessageGetThreadData, EntityMessageGetThreadResponse, EntityMessageGetThreadResponses, EntityMessageLegacyData, EntityMessageLegacyResponse, EntityMessageLegacyResponses, EntityMessagePatchThreadData, EntityMessagePatchThreadResponse, EntityMessagePatchThreadResponses, EntityMessageReactData, EntityMessageReactResponse, EntityMessageReactResponses, EntityMessageTypingData, EntityMessageTypingResponse, EntityMessageTypingResponses, EntityPermission, EntityPermissionResponse, EntityRef, EntityReference, EntityType, ErrorResponse, EventReminderOverride, EventReminders, EventStatus, EventTime, EventTransparency, EventType, EventVisibility, ExcludedDefaultView, ExcludeDefaultViewHandlerData, ExcludeDefaultViewHandlerError, ExcludeDefaultViewHandlerErrors, ExcludeDefaultViewHandlerResponses, ExcludeDefaultViewRequest, ExportDocumentData, ExportDocumentError, ExportDocumentErrors, ExportDocumentResponse, ExportDocumentResponse2, ExportDocumentResponses, Favorite, FavoriteEntityRef, FavoritesList, FileChangeKindDto, FileSystemNodeWithIds, FileType, FileTypeUpdate, FilterCondition, FilterGroup, FilterNode, FilterTest, FinalizeSlackImportData, FinalizeSlackImportErrors, FinalizeSlackImportResponse, FinalizeSlackImportResponses, FolderItem, FollowupState, ForeignEntity, ForeignEntityFilters, Form, FormAccess, FormCollaboration, FormDetail, FormErrorCode, FormErrorResponse, FormLayout, FormPublicationProblem, FormQuestionDetail, FormResponse, FormSection, FormSectionDetail, FormSource, FormStatus, FormTally, Formula, GenericErrorResponse, GenericResponse, GenericSuccessResponse, GetActiveCallsData, GetActiveCallsError, GetActiveCallsErrors, GetActiveCallsResponse, GetActiveCallsResponses, GetActivityData, GetActivityError, GetActivityErrors, GetActivityResponse, GetActivityResponses, GetAttachmentReferencesData, GetAttachmentReferencesError, GetAttachmentReferencesErrors, GetAttachmentReferencesResponse, GetAttachmentReferencesResponse2, GetAttachmentReferencesResponses, GetBatchCallRecordPreviewData, GetBatchCallRecordPreviewError, GetBatchCallRecordPreviewErrors, GetBatchCallRecordPreviewRequest, GetBatchCallRecordPreviewResponse, GetBatchCallRecordPreviewResponse2, GetBatchCallRecordPreviewResponses, GetBatchChannelPreviewData, GetBatchChannelPreviewError, GetBatchChannelPreviewErrors, GetBatchChannelPreviewRequest, GetBatchChannelPreviewResponse, GetBatchChannelPreviewResponse2, GetBatchChannelPreviewResponses, GetBatchPreviewHandlerData, GetBatchPreviewHandlerError, GetBatchPreviewHandlerErrors, GetBatchPreviewHandlerResponse, GetBatchPreviewHandlerResponses, GetBatchPreviewRequest, GetBatchPreviewResponse, GetBatchProjectPreviewData, GetBatchProjectPreviewError, GetBatchProjectPreviewErrors, GetBatchProjectPreviewRequest, GetBatchProjectPreviewResponse, GetBatchProjectPreviewResponse2, GetBatchProjectPreviewResponses, GetBotOwnerProfilesData, GetBotOwnerProfilesError, GetBotOwnerProfilesErrors, GetBotOwnerProfilesResponse, GetBotOwnerProfilesResponses, GetCallRecordData, GetCallRecordError, GetCallRecordErrors, GetCallRecordResponse, GetCallRecordResponses, GetChannelAttachmentsData, GetChannelAttachmentsError, GetChannelAttachmentsErrors, GetChannelAttachmentsResponse, GetChannelAttachmentsResponses, GetChannelData, GetChannelError, GetChannelErrors, GetChannelJoinLinkData, GetChannelJoinLinkError, GetChannelJoinLinkErrors, GetChannelJoinLinkResponse, GetChannelJoinLinkResponses, GetChannelParticipantsData, GetChannelParticipantsError, GetChannelParticipantsErrors, GetChannelParticipantsResponse, GetChannelParticipantsResponses, GetChannelResponse, GetChannelResponses, GetChannelsData, GetChannelsError, GetChannelsErrors, GetChannelsResponse, GetChannelsResponses, GetCollabSurfaceData, GetCollabSurfaceError, GetCollabSurfaceErrors, GetCollabSurfaceResponse, GetCollabSurfaceResponses, GetCompanyData, GetCompanyError, GetCompanyErrors, GetCompanyResponse, GetCompanyResponses, GetContactByEmailData, GetContactByEmailError, GetContactByEmailErrors, GetContactByEmailResponse, GetContactByEmailResponse2, GetContactByEmailResponses, GetContactData, GetContactError, GetContactErrors, GetContactResponse, GetContactResponses, GetCrmPipelineData, GetCrmPipelinePermissionsData, GetCrmPipelinePermissionsResponse, GetCrmPipelinePermissionsResponses, GetCrmPipelineResponse, GetCrmPipelineResponses, GetCrmPipelineRowsData, GetCrmPipelineRowsResponse, GetCrmPipelineRowsResponses, GetCrmPipelineTableData, GetCrmPipelineTableResponse, GetCrmPipelineTableResponses, GetCrmTeamSettingsData, GetCrmTeamSettingsError, GetCrmTeamSettingsErrors, GetCrmTeamSettingsResponse, GetCrmTeamSettingsResponses, GetDatabaseData, GetDatabaseError, GetDatabaseErrors, GetDatabasePermissionsData, GetDatabasePermissionsError, GetDatabasePermissionsErrors, GetDatabasePermissionsResponse, GetDatabasePermissionsResponses, GetDatabaseQueryData, GetDatabaseQueryError, GetDatabaseQueryErrors, GetDatabaseQueryResponse, GetDatabaseQueryResponses, GetDatabaseResponse, GetDatabaseResponses, GetDatabaseRowHistoryData, GetDatabaseRowHistoryError, GetDatabaseRowHistoryErrors, GetDatabaseRowHistoryResponse, GetDatabaseRowHistoryResponses, GetDatabaseTableChangesData, GetDatabaseTableChangesError, GetDatabaseTableChangesErrors, GetDatabaseTableChangesResponse, GetDatabaseTableChangesResponses, GetDatabaseViewPositionsData, GetDatabaseViewPositionsError, GetDatabaseViewPositionsErrors, GetDatabaseViewPositionsResponse, GetDatabaseViewPositionsResponses, GetDocumentAnchorsData, GetDocumentAnchorsError, GetDocumentAnchorsErrors, GetDocumentAnchorsResponse, GetDocumentAnchorsResponses, GetDocumentBranchNameData, GetDocumentBranchNameError, GetDocumentBranchNameErrors, GetDocumentBranchNameResponse, GetDocumentBranchNameResponses, GetDocumentByTeamSlugData, GetDocumentByTeamSlugError, GetDocumentByTeamSlugErrors, GetDocumentByTeamSlugResponse, GetDocumentByTeamSlugResponses, GetDocumentData, GetDocumentError, GetDocumentErrors, GetDocumentGithubPullRequestsData, GetDocumentGithubPullRequestsError, GetDocumentGithubPullRequestsErrors, GetDocumentGithubPullRequestsResponse, GetDocumentGithubPullRequestsResponses, GetDocumentKeyResponse, GetDocumentKeyResponseData, GetDocumentListHandlerData, GetDocumentListHandlerError, GetDocumentListHandlerErrors, GetDocumentListHandlerResponse, GetDocumentListHandlerResponses, GetDocumentListResult, GetDocumentLocationV3Data, GetDocumentLocationV3Error, GetDocumentLocationV3Errors, GetDocumentLocationV3Response, GetDocumentLocationV3Responses, GetDocumentPermissionsResponseDataV2, GetDocumentPermissionsTokenData, GetDocumentPermissionsTokenError, GetDocumentPermissionsTokenErrors, GetDocumentPermissionsTokenResponse, GetDocumentPermissionsTokenResponses, GetDocumentPermissionsV2Data, GetDocumentPermissionsV2Error, GetDocumentPermissionsV2Errors, GetDocumentPermissionsV2Response, GetDocumentPermissionsV2Responses, GetDocumentProcessingResult, GetDocumentProcessingResultData, GetDocumentProcessingResultError, GetDocumentProcessingResultErrors, GetDocumentProcessingResultResponse, GetDocumentProcessingResultResponse2, GetDocumentProcessingResultResponses, GetDocumentResponse, GetDocumentResponse2, GetDocumentResponseData, GetDocumentResponses, GetDocumentSearchResponse, GetDocumentShortIdData, GetDocumentShortIdError, GetDocumentShortIdErrors, GetDocumentShortIdResponse, GetDocumentShortIdResponses, GetDocumentsResponse, GetDocumentTeamShareData, GetDocumentTeamShareError, GetDocumentTeamShareErrors, GetDocumentTeamShareResponse, GetDocumentTeamShareResponses, GetDocumentTextContentData, GetDocumentTextContentErrors, GetDocumentTextContentResponse, GetDocumentTextContentResponses, GetDocumentUserAccessLevelResponse, GetDocumentVersionData, GetDocumentVersionError, GetDocumentVersionErrors, GetDocumentVersionResponse, GetDocumentVersionResponses, GetDocumentViewsHandlerData, GetDocumentViewsHandlerError, GetDocumentViewsHandlerErrors, GetDocumentViewsHandlerResponse, GetDocumentViewsHandlerResponses, GetEmailFollowupData, GetEmailFollowupError, GetEmailFollowupErrors, GetEmailFollowupResponse, GetEmailFollowupResponses, GetEntityPermissionData, GetEntityPermissionErrors, GetEntityPermissionResponse, GetEntityPermissionResponses, GetForeignEntityBySourceData, GetForeignEntityBySourceError, GetForeignEntityBySourceErrors, GetForeignEntityBySourceResponse, GetForeignEntityBySourceResponses, GetForeignEntityData, GetForeignEntityError, GetForeignEntityErrors, GetForeignEntityResponse, GetForeignEntityResponses, GetFormData, GetFormError, GetFormErrors, GetFormPermissionsData, GetFormPermissionsError, GetFormPermissionsErrors, GetFormPermissionsResponse, GetFormPermissionsResponses, GetFormResponse, GetFormResponses, GetFormResponseSummaryData, GetFormResponseSummaryError, GetFormResponseSummaryErrors, GetFormResponseSummaryResponse, GetFormResponseSummaryResponses, GetFormTallyData, GetFormTallyError, GetFormTallyErrors, GetFormTallyResponse, GetFormTallyResponses, GetGithubPullRequestChangesData, GetGithubPullRequestChangesError, GetGithubPullRequestChangesErrors, GetGithubPullRequestChangesPatchData, GetGithubPullRequestChangesPatchError, GetGithubPullRequestChangesPatchErrors, GetGithubPullRequestChangesPatchResponse, GetGithubPullRequestChangesPatchResponses, GetGithubPullRequestChangesResponse, GetGithubPullRequestChangesResponses, GetGithubPullRequestData, GetGithubPullRequestError, GetGithubPullRequestErrors, GetGithubPullRequestFacetsData, GetGithubPullRequestFacetsError, GetGithubPullRequestFacetsErrors, GetGithubPullRequestFacetsResponse, GetGithubPullRequestFacetsResponses, GetGithubPullRequestResponse, GetGithubPullRequestResponses, GetGithubPullRequestTasksData, GetGithubPullRequestTasksError, GetGithubPullRequestTasksErrors, GetGithubPullRequestTasksResponse, GetGithubPullRequestTasksResponses, GetHarnessPairingData, GetHarnessPairingError, GetHarnessPairingErrors, GetHarnessPairingResponse, GetHarnessPairingResponses, GetHistoryHandlerData, GetHistoryHandlerError, GetHistoryHandlerErrors, GetHistoryHandlerResponse, GetHistoryHandlerResponses, GetInitiativeData, GetInitiativeError, GetInitiativeErrors, GetInitiativeResponse, GetInitiativeResponses, GetInstructionsDocumentResponse, GetInstructionsHandlerData, GetInstructionsHandlerError, GetInstructionsHandlerErrors, GetInstructionsHandlerResponse, GetInstructionsHandlerResponses, GetItemsSoupData, GetItemsSoupError, GetItemsSoupErrors, GetItemsSoupResponse, GetItemsSoupResponses, GetLocationHandlerData, GetLocationHandlerError, GetLocationHandlerErrors, GetLocationHandlerResponse, GetLocationHandlerResponses, GetMyFormResponseData, GetMyFormResponseError, GetMyFormResponseErrors, GetMyFormResponseResponse, GetMyFormResponseResponses, GetOrCreateAction, GetOrCreateCallData, GetOrCreateCallError, GetOrCreateCallErrors, GetOrCreateCallResponse, GetOrCreateCallResponses, GetOrCreateChannelResponse, GetOrCreateDmData, GetOrCreateDmError, GetOrCreateDmErrors, GetOrCreateDmRequest, GetOrCreateDmResponse, GetOrCreateDmResponses, GetOrCreatePrivateData, GetOrCreatePrivateError, GetOrCreatePrivateErrors, GetOrCreatePrivateRequest, GetOrCreatePrivateResponse, GetOrCreatePrivateResponses, GetPendingProjectsHandlerData, GetPendingProjectsHandlerError, GetPendingProjectsHandlerErrors, GetPendingProjectsHandlerResponse, GetPendingProjectsHandlerResponses, GetPinsHandlerData, GetPinsHandlerError, GetPinsHandlerErrors, GetPinsHandlerResponse, GetPinsHandlerResponses, GetPinsResponse, GetProjectContentHandlerData, GetProjectContentHandlerError, GetProjectContentHandlerErrors, GetProjectContentHandlerResponse, GetProjectContentHandlerResponses, GetProjectContentResponse, GetProjectHandlerData, GetProjectHandlerError, GetProjectHandlerErrors, GetProjectHandlerResponse, GetProjectHandlerResponses, GetProjectPermissionsV2Data, GetProjectPermissionsV2Error, GetProjectPermissionsV2Errors, GetProjectPermissionsV2Response, GetProjectPermissionsV2Responses, GetProjectResponse, GetProjectResponseData, GetProjectsHandlerData, GetProjectsHandlerError, GetProjectsHandlerErrors, GetProjectsHandlerResponse, GetProjectsHandlerResponses, GetProjectsResponse, GetProjectUserAccessLevelData, GetProjectUserAccessLevelError, GetProjectUserAccessLevelErrors, GetProjectUserAccessLevelResponse, GetProjectUserAccessLevelResponses, GetRingStatusData, GetRingStatusError, GetRingStatusErrors, GetRingStatusResponse, GetRingStatusResponses, GetSelfBotData, GetSelfBotError, GetSelfBotErrors, GetSelfBotResponse, GetSelfBotResponses, GetSelfHarnessData, GetSelfHarnessError, GetSelfHarnessErrors, GetSelfHarnessResponse, GetSelfHarnessResponses, GetSlackImportData, GetSlackImportErrors, GetSlackImportResponse, GetSlackImportResponses, GetSystemSkillsHandlerData, GetSystemSkillsHandlerError, GetSystemSkillsHandlerErrors, GetSystemSkillsHandlerResponse, GetSystemSkillsHandlerResponses, GetUserDocumentsHandlerData, GetUserDocumentsHandlerError, GetUserDocumentsHandlerErrors, GetUserDocumentsHandlerResponse, GetUserDocumentsHandlerResponses, GetUserDocumentViewLocationData, GetUserDocumentViewLocationError, GetUserDocumentViewLocationErrors, GetUserDocumentViewLocationResponse, GetUserDocumentViewLocationResponses, GetUserHistoryResponse, GetViewsHandlerData, GetViewsHandlerError, GetViewsHandlerErrors, GetViewsHandlerResponse, GetViewsHandlerResponses, GetWebhookData, GetWebhookError, GetWebhookErrors, GetWebhookResponse, GetWebhookResponses, GithubLabelFacet, GithubPullRequest, GithubPullRequestChangesPatchResponse, GithubPullRequestChangesResponse, GithubPullRequestCheckRun, GithubPullRequestComment, GithubPullRequestFacets, GithubPullRequestLabel, GithubPullRequestReview, GithubPullRequestReviewDecision, GithubPullRequestReviewState, GithubPullRequestsResponse, GithubPullRequestTasks, GithubPullRequestTasksRequest, GithubPullRequestTasksResponse, GithubPullRequestUser, GithubRepositoryFacet, GithubUserFacet, GitRefDto, GroupedInitialParams, GroupedPageParams, GroupedSoupGroupPage, GroupedSoupInitialPage, GroupedSoupPage, GroupedSoupSort, GuestCallChatPostData, GuestCallChatPostErrors, GuestCallChatPostResponse, GuestCallChatPostResponses, GuestCallChatReadData, GuestCallChatReadErrors, GuestCallChatReadResponse, GuestCallChatReadResponses, GuestChatMessage, GuestChatPage, GuestChatPost, GuestId, GuestJoinRequest, HandlerData, HandlerError, HandlerErrors, HandlerResponse, HandlerResponses, Harness, HarnessAgent, HarnessId, HarnessOwner, HarnessSession, HashMap, HealthHandlerData, HealthHandlerResponse, HealthHandlerResponses, HighlightType, ImportCounters, ImportDatabaseTableData, ImportDatabaseTableError, ImportDatabaseTableErrors, ImportDatabaseTableResponse, ImportDatabaseTableResponses, ImportedAuthor, ImportError, ImportLimits, ImportPage, ImportProgress, ImportTable, ImportWarning, InferColumnTypeOutcome, InferColumnTypeRequest, InferDatabaseColumnTypeData, InferDatabaseColumnTypeError, InferDatabaseColumnTypeErrors, InferDatabaseColumnTypeResponse, InferDatabaseColumnTypeResponses, InFlightTurnSummary, IngestTranscriptData, IngestTranscriptError, IngestTranscriptErrors, IngestTranscriptResponses, InitializeUserDocumentsData, InitializeUserDocumentsError, InitializeUserDocumentsErrors, InitializeUserDocumentsResponse, InitializeUserDocumentsResponses, InitialPropertyValue, InitiativeDetail, InitiativeFilters, InitiativeId, InitiativeList, InitiativeSummary, InputReceivedMetadata, InstallSyncData, InstallSyncErrors, InteractionReason, InvalidDatabaseWebhookPayloadResponse, InviteMeetingRequest, InviteMeetingUsersRequest, Item, ItemWithUserAccessLevel, JobId, JobProcessingResultHandlerData, JobProcessingResultHandlerError, JobProcessingResultHandlerErrors, JobProcessingResultHandlerResponse, JobProcessingResultHandlerResponses, JobStatus, JoinChannelByCodeData, JoinChannelByCodeError, JoinChannelByCodeErrors, JoinChannelByCodeResponses, JoinChannelData, JoinChannelError, JoinChannelErrors, JoinChannelResponses, KeySegment, Lane, LaneKey, LatestMessage, LayoutProblem, LeaveCallResponse, LeaveChannelData, LeaveChannelError, LeaveChannelErrors, LeaveChannelResponses, LeaveOrEndCallData, LeaveOrEndCallError, LeaveOrEndCallErrors, LeaveOrEndCallResponse, LeaveOrEndCallResponses, LinkShare, ListAccessibleFormsData, ListAccessibleFormsError, ListAccessibleFormsErrors, ListAccessibleFormsResponse, ListAccessibleFormsResponses, ListAgentsData, ListAgentsError, ListAgentsErrors, ListAgentsResponse, ListAgentsResponses, ListBotChannelsData, ListBotChannelsError, ListBotChannelsErrors, ListBotChannelsResponse, ListBotChannelsResponses, ListChannelLabelsData, ListChannelLabelsError, ListChannelLabelsErrors, ListChannelLabelsResponse, ListChannelLabelsResponses, ListCompanyContactsData, ListCompanyContactsError, ListCompanyContactsErrors, ListCompanyContactsResponse, ListCompanyContactsResponses, ListCrmPipelinesData, ListCrmPipelinesResponse, ListCrmPipelinesResponses, ListDatabaseColumnCastsData, ListDatabaseColumnCastsError, ListDatabaseColumnCastsErrors, ListDatabaseColumnCastsResponse, ListDatabaseColumnCastsResponses, ListDatabasesData, ListDatabasesError, ListDatabasesErrors, ListDatabasesResponse, ListDatabasesResponses, ListDatabaseWebhooksData, ListDatabaseWebhooksError, ListDatabaseWebhooksErrors, ListDatabaseWebhooksResponse, ListDatabaseWebhooksResponse2, ListDatabaseWebhooksResponses, ListedDatabase, ListedForm, ListEmailRemindersData, ListEmailRemindersError, ListEmailRemindersErrors, ListEmailRemindersResponse, ListEmailRemindersResponses, ListFavoritesData, ListFavoritesError, ListFavoritesErrors, ListFavoritesResponse, ListFavoritesResponses, ListFormsData, ListFormsError, ListFormsErrors, ListFormsResponse, ListFormsResponses, ListHarnessAgentsData, ListHarnessAgentsError, ListHarnessAgentsErrors, ListHarnessAgentsResponse, ListHarnessAgentsResponses, ListHarnessesData, ListHarnessesError, ListHarnessesErrors, ListHarnessesResponse, ListHarnessesResponses, ListHarnessSessionsData, ListHarnessSessionsError, ListHarnessSessionsErrors, ListHarnessSessionsResponse, ListHarnessSessionsResponses, ListInitiativesData, ListInitiativesError, ListInitiativesErrors, ListInitiativesResponse, ListInitiativesResponses, ListOccurrencesData, ListOccurrencesErrors, ListOccurrencesResponse, ListOccurrencesResponses, ListSlackImportsData, ListSlackImportsResponse, ListSlackImportsResponses, ListTeamCalendarData, ListTeamCalendarResponse, ListTeamCalendarResponses, ListTeamOutOfOfficeData, ListTeamOutOfOfficeErrors, ListTeamOutOfOfficeResponse, ListTeamOutOfOfficeResponses, ListUserApiKeysData, ListUserApiKeysError, ListUserApiKeysErrors, ListUserApiKeysResponse, ListUserApiKeysResponses, ListWebhooksData, ListWebhooksError, ListWebhooksErrors, ListWebhooksResponse, ListWebhooksResponse2, ListWebhooksResponses, LocationResponseData, LocationResponseV3, MacroUserIdStr, Meeting, MeetingCancelData, MeetingCancelError, MeetingCancelErrors, MeetingCancelPreparationData, MeetingCancelPreparationError, MeetingCancelPreparationErrors, MeetingCancelPreparationResponse, MeetingCancelPreparationResponses, MeetingCancelResponse, MeetingCancelResponses, MeetingCreateData, MeetingCreateError, MeetingCreateErrors, MeetingCreateResponse, MeetingCreateResponses, MeetingGuestJoinData, MeetingGuestJoinError, MeetingGuestJoinErrors, MeetingGuestJoinResponse, MeetingGuestJoinResponses, MeetingGuestParticipantsData, MeetingGuestParticipantsError, MeetingGuestParticipantsErrors, MeetingGuestParticipantsResponse, MeetingGuestParticipantsResponses, MeetingInviteData, MeetingInviteError, MeetingInviteErrors, MeetingInvitePermissions, MeetingInvitePermissionsData, MeetingInvitePermissionsError, MeetingInvitePermissionsErrors, MeetingInvitePermissionsResponse, MeetingInvitePermissionsResponses, MeetingInviteResponse, MeetingInviteResponses, MeetingInviteUsersData, MeetingInviteUsersError, MeetingInviteUsersErrors, MeetingInviteUsersResponse, MeetingInviteUsersResponses, MeetingJoinData, MeetingJoinError, MeetingJoinErrors, MeetingJoinResponse, MeetingJoinResponses, MeetingLeaveData, MeetingLeaveError, MeetingLeaveErrors, MeetingLeaveResponse, MeetingLeaveResponses, MeetingListActiveData, MeetingListActiveError, MeetingListActiveErrors, MeetingListActiveResponse, MeetingListActiveResponses, MeetingListData, MeetingListError, MeetingListErrors, MeetingListResponse, MeetingListResponses, MeetingLookupData, MeetingLookupError, MeetingLookupErrors, MeetingLookupResponse, MeetingLookupResponses, MeetingParticipant, MeetingParticipants, MeetingParticipantsData, MeetingParticipantsError, MeetingParticipantsErrors, MeetingParticipantsResponse, MeetingParticipantsResponses, MeetingPreparation, MeetingPrepareData, MeetingPrepareError, MeetingPrepareErrors, MeetingPrepareResponse, MeetingPrepareResponses, MeetingShareData, MeetingShareError, MeetingShareErrors, MeetingShareResponse, MeetingShareResponses, MeetingsResponse, MeetingToken, MeetingUpdateData, MeetingUpdateError, MeetingUpdateErrors, MeetingUpdateResponse, MeetingUpdateResponses, MentionPreviewsData, MentionPreviewsErrors, MentionPreviewsResponse, MentionPreviewsResponses, Message, MessageAttachment, MessageAttachmentCreatedMetadata, MessageAttachmentRemovedMetadata, MessageChange, MessageCursor, MessageDeletedMetadata, MessageDirection, MessageEvent, MessageEventAttachment, MessageListItem, MessageMentionedMetadata, MessagePage, MessageParent, MessagePatch, MessagePatchedMetadata, MessagePostedMetadata, MessageThread, MessageThreadPreview, MessageTimelineData, MessageTimelineEntriesData, MessageTimelineEntriesResponse, MessageTimelineEntriesResponses, MessageTimelineEntry, MessageTimelinePage, MessageTimelineQuery, MessageTimelineResponse, MessageTimelineResponses, MessageTopicEvent, MyResponse, NewAttachment, NewColumn, NewOption, NewThreadAnchor, NewView, NotificationFilters, NotificationState, NumberOperator, OpBatch, Operator, OpRefusalResponse, OpResult, OptionRef, PairingDetails, Params, ParticipantRole, PatchBotRequest, PatchChannelData, PatchChannelError, PatchChannelErrors, PatchChannelRequest, PatchChannelResponse, PatchChannelResponses, PatchMessageNotificationPolicy, PatchProjectRequestV2, PatchThreadRequestV2, PatchViewHandlerData, PatchViewHandlerError, PatchViewHandlerErrors, PatchViewHandlerResponses, PatchWebhookData, PatchWebhookError, PatchWebhookErrors, PatchWebhookRequest, PatchWebhookResponse, PatchWebhookResponses, PdfAnchor, PdfAnchorId, PdfHighlightAnchor, PdfHighlightAnchorRequest, PdfHighlightRect, PdfHighlightRectAnchorRequest, PdfPlaceableCommentAnchor, PendingClaimResponse, PermanentlyDeleteDocumentData, PermanentlyDeleteDocumentError, PermanentlyDeleteDocumentErrors, PermanentlyDeleteDocumentResponse, PermanentlyDeleteDocumentResponses, PermanentlyDeleteProjectData, PermanentlyDeleteProjectError, PermanentlyDeleteProjectErrors, PermanentlyDeleteProjectResponse, PermanentlyDeleteProjectResponses, PinnedItem, PinRequest, Pipeline, PipelineRecordType, PipelineSharing, PostActivityData, PostActivityError, PostActivityErrors, PostActivityRequest, PostActivityResponse, PostActivityResponses, PostChannelBotWebhookData, PostChannelBotWebhookError, PostChannelBotWebhookErrors, PostChannelBotWebhookResponse, PostChannelBotWebhookResponses, PostGroupedSoupAstGroupPageRequest, PostGroupedSoupAstInitialRequest, PostGroupedSoupAstRequest, PostItemsSoupAstData, PostItemsSoupAstError, PostItemsSoupAstErrors, PostItemsSoupAstGroupedData, PostItemsSoupAstGroupedError, PostItemsSoupAstGroupedErrors, PostItemsSoupAstGroupedResponse, PostItemsSoupAstGroupedResponses, PostItemsSoupAstResponse, PostItemsSoupAstResponses, PostItemsSoupData, PostItemsSoupError, PostItemsSoupErrors, PostItemsSoupResponse, PostItemsSoupResponses, PostMessage, PostMessageNotificationPolicy, PostSoupAstRequest, PostSoupRequest, PresaveDocumentHandlerData, PresaveDocumentHandlerError, PresaveDocumentHandlerErrors, PresaveDocumentHandlerResponse, PresaveDocumentHandlerResponses, PreSaveDocumentRequest, PreSaveDocumentResponse, PreSaveDocumentResponseData, PresenceOperator, PresignedUrl, PreviewSmartTagData, PreviewSmartTagError, PreviewSmartTagErrors, PreviewSmartTagResponse, PreviewSmartTagResponses, Project, ProjectDeleteResponseData, ProjectDocumentStatus, ProjectFilters, ProjectPreview, ProjectPreviewData, PropertyDefinition, PropertyDefinitionWithOptions, PropertyFilter, PropertyInput, PropertyOption, PropertyOptionValue, PropertyOwner, PropertyValue, PutCrmTeamSettingsData, PutCrmTeamSettingsError, PutCrmTeamSettingsErrors, PutCrmTeamSettingsResponse, PutCrmTeamSettingsResponses, PutCrmTeamStagesData, PutCrmTeamStagesError, PutCrmTeamStagesErrors, PutCrmTeamStagesResponse, PutCrmTeamStagesResponses, PutFormLayoutData, PutFormLayoutError, PutFormLayoutErrors, PutFormLayoutResponse, PutFormLayoutResponses, QueryCrmPipelineRowsData, QueryCrmPipelineRowsResponse, QueryCrmPipelineRowsResponses, QueryDefinition, QuestionLayout, QuestionOption, QuestionTally, ReactionInput, RecentlyDeletedData, RecentlyDeletedError, RecentlyDeletedErrors, RecentlyDeletedResponse, RecentlyDeletedResponseData, RecentlyDeletedResponses, RegisterSlackImportUploadsData, RegisterSlackImportUploadsErrors, RegisterSlackImportUploadsResponse, RegisterSlackImportUploadsResponses, RegisterUploads, RemoveBotFromChannelByBotData, RemoveBotFromChannelByBotError, RemoveBotFromChannelByBotErrors, RemoveBotFromChannelByBotResponse, RemoveBotFromChannelByBotResponses, RemoveFavoriteByEntityData, RemoveFavoriteByEntityError, RemoveFavoriteByEntityErrors, RemoveFavoriteByEntityResponses, RemoveParticipantsData, RemoveParticipantsError, RemoveParticipantsErrors, RemoveParticipantsRequest, RemoveParticipantsResponses, RemovePinHandlerData, RemovePinHandlerError, RemovePinHandlerErrors, RemovePinHandlerResponse, RemovePinHandlerResponses, RenameChannelLabelData, RenameChannelLabelError, RenameChannelLabelErrors, RenameChannelLabelRequest, RenameChannelLabelResponse, RenameChannelLabelResponses, RenameCrmPipelineData, RenameCrmPipelineResponse, RenameCrmPipelineResponses, RenamePipeline, ReorderFavoritesData, ReorderFavoritesError, ReorderFavoritesErrors, ReorderFavoritesRequest, ReorderFavoritesResponses, ReorderPinRequest, ReorderPinsHandlerData, ReorderPinsHandlerError, ReorderPinsHandlerErrors, ReorderPinsHandlerResponse, ReorderPinsHandlerResponses, ReplaceCrmStagesRequest, RequestAccess, RequestedHarnessScope, RequestedLayout, RequestStatus, ResetCrmTeamStagesData, ResetCrmTeamStagesError, ResetCrmTeamStagesErrors, ResetCrmTeamStagesResponse, ResetCrmTeamStagesResponses, ResolveRequest, ResponseStatus, ResponseSummary, RevertDeleteDocumentData, RevertDeleteDocumentError, RevertDeleteDocumentErrors, RevertDeleteDocumentResponse, RevertDeleteDocumentResponses, RevertDeleteProjectData, RevertDeleteProjectError, RevertDeleteProjectErrors, RevertDeleteProjectResponse, RevertDeleteProjectResponses, RingStatus, RingStatusResponse, RowChange, RowChangeKind, RowChanges, RowHistoryEntry, RowHistoryResponse, RowId, RowsChange, RowsResult, S3ObjectInfo, SaveBomPart, SaveDatabaseQueryData, SaveDatabaseQueryError, SaveDatabaseQueryErrors, SaveDatabaseQueryResponse, SaveDatabaseQueryResponses, SaveDocumentHandlerData, SaveDocumentHandlerError, SaveDocumentHandlerErrors, SaveDocumentHandlerResponse, SaveDocumentHandlerResponses, SaveDocumentRequest, SaveDocumentResponse, SaveDocumentResponseData, SavedQuery, SaveQueryRequest, SearchContactsData, SearchContactsError, SearchContactsErrors, SearchContactsResponse, SearchContactsResponse2, SearchContactsResponses, SearchState, SectionCount, SessionDeletedMetadata, SessionIdentity, SessionMentionedMetadata, SessionOpenedMetadata, SessionRenamedMetadata, SessionSettledMetadata, SessionStoppedMetadata, SetChannelLabelData, SetChannelLabelError, SetChannelLabelErrors, SetChannelLabelRequest, SetChannelLabelResponse, SetChannelLabelResponses, SetChannelPictureData, SetChannelPictureError, SetChannelPictureErrors, SetChannelPictureRequest, SetChannelPictureResponse, SetChannelPictureResponses, SetCompanyHiddenData, SetCompanyHiddenError, SetCompanyHiddenErrors, SetCompanyHiddenRequest, SetCompanyHiddenResponse, SetCompanyHiddenResponses, SetCompanyNameRequest, SetContactHiddenData, SetContactHiddenError, SetContactHiddenErrors, SetContactHiddenRequest, SetContactHiddenResponse, SetContactHiddenResponses, SetContactNameRequest, SetCrmCompanyNameData, SetCrmCompanyNameError, SetCrmCompanyNameErrors, SetCrmCompanyNameResponse, SetCrmCompanyNameResponses, SetCrmContactNameData, SetCrmContactNameError, SetCrmContactNameErrors, SetCrmContactNameResponse, SetCrmContactNameResponses, SetDirectAccess, SetDocumentTeamShareData, SetDocumentTeamShareError, SetDocumentTeamShareErrors, SetDocumentTeamShareRequest, SetDocumentTeamShareResponse, SetDocumentTeamShareResponses, SetEmailFollowupData, SetEmailFollowupError, SetEmailFollowupErrors, SetEmailFollowupResponse, SetEmailFollowupResponses, SetEmailSyncData, SetEmailSyncError, SetEmailSyncErrors, SetEmailSyncRequest, SetEmailSyncResponse, SetEmailSyncResponses, SetOperator, SetPropertyValue, Sha256Digest, ShareCrmPipelineData, ShareCrmPipelineResponse, ShareCrmPipelineResponses, ShareDatabaseAwarenessData, ShareDatabaseAwarenessError, ShareDatabaseAwarenessErrors, ShareDatabaseAwarenessResponse, ShareDatabaseAwarenessResponses, SharedEmailFilter, ShareEntity, ShareEntityType, SharePermissionV2, SharePipeline, ShortIdResponse, SimpleMention, SimpleSaveData, SimpleSaveError, SimpleSaveErrors, SimpleSaveResponse, SimpleSaveResponses, SkippedCell, SlackCompleteRequest, SlackCreateRequest, SlackRegisterRequest, SlackTimestamp, SlackUserId, SmartTagChannelMatch, SmartTagPreview, SortDirection, SortKey, SoupAgentSessionSoupPropertiesField, SoupApiItem, SoupApiSort, SoupApiSortDirection, SoupAttachment, SoupCalendarEventSoupPropertiesField, SoupCalendarEventTime, SoupCallRecordGuest, SoupCallRecordParticipant, SoupCallRecordSoupPropertiesField, SoupChannel, SoupChannelThread, SoupChatSoupPropertiesField, SoupContact, SoupCountedReaction, SoupCrmCompanySoupPropertiesField, SoupCrmContactSoupPropertiesField, SoupCrmDomain, SoupDatabaseRowSoupPropertiesField, SoupDocumentSoupPropertiesField, SoupDocumentSubType, SoupEmailThreadPreview, SoupEnrichedEmailThreadPreviewSoupPropertiesField, SoupForeignEntity, SoupInitiativeSoupPropertiesField, SoupItem, SoupLabel, SoupLabelListVisibility, SoupLabelType, SoupMessageAttachment, SoupMessageListVisibility, SoupMessageSender, SoupMessageSenderType, SoupPage, SoupProjectSoupPropertiesField, SoupPropertiesField, SoupProperty, SoupThreadInfo, SoupThreadReply, SourceBinding, SourceId, SourceIdentity, StarterDatabase, StarterDocumentsResponse, StorageRow, StorageRows, StorageRowsQuery, StoredGithubPullRequest, StreamEventsData, StreamEventsError, StreamEventsErrors, StreamEventsResponse, StreamEventsResponses, String, Submission, SubmissionOutcome, SubmitFormResponseData, SubmitFormResponseError, SubmitFormResponseErrors, SubmitFormResponseResponse, SubmitFormResponseResponses, SuccessResponse, SurfaceState, SyncServiceVersionId, SystemSkillSummary, Table, TableChange, TableChanged, TableChanges, TableDetail, TableResult, TableVersion, TagFilterMode, TakenId, TallyBucket, TallyValue, TaskFilters, TeamCalendarContent, TeamCalendarCoverage, TeamCalendarDetails, TeamCalendarItem, TeamCalendarMember, TeamCalendarPage, TeamCalendarSharing, TeamOutOfOfficeItem, TeamOutOfOfficeResponse, TeamRole, TextOperator, ThreadAnchor, ThreadOrigin, ThreadPatch, ThreadState, TimelineActivity, ToggleShareWithTeamData, ToggleShareWithTeamError, ToggleShareWithTeamErrors, ToggleShareWithTeamResponse, ToggleShareWithTeamResponses, TouchedColumn, TouchedRow, TranscribeDictationData, TranscribeDictationError, TranscribeDictationErrors, TranscribeDictationResponse, TranscribeDictationResponses, TranscribeResponse, TranscriptSegmentRequest, TrashCrmPipelineData, TrashCrmPipelineResponse, TrashCrmPipelineResponses, TrashPipeline, TurnEndedMetadata, TurnStartedMetadata, TurnSummary, TypedSuccessResponse, TypedSuccessResponseGetDocumentResponseData, TypingInput, UndoChangeResponse, UndoDatabaseChangeData, UndoDatabaseChangeError, UndoDatabaseChangeErrors, UndoDatabaseChangeResponse, UndoDatabaseChangeResponses, UndoOutcome, UndoRefusal, UnlockedBooking, UpdateAgentData, UpdateAgentError, UpdateAgentErrors, UpdateAgentRequest, UpdateAgentResponse, UpdateAgentResponses, UpdateChannelSharePermission, UpdateCrmPipelinePermissionsData, UpdateCrmPipelinePermissionsResponse, UpdateCrmPipelinePermissionsResponses, UpdateCrmTeamSettingsRequest, UpdateDatabasePermissionsData, UpdateDatabasePermissionsError, UpdateDatabasePermissionsErrors, UpdateDatabasePermissionsResponse, UpdateDatabasePermissionsResponses, UpdateForm, UpdateFormData, UpdateFormError, UpdateFormErrors, UpdateFormPermissionsData, UpdateFormPermissionsError, UpdateFormPermissionsErrors, UpdateFormPermissionsResponse, UpdateFormPermissionsResponses, UpdateFormResponse, UpdateFormResponses, UpdateInitiativeData, UpdateInitiativeError, UpdateInitiativeErrors, UpdateInitiativeRequest, UpdateInitiativeResponse, UpdateInitiativeResponses, UpdateMeetingRequest, UpdateOperation, UpdateSharePermissionRequestV2, UploadDescriptor, UploadDocumentStatus, UploadExtractFolderHandlerData, UploadExtractFolderHandlerError, UploadExtractFolderHandlerErrors, UploadExtractFolderHandlerResponse, UploadExtractFolderHandlerResponses, UploadExtractFolderRequest, UploadFolderHandlerData, UploadFolderHandlerError, UploadFolderHandlerErrors, UploadFolderHandlerResponse, UploadFolderHandlerResponses, UploadFolderRequest, UploadGrant, UploadId, UpsertHistoryHandlerData, UpsertHistoryHandlerError, UpsertHistoryHandlerErrors, UpsertHistoryHandlerResponse, UpsertHistoryHandlerResponses, UpsertUserDocumentViewLocationData, UpsertUserDocumentViewLocationError, UpsertUserDocumentViewLocationErrors, UpsertUserDocumentViewLocationRequest, UpsertUserDocumentViewLocationResponse, UpsertUserDocumentViewLocationResponses, UserApiKeyId, UserApiKeyInfo, UserApiKeysList, UserDocumentsResponse, UserDocumentViewLocation, UserDocumentViewLocationResponse, UserPinsResponse, UserViewsResponse, ValidateDocumentPermissionsTokenData, ValidateDocumentPermissionsTokenError, ValidateDocumentPermissionsTokenErrors, ValidateDocumentPermissionsTokenResponse, ValidateDocumentPermissionsTokenResponses, ValidateWebhookData, ValidateWebhookError, ValidateWebhookErrors, ValidateWebhookResponse, ValidateWebhookResponse2, ValidateWebhookResponses, Vec, VersionedTable, View, ViewChange, ViewColumn, ViewLayout, ViewPatch, ViewPosition, ViewPositionsResponse, ViewQuery, ViewResult, ViewsResponse, WaitingForInputMetadata, Webhook, WebhookEvent, WebhookFilter, WebhookScope, WebhookStatus, WebhookValidationTestEvent, Widget, WithCallId, WithChannelId, WithDocumentId, WithProjectId } from './types.gen';+export type { AccessiblePipeline, AccessLevel, AccessRequest, AccessRequestsCancelData, AccessRequestsCancelErrors, AccessRequestsCancelResponses, AccessRequestsDirectData, AccessRequestsDirectErrors, AccessRequestsDirectResponse, AccessRequestsDirectResponses, AccessRequestsRemoveDirectData, AccessRequestsRemoveDirectErrors, AccessRequestsRemoveDirectResponses, AccessRequestsResolveData, AccessRequestsResolveErrors, AccessRequestsResolveResponse, AccessRequestsResolveResponses, AccessRequestsSetDirectData, AccessRequestsSetDirectErrors, AccessRequestsSetDirectResponses, AccessRequestsStateData, AccessRequestsStateErrors, AccessRequestsStateResponse, AccessRequestsStateResponses, AccessRequestsSubmitData, AccessRequestsSubmitErrors, AccessRequestsSubmitResponse, AccessRequestsSubmitResponses, AccessRequestState, ActiveCallsResponse, ActiveCallSummary, ActiveMeeting, ActiveMeetingsResponse, ActivityType, AddFavoriteData, AddFavoriteError, AddFavoriteErrors, AddFavoriteRequest, AddFavoriteResponse, AddFavoriteResponses, AddParticipantsData, AddParticipantsError, AddParticipantsErrors, AddParticipantsRequest, AddParticipantsResponses, AddPinHandlerData, AddPinHandlerError, AddPinHandlerErrors, AddPinHandlerResponse, AddPinHandlerResponses, AddPinRequest, Agent, AgentActionId, AgentChannelScope, AgentDmProfile, AgentMcpServer, AgentMcpServers, AgentPullRequestState, AgentSessionFilters, AgentSessionLifecycleEvent, AgentTyping, AgentTypingPhase, Anchor, AnchorId, AnchorResponse, AnnotationIncrementalUpdate, Answer, ApiActivity, ApiAttachmentChannelReference, ApiAttachmentEntityReference, ApiAttachmentGenericReference, ApiChannelAttachment, ApiChannelAttachmentsPage, ApiChannelDetail, ApiChannelListMessage, ApiChannelListPage, ApiChannelListParticipant, ApiChannelListType, ApiChannelParticipant, ApiChannelWithLatest, ApiEntityFilterAst, ApiGroupByField, ApiGroupMeta, ApiParticipantListRole, ApiParticipantRole, ApiPropertyEntityType, AppliedOps, ApplyCrmPipelineOpsData, ApplyCrmPipelineOpsResponse, ApplyCrmPipelineOpsResponses, ApplyDatabaseOpsData, ApplyDatabaseOpsError, ApplyDatabaseOpsErrors, ApplyDatabaseOpsResponse, ApplyDatabaseOpsResponses, ApplyOpsRequest, ApplyOpsResponse, ApproveHarnessPairingData, ApproveHarnessPairingError, ApproveHarnessPairingErrors, ApproveHarnessPairingResponse, ApproveHarnessPairingResponses, ApprovePairingRequest, AttachmentChange, AttendeeResponseStatus, Audience, Awareness, AwarenessRelay, BasicDocument, BasicDocumentSubType, BomPart, BookingTarget, Bot, BotChannel, BotChannelType, BotId, BotKind, BotOwner, BotOwnerProfile, BotSenderProfile, BotToken, BranchNameResponse, BTreeMap, BulkWakeupRequest, BulkWakeupResponse, BulkWakeupSyncServiceDocumentsData, BulkWakeupSyncServiceDocumentsErrors, BulkWakeupSyncServiceDocumentsResponse, BulkWakeupSyncServiceDocumentsResponses, CalendarAttendee, CalendarEvent, CalendarEventFilters, CalendarEventSourceContent, CalendarMentionEvent, CalendarMentionPreviewItem, CalendarMentionPreviewKind, CalendarMentionPreviewRequest, CalendarMentionPreviewRequestItem, CalendarMentionPreviewResponse, CalendarOccurrence, CalendarOccurrenceItem, CalendarOccurrenceResponse, CalendarSyncStatus, CallActiveResponse, CallFilters, CallRecord, CallRecordGuest, CallRecordParticipant, CallRecordPreview, CallRecordPreviewData, CallRecordTranscriptSegment, CallStatus, CallTokenResponse, CallWebhookData, CallWebhookError, CallWebhookErrors, CallWebhookResponses, CancelSlackImportData, CancelSlackImportErrors, CancelSlackImportResponse, CancelSlackImportResponses, CardPosition, CastVerdict, CellValue, CellWrite, ChangedFileDto, ChangesetDto, ChangesetSourceDto, Channel, ChannelCreatedMetadata, ChannelDeletedMetadata, ChannelFilters, ChannelJoinCodeResponse, ChannelLabel, ChannelLabelRule, ChannelLabelsList, ChannelMessage, ChannelParticipant, ChannelParticipantAddedMetadata, ChannelParticipantRemovedMetadata, ChannelPictureChangedMetadata, ChannelPreview, ChannelPreviewData, ChannelSender, ChannelSharePermission, ChannelThreadFilters, ChannelTopicEvent, ChannelType, ChannelUpdatedMetadata, ChannelWebhookRequest, ChannelWebhookResponse, ChannelWithParticipants, Chat, ChatFilters, CheckActiveCallData, CheckActiveCallError, CheckActiveCallErrors, CheckActiveCallResponse, CheckActiveCallResponses, ClaimedPairing, ClaimHarnessPairingData, ClaimHarnessPairingError, ClaimHarnessPairingErrors, ClaimHarnessPairingResponse, ClaimHarnessPairingResponses, ClaimPairingRequest, ClientOptions, CloudStorageItemType, CollaborateFormData, CollaborateFormError, CollaborateFormErrors, CollaborateFormResponse, CollaborateFormResponses, CollabSurfaceResponse, CollabSurfaceTokenResponse, Column, ColumnCast, ColumnChange, ColumnChangeKind, ColumnConfig, ColumnConversion, ColumnConversionRequest, ColumnDetail, ColumnId, ColumnKind, ColumnProtection, ColumnResult, CommandFailure, CommandRejectedMetadata, CommittedChange, CompleteSlackImportUploadsData, CompleteSlackImportUploadsErrors, CompleteSlackImportUploadsResponse, CompleteSlackImportUploadsResponses, CompleteUploads, ConferenceProvider, Conjunction, ConversationId, ConversationKind, ConversationMetadata, ConversationProgress, ConversationSeal, ConversationStatus, ConvertDatabaseColumnData, ConvertDatabaseColumnError, ConvertDatabaseColumnErrors, ConvertDatabaseColumnResponse, ConvertDatabaseColumnResponses, ConvertedCell, CopyDocumentData, CopyDocumentError, CopyDocumentErrors, CopyDocumentQueryParams, CopyDocumentRequest, CopyDocumentResponse, CopyDocumentResponse2, CopyDocumentResponses, CountedReaction, CreateAgentData, CreateAgentError, CreateAgentErrors, CreateAgentRequest, CreateAgentResponse, CreateAgentResponses, CreateAnchorData, CreateAnchorError, CreateAnchorErrors, CreateAnchorResponse, CreateAnchorResponses, CreateBotRequest, CreateBulkDocumentResponse, CreateBulkDocumentResponseData, CreateChannelData, CreateChannelError, CreateChannelErrors, CreateChannelLabelData, CreateChannelLabelError, CreateChannelLabelErrors, CreateChannelLabelRequest, CreateChannelLabelResponse, CreateChannelLabelResponses, CreateChannelRequest, CreateChannelResponse, CreateChannelResponse2, CreateChannelResponses, CreateChannelScopedBotData, CreateChannelScopedBotError, CreateChannelScopedBotErrors, CreateChannelScopedBotRequest, CreateChannelScopedBotResponse, CreateChannelScopedBotResponse2, CreateChannelScopedBotResponses, CreateCollabSurfaceTokenData, CreateCollabSurfaceTokenError, CreateCollabSurfaceTokenErrors, CreateCollabSurfaceTokenResponse, CreateCollabSurfaceTokenResponses, CreateCrmCompanyData, CreateCrmCompanyError, CreateCrmCompanyErrors, CreateCrmCompanyRequest, CreateCrmCompanyResponse, CreateCrmCompanyResponses, CreateCrmContactData, CreateCrmContactError, CreateCrmContactErrors, CreateCrmContactRequest, CreateCrmContactResponse, CreateCrmContactResponses, CreateCrmPipelineData, CreateCrmPipelineResponse, CreateCrmPipelineResponses, CreateDatabaseData, CreateDatabaseError, CreateDatabaseErrors, CreateDatabaseRequest, CreateDatabaseResponse, CreateDatabaseResponses, CreateDatabaseWebhookData, CreateDatabaseWebhookError, CreateDatabaseWebhookErrors, CreateDatabaseWebhookRequest, CreateDatabaseWebhookResponse, CreateDatabaseWebhookResponses, CreatedDatabaseWebhookResponse, CreateDocumentData, CreateDocumentError, CreateDocumentErrors, CreateDocumentRequest, CreateDocumentResponse, CreateDocumentResponseData, CreateDocumentResponses, CreatedPairing, CreatedUserApiKey, CreateEntityMentionData, CreateEntityMentionError, CreateEntityMentionErrors, CreateEntityMentionRequest, CreateEntityMentionResponse, CreateEntityMentionResponse2, CreateEntityMentionResponses, CreateForm, CreateFormData, CreateFormError, CreateFormErrors, CreateFormResponse, CreateFormResponses, CreateHarnessPairingData, CreateHarnessPairingError, CreateHarnessPairingErrors, CreateHarnessPairingResponse, CreateHarnessPairingResponses, CreateImport, CreateInitiativeData, CreateInitiativeError, CreateInitiativeErrors, CreateInitiativeRequest, CreateInitiativeResponse, CreateInitiativeResponses, CreateInstructionsDocumentResponse, CreateInstructionsHandlerData, CreateInstructionsHandlerError, CreateInstructionsHandlerErrors, CreateInstructionsHandlerResponse, CreateInstructionsHandlerResponses, CreateMarkdownDocumentRequest, CreateMarkdownDocumentResponse, CreateMarkdownHandlerData, CreateMarkdownHandlerError, CreateMarkdownHandlerErrors, CreateMarkdownHandlerResponse, CreateMarkdownHandlerResponses, CreateMeetingRequest, CreatePairingRequest, CreatePipeline, CreateProjectHandlerData, CreateProjectHandlerError, CreateProjectHandlerErrors, CreateProjectHandlerResponse, CreateProjectHandlerResponses, CreateProjectRequest, CreateProjectResponse, CreateSkillHandlerData, CreateSkillHandlerError, CreateSkillHandlerErrors, CreateSkillHandlerResponse, CreateSkillHandlerResponses, CreateSkillRequest, CreateSkillResponse, CreateSlackImportData, CreateSlackImportErrors, CreateSlackImportResponse, CreateSlackImportResponses, CreateSnippetHandlerData, CreateSnippetHandlerError, CreateSnippetHandlerErrors, CreateSnippetHandlerResponse, CreateSnippetHandlerResponses, CreateSnippetRequest, CreateSnippetResponse, CreateTaskHandlerData, CreateTaskHandlerError, CreateTaskHandlerErrors, CreateTaskHandlerResponse, CreateTaskHandlerResponses, CreateTaskRequest, CreateTaskResponse, CreateToken, CreateUnthreadedAnchorRequest, CreateUnthreadedAnchorResponse, CreateUnthreadedPdfAnchorRequest, CreateUserApiKeyData, CreateUserApiKeyError, CreateUserApiKeyErrors, CreateUserApiKeyRequest, CreateUserApiKeyResponse, CreateUserApiKeyResponses, CreateViewHandlerData, CreateViewHandlerError, CreateViewHandlerErrors, CreateViewHandlerResponse, CreateViewHandlerResponses, CreateViewRequest, CreateWebhookData, CreateWebhookError, CreateWebhookErrors, CreateWebhookRequest, CreateWebhookResponse, CreateWebhookResponse2, CreateWebhookResponses, CrmAssociation, CrmCompanyFilters, CrmCompanyResponse, CrmContactResponse, CrmDomainResponse, CrmPermissionRole, CrmStageInput, CrmStageResponse, CrmStagesResponse, CrmTeamSettingsResponse, CustomSpeakerAssignment, Database, DatabaseDetail, DatabaseId, DatabaseOp, DatabaseQueryRequest, DatabaseView, DatabaseWebhookDeliveryResponse, DatabaseWebhookPayloadProblem, DatabaseWebhookResponse, DataType, DateOperator, DeclineCallData, DeclineCallError, DeclineCallErrors, DeclineCallResponse, DeclineCallResponses, DeclineRingData, DeclineRingError, DeclineRingErrors, DeclineRingResponse, DeclineRingResponses, DeleteAnchorData, DeleteAnchorError, DeleteAnchorErrors, DeleteAnchorResponse, DeleteAnchorResponses, DeleteCallRecordData, DeleteCallRecordError, DeleteCallRecordErrors, DeleteCallRecordResponse, DeleteCallRecordResponses, DeleteChannelData, DeleteChannelError, DeleteChannelErrors, DeleteChannelLabelData, DeleteChannelLabelError, DeleteChannelLabelErrors, DeleteChannelLabelResponse, DeleteChannelLabelResponses, DeleteChannelResponse, DeleteChannelResponses, DeleteCollabSurfaceData, DeleteCollabSurfaceError, DeleteCollabSurfaceErrors, DeleteCollabSurfaceResponse, DeleteCollabSurfaceResponses, DeleteDatabaseWebhookData, DeleteDatabaseWebhookError, DeleteDatabaseWebhookErrors, DeleteDatabaseWebhookResponse, DeleteDatabaseWebhookResponses, DeleteDocumentData, DeleteDocumentError, DeleteDocumentErrors, DeleteDocumentResponse, DeleteDocumentResponses, DeleteEntityMentionData, DeleteEntityMentionError, DeleteEntityMentionErrors, DeleteEntityMentionResponse, DeleteEntityMentionResponse2, DeleteEntityMentionResponses, DeleteHarnessData, DeleteHarnessError, DeleteHarnessErrors, DeleteHarnessResponse, DeleteHarnessResponses, DeleteHistoryHandlerData, DeleteHistoryHandlerError, DeleteHistoryHandlerErrors, DeleteHistoryHandlerResponse, DeleteHistoryHandlerResponses, DeleteInitiativeData, DeleteInitiativeError, DeleteInitiativeErrors, DeleteInitiativeResponse, DeleteInitiativeResponses, DeleteProjectHandlerData, DeleteProjectHandlerError, DeleteProjectHandlerErrors, DeleteProjectHandlerResponse, DeleteProjectHandlerResponses, DeleteSelfHarnessData, DeleteSelfHarnessError, DeleteSelfHarnessErrors, DeleteSelfHarnessResponse, DeleteSelfHarnessResponses, DeleteUnthreadedAnchorRequest, DeleteUnthreadedAnchorResponse, DeleteUnthreadedPdfAnchorRequest, DeleteUserApiKeyData, DeleteUserApiKeyError, DeleteUserApiKeyErrors, DeleteUserApiKeyResponse, DeleteUserApiKeyResponses, DeleteUserDocumentViewLocationData, DeleteUserDocumentViewLocationError, DeleteUserDocumentViewLocationErrors, DeleteUserDocumentViewLocationResponse, DeleteUserDocumentViewLocationResponses, DeleteViewHandlerData, DeleteViewHandlerError, DeleteViewHandlerErrors, DeleteViewHandlerResponses, DeleteWebhookData, DeleteWebhookError, DeleteWebhookErrors, DeleteWebhookResponse, DeleteWebhookResponses, DeliverDatabaseWebhookData, DeliverDatabaseWebhookError, DeliverDatabaseWebhookErrors, DeliverDatabaseWebhookResponse, DeliverDatabaseWebhookResponses, DirectAccess, DocumentBasic, DocumentContent, DocumentContentLocation, DocumentContentState, DocumentContentUploadedMetadata, DocumentCopiedMetadata, DocumentCreatedMetadata, DocumentDeletedMetadata, DocumentFilters, DocumentId, DocumentInteractionMetadata, DocumentMetadata, DocumentMetadataWithContent, DocumentPermissionsToken, DocumentPermissionsTokenRequest, DocumentPermissionsTokenResponse, DocumentPreview, DocumentPreviewData, DocumentPreviewDataSubType, DocumentPurgedMetadata, DocumentResponse, DocumentResponseMetadata, DocumentResponseMetadataWithContent, DocumentStorageServiceApiVersion, DocumentSubType, DocumentSyncContentUpdatedMetadata, DocumentSyncEditor, DocumentTeamShareResponse, DocumentTextContent, DocumentTopicEvent, DocumentUpdatedMetadata, EditAnchorData, EditAnchorError, EditAnchorErrors, EditAnchorRequest, EditAnchorResponse, EditAnchorResponse2, EditAnchorResponses, EditCallRecordData, EditCallRecordError, EditCallRecordErrors, EditCallRecordRequest, EditCallRecordResponse, EditCallRecordResponses, EditCallTranscriptData, EditCallTranscriptError, EditCallTranscriptErrors, EditCallTranscriptRequest, EditCallTranscriptResponse, EditCallTranscriptResponses, EditDocumentData, EditDocumentError, EditDocumentErrors, EditDocumentResponse, EditDocumentResponse2, EditDocumentResponses, EditDocumentServiceArgs, EditMyFormResponseData, EditMyFormResponseError, EditMyFormResponseErrors, EditMyFormResponseResponse, EditMyFormResponseResponses, EditPdfAnchorRequest, EditPdfPlaceableCommentAnchorRequest, EditProjectV2Data, EditProjectV2Error, EditProjectV2Errors, EditProjectV2Response, EditProjectV2Responses, EditThreadV2Data, EditThreadV2Error, EditThreadV2Errors, EditThreadV2Response, EditThreadV2Responses, EmailFilters, EmailFollowup, EmailFollowupCommand, EmailFollowupResponse, EmailReminderCondition, EmailReminderPage, EmailReminderSummary, EmptyResponse, EnsureCollabSurfaceData, EnsureCollabSurfaceError, EnsureCollabSurfaceErrors, EnsureCollabSurfaceRequest, EnsureCollabSurfaceResponse, EnsureCollabSurfaceResponses, EnsureStarterHandlerData, EnsureStarterHandlerErrors, EnsureStarterHandlerResponse, EnsureStarterHandlerResponses, EntityFilters, EntityKind, EntityMessageCreateData, EntityMessageCreateResponse, EntityMessageCreateResponses, EntityMessageDeleteMessageData, EntityMessageDeleteMessageResponse, EntityMessageDeleteMessageResponses, EntityMessageDeleteThreadData, EntityMessageDeleteThreadResponse, EntityMessageDeleteThreadResponses, EntityMessageEditData, EntityMessageEditResponse, EntityMessageEditResponses, EntityMessageGetMessageData, EntityMessageGetMessageResponse, EntityMessageGetMessageResponses, EntityMessageGetThreadData, EntityMessageGetThreadResponse, EntityMessageGetThreadResponses, EntityMessageLegacyData, EntityMessageLegacyResponse, EntityMessageLegacyResponses, EntityMessagePatchThreadData, EntityMessagePatchThreadResponse, EntityMessagePatchThreadResponses, EntityMessageReactData, EntityMessageReactResponse, EntityMessageReactResponses, EntityMessageTypingData, EntityMessageTypingResponse, EntityMessageTypingResponses, EntityPermission, EntityPermissionResponse, EntityRef, EntityReference, EntityType, ErrorResponse, EventReminderOverride, EventReminders, EventStatus, EventTime, EventTransparency, EventType, EventVisibility, ExcludedDefaultView, ExcludeDefaultViewHandlerData, ExcludeDefaultViewHandlerError, ExcludeDefaultViewHandlerErrors, ExcludeDefaultViewHandlerResponses, ExcludeDefaultViewRequest, ExportDocumentData, ExportDocumentError, ExportDocumentErrors, ExportDocumentResponse, ExportDocumentResponse2, ExportDocumentResponses, Favorite, FavoriteEntityRef, FavoritesList, FileChangeKindDto, FileSystemNodeWithIds, FileType, FileTypeUpdate, FilterCondition, FilterGroup, FilterNode, FilterTest, FinalizeSlackImportData, FinalizeSlackImportErrors, FinalizeSlackImportResponse, FinalizeSlackImportResponses, FolderItem, FollowupState, ForeignEntity, ForeignEntityFilters, Form, FormAccess, FormCollaboration, FormDetail, FormErrorCode, FormErrorResponse, FormLayout, FormPublicationProblem, FormQuestionDetail, FormResponse, FormSection, FormSectionDetail, FormSource, FormStatus, FormTally, Formula, GenericErrorResponse, GenericResponse, GenericSuccessResponse, GetActiveCallsData, GetActiveCallsError, GetActiveCallsErrors, GetActiveCallsResponse, GetActiveCallsResponses, GetActivityData, GetActivityError, GetActivityErrors, GetActivityResponse, GetActivityResponses, GetAttachmentReferencesData, GetAttachmentReferencesError, GetAttachmentReferencesErrors, GetAttachmentReferencesResponse, GetAttachmentReferencesResponse2, GetAttachmentReferencesResponses, GetBatchCallRecordPreviewData, GetBatchCallRecordPreviewError, GetBatchCallRecordPreviewErrors, GetBatchCallRecordPreviewRequest, GetBatchCallRecordPreviewResponse, GetBatchCallRecordPreviewResponse2, GetBatchCallRecordPreviewResponses, GetBatchChannelPreviewData, GetBatchChannelPreviewError, GetBatchChannelPreviewErrors, GetBatchChannelPreviewRequest, GetBatchChannelPreviewResponse, GetBatchChannelPreviewResponse2, GetBatchChannelPreviewResponses, GetBatchPreviewHandlerData, GetBatchPreviewHandlerError, GetBatchPreviewHandlerErrors, GetBatchPreviewHandlerResponse, GetBatchPreviewHandlerResponses, GetBatchPreviewRequest, GetBatchPreviewResponse, GetBatchProjectPreviewData, GetBatchProjectPreviewError, GetBatchProjectPreviewErrors, GetBatchProjectPreviewRequest, GetBatchProjectPreviewResponse, GetBatchProjectPreviewResponse2, GetBatchProjectPreviewResponses, GetBotOwnerProfilesData, GetBotOwnerProfilesError, GetBotOwnerProfilesErrors, GetBotOwnerProfilesResponse, GetBotOwnerProfilesResponses, GetCallRecordData, GetCallRecordError, GetCallRecordErrors, GetCallRecordResponse, GetCallRecordResponses, GetChannelAttachmentsData, GetChannelAttachmentsError, GetChannelAttachmentsErrors, GetChannelAttachmentsResponse, GetChannelAttachmentsResponses, GetChannelData, GetChannelError, GetChannelErrors, GetChannelJoinLinkData, GetChannelJoinLinkError, GetChannelJoinLinkErrors, GetChannelJoinLinkResponse, GetChannelJoinLinkResponses, GetChannelParticipantsData, GetChannelParticipantsError, GetChannelParticipantsErrors, GetChannelParticipantsResponse, GetChannelParticipantsResponses, GetChannelResponse, GetChannelResponses, GetChannelsData, GetChannelsError, GetChannelsErrors, GetChannelsResponse, GetChannelsResponses, GetCollabSurfaceData, GetCollabSurfaceError, GetCollabSurfaceErrors, GetCollabSurfaceResponse, GetCollabSurfaceResponses, GetCompanyData, GetCompanyError, GetCompanyErrors, GetCompanyResponse, GetCompanyResponses, GetContactByEmailData, GetContactByEmailError, GetContactByEmailErrors, GetContactByEmailResponse, GetContactByEmailResponse2, GetContactByEmailResponses, GetContactData, GetContactError, GetContactErrors, GetContactResponse, GetContactResponses, GetCrmPipelineData, GetCrmPipelinePermissionsData, GetCrmPipelinePermissionsResponse, GetCrmPipelinePermissionsResponses, GetCrmPipelineResponse, GetCrmPipelineResponses, GetCrmPipelineRowsData, GetCrmPipelineRowsResponse, GetCrmPipelineRowsResponses, GetCrmPipelineTableData, GetCrmPipelineTableResponse, GetCrmPipelineTableResponses, GetCrmTeamSettingsData, GetCrmTeamSettingsError, GetCrmTeamSettingsErrors, GetCrmTeamSettingsResponse, GetCrmTeamSettingsResponses, GetDatabaseData, GetDatabaseError, GetDatabaseErrors, GetDatabasePermissionsData, GetDatabasePermissionsError, GetDatabasePermissionsErrors, GetDatabasePermissionsResponse, GetDatabasePermissionsResponses, GetDatabaseQueryData, GetDatabaseQueryError, GetDatabaseQueryErrors, GetDatabaseQueryResponse, GetDatabaseQueryResponses, GetDatabaseResponse, GetDatabaseResponses, GetDatabaseRowHistoryData, GetDatabaseRowHistoryError, GetDatabaseRowHistoryErrors, GetDatabaseRowHistoryResponse, GetDatabaseRowHistoryResponses, GetDatabaseTableChangesData, GetDatabaseTableChangesError, GetDatabaseTableChangesErrors, GetDatabaseTableChangesResponse, GetDatabaseTableChangesResponses, GetDatabaseViewPositionsData, GetDatabaseViewPositionsError, GetDatabaseViewPositionsErrors, GetDatabaseViewPositionsResponse, GetDatabaseViewPositionsResponses, GetDocumentAnchorsData, GetDocumentAnchorsError, GetDocumentAnchorsErrors, GetDocumentAnchorsResponse, GetDocumentAnchorsResponses, GetDocumentBranchNameData, GetDocumentBranchNameError, GetDocumentBranchNameErrors, GetDocumentBranchNameResponse, GetDocumentBranchNameResponses, GetDocumentByTeamSlugData, GetDocumentByTeamSlugError, GetDocumentByTeamSlugErrors, GetDocumentByTeamSlugResponse, GetDocumentByTeamSlugResponses, GetDocumentData, GetDocumentError, GetDocumentErrors, GetDocumentGithubPullRequestsData, GetDocumentGithubPullRequestsError, GetDocumentGithubPullRequestsErrors, GetDocumentGithubPullRequestsResponse, GetDocumentGithubPullRequestsResponses, GetDocumentKeyResponse, GetDocumentKeyResponseData, GetDocumentListHandlerData, GetDocumentListHandlerError, GetDocumentListHandlerErrors, GetDocumentListHandlerResponse, GetDocumentListHandlerResponses, GetDocumentListResult, GetDocumentLocationV3Data, GetDocumentLocationV3Error, GetDocumentLocationV3Errors, GetDocumentLocationV3Response, GetDocumentLocationV3Responses, GetDocumentPermissionsResponseDataV2, GetDocumentPermissionsTokenData, GetDocumentPermissionsTokenError, GetDocumentPermissionsTokenErrors, GetDocumentPermissionsTokenResponse, GetDocumentPermissionsTokenResponses, GetDocumentPermissionsV2Data, GetDocumentPermissionsV2Error, GetDocumentPermissionsV2Errors, GetDocumentPermissionsV2Response, GetDocumentPermissionsV2Responses, GetDocumentProcessingResult, GetDocumentProcessingResultData, GetDocumentProcessingResultError, GetDocumentProcessingResultErrors, GetDocumentProcessingResultResponse, GetDocumentProcessingResultResponse2, GetDocumentProcessingResultResponses, GetDocumentResponse, GetDocumentResponse2, GetDocumentResponseData, GetDocumentResponses, GetDocumentSearchResponse, GetDocumentShortIdData, GetDocumentShortIdError, GetDocumentShortIdErrors, GetDocumentShortIdResponse, GetDocumentShortIdResponses, GetDocumentsResponse, GetDocumentTeamShareData, GetDocumentTeamShareError, GetDocumentTeamShareErrors, GetDocumentTeamShareResponse, GetDocumentTeamShareResponses, GetDocumentTextContentData, GetDocumentTextContentErrors, GetDocumentTextContentResponse, GetDocumentTextContentResponses, GetDocumentUserAccessLevelResponse, GetDocumentVersionData, GetDocumentVersionError, GetDocumentVersionErrors, GetDocumentVersionResponse, GetDocumentVersionResponses, GetDocumentViewsHandlerData, GetDocumentViewsHandlerError, GetDocumentViewsHandlerErrors, GetDocumentViewsHandlerResponse, GetDocumentViewsHandlerResponses, GetEmailFollowupData, GetEmailFollowupError, GetEmailFollowupErrors, GetEmailFollowupResponse, GetEmailFollowupResponses, GetEntityPermissionData, GetEntityPermissionErrors, GetEntityPermissionResponse, GetEntityPermissionResponses, GetForeignEntityBySourceData, GetForeignEntityBySourceError, GetForeignEntityBySourceErrors, GetForeignEntityBySourceResponse, GetForeignEntityBySourceResponses, GetForeignEntityData, GetForeignEntityError, GetForeignEntityErrors, GetForeignEntityResponse, GetForeignEntityResponses, GetFormData, GetFormError, GetFormErrors, GetFormPermissionsData, GetFormPermissionsError, GetFormPermissionsErrors, GetFormPermissionsResponse, GetFormPermissionsResponses, GetFormResponse, GetFormResponses, GetFormResponseSummaryData, GetFormResponseSummaryError, GetFormResponseSummaryErrors, GetFormResponseSummaryResponse, GetFormResponseSummaryResponses, GetFormTallyData, GetFormTallyError, GetFormTallyErrors, GetFormTallyResponse, GetFormTallyResponses, GetGithubPullRequestChangesData, GetGithubPullRequestChangesError, GetGithubPullRequestChangesErrors, GetGithubPullRequestChangesPatchData, GetGithubPullRequestChangesPatchError, GetGithubPullRequestChangesPatchErrors, GetGithubPullRequestChangesPatchResponse, GetGithubPullRequestChangesPatchResponses, GetGithubPullRequestChangesResponse, GetGithubPullRequestChangesResponses, GetGithubPullRequestData, GetGithubPullRequestError, GetGithubPullRequestErrors, GetGithubPullRequestFacetsData, GetGithubPullRequestFacetsError, GetGithubPullRequestFacetsErrors, GetGithubPullRequestFacetsResponse, GetGithubPullRequestFacetsResponses, GetGithubPullRequestResponse, GetGithubPullRequestResponses, GetGithubPullRequestTasksData, GetGithubPullRequestTasksError, GetGithubPullRequestTasksErrors, GetGithubPullRequestTasksResponse, GetGithubPullRequestTasksResponses, GetHarnessPairingData, GetHarnessPairingError, GetHarnessPairingErrors, GetHarnessPairingResponse, GetHarnessPairingResponses, GetHistoryHandlerData, GetHistoryHandlerError, GetHistoryHandlerErrors, GetHistoryHandlerResponse, GetHistoryHandlerResponses, GetInitiativeData, GetInitiativeError, GetInitiativeErrors, GetInitiativeResponse, GetInitiativeResponses, GetInstructionsDocumentResponse, GetInstructionsHandlerData, GetInstructionsHandlerError, GetInstructionsHandlerErrors, GetInstructionsHandlerResponse, GetInstructionsHandlerResponses, GetItemsSoupData, GetItemsSoupError, GetItemsSoupErrors, GetItemsSoupResponse, GetItemsSoupResponses, GetLocationHandlerData, GetLocationHandlerError, GetLocationHandlerErrors, GetLocationHandlerResponse, GetLocationHandlerResponses, GetMyFormResponseData, GetMyFormResponseError, GetMyFormResponseErrors, GetMyFormResponseResponse, GetMyFormResponseResponses, GetOrCreateAction, GetOrCreateCallData, GetOrCreateCallError, GetOrCreateCallErrors, GetOrCreateCallResponse, GetOrCreateCallResponses, GetOrCreateChannelResponse, GetOrCreateDmData, GetOrCreateDmError, GetOrCreateDmErrors, GetOrCreateDmRequest, GetOrCreateDmResponse, GetOrCreateDmResponses, GetOrCreatePrivateData, GetOrCreatePrivateError, GetOrCreatePrivateErrors, GetOrCreatePrivateRequest, GetOrCreatePrivateResponse, GetOrCreatePrivateResponses, GetPendingProjectsHandlerData, GetPendingProjectsHandlerError, GetPendingProjectsHandlerErrors, GetPendingProjectsHandlerResponse, GetPendingProjectsHandlerResponses, GetPinsHandlerData, GetPinsHandlerError, GetPinsHandlerErrors, GetPinsHandlerResponse, GetPinsHandlerResponses, GetPinsResponse, GetProjectContentHandlerData, GetProjectContentHandlerError, GetProjectContentHandlerErrors, GetProjectContentHandlerResponse, GetProjectContentHandlerResponses, GetProjectContentResponse, GetProjectHandlerData, GetProjectHandlerError, GetProjectHandlerErrors, GetProjectHandlerResponse, GetProjectHandlerResponses, GetProjectPermissionsV2Data, GetProjectPermissionsV2Error, GetProjectPermissionsV2Errors, GetProjectPermissionsV2Response, GetProjectPermissionsV2Responses, GetProjectResponse, GetProjectResponseData, GetProjectsHandlerData, GetProjectsHandlerError, GetProjectsHandlerErrors, GetProjectsHandlerResponse, GetProjectsHandlerResponses, GetProjectsResponse, GetProjectUserAccessLevelData, GetProjectUserAccessLevelError, GetProjectUserAccessLevelErrors, GetProjectUserAccessLevelResponse, GetProjectUserAccessLevelResponses, GetRingStatusData, GetRingStatusError, GetRingStatusErrors, GetRingStatusResponse, GetRingStatusResponses, GetSelfBotData, GetSelfBotError, GetSelfBotErrors, GetSelfBotResponse, GetSelfBotResponses, GetSelfHarnessData, GetSelfHarnessError, GetSelfHarnessErrors, GetSelfHarnessResponse, GetSelfHarnessResponses, GetSlackImportData, GetSlackImportErrors, GetSlackImportResponse, GetSlackImportResponses, GetSystemSkillsHandlerData, GetSystemSkillsHandlerError, GetSystemSkillsHandlerErrors, GetSystemSkillsHandlerResponse, GetSystemSkillsHandlerResponses, GetUserDocumentsHandlerData, GetUserDocumentsHandlerError, GetUserDocumentsHandlerErrors, GetUserDocumentsHandlerResponse, GetUserDocumentsHandlerResponses, GetUserDocumentViewLocationData, GetUserDocumentViewLocationError, GetUserDocumentViewLocationErrors, GetUserDocumentViewLocationResponse, GetUserDocumentViewLocationResponses, GetUserHistoryResponse, GetViewsHandlerData, GetViewsHandlerError, GetViewsHandlerErrors, GetViewsHandlerResponse, GetViewsHandlerResponses, GetWebhookData, GetWebhookError, GetWebhookErrors, GetWebhookResponse, GetWebhookResponses, GithubLabelFacet, GithubPullRequest, GithubPullRequestChangesPatchResponse, GithubPullRequestChangesResponse, GithubPullRequestCheckRun, GithubPullRequestComment, GithubPullRequestFacets, GithubPullRequestLabel, GithubPullRequestReview, GithubPullRequestReviewDecision, GithubPullRequestReviewState, GithubPullRequestsResponse, GithubPullRequestTasks, GithubPullRequestTasksRequest, GithubPullRequestTasksResponse, GithubPullRequestUser, GithubRepositoryFacet, GithubUserFacet, GitRefDto, GroupedInitialParams, GroupedPageParams, GroupedSoupGroupPage, GroupedSoupInitialPage, GroupedSoupPage, GroupedSoupSort, GuestCallChatPostData, GuestCallChatPostErrors, GuestCallChatPostResponse, GuestCallChatPostResponses, GuestCallChatReadData, GuestCallChatReadErrors, GuestCallChatReadResponse, GuestCallChatReadResponses, GuestChatMessage, GuestChatPage, GuestChatPost, GuestId, GuestJoinRequest, HandlerData, HandlerError, HandlerErrors, HandlerResponse, HandlerResponses, Harness, HarnessAgent, HarnessId, HarnessOwner, HarnessSession, HashMap, HealthHandlerData, HealthHandlerResponse, HealthHandlerResponses, HighlightType, ImportCounters, ImportDatabaseTableData, ImportDatabaseTableError, ImportDatabaseTableErrors, ImportDatabaseTableResponse, ImportDatabaseTableResponses, ImportedAuthor, ImportError, ImportLimits, ImportPage, ImportProgress, ImportTable, ImportWarning, InferColumnTypeOutcome, InferColumnTypeRequest, InferDatabaseColumnTypeData, InferDatabaseColumnTypeError, InferDatabaseColumnTypeErrors, InferDatabaseColumnTypeResponse, InferDatabaseColumnTypeResponses, InFlightTurnSummary, IngestTranscriptData, IngestTranscriptError, IngestTranscriptErrors, IngestTranscriptResponses, InitializeUserDocumentsData, InitializeUserDocumentsError, InitializeUserDocumentsErrors, InitializeUserDocumentsResponse, InitializeUserDocumentsResponses, InitialPropertyValue, InitiativeDetail, InitiativeFilters, InitiativeId, InitiativeList, InitiativeSummary, InputReceivedMetadata, InstallSyncData, InstallSyncErrors, InteractionReason, InvalidDatabaseWebhookPayloadResponse, InviteMeetingRequest, InviteMeetingUsersRequest, Item, ItemWithUserAccessLevel, JobId, JobProcessingResultHandlerData, JobProcessingResultHandlerError, JobProcessingResultHandlerErrors, JobProcessingResultHandlerResponse, JobProcessingResultHandlerResponses, JobStatus, JoinChannelByCodeData, JoinChannelByCodeError, JoinChannelByCodeErrors, JoinChannelByCodeResponses, JoinChannelData, JoinChannelError, JoinChannelErrors, JoinChannelResponses, KeySegment, Lane, LaneKey, LatestMessage, LayoutProblem, LeaveCallResponse, LeaveChannelData, LeaveChannelError, LeaveChannelErrors, LeaveChannelResponses, LeaveOrEndCallData, LeaveOrEndCallError, LeaveOrEndCallErrors, LeaveOrEndCallResponse, LeaveOrEndCallResponses, LinkShare, ListAccessibleFormsData, ListAccessibleFormsError, ListAccessibleFormsErrors, ListAccessibleFormsResponse, ListAccessibleFormsResponses, ListAgentsData, ListAgentsError, ListAgentsErrors, ListAgentsResponse, ListAgentsResponses, ListBotChannelsData, ListBotChannelsError, ListBotChannelsErrors, ListBotChannelsResponse, ListBotChannelsResponses, ListChannelLabelsData, ListChannelLabelsError, ListChannelLabelsErrors, ListChannelLabelsResponse, ListChannelLabelsResponses, ListCompanyContactsData, ListCompanyContactsError, ListCompanyContactsErrors, ListCompanyContactsResponse, ListCompanyContactsResponses, ListCrmPipelinesData, ListCrmPipelinesResponse, ListCrmPipelinesResponses, ListDatabaseColumnCastsData, ListDatabaseColumnCastsError, ListDatabaseColumnCastsErrors, ListDatabaseColumnCastsResponse, ListDatabaseColumnCastsResponses, ListDatabasesData, ListDatabasesError, ListDatabasesErrors, ListDatabasesResponse, ListDatabasesResponses, ListDatabaseWebhooksData, ListDatabaseWebhooksError, ListDatabaseWebhooksErrors, ListDatabaseWebhooksResponse, ListDatabaseWebhooksResponse2, ListDatabaseWebhooksResponses, ListedDatabase, ListedForm, ListEmailRemindersData, ListEmailRemindersError, ListEmailRemindersErrors, ListEmailRemindersResponse, ListEmailRemindersResponses, ListFavoritesData, ListFavoritesError, ListFavoritesErrors, ListFavoritesResponse, ListFavoritesResponses, ListFormsData, ListFormsError, ListFormsErrors, ListFormsResponse, ListFormsResponses, ListHarnessAgentsData, ListHarnessAgentsError, ListHarnessAgentsErrors, ListHarnessAgentsResponse, ListHarnessAgentsResponses, ListHarnessesData, ListHarnessesError, ListHarnessesErrors, ListHarnessesResponse, ListHarnessesResponses, ListHarnessSessionsData, ListHarnessSessionsError, ListHarnessSessionsErrors, ListHarnessSessionsResponse, ListHarnessSessionsResponses, ListInitiativesData, ListInitiativesError, ListInitiativesErrors, ListInitiativesResponse, ListInitiativesResponses, ListOccurrencesData, ListOccurrencesErrors, ListOccurrencesResponse, ListOccurrencesResponses, ListSlackImportsData, ListSlackImportsResponse, ListSlackImportsResponses, ListTeamCalendarData, ListTeamCalendarResponse, ListTeamCalendarResponses, ListTeamOutOfOfficeData, ListTeamOutOfOfficeErrors, ListTeamOutOfOfficeResponse, ListTeamOutOfOfficeResponses, ListUserApiKeysData, ListUserApiKeysError, ListUserApiKeysErrors, ListUserApiKeysResponse, ListUserApiKeysResponses, ListWebhooksData, ListWebhooksError, ListWebhooksErrors, ListWebhooksResponse, ListWebhooksResponse2, ListWebhooksResponses, LocationResponseData, LocationResponseV3, MacroUserIdStr, Meeting, MeetingCancelData, MeetingCancelError, MeetingCancelErrors, MeetingCancelPreparationData, MeetingCancelPreparationError, MeetingCancelPreparationErrors, MeetingCancelPreparationResponse, MeetingCancelPreparationResponses, MeetingCancelResponse, MeetingCancelResponses, MeetingCreateData, MeetingCreateError, MeetingCreateErrors, MeetingCreateResponse, MeetingCreateResponses, MeetingGuestJoinData, MeetingGuestJoinError, MeetingGuestJoinErrors, MeetingGuestJoinResponse, MeetingGuestJoinResponses, MeetingGuestParticipantsData, MeetingGuestParticipantsError, MeetingGuestParticipantsErrors, MeetingGuestParticipantsResponse, MeetingGuestParticipantsResponses, MeetingInviteData, MeetingInviteError, MeetingInviteErrors, MeetingInvitePermissions, MeetingInvitePermissionsData, MeetingInvitePermissionsError, MeetingInvitePermissionsErrors, MeetingInvitePermissionsResponse, MeetingInvitePermissionsResponses, MeetingInviteResponse, MeetingInviteResponses, MeetingInviteUsersData, MeetingInviteUsersError, MeetingInviteUsersErrors, MeetingInviteUsersResponse, MeetingInviteUsersResponses, MeetingJoinData, MeetingJoinError, MeetingJoinErrors, MeetingJoinResponse, MeetingJoinResponses, MeetingLeaveData, MeetingLeaveError, MeetingLeaveErrors, MeetingLeaveResponse, MeetingLeaveResponses, MeetingListActiveData, MeetingListActiveError, MeetingListActiveErrors, MeetingListActiveResponse, MeetingListActiveResponses, MeetingListData, MeetingListError, MeetingListErrors, MeetingListResponse, MeetingListResponses, MeetingLookupData, MeetingLookupError, MeetingLookupErrors, MeetingLookupResponse, MeetingLookupResponses, MeetingParticipant, MeetingParticipants, MeetingParticipantsData, MeetingParticipantsError, MeetingParticipantsErrors, MeetingParticipantsResponse, MeetingParticipantsResponses, MeetingPreparation, MeetingPrepareData, MeetingPrepareError, MeetingPrepareErrors, MeetingPrepareResponse, MeetingPrepareResponses, MeetingShareData, MeetingShareError, MeetingShareErrors, MeetingShareResponse, MeetingShareResponses, MeetingsResponse, MeetingToken, MeetingUpdateData, MeetingUpdateError, MeetingUpdateErrors, MeetingUpdateResponse, MeetingUpdateResponses, MentionPreviewsData, MentionPreviewsErrors, MentionPreviewsResponse, MentionPreviewsResponses, Message, MessageAttachment, MessageAttachmentCreatedMetadata, MessageAttachmentRemovedMetadata, MessageChange, MessageCursor, MessageDeletedMetadata, MessageDirection, MessageEvent, MessageEventAttachment, MessageListItem, MessageMentionedMetadata, MessagePage, MessageParent, MessagePatch, MessagePatchedMetadata, MessagePostedMetadata, MessageThread, MessageThreadPreview, MessageTimelineData, MessageTimelineEntriesData, MessageTimelineEntriesResponse, MessageTimelineEntriesResponses, MessageTimelineEntry, MessageTimelinePage, MessageTimelineQuery, MessageTimelineResponse, MessageTimelineResponses, MessageTopicEvent, MyResponse, NewAttachment, NewColumn, NewOption, NewThreadAnchor, NewView, NotificationFilters, NotificationState, NumberOperator, OpBatch, Operator, OpRefusalResponse, OpResult, OptionId, OptionRef, PairingDetails, Params, ParticipantRole, PatchBotRequest, PatchChannelData, PatchChannelError, PatchChannelErrors, PatchChannelRequest, PatchChannelResponse, PatchChannelResponses, PatchMessageNotificationPolicy, PatchProjectRequestV2, PatchThreadRequestV2, PatchViewHandlerData, PatchViewHandlerError, PatchViewHandlerErrors, PatchViewHandlerResponses, PatchWebhookData, PatchWebhookError, PatchWebhookErrors, PatchWebhookRequest, PatchWebhookResponse, PatchWebhookResponses, PdfAnchor, PdfAnchorId, PdfHighlightAnchor, PdfHighlightAnchorRequest, PdfHighlightRect, PdfHighlightRectAnchorRequest, PdfPlaceableCommentAnchor, PendingClaimResponse, PermanentlyDeleteDocumentData, PermanentlyDeleteDocumentError, PermanentlyDeleteDocumentErrors, PermanentlyDeleteDocumentResponse, PermanentlyDeleteDocumentResponses, PermanentlyDeleteProjectData, PermanentlyDeleteProjectError, PermanentlyDeleteProjectErrors, PermanentlyDeleteProjectResponse, PermanentlyDeleteProjectResponses, PinnedItem, PinRequest, Pipeline, PipelineRecordType, PipelineSharing, PostActivityData, PostActivityError, PostActivityErrors, PostActivityRequest, PostActivityResponse, PostActivityResponses, PostChannelBotWebhookData, PostChannelBotWebhookError, PostChannelBotWebhookErrors, PostChannelBotWebhookResponse, PostChannelBotWebhookResponses, PostGroupedSoupAstGroupPageRequest, PostGroupedSoupAstInitialRequest, PostGroupedSoupAstRequest, PostItemsSoupAstData, PostItemsSoupAstError, PostItemsSoupAstErrors, PostItemsSoupAstGroupedData, PostItemsSoupAstGroupedError, PostItemsSoupAstGroupedErrors, PostItemsSoupAstGroupedResponse, PostItemsSoupAstGroupedResponses, PostItemsSoupAstResponse, PostItemsSoupAstResponses, PostItemsSoupData, PostItemsSoupError, PostItemsSoupErrors, PostItemsSoupResponse, PostItemsSoupResponses, PostMessage, PostMessageNotificationPolicy, PostSoupAstRequest, PostSoupRequest, PresaveDocumentHandlerData, PresaveDocumentHandlerError, PresaveDocumentHandlerErrors, PresaveDocumentHandlerResponse, PresaveDocumentHandlerResponses, PreSaveDocumentRequest, PreSaveDocumentResponse, PreSaveDocumentResponseData, PresenceOperator, PresignedUrl, PreviewSmartTagData, PreviewSmartTagError, PreviewSmartTagErrors, PreviewSmartTagResponse, PreviewSmartTagResponses, Project, ProjectDeleteResponseData, ProjectDocumentStatus, ProjectFilters, ProjectPreview, ProjectPreviewData, PropertyDefinition, PropertyDefinitionWithOptions, PropertyFilter, PropertyInput, PropertyOption, PropertyOptionValue, PropertyOwner, PropertyValue, PutCrmTeamSettingsData, PutCrmTeamSettingsError, PutCrmTeamSettingsErrors, PutCrmTeamSettingsResponse, PutCrmTeamSettingsResponses, PutCrmTeamStagesData, PutCrmTeamStagesError, PutCrmTeamStagesErrors, PutCrmTeamStagesResponse, PutCrmTeamStagesResponses, PutFormLayoutData, PutFormLayoutError, PutFormLayoutErrors, PutFormLayoutResponse, PutFormLayoutResponses, QueryCrmPipelineRowsData, QueryCrmPipelineRowsResponse, QueryCrmPipelineRowsResponses, QueryDatabasesData, QueryDatabasesError, QueryDatabasesErrors, QueryDatabasesResponse, QueryDatabasesResponses, QueryDefinition, QuestionLayout, QuestionOption, QuestionTally, ReactionInput, RecentlyDeletedData, RecentlyDeletedError, RecentlyDeletedErrors, RecentlyDeletedResponse, RecentlyDeletedResponseData, RecentlyDeletedResponses, RegisterSlackImportUploadsData, RegisterSlackImportUploadsErrors, RegisterSlackImportUploadsResponse, RegisterSlackImportUploadsResponses, RegisterUploads, RemoveBotFromChannelByBotData, RemoveBotFromChannelByBotError, RemoveBotFromChannelByBotErrors, RemoveBotFromChannelByBotResponse, RemoveBotFromChannelByBotResponses, RemoveFavoriteByEntityData, RemoveFavoriteByEntityError, RemoveFavoriteByEntityErrors, RemoveFavoriteByEntityResponses, RemoveParticipantsData, RemoveParticipantsError, RemoveParticipantsErrors, RemoveParticipantsRequest, RemoveParticipantsResponses, RemovePinHandlerData, RemovePinHandlerError, RemovePinHandlerErrors, RemovePinHandlerResponse, RemovePinHandlerResponses, RenameChannelLabelData, RenameChannelLabelError, RenameChannelLabelErrors, RenameChannelLabelRequest, RenameChannelLabelResponse, RenameChannelLabelResponses, RenameCrmPipelineData, RenameCrmPipelineResponse, RenameCrmPipelineResponses, RenamePipeline, ReorderFavoritesData, ReorderFavoritesError, ReorderFavoritesErrors, ReorderFavoritesRequest, ReorderFavoritesResponses, ReorderPinRequest, ReorderPinsHandlerData, ReorderPinsHandlerError, ReorderPinsHandlerErrors, ReorderPinsHandlerResponse, ReorderPinsHandlerResponses, ReplaceCrmStagesRequest, RequestAccess, RequestedHarnessScope, RequestedLayout, RequestStatus, ResetCrmTeamStagesData, ResetCrmTeamStagesError, ResetCrmTeamStagesErrors, ResetCrmTeamStagesResponse, ResetCrmTeamStagesResponses, ResolveRequest, ResponseStatus, ResponseSummary, ResultColumn, ResultSet, RevertDeleteDocumentData, RevertDeleteDocumentError, RevertDeleteDocumentErrors, RevertDeleteDocumentResponse, RevertDeleteDocumentResponses, RevertDeleteProjectData, RevertDeleteProjectError, RevertDeleteProjectErrors, RevertDeleteProjectResponse, RevertDeleteProjectResponses, RingStatus, RingStatusResponse, RowChange, RowChangeKind, RowChanges, RowHistoryEntry, RowHistoryResponse, RowId, RowsChange, RowsResult, S3ObjectInfo, SaveBomPart, SaveDatabaseQueryData, SaveDatabaseQueryError, SaveDatabaseQueryErrors, SaveDatabaseQueryResponse, SaveDatabaseQueryResponses, SaveDocumentHandlerData, SaveDocumentHandlerError, SaveDocumentHandlerErrors, SaveDocumentHandlerResponse, SaveDocumentHandlerResponses, SaveDocumentRequest, SaveDocumentResponse, SaveDocumentResponseData, SavedQuery, SaveQueryRequest, SearchContactsData, SearchContactsError, SearchContactsErrors, SearchContactsResponse, SearchContactsResponse2, SearchContactsResponses, SearchState, SectionCount, SessionDeletedMetadata, SessionIdentity, SessionMentionedMetadata, SessionOpenedMetadata, SessionRenamedMetadata, SessionSettledMetadata, SessionStoppedMetadata, SetChannelLabelData, SetChannelLabelError, SetChannelLabelErrors, SetChannelLabelRequest, SetChannelLabelResponse, SetChannelLabelResponses, SetChannelPictureData, SetChannelPictureError, SetChannelPictureErrors, SetChannelPictureRequest, SetChannelPictureResponse, SetChannelPictureResponses, SetCompanyHiddenData, SetCompanyHiddenError, SetCompanyHiddenErrors, SetCompanyHiddenRequest, SetCompanyHiddenResponse, SetCompanyHiddenResponses, SetCompanyNameRequest, SetContactHiddenData, SetContactHiddenError, SetContactHiddenErrors, SetContactHiddenRequest, SetContactHiddenResponse, SetContactHiddenResponses, SetContactNameRequest, SetCrmCompanyNameData, SetCrmCompanyNameError, SetCrmCompanyNameErrors, SetCrmCompanyNameResponse, SetCrmCompanyNameResponses, SetCrmContactNameData, SetCrmContactNameError, SetCrmContactNameErrors, SetCrmContactNameResponse, SetCrmContactNameResponses, SetDirectAccess, SetDocumentTeamShareData, SetDocumentTeamShareError, SetDocumentTeamShareErrors, SetDocumentTeamShareRequest, SetDocumentTeamShareResponse, SetDocumentTeamShareResponses, SetEmailFollowupData, SetEmailFollowupError, SetEmailFollowupErrors, SetEmailFollowupResponse, SetEmailFollowupResponses, SetEmailSyncData, SetEmailSyncError, SetEmailSyncErrors, SetEmailSyncRequest, SetEmailSyncResponse, SetEmailSyncResponses, SetOperator, SetPropertyValue, Sha256Digest, ShareCrmPipelineData, ShareCrmPipelineResponse, ShareCrmPipelineResponses, ShareDatabaseAwarenessData, ShareDatabaseAwarenessError, ShareDatabaseAwarenessErrors, ShareDatabaseAwarenessResponse, ShareDatabaseAwarenessResponses, SharedEmailFilter, ShareEntity, ShareEntityType, SharePermissionV2, SharePipeline, ShortIdResponse, SimpleMention, SimpleSaveData, SimpleSaveError, SimpleSaveErrors, SimpleSaveResponse, SimpleSaveResponses, SkippedCell, SlackCompleteRequest, SlackCreateRequest, SlackRegisterRequest, SlackTimestamp, SlackUserId, SmartTagChannelMatch, SmartTagPreview, SortDirection, SortKey, SoupAgentSessionSoupPropertiesField, SoupApiItem, SoupApiSort, SoupApiSortDirection, SoupAttachment, SoupCalendarEventSoupPropertiesField, SoupCalendarEventTime, SoupCallRecordGuest, SoupCallRecordParticipant, SoupCallRecordSoupPropertiesField, SoupChannel, SoupChannelThread, SoupChatSoupPropertiesField, SoupContact, SoupCountedReaction, SoupCrmCompanySoupPropertiesField, SoupCrmContactSoupPropertiesField, SoupCrmDomain, SoupDatabaseRowSoupPropertiesField, SoupDocumentSoupPropertiesField, SoupDocumentSubType, SoupEmailThreadPreview, SoupEnrichedEmailThreadPreviewSoupPropertiesField, SoupForeignEntity, SoupInitiativeSoupPropertiesField, SoupItem, SoupLabel, SoupLabelListVisibility, SoupLabelType, SoupMessageAttachment, SoupMessageListVisibility, SoupMessageSender, SoupMessageSenderType, SoupPage, SoupProjectSoupPropertiesField, SoupPropertiesField, SoupProperty, SoupThreadInfo, SoupThreadReply, SourceBinding, SourceId, SourceIdentity, SqlCell, SqlEntityKind, SqlOutcome, SqlOutcomeKind, SqlSelectOption, SqlStatement, StarterDatabase, StarterDocumentsResponse, StorageRow, StorageRows, StorageRowsQuery, StoredGithubPullRequest, StreamEventsData, StreamEventsError, StreamEventsErrors, StreamEventsResponse, StreamEventsResponses, String, Submission, SubmissionOutcome, SubmitFormResponseData, SubmitFormResponseError, SubmitFormResponseErrors, SubmitFormResponseResponse, SubmitFormResponseResponses, SuccessResponse, SurfaceState, SyncServiceVersionId, SystemSkillSummary, Table, TableChange, TableChanged, TableChanges, TableDetail, TableId, TableResult, TableVersion, TagFilterMode, TakenId, TallyBucket, TallyValue, TaskFilters, TeamCalendarContent, TeamCalendarCoverage, TeamCalendarDetails, TeamCalendarItem, TeamCalendarMember, TeamCalendarPage, TeamCalendarSharing, TeamOutOfOfficeItem, TeamOutOfOfficeResponse, TeamRole, TextOperator, ThreadAnchor, ThreadOrigin, ThreadPatch, ThreadState, TimelineActivity, ToggleShareWithTeamData, ToggleShareWithTeamError, ToggleShareWithTeamErrors, ToggleShareWithTeamResponse, ToggleShareWithTeamResponses, TouchedColumn, TouchedRow, TranscribeDictationData, TranscribeDictationError, TranscribeDictationErrors, TranscribeDictationResponse, TranscribeDictationResponses, TranscribeResponse, TranscriptSegmentRequest, TrashCrmPipelineData, TrashCrmPipelineResponse, TrashCrmPipelineResponses, TrashPipeline, TurnEndedMetadata, TurnStartedMetadata, TurnSummary, TypedSuccessResponse, TypedSuccessResponseGetDocumentResponseData, TypingInput, UndoChangeResponse, UndoDatabaseChangeData, UndoDatabaseChangeError, UndoDatabaseChangeErrors, UndoDatabaseChangeResponse, UndoDatabaseChangeResponses, UndoOutcome, UndoRefusal, UnlockedBooking, UpdateAgentData, UpdateAgentError, UpdateAgentErrors, UpdateAgentRequest, UpdateAgentResponse, UpdateAgentResponses, UpdateChannelSharePermission, UpdateCrmPipelinePermissionsData, UpdateCrmPipelinePermissionsResponse, UpdateCrmPipelinePermissionsResponses, UpdateCrmTeamSettingsRequest, UpdateDatabasePermissionsData, UpdateDatabasePermissionsError, UpdateDatabasePermissionsErrors, UpdateDatabasePermissionsResponse, UpdateDatabasePermissionsResponses, UpdateForm, UpdateFormData, UpdateFormError, UpdateFormErrors, UpdateFormPermissionsData, UpdateFormPermissionsError, UpdateFormPermissionsErrors, UpdateFormPermissionsResponse, UpdateFormPermissionsResponses, UpdateFormResponse, UpdateFormResponses, UpdateInitiativeData, UpdateInitiativeError, UpdateInitiativeErrors, UpdateInitiativeRequest, UpdateInitiativeResponse, UpdateInitiativeResponses, UpdateMeetingRequest, UpdateOperation, UpdateSharePermissionRequestV2, UploadDescriptor, UploadDocumentStatus, UploadExtractFolderHandlerData, UploadExtractFolderHandlerError, UploadExtractFolderHandlerErrors, UploadExtractFolderHandlerResponse, UploadExtractFolderHandlerResponses, UploadExtractFolderRequest, UploadFolderHandlerData, UploadFolderHandlerError, UploadFolderHandlerErrors, UploadFolderHandlerResponse, UploadFolderHandlerResponses, UploadFolderRequest, UploadGrant, UploadId, UpsertHistoryHandlerData, UpsertHistoryHandlerError, UpsertHistoryHandlerErrors, UpsertHistoryHandlerResponse, UpsertHistoryHandlerResponses, UpsertUserDocumentViewLocationData, UpsertUserDocumentViewLocationError, UpsertUserDocumentViewLocationErrors, UpsertUserDocumentViewLocationRequest, UpsertUserDocumentViewLocationResponse, UpsertUserDocumentViewLocationResponses, UserApiKeyId, UserApiKeyInfo, UserApiKeysList, UserDocumentsResponse, UserDocumentViewLocation, UserDocumentViewLocationResponse, UserPinsResponse, UserViewsResponse, ValidateDocumentPermissionsTokenData, ValidateDocumentPermissionsTokenError, ValidateDocumentPermissionsTokenErrors, ValidateDocumentPermissionsTokenResponse, ValidateDocumentPermissionsTokenResponses, ValidateWebhookData, ValidateWebhookError, ValidateWebhookErrors, ValidateWebhookResponse, ValidateWebhookResponse2, ValidateWebhookResponses, Vec, VersionedTable, View, ViewChange, ViewColumn, ViewLayout, ViewPatch, ViewPosition, ViewPositionsResponse, ViewQuery, ViewResult, ViewsResponse, WaitingForInputMetadata, Webhook, WebhookEvent, WebhookFilter, WebhookScope, WebhookStatus, WebhookValidationTestEvent, Widget, WithCallId, WithChannelId, WithDocumentId, WithProjectId } from './types.gen';diff --git a/packages/sdk/generated/storage/sdk.gen.ts b/packages/sdk/generated/storage/sdk.gen.tsindex 145b09e463..3e1385b5f2 100644--- a/packages/sdk/generated/storage/sdk.gen.ts+++ b/packages/sdk/generated/storage/sdk.gen.ts@@ -2,7 +2,7 @@import type { Client, ClientMeta, Options as Options2, RequestResult, ServerSentEventsResult, TDataShape } from './client';import { client } from './client.gen';-import type { AccessRequestsCancelData, AccessRequestsCancelErrors, AccessRequestsCancelResponses, AccessRequestsDirectData, AccessRequestsDirectErrors, AccessRequestsDirectResponses, AccessRequestsRemoveDirectData, AccessRequestsRemoveDirectErrors, AccessRequestsRemoveDirectResponses, AccessRequestsResolveData, AccessRequestsResolveErrors, AccessRequestsResolveResponses, AccessRequestsSetDirectData, AccessRequestsSetDirectErrors, AccessRequestsSetDirectResponses, AccessRequestsStateData, AccessRequestsStateErrors, AccessRequestsStateResponses, AccessRequestsSubmitData, AccessRequestsSubmitErrors, AccessRequestsSubmitResponses, AddFavoriteData, AddFavoriteErrors, AddFavoriteResponses, AddParticipantsData, AddParticipantsErrors, AddParticipantsResponses, AddPinHandlerData, AddPinHandlerErrors, AddPinHandlerResponses, ApplyCrmPipelineOpsData, ApplyCrmPipelineOpsResponses, ApplyDatabaseOpsData, ApplyDatabaseOpsErrors, ApplyDatabaseOpsResponses, ApproveHarnessPairingData, ApproveHarnessPairingErrors, ApproveHarnessPairingResponses, BulkWakeupSyncServiceDocumentsData, BulkWakeupSyncServiceDocumentsErrors, BulkWakeupSyncServiceDocumentsResponses, CallWebhookData, CallWebhookErrors, CallWebhookResponses, CancelSlackImportData, CancelSlackImportErrors, CancelSlackImportResponses, CheckActiveCallData, CheckActiveCallErrors, CheckActiveCallResponses, ClaimHarnessPairingData, ClaimHarnessPairingErrors, ClaimHarnessPairingResponses, CollaborateFormData, CollaborateFormErrors, CollaborateFormResponses, CompleteSlackImportUploadsData, CompleteSlackImportUploadsErrors, CompleteSlackImportUploadsResponses, ConvertDatabaseColumnData, ConvertDatabaseColumnErrors, ConvertDatabaseColumnResponses, CopyDocumentData, CopyDocumentErrors, CopyDocumentResponses, CreateAgentData, CreateAgentErrors, CreateAgentResponses, CreateAnchorData, CreateAnchorErrors, CreateAnchorResponses, CreateChannelData, CreateChannelErrors, CreateChannelLabelData, CreateChannelLabelErrors, CreateChannelLabelResponses, CreateChannelResponses, CreateChannelScopedBotData, CreateChannelScopedBotErrors, CreateChannelScopedBotResponses, CreateCollabSurfaceTokenData, CreateCollabSurfaceTokenErrors, CreateCollabSurfaceTokenResponses, CreateCrmCompanyData, CreateCrmCompanyErrors, CreateCrmCompanyResponses, CreateCrmContactData, CreateCrmContactErrors, CreateCrmContactResponses, CreateCrmPipelineData, CreateCrmPipelineResponses, CreateDatabaseData, CreateDatabaseErrors, CreateDatabaseResponses, CreateDatabaseWebhookData, CreateDatabaseWebhookErrors, CreateDatabaseWebhookResponses, CreateDocumentData, CreateDocumentErrors, CreateDocumentResponses, CreateEntityMentionData, CreateEntityMentionErrors, CreateEntityMentionResponses, CreateFormData, CreateFormErrors, CreateFormResponses, CreateHarnessPairingData, CreateHarnessPairingErrors, CreateHarnessPairingResponses, CreateInitiativeData, CreateInitiativeErrors, CreateInitiativeResponses, CreateInstructionsHandlerData, CreateInstructionsHandlerErrors, CreateInstructionsHandlerResponses, CreateMarkdownHandlerData, CreateMarkdownHandlerErrors, CreateMarkdownHandlerResponses, CreateProjectHandlerData, CreateProjectHandlerErrors, CreateProjectHandlerResponses, CreateSkillHandlerData, CreateSkillHandlerErrors, CreateSkillHandlerResponses, CreateSlackImportData, CreateSlackImportErrors, CreateSlackImportResponses, CreateSnippetHandlerData, CreateSnippetHandlerErrors, CreateSnippetHandlerResponses, CreateTaskHandlerData, CreateTaskHandlerErrors, CreateTaskHandlerResponses, CreateUserApiKeyData, CreateUserApiKeyErrors, CreateUserApiKeyResponses, CreateViewHandlerData, CreateViewHandlerErrors, CreateViewHandlerResponses, CreateWebhookData, CreateWebhookErrors, CreateWebhookResponses, DeclineCallData, DeclineCallErrors, DeclineCallResponses, DeclineRingData, DeclineRingErrors, DeclineRingResponses, DeleteAnchorData, DeleteAnchorErrors, DeleteAnchorResponses, DeleteCallRecordData, DeleteCallRecordErrors, DeleteCallRecordResponses, DeleteChannelData, DeleteChannelErrors, DeleteChannelLabelData, DeleteChannelLabelErrors, DeleteChannelLabelResponses, DeleteChannelResponses, DeleteCollabSurfaceData, DeleteCollabSurfaceErrors, DeleteCollabSurfaceResponses, DeleteDatabaseWebhookData, DeleteDatabaseWebhookErrors, DeleteDatabaseWebhookResponses, DeleteDocumentData, DeleteDocumentErrors, DeleteDocumentResponses, DeleteEntityMentionData, DeleteEntityMentionErrors, DeleteEntityMentionResponses, DeleteHarnessData, DeleteHarnessErrors, DeleteHarnessResponses, DeleteHistoryHandlerData, DeleteHistoryHandlerErrors, DeleteHistoryHandlerResponses, DeleteInitiativeData, DeleteInitiativeErrors, DeleteInitiativeResponses, DeleteProjectHandlerData, DeleteProjectHandlerErrors, DeleteProjectHandlerResponses, DeleteSelfHarnessData, DeleteSelfHarnessErrors, DeleteSelfHarnessResponses, DeleteUserApiKeyData, DeleteUserApiKeyErrors, DeleteUserApiKeyResponses, DeleteUserDocumentViewLocationData, DeleteUserDocumentViewLocationErrors, DeleteUserDocumentViewLocationResponses, DeleteViewHandlerData, DeleteViewHandlerErrors, DeleteViewHandlerResponses, DeleteWebhookData, DeleteWebhookErrors, DeleteWebhookResponses, DeliverDatabaseWebhookData, DeliverDatabaseWebhookErrors, DeliverDatabaseWebhookResponses, EditAnchorData, EditAnchorErrors, EditAnchorResponses, EditCallRecordData, EditCallRecordErrors, EditCallRecordResponses, EditCallTranscriptData, EditCallTranscriptErrors, EditCallTranscriptResponses, EditDocumentData, EditDocumentErrors, EditDocumentResponses, EditMyFormResponseData, EditMyFormResponseErrors, EditMyFormResponseResponses, EditProjectV2Data, EditProjectV2Errors, EditProjectV2Responses, EditThreadV2Data, EditThreadV2Errors, EditThreadV2Responses, EnsureCollabSurfaceData, EnsureCollabSurfaceErrors, EnsureCollabSurfaceResponses, EnsureStarterHandlerData, EnsureStarterHandlerErrors, EnsureStarterHandlerResponses, EntityMessageCreateData, EntityMessageCreateResponses, EntityMessageDeleteMessageData, EntityMessageDeleteMessageResponses, EntityMessageDeleteThreadData, EntityMessageDeleteThreadResponses, EntityMessageEditData, EntityMessageEditResponses, EntityMessageGetMessageData, EntityMessageGetMessageResponses, EntityMessageGetThreadData, EntityMessageGetThreadResponses, EntityMessageLegacyData, EntityMessageLegacyResponses, EntityMessagePatchThreadData, EntityMessagePatchThreadResponses, EntityMessageReactData, EntityMessageReactResponses, EntityMessageTypingData, EntityMessageTypingResponses, ExcludeDefaultViewHandlerData, ExcludeDefaultViewHandlerErrors, ExcludeDefaultViewHandlerResponses, ExportDocumentData, ExportDocumentErrors, ExportDocumentResponses, FinalizeSlackImportData, FinalizeSlackImportErrors, FinalizeSlackImportResponses, GetActiveCallsData, GetActiveCallsErrors, GetActiveCallsResponses, GetActivityData, GetActivityErrors, GetActivityResponses, GetAttachmentReferencesData, GetAttachmentReferencesErrors, GetAttachmentReferencesResponses, GetBatchCallRecordPreviewData, GetBatchCallRecordPreviewErrors, GetBatchCallRecordPreviewResponses, GetBatchChannelPreviewData, GetBatchChannelPreviewErrors, GetBatchChannelPreviewResponses, GetBatchPreviewHandlerData, GetBatchPreviewHandlerErrors, GetBatchPreviewHandlerResponses, GetBatchProjectPreviewData, GetBatchProjectPreviewErrors, GetBatchProjectPreviewResponses, GetBotOwnerProfilesData, GetBotOwnerProfilesErrors, GetBotOwnerProfilesResponses, GetCallRecordData, GetCallRecordErrors, GetCallRecordResponses, GetChannelAttachmentsData, GetChannelAttachmentsErrors, GetChannelAttachmentsResponses, GetChannelData, GetChannelErrors, GetChannelJoinLinkData, GetChannelJoinLinkErrors, GetChannelJoinLinkResponses, GetChannelParticipantsData, GetChannelParticipantsErrors, GetChannelParticipantsResponses, GetChannelResponses, GetChannelsData, GetChannelsErrors, GetChannelsResponses, GetCollabSurfaceData, GetCollabSurfaceErrors, GetCollabSurfaceResponses, GetCompanyData, GetCompanyErrors, GetCompanyResponses, GetContactByEmailData, GetContactByEmailErrors, GetContactByEmailResponses, GetContactData, GetContactErrors, GetContactResponses, GetCrmPipelineData, GetCrmPipelinePermissionsData, GetCrmPipelinePermissionsResponses, GetCrmPipelineResponses, GetCrmPipelineRowsData, GetCrmPipelineRowsResponses, GetCrmPipelineTableData, GetCrmPipelineTableResponses, GetCrmTeamSettingsData, GetCrmTeamSettingsErrors, GetCrmTeamSettingsResponses, GetDatabaseData, GetDatabaseErrors, GetDatabasePermissionsData, GetDatabasePermissionsErrors, GetDatabasePermissionsResponses, GetDatabaseQueryData, GetDatabaseQueryErrors, GetDatabaseQueryResponses, GetDatabaseResponses, GetDatabaseRowHistoryData, GetDatabaseRowHistoryErrors, GetDatabaseRowHistoryResponses, GetDatabaseTableChangesData, GetDatabaseTableChangesErrors, GetDatabaseTableChangesResponses, GetDatabaseViewPositionsData, GetDatabaseViewPositionsErrors, GetDatabaseViewPositionsResponses, GetDocumentAnchorsData, GetDocumentAnchorsErrors, GetDocumentAnchorsResponses, GetDocumentBranchNameData, GetDocumentBranchNameErrors, GetDocumentBranchNameResponses, GetDocumentByTeamSlugData, GetDocumentByTeamSlugErrors, GetDocumentByTeamSlugResponses, GetDocumentData, GetDocumentErrors, GetDocumentGithubPullRequestsData, GetDocumentGithubPullRequestsErrors, GetDocumentGithubPullRequestsResponses, GetDocumentListHandlerData, GetDocumentListHandlerErrors, GetDocumentListHandlerResponses, GetDocumentLocationV3Data, GetDocumentLocationV3Errors, GetDocumentLocationV3Responses, GetDocumentPermissionsTokenData, GetDocumentPermissionsTokenErrors, GetDocumentPermissionsTokenResponses, GetDocumentPermissionsV2Data, GetDocumentPermissionsV2Errors, GetDocumentPermissionsV2Responses, GetDocumentProcessingResultData, GetDocumentProcessingResultErrors, GetDocumentProcessingResultResponses, GetDocumentResponses, GetDocumentShortIdData, GetDocumentShortIdErrors, GetDocumentShortIdResponses, GetDocumentTeamShareData, GetDocumentTeamShareErrors, GetDocumentTeamShareResponses, GetDocumentTextContentData, GetDocumentTextContentErrors, GetDocumentTextContentResponses, GetDocumentVersionData, GetDocumentVersionErrors, GetDocumentVersionResponses, GetDocumentViewsHandlerData, GetDocumentViewsHandlerErrors, GetDocumentViewsHandlerResponses, GetEmailFollowupData, GetEmailFollowupErrors, GetEmailFollowupResponses, GetEntityPermissionData, GetEntityPermissionErrors, GetEntityPermissionResponses, GetForeignEntityBySourceData, GetForeignEntityBySourceErrors, GetForeignEntityBySourceResponses, GetForeignEntityData, GetForeignEntityErrors, GetForeignEntityResponses, GetFormData, GetFormErrors, GetFormPermissionsData, GetFormPermissionsErrors, GetFormPermissionsResponses, GetFormResponses, GetFormResponseSummaryData, GetFormResponseSummaryErrors, GetFormResponseSummaryResponses, GetFormTallyData, GetFormTallyErrors, GetFormTallyResponses, GetGithubPullRequestChangesData, GetGithubPullRequestChangesErrors, GetGithubPullRequestChangesPatchData, GetGithubPullRequestChangesPatchErrors, GetGithubPullRequestChangesPatchResponses, GetGithubPullRequestChangesResponses, GetGithubPullRequestData, GetGithubPullRequestErrors, GetGithubPullRequestFacetsData, GetGithubPullRequestFacetsErrors, GetGithubPullRequestFacetsResponses, GetGithubPullRequestResponses, GetGithubPullRequestTasksData, GetGithubPullRequestTasksErrors, GetGithubPullRequestTasksResponses, GetHarnessPairingData, GetHarnessPairingErrors, GetHarnessPairingResponses, GetHistoryHandlerData, GetHistoryHandlerErrors, GetHistoryHandlerResponses, GetInitiativeData, GetInitiativeErrors, GetInitiativeResponses, GetInstructionsHandlerData, GetInstructionsHandlerErrors, GetInstructionsHandlerResponses, GetItemsSoupData, GetItemsSoupErrors, GetItemsSoupResponses, GetLocationHandlerData, GetLocationHandlerErrors, GetLocationHandlerResponses, GetMyFormResponseData, GetMyFormResponseErrors, GetMyFormResponseResponses, GetOrCreateCallData, GetOrCreateCallErrors, GetOrCreateCallResponses, GetOrCreateDmData, GetOrCreateDmErrors, GetOrCreateDmResponses, GetOrCreatePrivateData, GetOrCreatePrivateErrors, GetOrCreatePrivateResponses, GetPendingProjectsHandlerData, GetPendingProjectsHandlerErrors, GetPendingProjectsHandlerResponses, GetPinsHandlerData, GetPinsHandlerErrors, GetPinsHandlerResponses, GetProjectContentHandlerData, GetProjectContentHandlerErrors, GetProjectContentHandlerResponses, GetProjectHandlerData, GetProjectHandlerErrors, GetProjectHandlerResponses, GetProjectPermissionsV2Data, GetProjectPermissionsV2Errors, GetProjectPermissionsV2Responses, GetProjectsHandlerData, GetProjectsHandlerErrors, GetProjectsHandlerResponses, GetProjectUserAccessLevelData, GetProjectUserAccessLevelErrors, GetProjectUserAccessLevelResponses, GetRingStatusData, GetRingStatusErrors, GetRingStatusResponses, GetSelfBotData, GetSelfBotErrors, GetSelfBotResponses, GetSelfHarnessData, GetSelfHarnessErrors, GetSelfHarnessResponses, GetSlackImportData, GetSlackImportErrors, GetSlackImportResponses, GetSystemSkillsHandlerData, GetSystemSkillsHandlerErrors, GetSystemSkillsHandlerResponses, GetUserDocumentsHandlerData, GetUserDocumentsHandlerErrors, GetUserDocumentsHandlerResponses, GetUserDocumentViewLocationData, GetUserDocumentViewLocationErrors, GetUserDocumentViewLocationResponses, GetViewsHandlerData, GetViewsHandlerErrors, GetViewsHandlerResponses, GetWebhookData, GetWebhookErrors, GetWebhookResponses, GuestCallChatPostData, GuestCallChatPostErrors, GuestCallChatPostResponses, GuestCallChatReadData, GuestCallChatReadErrors, GuestCallChatReadResponses, HandlerData, HandlerErrors, HandlerResponses, HealthHandlerData, HealthHandlerResponses, ImportDatabaseTableData, ImportDatabaseTableErrors, ImportDatabaseTableResponses, InferDatabaseColumnTypeData, InferDatabaseColumnTypeErrors, InferDatabaseColumnTypeResponses, IngestTranscriptData, IngestTranscriptErrors, IngestTranscriptResponses, InitializeUserDocumentsData, InitializeUserDocumentsErrors, InitializeUserDocumentsResponses, InstallSyncData, InstallSyncErrors, JobProcessingResultHandlerData, JobProcessingResultHandlerErrors, JobProcessingResultHandlerResponses, JoinChannelByCodeData, JoinChannelByCodeErrors, JoinChannelByCodeResponses, JoinChannelData, JoinChannelErrors, JoinChannelResponses, LeaveChannelData, LeaveChannelErrors, LeaveChannelResponses, LeaveOrEndCallData, LeaveOrEndCallErrors, LeaveOrEndCallResponses, ListAccessibleFormsData, ListAccessibleFormsErrors, ListAccessibleFormsResponses, ListAgentsData, ListAgentsErrors, ListAgentsResponses, ListBotChannelsData, ListBotChannelsErrors, ListBotChannelsResponses, ListChannelLabelsData, ListChannelLabelsErrors, ListChannelLabelsResponses, ListCompanyContactsData, ListCompanyContactsErrors, ListCompanyContactsResponses, ListCrmPipelinesData, ListCrmPipelinesResponses, ListDatabaseColumnCastsData, ListDatabaseColumnCastsErrors, ListDatabaseColumnCastsResponses, ListDatabasesData, ListDatabasesErrors, ListDatabasesResponses, ListDatabaseWebhooksData, ListDatabaseWebhooksErrors, ListDatabaseWebhooksResponses, ListEmailRemindersData, ListEmailRemindersErrors, ListEmailRemindersResponses, ListFavoritesData, ListFavoritesErrors, ListFavoritesResponses, ListFormsData, ListFormsErrors, ListFormsResponses, ListHarnessAgentsData, ListHarnessAgentsErrors, ListHarnessAgentsResponses, ListHarnessesData, ListHarnessesErrors, ListHarnessesResponses, ListHarnessSessionsData, ListHarnessSessionsErrors, ListHarnessSessionsResponses, ListInitiativesData, ListInitiativesErrors, ListInitiativesResponses, ListOccurrencesData, ListOccurrencesErrors, ListOccurrencesResponses, ListSlackImportsData, ListSlackImportsResponses, ListTeamCalendarData, ListTeamCalendarResponses, ListTeamOutOfOfficeData, ListTeamOutOfOfficeErrors, ListTeamOutOfOfficeResponses, ListUserApiKeysData, ListUserApiKeysErrors, ListUserApiKeysResponses, ListWebhooksData, ListWebhooksErrors, ListWebhooksResponses, MeetingCancelData, MeetingCancelErrors, MeetingCancelPreparationData, MeetingCancelPreparationErrors, MeetingCancelPreparationResponses, MeetingCancelResponses, MeetingCreateData, MeetingCreateErrors, MeetingCreateResponses, MeetingGuestJoinData, MeetingGuestJoinErrors, MeetingGuestJoinResponses, MeetingGuestParticipantsData, MeetingGuestParticipantsErrors, MeetingGuestParticipantsResponses, MeetingInviteData, MeetingInviteErrors, MeetingInvitePermissionsData, MeetingInvitePermissionsErrors, MeetingInvitePermissionsResponses, MeetingInviteResponses, MeetingInviteUsersData, MeetingInviteUsersErrors, MeetingInviteUsersResponses, MeetingJoinData, MeetingJoinErrors, MeetingJoinResponses, MeetingLeaveData, MeetingLeaveErrors, MeetingLeaveResponses, MeetingListActiveData, MeetingListActiveErrors, MeetingListActiveResponses, MeetingListData, MeetingListErrors, MeetingListResponses, MeetingLookupData, MeetingLookupErrors, MeetingLookupResponses, MeetingParticipantsData, MeetingParticipantsErrors, MeetingParticipantsResponses, MeetingPrepareData, MeetingPrepareErrors, MeetingPrepareResponses, MeetingShareData, MeetingShareErrors, MeetingShareResponses, MeetingUpdateData, MeetingUpdateErrors, MeetingUpdateResponses, MentionPreviewsData, MentionPreviewsErrors, MentionPreviewsResponses, MessageTimelineData, MessageTimelineEntriesData, MessageTimelineEntriesResponses, MessageTimelineResponses, PatchChannelData, PatchChannelErrors, PatchChannelResponses, PatchViewHandlerData, PatchViewHandlerErrors, PatchViewHandlerResponses, PatchWebhookData, PatchWebhookErrors, PatchWebhookResponses, PermanentlyDeleteDocumentData, PermanentlyDeleteDocumentErrors, PermanentlyDeleteDocumentResponses, PermanentlyDeleteProjectData, PermanentlyDeleteProjectErrors, PermanentlyDeleteProjectResponses, PostActivityData, PostActivityErrors, PostActivityResponses, PostChannelBotWebhookData, PostChannelBotWebhookErrors, PostChannelBotWebhookResponses, PostItemsSoupAstData, PostItemsSoupAstErrors, PostItemsSoupAstGroupedData, PostItemsSoupAstGroupedErrors, PostItemsSoupAstGroupedResponses, PostItemsSoupAstResponses, PostItemsSoupData, PostItemsSoupErrors, PostItemsSoupResponses, PresaveDocumentHandlerData, PresaveDocumentHandlerErrors, PresaveDocumentHandlerResponses, PreviewSmartTagData, PreviewSmartTagErrors, PreviewSmartTagResponses, PutCrmTeamSettingsData, PutCrmTeamSettingsErrors, PutCrmTeamSettingsResponses, PutCrmTeamStagesData, PutCrmTeamStagesErrors, PutCrmTeamStagesResponses, PutFormLayoutData, PutFormLayoutErrors, PutFormLayoutResponses, QueryCrmPipelineRowsData, QueryCrmPipelineRowsResponses, RecentlyDeletedData, RecentlyDeletedErrors, RecentlyDeletedResponses, RegisterSlackImportUploadsData, RegisterSlackImportUploadsErrors, RegisterSlackImportUploadsResponses, RemoveBotFromChannelByBotData, RemoveBotFromChannelByBotErrors, RemoveBotFromChannelByBotResponses, RemoveFavoriteByEntityData, RemoveFavoriteByEntityErrors, RemoveFavoriteByEntityResponses, RemoveParticipantsData, RemoveParticipantsErrors, RemoveParticipantsResponses, RemovePinHandlerData, RemovePinHandlerErrors, RemovePinHandlerResponses, RenameChannelLabelData, RenameChannelLabelErrors, RenameChannelLabelResponses, RenameCrmPipelineData, RenameCrmPipelineResponses, ReorderFavoritesData, ReorderFavoritesErrors, ReorderFavoritesResponses, ReorderPinsHandlerData, ReorderPinsHandlerErrors, ReorderPinsHandlerResponses, ResetCrmTeamStagesData, ResetCrmTeamStagesErrors, ResetCrmTeamStagesResponses, RevertDeleteDocumentData, RevertDeleteDocumentErrors, RevertDeleteDocumentResponses, RevertDeleteProjectData, RevertDeleteProjectErrors, RevertDeleteProjectResponses, SaveDatabaseQueryData, SaveDatabaseQueryErrors, SaveDatabaseQueryResponses, SaveDocumentHandlerData, SaveDocumentHandlerErrors, SaveDocumentHandlerResponses, SearchContactsData, SearchContactsErrors, SearchContactsResponses, SetChannelLabelData, SetChannelLabelErrors, SetChannelLabelResponses, SetChannelPictureData, SetChannelPictureErrors, SetChannelPictureResponses, SetCompanyHiddenData, SetCompanyHiddenErrors, SetCompanyHiddenResponses, SetContactHiddenData, SetContactHiddenErrors, SetContactHiddenResponses, SetCrmCompanyNameData, SetCrmCompanyNameErrors, SetCrmCompanyNameResponses, SetCrmContactNameData, SetCrmContactNameErrors, SetCrmContactNameResponses, SetDocumentTeamShareData, SetDocumentTeamShareErrors, SetDocumentTeamShareResponses, SetEmailFollowupData, SetEmailFollowupErrors, SetEmailFollowupResponses, SetEmailSyncData, SetEmailSyncErrors, SetEmailSyncResponses, ShareCrmPipelineData, ShareCrmPipelineResponses, ShareDatabaseAwarenessData, ShareDatabaseAwarenessErrors, ShareDatabaseAwarenessResponses, SimpleSaveData, SimpleSaveErrors, SimpleSaveResponses, StreamEventsData, StreamEventsErrors, StreamEventsResponse, StreamEventsResponses, SubmitFormResponseData, SubmitFormResponseErrors, SubmitFormResponseResponses, ToggleShareWithTeamData, ToggleShareWithTeamErrors, ToggleShareWithTeamResponses, TranscribeDictationData, TranscribeDictationErrors, TranscribeDictationResponses, TrashCrmPipelineData, TrashCrmPipelineResponses, UndoDatabaseChangeData, UndoDatabaseChangeErrors, UndoDatabaseChangeResponses, UpdateAgentData, UpdateAgentErrors, UpdateAgentResponses, UpdateCrmPipelinePermissionsData, UpdateCrmPipelinePermissionsResponses, UpdateDatabasePermissionsData, UpdateDatabasePermissionsErrors, UpdateDatabasePermissionsResponses, UpdateFormData, UpdateFormErrors, UpdateFormPermissionsData, UpdateFormPermissionsErrors, UpdateFormPermissionsResponses, UpdateFormResponses, UpdateInitiativeData, UpdateInitiativeErrors, UpdateInitiativeResponses, UploadExtractFolderHandlerData, UploadExtractFolderHandlerErrors, UploadExtractFolderHandlerResponses, UploadFolderHandlerData, UploadFolderHandlerErrors, UploadFolderHandlerResponses, UpsertHistoryHandlerData, UpsertHistoryHandlerErrors, UpsertHistoryHandlerResponses, UpsertUserDocumentViewLocationData, UpsertUserDocumentViewLocationErrors, UpsertUserDocumentViewLocationResponses, ValidateDocumentPermissionsTokenData, ValidateDocumentPermissionsTokenErrors, ValidateDocumentPermissionsTokenResponses, ValidateWebhookData, ValidateWebhookErrors, ValidateWebhookResponses } from './types.gen';+import type { AccessRequestsCancelData, AccessRequestsCancelErrors, AccessRequestsCancelResponses, AccessRequestsDirectData, AccessRequestsDirectErrors, AccessRequestsDirectResponses, AccessRequestsRemoveDirectData, AccessRequestsRemoveDirectErrors, AccessRequestsRemoveDirectResponses, AccessRequestsResolveData, AccessRequestsResolveErrors, AccessRequestsResolveResponses, AccessRequestsSetDirectData, AccessRequestsSetDirectErrors, AccessRequestsSetDirectResponses, AccessRequestsStateData, AccessRequestsStateErrors, AccessRequestsStateResponses, AccessRequestsSubmitData, AccessRequestsSubmitErrors, AccessRequestsSubmitResponses, AddFavoriteData, AddFavoriteErrors, AddFavoriteResponses, AddParticipantsData, AddParticipantsErrors, AddParticipantsResponses, AddPinHandlerData, AddPinHandlerErrors, AddPinHandlerResponses, ApplyCrmPipelineOpsData, ApplyCrmPipelineOpsResponses, ApplyDatabaseOpsData, ApplyDatabaseOpsErrors, ApplyDatabaseOpsResponses, ApproveHarnessPairingData, ApproveHarnessPairingErrors, ApproveHarnessPairingResponses, BulkWakeupSyncServiceDocumentsData, BulkWakeupSyncServiceDocumentsErrors, BulkWakeupSyncServiceDocumentsResponses, CallWebhookData, CallWebhookErrors, CallWebhookResponses, CancelSlackImportData, CancelSlackImportErrors, CancelSlackImportResponses, CheckActiveCallData, CheckActiveCallErrors, CheckActiveCallResponses, ClaimHarnessPairingData, ClaimHarnessPairingErrors, ClaimHarnessPairingResponses, CollaborateFormData, CollaborateFormErrors, CollaborateFormResponses, CompleteSlackImportUploadsData, CompleteSlackImportUploadsErrors, CompleteSlackImportUploadsResponses, ConvertDatabaseColumnData, ConvertDatabaseColumnErrors, ConvertDatabaseColumnResponses, CopyDocumentData, CopyDocumentErrors, CopyDocumentResponses, CreateAgentData, CreateAgentErrors, CreateAgentResponses, CreateAnchorData, CreateAnchorErrors, CreateAnchorResponses, CreateChannelData, CreateChannelErrors, CreateChannelLabelData, CreateChannelLabelErrors, CreateChannelLabelResponses, CreateChannelResponses, CreateChannelScopedBotData, CreateChannelScopedBotErrors, CreateChannelScopedBotResponses, CreateCollabSurfaceTokenData, CreateCollabSurfaceTokenErrors, CreateCollabSurfaceTokenResponses, CreateCrmCompanyData, CreateCrmCompanyErrors, CreateCrmCompanyResponses, CreateCrmContactData, CreateCrmContactErrors, CreateCrmContactResponses, CreateCrmPipelineData, CreateCrmPipelineResponses, CreateDatabaseData, CreateDatabaseErrors, CreateDatabaseResponses, CreateDatabaseWebhookData, CreateDatabaseWebhookErrors, CreateDatabaseWebhookResponses, CreateDocumentData, CreateDocumentErrors, CreateDocumentResponses, CreateEntityMentionData, CreateEntityMentionErrors, CreateEntityMentionResponses, CreateFormData, CreateFormErrors, CreateFormResponses, CreateHarnessPairingData, CreateHarnessPairingErrors, CreateHarnessPairingResponses, CreateInitiativeData, CreateInitiativeErrors, CreateInitiativeResponses, CreateInstructionsHandlerData, CreateInstructionsHandlerErrors, CreateInstructionsHandlerResponses, CreateMarkdownHandlerData, CreateMarkdownHandlerErrors, CreateMarkdownHandlerResponses, CreateProjectHandlerData, CreateProjectHandlerErrors, CreateProjectHandlerResponses, CreateSkillHandlerData, CreateSkillHandlerErrors, CreateSkillHandlerResponses, CreateSlackImportData, CreateSlackImportErrors, CreateSlackImportResponses, CreateSnippetHandlerData, CreateSnippetHandlerErrors, CreateSnippetHandlerResponses, CreateTaskHandlerData, CreateTaskHandlerErrors, CreateTaskHandlerResponses, CreateUserApiKeyData, CreateUserApiKeyErrors, CreateUserApiKeyResponses, CreateViewHandlerData, CreateViewHandlerErrors, CreateViewHandlerResponses, CreateWebhookData, CreateWebhookErrors, CreateWebhookResponses, DeclineCallData, DeclineCallErrors, DeclineCallResponses, DeclineRingData, DeclineRingErrors, DeclineRingResponses, DeleteAnchorData, DeleteAnchorErrors, DeleteAnchorResponses, DeleteCallRecordData, DeleteCallRecordErrors, DeleteCallRecordResponses, DeleteChannelData, DeleteChannelErrors, DeleteChannelLabelData, DeleteChannelLabelErrors, DeleteChannelLabelResponses, DeleteChannelResponses, DeleteCollabSurfaceData, DeleteCollabSurfaceErrors, DeleteCollabSurfaceResponses, DeleteDatabaseWebhookData, DeleteDatabaseWebhookErrors, DeleteDatabaseWebhookResponses, DeleteDocumentData, DeleteDocumentErrors, DeleteDocumentResponses, DeleteEntityMentionData, DeleteEntityMentionErrors, DeleteEntityMentionResponses, DeleteHarnessData, DeleteHarnessErrors, DeleteHarnessResponses, DeleteHistoryHandlerData, DeleteHistoryHandlerErrors, DeleteHistoryHandlerResponses, DeleteInitiativeData, DeleteInitiativeErrors, DeleteInitiativeResponses, DeleteProjectHandlerData, DeleteProjectHandlerErrors, DeleteProjectHandlerResponses, DeleteSelfHarnessData, DeleteSelfHarnessErrors, DeleteSelfHarnessResponses, DeleteUserApiKeyData, DeleteUserApiKeyErrors, DeleteUserApiKeyResponses, DeleteUserDocumentViewLocationData, DeleteUserDocumentViewLocationErrors, DeleteUserDocumentViewLocationResponses, DeleteViewHandlerData, DeleteViewHandlerErrors, DeleteViewHandlerResponses, DeleteWebhookData, DeleteWebhookErrors, DeleteWebhookResponses, DeliverDatabaseWebhookData, DeliverDatabaseWebhookErrors, DeliverDatabaseWebhookResponses, EditAnchorData, EditAnchorErrors, EditAnchorResponses, EditCallRecordData, EditCallRecordErrors, EditCallRecordResponses, EditCallTranscriptData, EditCallTranscriptErrors, EditCallTranscriptResponses, EditDocumentData, EditDocumentErrors, EditDocumentResponses, EditMyFormResponseData, EditMyFormResponseErrors, EditMyFormResponseResponses, EditProjectV2Data, EditProjectV2Errors, EditProjectV2Responses, EditThreadV2Data, EditThreadV2Errors, EditThreadV2Responses, EnsureCollabSurfaceData, EnsureCollabSurfaceErrors, EnsureCollabSurfaceResponses, EnsureStarterHandlerData, EnsureStarterHandlerErrors, EnsureStarterHandlerResponses, EntityMessageCreateData, EntityMessageCreateResponses, EntityMessageDeleteMessageData, EntityMessageDeleteMessageResponses, EntityMessageDeleteThreadData, EntityMessageDeleteThreadResponses, EntityMessageEditData, EntityMessageEditResponses, EntityMessageGetMessageData, EntityMessageGetMessageResponses, EntityMessageGetThreadData, EntityMessageGetThreadResponses, EntityMessageLegacyData, EntityMessageLegacyResponses, EntityMessagePatchThreadData, EntityMessagePatchThreadResponses, EntityMessageReactData, EntityMessageReactResponses, EntityMessageTypingData, EntityMessageTypingResponses, ExcludeDefaultViewHandlerData, ExcludeDefaultViewHandlerErrors, ExcludeDefaultViewHandlerResponses, ExportDocumentData, ExportDocumentErrors, ExportDocumentResponses, FinalizeSlackImportData, FinalizeSlackImportErrors, FinalizeSlackImportResponses, GetActiveCallsData, GetActiveCallsErrors, GetActiveCallsResponses, GetActivityData, GetActivityErrors, GetActivityResponses, GetAttachmentReferencesData, GetAttachmentReferencesErrors, GetAttachmentReferencesResponses, GetBatchCallRecordPreviewData, GetBatchCallRecordPreviewErrors, GetBatchCallRecordPreviewResponses, GetBatchChannelPreviewData, GetBatchChannelPreviewErrors, GetBatchChannelPreviewResponses, GetBatchPreviewHandlerData, GetBatchPreviewHandlerErrors, GetBatchPreviewHandlerResponses, GetBatchProjectPreviewData, GetBatchProjectPreviewErrors, GetBatchProjectPreviewResponses, GetBotOwnerProfilesData, GetBotOwnerProfilesErrors, GetBotOwnerProfilesResponses, GetCallRecordData, GetCallRecordErrors, GetCallRecordResponses, GetChannelAttachmentsData, GetChannelAttachmentsErrors, GetChannelAttachmentsResponses, GetChannelData, GetChannelErrors, GetChannelJoinLinkData, GetChannelJoinLinkErrors, GetChannelJoinLinkResponses, GetChannelParticipantsData, GetChannelParticipantsErrors, GetChannelParticipantsResponses, GetChannelResponses, GetChannelsData, GetChannelsErrors, GetChannelsResponses, GetCollabSurfaceData, GetCollabSurfaceErrors, GetCollabSurfaceResponses, GetCompanyData, GetCompanyErrors, GetCompanyResponses, GetContactByEmailData, GetContactByEmailErrors, GetContactByEmailResponses, GetContactData, GetContactErrors, GetContactResponses, GetCrmPipelineData, GetCrmPipelinePermissionsData, GetCrmPipelinePermissionsResponses, GetCrmPipelineResponses, GetCrmPipelineRowsData, GetCrmPipelineRowsResponses, GetCrmPipelineTableData, GetCrmPipelineTableResponses, GetCrmTeamSettingsData, GetCrmTeamSettingsErrors, GetCrmTeamSettingsResponses, GetDatabaseData, GetDatabaseErrors, GetDatabasePermissionsData, GetDatabasePermissionsErrors, GetDatabasePermissionsResponses, GetDatabaseQueryData, GetDatabaseQueryErrors, GetDatabaseQueryResponses, GetDatabaseResponses, GetDatabaseRowHistoryData, GetDatabaseRowHistoryErrors, GetDatabaseRowHistoryResponses, GetDatabaseTableChangesData, GetDatabaseTableChangesErrors, GetDatabaseTableChangesResponses, GetDatabaseViewPositionsData, GetDatabaseViewPositionsErrors, GetDatabaseViewPositionsResponses, GetDocumentAnchorsData, GetDocumentAnchorsErrors, GetDocumentAnchorsResponses, GetDocumentBranchNameData, GetDocumentBranchNameErrors, GetDocumentBranchNameResponses, GetDocumentByTeamSlugData, GetDocumentByTeamSlugErrors, GetDocumentByTeamSlugResponses, GetDocumentData, GetDocumentErrors, GetDocumentGithubPullRequestsData, GetDocumentGithubPullRequestsErrors, GetDocumentGithubPullRequestsResponses, GetDocumentListHandlerData, GetDocumentListHandlerErrors, GetDocumentListHandlerResponses, GetDocumentLocationV3Data, GetDocumentLocationV3Errors, GetDocumentLocationV3Responses, GetDocumentPermissionsTokenData, GetDocumentPermissionsTokenErrors, GetDocumentPermissionsTokenResponses, GetDocumentPermissionsV2Data, GetDocumentPermissionsV2Errors, GetDocumentPermissionsV2Responses, GetDocumentProcessingResultData, GetDocumentProcessingResultErrors, GetDocumentProcessingResultResponses, GetDocumentResponses, GetDocumentShortIdData, GetDocumentShortIdErrors, GetDocumentShortIdResponses, GetDocumentTeamShareData, GetDocumentTeamShareErrors, GetDocumentTeamShareResponses, GetDocumentTextContentData, GetDocumentTextContentErrors, GetDocumentTextContentResponses, GetDocumentVersionData, GetDocumentVersionErrors, GetDocumentVersionResponses, GetDocumentViewsHandlerData, GetDocumentViewsHandlerErrors, GetDocumentViewsHandlerResponses, GetEmailFollowupData, GetEmailFollowupErrors, GetEmailFollowupResponses, GetEntityPermissionData, GetEntityPermissionErrors, GetEntityPermissionResponses, GetForeignEntityBySourceData, GetForeignEntityBySourceErrors, GetForeignEntityBySourceResponses, GetForeignEntityData, GetForeignEntityErrors, GetForeignEntityResponses, GetFormData, GetFormErrors, GetFormPermissionsData, GetFormPermissionsErrors, GetFormPermissionsResponses, GetFormResponses, GetFormResponseSummaryData, GetFormResponseSummaryErrors, GetFormResponseSummaryResponses, GetFormTallyData, GetFormTallyErrors, GetFormTallyResponses, GetGithubPullRequestChangesData, GetGithubPullRequestChangesErrors, GetGithubPullRequestChangesPatchData, GetGithubPullRequestChangesPatchErrors, GetGithubPullRequestChangesPatchResponses, GetGithubPullRequestChangesResponses, GetGithubPullRequestData, GetGithubPullRequestErrors, GetGithubPullRequestFacetsData, GetGithubPullRequestFacetsErrors, GetGithubPullRequestFacetsResponses, GetGithubPullRequestResponses, GetGithubPullRequestTasksData, GetGithubPullRequestTasksErrors, GetGithubPullRequestTasksResponses, GetHarnessPairingData, GetHarnessPairingErrors, GetHarnessPairingResponses, GetHistoryHandlerData, GetHistoryHandlerErrors, GetHistoryHandlerResponses, GetInitiativeData, GetInitiativeErrors, GetInitiativeResponses, GetInstructionsHandlerData, GetInstructionsHandlerErrors, GetInstructionsHandlerResponses, GetItemsSoupData, GetItemsSoupErrors, GetItemsSoupResponses, GetLocationHandlerData, GetLocationHandlerErrors, GetLocationHandlerResponses, GetMyFormResponseData, GetMyFormResponseErrors, GetMyFormResponseResponses, GetOrCreateCallData, GetOrCreateCallErrors, GetOrCreateCallResponses, GetOrCreateDmData, GetOrCreateDmErrors, GetOrCreateDmResponses, GetOrCreatePrivateData, GetOrCreatePrivateErrors, GetOrCreatePrivateResponses, GetPendingProjectsHandlerData, GetPendingProjectsHandlerErrors, GetPendingProjectsHandlerResponses, GetPinsHandlerData, GetPinsHandlerErrors, GetPinsHandlerResponses, GetProjectContentHandlerData, GetProjectContentHandlerErrors, GetProjectContentHandlerResponses, GetProjectHandlerData, GetProjectHandlerErrors, GetProjectHandlerResponses, GetProjectPermissionsV2Data, GetProjectPermissionsV2Errors, GetProjectPermissionsV2Responses, GetProjectsHandlerData, GetProjectsHandlerErrors, GetProjectsHandlerResponses, GetProjectUserAccessLevelData, GetProjectUserAccessLevelErrors, GetProjectUserAccessLevelResponses, GetRingStatusData, GetRingStatusErrors, GetRingStatusResponses, GetSelfBotData, GetSelfBotErrors, GetSelfBotResponses, GetSelfHarnessData, GetSelfHarnessErrors, GetSelfHarnessResponses, GetSlackImportData, GetSlackImportErrors, GetSlackImportResponses, GetSystemSkillsHandlerData, GetSystemSkillsHandlerErrors, GetSystemSkillsHandlerResponses, GetUserDocumentsHandlerData, GetUserDocumentsHandlerErrors, GetUserDocumentsHandlerResponses, GetUserDocumentViewLocationData, GetUserDocumentViewLocationErrors, GetUserDocumentViewLocationResponses, GetViewsHandlerData, GetViewsHandlerErrors, GetViewsHandlerResponses, GetWebhookData, GetWebhookErrors, GetWebhookResponses, GuestCallChatPostData, GuestCallChatPostErrors, GuestCallChatPostResponses, GuestCallChatReadData, GuestCallChatReadErrors, GuestCallChatReadResponses, HandlerData, HandlerErrors, HandlerResponses, HealthHandlerData, HealthHandlerResponses, ImportDatabaseTableData, ImportDatabaseTableErrors, ImportDatabaseTableResponses, InferDatabaseColumnTypeData, InferDatabaseColumnTypeErrors, InferDatabaseColumnTypeResponses, IngestTranscriptData, IngestTranscriptErrors, IngestTranscriptResponses, InitializeUserDocumentsData, InitializeUserDocumentsErrors, InitializeUserDocumentsResponses, InstallSyncData, InstallSyncErrors, JobProcessingResultHandlerData, JobProcessingResultHandlerErrors, JobProcessingResultHandlerResponses, JoinChannelByCodeData, JoinChannelByCodeErrors, JoinChannelByCodeResponses, JoinChannelData, JoinChannelErrors, JoinChannelResponses, LeaveChannelData, LeaveChannelErrors, LeaveChannelResponses, LeaveOrEndCallData, LeaveOrEndCallErrors, LeaveOrEndCallResponses, ListAccessibleFormsData, ListAccessibleFormsErrors, ListAccessibleFormsResponses, ListAgentsData, ListAgentsErrors, ListAgentsResponses, ListBotChannelsData, ListBotChannelsErrors, ListBotChannelsResponses, ListChannelLabelsData, ListChannelLabelsErrors, ListChannelLabelsResponses, ListCompanyContactsData, ListCompanyContactsErrors, ListCompanyContactsResponses, ListCrmPipelinesData, ListCrmPipelinesResponses, ListDatabaseColumnCastsData, ListDatabaseColumnCastsErrors, ListDatabaseColumnCastsResponses, ListDatabasesData, ListDatabasesErrors, ListDatabasesResponses, ListDatabaseWebhooksData, ListDatabaseWebhooksErrors, ListDatabaseWebhooksResponses, ListEmailRemindersData, ListEmailRemindersErrors, ListEmailRemindersResponses, ListFavoritesData, ListFavoritesErrors, ListFavoritesResponses, ListFormsData, ListFormsErrors, ListFormsResponses, ListHarnessAgentsData, ListHarnessAgentsErrors, ListHarnessAgentsResponses, ListHarnessesData, ListHarnessesErrors, ListHarnessesResponses, ListHarnessSessionsData, ListHarnessSessionsErrors, ListHarnessSessionsResponses, ListInitiativesData, ListInitiativesErrors, ListInitiativesResponses, ListOccurrencesData, ListOccurrencesErrors, ListOccurrencesResponses, ListSlackImportsData, ListSlackImportsResponses, ListTeamCalendarData, ListTeamCalendarResponses, ListTeamOutOfOfficeData, ListTeamOutOfOfficeErrors, ListTeamOutOfOfficeResponses, ListUserApiKeysData, ListUserApiKeysErrors, ListUserApiKeysResponses, ListWebhooksData, ListWebhooksErrors, ListWebhooksResponses, MeetingCancelData, MeetingCancelErrors, MeetingCancelPreparationData, MeetingCancelPreparationErrors, MeetingCancelPreparationResponses, MeetingCancelResponses, MeetingCreateData, MeetingCreateErrors, MeetingCreateResponses, MeetingGuestJoinData, MeetingGuestJoinErrors, MeetingGuestJoinResponses, MeetingGuestParticipantsData, MeetingGuestParticipantsErrors, MeetingGuestParticipantsResponses, MeetingInviteData, MeetingInviteErrors, MeetingInvitePermissionsData, MeetingInvitePermissionsErrors, MeetingInvitePermissionsResponses, MeetingInviteResponses, MeetingInviteUsersData, MeetingInviteUsersErrors, MeetingInviteUsersResponses, MeetingJoinData, MeetingJoinErrors, MeetingJoinResponses, MeetingLeaveData, MeetingLeaveErrors, MeetingLeaveResponses, MeetingListActiveData, MeetingListActiveErrors, MeetingListActiveResponses, MeetingListData, MeetingListErrors, MeetingListResponses, MeetingLookupData, MeetingLookupErrors, MeetingLookupResponses, MeetingParticipantsData, MeetingParticipantsErrors, MeetingParticipantsResponses, MeetingPrepareData, MeetingPrepareErrors, MeetingPrepareResponses, MeetingShareData, MeetingShareErrors, MeetingShareResponses, MeetingUpdateData, MeetingUpdateErrors, MeetingUpdateResponses, MentionPreviewsData, MentionPreviewsErrors, MentionPreviewsResponses, MessageTimelineData, MessageTimelineEntriesData, MessageTimelineEntriesResponses, MessageTimelineResponses, PatchChannelData, PatchChannelErrors, PatchChannelResponses, PatchViewHandlerData, PatchViewHandlerErrors, PatchViewHandlerResponses, PatchWebhookData, PatchWebhookErrors, PatchWebhookResponses, PermanentlyDeleteDocumentData, PermanentlyDeleteDocumentErrors, PermanentlyDeleteDocumentResponses, PermanentlyDeleteProjectData, PermanentlyDeleteProjectErrors, PermanentlyDeleteProjectResponses, PostActivityData, PostActivityErrors, PostActivityResponses, PostChannelBotWebhookData, PostChannelBotWebhookErrors, PostChannelBotWebhookResponses, PostItemsSoupAstData, PostItemsSoupAstErrors, PostItemsSoupAstGroupedData, PostItemsSoupAstGroupedErrors, PostItemsSoupAstGroupedResponses, PostItemsSoupAstResponses, PostItemsSoupData, PostItemsSoupErrors, PostItemsSoupResponses, PresaveDocumentHandlerData, PresaveDocumentHandlerErrors, PresaveDocumentHandlerResponses, PreviewSmartTagData, PreviewSmartTagErrors, PreviewSmartTagResponses, PutCrmTeamSettingsData, PutCrmTeamSettingsErrors, PutCrmTeamSettingsResponses, PutCrmTeamStagesData, PutCrmTeamStagesErrors, PutCrmTeamStagesResponses, PutFormLayoutData, PutFormLayoutErrors, PutFormLayoutResponses, QueryCrmPipelineRowsData, QueryCrmPipelineRowsResponses, QueryDatabasesData, QueryDatabasesErrors, QueryDatabasesResponses, RecentlyDeletedData, RecentlyDeletedErrors, RecentlyDeletedResponses, RegisterSlackImportUploadsData, RegisterSlackImportUploadsErrors, RegisterSlackImportUploadsResponses, RemoveBotFromChannelByBotData, RemoveBotFromChannelByBotErrors, RemoveBotFromChannelByBotResponses, RemoveFavoriteByEntityData, RemoveFavoriteByEntityErrors, RemoveFavoriteByEntityResponses, RemoveParticipantsData, RemoveParticipantsErrors, RemoveParticipantsResponses, RemovePinHandlerData, RemovePinHandlerErrors, RemovePinHandlerResponses, RenameChannelLabelData, RenameChannelLabelErrors, RenameChannelLabelResponses, RenameCrmPipelineData, RenameCrmPipelineResponses, ReorderFavoritesData, ReorderFavoritesErrors, ReorderFavoritesResponses, ReorderPinsHandlerData, ReorderPinsHandlerErrors, ReorderPinsHandlerResponses, ResetCrmTeamStagesData, ResetCrmTeamStagesErrors, ResetCrmTeamStagesResponses, RevertDeleteDocumentData, RevertDeleteDocumentErrors, RevertDeleteDocumentResponses, RevertDeleteProjectData, RevertDeleteProjectErrors, RevertDeleteProjectResponses, SaveDatabaseQueryData, SaveDatabaseQueryErrors, SaveDatabaseQueryResponses, SaveDocumentHandlerData, SaveDocumentHandlerErrors, SaveDocumentHandlerResponses, SearchContactsData, SearchContactsErrors, SearchContactsResponses, SetChannelLabelData, SetChannelLabelErrors, SetChannelLabelResponses, SetChannelPictureData, SetChannelPictureErrors, SetChannelPictureResponses, SetCompanyHiddenData, SetCompanyHiddenErrors, SetCompanyHiddenResponses, SetContactHiddenData, SetContactHiddenErrors, SetContactHiddenResponses, SetCrmCompanyNameData, SetCrmCompanyNameErrors, SetCrmCompanyNameResponses, SetCrmContactNameData, SetCrmContactNameErrors, SetCrmContactNameResponses, SetDocumentTeamShareData, SetDocumentTeamShareErrors, SetDocumentTeamShareResponses, SetEmailFollowupData, SetEmailFollowupErrors, SetEmailFollowupResponses, SetEmailSyncData, SetEmailSyncErrors, SetEmailSyncResponses, ShareCrmPipelineData, ShareCrmPipelineResponses, ShareDatabaseAwarenessData, ShareDatabaseAwarenessErrors, ShareDatabaseAwarenessResponses, SimpleSaveData, SimpleSaveErrors, SimpleSaveResponses, StreamEventsData, StreamEventsErrors, StreamEventsResponse, StreamEventsResponses, SubmitFormResponseData, SubmitFormResponseErrors, SubmitFormResponseResponses, ToggleShareWithTeamData, ToggleShareWithTeamErrors, ToggleShareWithTeamResponses, TranscribeDictationData, TranscribeDictationErrors, TranscribeDictationResponses, TrashCrmPipelineData, TrashCrmPipelineResponses, UndoDatabaseChangeData, UndoDatabaseChangeErrors, UndoDatabaseChangeResponses, UpdateAgentData, UpdateAgentErrors, UpdateAgentResponses, UpdateCrmPipelinePermissionsData, UpdateCrmPipelinePermissionsResponses, UpdateDatabasePermissionsData, UpdateDatabasePermissionsErrors, UpdateDatabasePermissionsResponses, UpdateFormData, UpdateFormErrors, UpdateFormPermissionsData, UpdateFormPermissionsErrors, UpdateFormPermissionsResponses, UpdateFormResponses, UpdateInitiativeData, UpdateInitiativeErrors, UpdateInitiativeResponses, UploadExtractFolderHandlerData, UploadExtractFolderHandlerErrors, UploadExtractFolderHandlerResponses, UploadFolderHandlerData, UploadFolderHandlerErrors, UploadFolderHandlerResponses, UpsertHistoryHandlerData, UpsertHistoryHandlerErrors, UpsertHistoryHandlerResponses, UpsertUserDocumentViewLocationData, UpsertUserDocumentViewLocationErrors, UpsertUserDocumentViewLocationResponses, ValidateDocumentPermissionsTokenData, ValidateDocumentPermissionsTokenErrors, ValidateDocumentPermissionsTokenResponses, ValidateWebhookData, ValidateWebhookErrors, ValidateWebhookResponses } from './types.gen';export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options2<TData, ThrowOnError, TResponse> & {/**@@ -1344,6 +1344,21 @@ export class Sdk extends HeyApiClient {return (options.client ?? this.client).get<GetDatabaseQueryResponses, GetDatabaseQueryErrors, ThrowOnError>({ url: '/databases/queries/{query_id}', ...options });}+ /**+ * Run one statement as the authenticated user. The viewer's catalog authorizes reads;+ * the SQL domain service obtains an edit receipt for every written database.+ */+ public queryDatabases<ThrowOnError extends boolean = false>(options: Options<QueryDatabasesData, ThrowOnError>): RequestResult<QueryDatabasesResponses, QueryDatabasesErrors, ThrowOnError> {+ return (options.client ?? this.client).post<QueryDatabasesResponses, QueryDatabasesErrors, ThrowOnError>({+ url: '/databases/query',+ ...options,+ headers: {+ 'Content-Type': 'application/json',+ ...options.headers+ }+ });+ }+/*** Create a small example once for the authenticated user, if they have no databases.*/diff --git a/packages/sdk/generated/storage/types.gen.ts b/packages/sdk/generated/storage/types.gen.tsindex bb6d568a08..b382366b10 100644--- a/packages/sdk/generated/storage/types.gen.ts+++ b/packages/sdk/generated/storage/types.gen.ts@@ -3284,6 +3284,11 @@ export type ColumnDetail = {writable: boolean;};+/**+ * Identifier of a column placement within a table.+ */+export type ColumnId = string;+/*** A type a column can have.*/@@ -4859,6 +4864,12 @@ export type DatabaseDetail = {tables: Array<TableDetail>;};+/**+ * Identifier of reusable database storage. Its optional Macro entity uses+ * the same identity, so existing routes and grants keep their IDs.+ */+export type DatabaseId = string;+/*** One write to a database: its tables, columns, options, rows or views,* grouped by the resource it changes. A request's ops apply in order and@@ -4923,6 +4934,23 @@ export type DatabaseOp = {order: Array<string>;};+/**+ * One SQL statement with an optional default database and optimistic write guards.+ */+export type DatabaseQueryRequest = {+ /**+ * Expected version for each table a subsequent statement writes.+ */+ baseVersions?: {+ [key: string]: TableVersion;+ };+ databaseId?: null | DatabaseId;+ /**+ * One supported SQL statement. Writes execute once, without automatic retries.+ */+ sql: string;+};+/*** A view of one table, as stored.*/@@ -9923,6 +9951,11 @@ export type OpResult = {*/export type Operator = 'add' | 'subtract' | 'multiply' | 'divide';+/**+ * Identifier of an option of a select or tag column.+ */+export type OptionId = string;+/*** A select option, by its id or by its label.*/@@ -10936,6 +10969,46 @@ export type ResponseSummary = {submitted: number;};+/**+ * One result column, with what its cells mean.+ */+export type ResultColumn = {+ /**+ * What its cells hold.+ */+ kind: SqlOutcomeKind;+ /**+ * The name or alias the statement gave it.+ */+ name: string;+ /**+ * For a select column, its options: its cells hold their ids.+ */+ options?: Array<SqlSelectOption>;+ relatedTable?: null | TableId;+ target?: null | SqlEntityKind;+};++/**+ * A `SELECT`'s rows, as the engine's typed cells.+ */+export type ResultSet = {+ /**+ * The columns, in select-list order.+ */+ columns: Array<ResultColumn>;+ /**+ * For a row-shaped result, the id of the row behind each result row;+ * empty for an aggregate.+ */+ rowIds: Array<RowId>;+ /**+ * One cell per column per row; `null` is an empty cell.+ */+ rows: Array<Array<null | SqlCell>>;+ sourceTable?: null | TableId;+};+/*** Per-user status of an incoming-call ring, as reported by the* ring-status endpoint while a native client is ringing.@@ -13066,6 +13139,196 @@ export type SourceIdentity = {kind: 'confirmed_unknown';};+/**+ * A cell as fetched. An absent cell is `NULL`; an absent multi-valued cell+ * is the empty set.+ */+export type SqlCell = {+ type: 'text';+ /**+ * Text or link.+ */+ value: string;+} | {+ type: 'number';+ /**+ * A number.+ */+ value: number;+} | {+ type: 'bool';+ /**+ * A checkbox.+ */+ value: boolean;+} | {+ type: 'date';+ /**+ * A date-time.+ */+ value: string;+} | {+ type: 'options';+ /**+ * The selected option ids; one for single-select columns.+ */+ value: Array<OptionId>;+} | {+ type: 'entities';+ /**+ * The referenced entity ids; one for single-valued columns.+ */+ value: Array<string>;+} | {+ type: 'row';+ /**+ * A table row's own id, the `row_id` column.+ */+ value: RowId;+};++/**+ * What an entity column's references point at: a kind of Macro entity, or+ * the rows of another table for a relation.+ *+ * Spelled as the properties system spells entity types (`USER`,+ * `DATABASE_ROW`), on the wire and in SQL, where it parses+ * case-insensitively.+ */+export type SqlEntityKind = 'USER' | 'DOCUMENT' | 'TASK' | 'COMPANY' | 'CONTACT' | 'CALL_RECORD' | 'CHANNEL' | 'CHAT' | 'PROJECT' | 'THREAD' | 'CALENDAR_EVENT' | 'INITIATIVE' | 'DATABASE_ROW';++/**+ * The answer to one statement.+ */+export type SqlOutcome = {+ /**+ * How many rows a write changed.+ */+ changesApplied: number;+ /**+ * The rows an `INSERT` created, in statement order.+ */+ insertedRowIds: Array<RowId>;+ /**+ * The new version of every table written.+ */+ newVersions: {+ [key: string]: TableVersion;+ };+ /**+ * The version of every table read, for a follow-up write to guard on.+ */+ readVersions: {+ [key: string]: TableVersion;+ };+ result?: null | ResultSet;+ /**+ * What kind of statement ran, and what it wrote.+ */+ statement: SqlStatement;+ /**+ * Owning database of each visible table referenced by this outcome.+ */+ tableDatabases: {+ [key: string]: DatabaseId;+ };+ /**+ * Every table the statement read, when any read hit the engine's row+ * cap: the engine reports the cap per statement, so aggregates over any+ * of them may be partial.+ */+ truncatedTables: Array<string>;+};++/**+ * The value kind of a result column.+ */+export type SqlOutcomeKind = 'text' | 'number' | 'boolean' | 'date' | 'select' | 'entity' | 'row';++/**+ * One option of a select column.+ */+export type SqlSelectOption = {+ /**+ * The option id.+ */+ id: OptionId;+ /**+ * The label users type in SQL.+ */+ label: string;+};++/**+ * The statement that ran: a read, or the table (and for a type change, the+ * column) it wrote.+ */+export type SqlStatement = {+ /**+ * Owning database.+ */+ databaseId: DatabaseId;+ kind: 'schema';+ /**+ * What changed and how to read the resulting schema.+ */+ summary: string;+} | {+ kind: 'select';+} | {+ kind: 'insert';+ /**+ * The table written.+ */+ tableId: TableId;+ /**+ * Its name.+ */+ tableName: string;+} | {+ kind: 'update';+ /**+ * The table written.+ */+ tableId: TableId;+ /**+ * Its name.+ */+ tableName: string;+} | {+ kind: 'delete';+ /**+ * The table written.+ */+ tableId: TableId;+ /**+ * Its name.+ */+ tableName: string;+} | {+ /**+ * The column placement; its id survives the change.+ */+ columnId: ColumnId;+ /**+ * The column's name.+ */+ columnName: string;+ kind: 'alterColumnType';+ /**+ * The table.+ */+ tableId: TableId;+ /**+ * Its name.+ */+ tableName: string;+ /**+ * The type it became, as SQL spells it, e.g. `select[]`.+ */+ to: string;+};+/*** Starter result. A missing database means the user already started or removed it.*/@@ -13458,6 +13721,11 @@ export type TableDetail = {views: Array<DatabaseView>;};+/**+ * Identifier of one table (tab) within a database.+ */+export type TableId = string;+/*** What happened to a table.*/@@ -17914,6 +18182,30 @@ export type GetDatabaseQueryResponses = {export type GetDatabaseQueryResponse = GetDatabaseQueryResponses[keyof GetDatabaseQueryResponses];+export type QueryDatabasesData = {+ body: DatabaseQueryRequest;+ path?: never;+ query?: never;+ url: '/databases/query';+};++export type QueryDatabasesErrors = {+ 400: ErrorResponse;+ 401: ErrorResponse;+ 403: ErrorResponse;+ 404: ErrorResponse;+ 409: ErrorResponse;+ 500: ErrorResponse;+};++export type QueryDatabasesError = QueryDatabasesErrors[keyof QueryDatabasesErrors];++export type QueryDatabasesResponses = {+ 200: SqlOutcome;+};++export type QueryDatabasesResponse = QueryDatabasesResponses[keyof QueryDatabasesResponses];+export type EnsureStarterHandlerData = {body?: never;path?: never;diff --git a/packages/sdk/package.json b/packages/sdk/package.jsonindex 339db4ed0c..3108db3d08 100644--- a/packages/sdk/package.json+++ b/packages/sdk/package.json@@ -1,6 +1,6 @@{"name": "@macro-inc/sdk",- "version": "0.2.1",+ "version": "0.2.2","repository": {"type": "git","url": "git+https://github.com/macro-inc/macro.git",diff --git a/packages/sdk/specs/storage.json b/packages/sdk/specs/storage.jsonindex 321a0bb121..0f1b56dbfd 100644--- a/packages/sdk/specs/storage.json+++ b/packages/sdk/specs/storage.json@@ -7100,6 +7100,95 @@}}},+ "/databases/query": {+ "post": {+ "tags": ["databases"],+ "summary": "Run one statement as the authenticated user. The viewer's catalog authorizes reads;\nthe SQL domain service obtains an edit receipt for every written database.",+ "operationId": "query_databases",+ "requestBody": {+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/DatabaseQueryRequest"+ }+ }+ },+ "required": true+ },+ "responses": {+ "200": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/SqlOutcome"+ }+ }+ }+ },+ "400": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ErrorResponse"+ }+ }+ }+ },+ "401": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ErrorResponse"+ }+ }+ }+ },+ "403": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ErrorResponse"+ }+ }+ }+ },+ "404": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ErrorResponse"+ }+ }+ }+ },+ "409": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ErrorResponse"+ }+ }+ }+ },+ "500": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ErrorResponse"+ }+ }+ }+ }+ }+ }+ },"/databases/starter": {"post": {"tags": ["databases"],@@ -23291,6 +23380,11 @@}}},+ "ColumnId": {+ "type": "string",+ "format": "uuid",+ "description": "Identifier of a column placement within a table."+ },"ColumnKind": {"oneOf": [{@@ -25483,6 +25577,11 @@}}},+ "DatabaseId": {+ "type": "string",+ "format": "uuid",+ "description": "Identifier of reusable database storage. Its optional Macro entity uses\nthe same identity, so existing routes and grants keep their IDs."+ },"DatabaseOp": {"oneOf": [{@@ -25597,6 +25696,40 @@],"description": "One write to a database: its tables, columns, options, rows or views,\ngrouped by the resource it changes. A request's ops apply in order and\ntogether, or not at all, and every op names a table of the database the\nrequest is for (or, creating one, adds it there)."},+ "DatabaseQueryRequest": {+ "type": "object",+ "description": "One SQL statement with an optional default database and optimistic write guards.",+ "required": ["sql"],+ "properties": {+ "baseVersions": {+ "type": "object",+ "description": "Expected version for each table a subsequent statement writes.",+ "additionalProperties": {+ "$ref": "#/components/schemas/TableVersion"+ },+ "propertyNames": {+ "type": "string",+ "format": "uuid",+ "description": "Identifier of one table (tab) within a database."+ }+ },+ "databaseId": {+ "oneOf": [+ {+ "type": "null"+ },+ {+ "$ref": "#/components/schemas/DatabaseId",+ "description": "Default database for resolving unqualified table names; other visible databases remain joinable."+ }+ ]+ },+ "sql": {+ "type": "string",+ "description": "One supported SQL statement. Writes execute once, without automatic retries."+ }+ }+ },"DatabaseView": {"type": "object","description": "A view of one table, as stored.",@@ -33823,6 +33956,11 @@"description": "An arithmetic operator.","enum": ["add", "subtract", "multiply", "divide"]},+ "OptionId": {+ "type": "string",+ "format": "uuid",+ "description": "Identifier of an option of a select or tag column."+ },"OptionRef": {"oneOf": [{@@ -35739,6 +35877,99 @@}}},+ "ResultColumn": {+ "type": "object",+ "description": "One result column, with what its cells mean.",+ "required": ["name", "kind"],+ "properties": {+ "kind": {+ "$ref": "#/components/schemas/SqlOutcomeKind",+ "description": "What its cells hold."+ },+ "name": {+ "type": "string",+ "description": "The name or alias the statement gave it."+ },+ "options": {+ "type": "array",+ "items": {+ "$ref": "#/components/schemas/SqlSelectOption"+ },+ "description": "For a select column, its options: its cells hold their ids."+ },+ "relatedTable": {+ "oneOf": [+ {+ "type": "null"+ },+ {+ "$ref": "#/components/schemas/TableId",+ "description": "For a relation, the table its rows belong to; for `row_id`, the\ntable read."+ }+ ]+ },+ "target": {+ "oneOf": [+ {+ "type": "null"+ },+ {+ "$ref": "#/components/schemas/SqlEntityKind",+ "description": "For an entity column, what its ids point at; `DATABASE_ROW` for a\nrelation, whose ids are rows of another table."+ }+ ]+ }+ }+ },+ "ResultSet": {+ "type": "object",+ "description": "A `SELECT`'s rows, as the engine's typed cells.",+ "required": ["columns", "rows", "rowIds"],+ "properties": {+ "columns": {+ "type": "array",+ "items": {+ "$ref": "#/components/schemas/ResultColumn"+ },+ "description": "The columns, in select-list order."+ },+ "rowIds": {+ "type": "array",+ "items": {+ "$ref": "#/components/schemas/RowId"+ },+ "description": "For a row-shaped result, the id of the row behind each result row;\nempty for an aggregate."+ },+ "rows": {+ "type": "array",+ "items": {+ "type": "array",+ "items": {+ "oneOf": [+ {+ "type": "null"+ },+ {+ "$ref": "#/components/schemas/SqlCell"+ }+ ]+ }+ },+ "description": "One cell per column per row; `null` is an empty cell."+ },+ "sourceTable": {+ "oneOf": [+ {+ "type": "null"+ },+ {+ "$ref": "#/components/schemas/TableId",+ "description": "Table whose rows the result identities refer to; absent for aggregates."+ }+ ]+ }+ }+ },"RingStatus": {"type": "string","description": "Per-user status of an incoming-call ring, as reported by the\nring-status endpoint while a native client is ringing.",@@ -38995,6 +39226,378 @@],"description": "Source identity supplied when creating a job. One binding per Macro team in v1."},+ "SqlCell": {+ "oneOf": [+ {+ "type": "object",+ "description": "Text or link.",+ "required": ["value", "type"],+ "properties": {+ "type": {+ "type": "string",+ "enum": ["text"]+ },+ "value": {+ "type": "string",+ "description": "Text or link."+ }+ }+ },+ {+ "type": "object",+ "description": "A number.",+ "required": ["value", "type"],+ "properties": {+ "type": {+ "type": "string",+ "enum": ["number"]+ },+ "value": {+ "type": "number",+ "format": "double",+ "description": "A number."+ }+ }+ },+ {+ "type": "object",+ "description": "A checkbox.",+ "required": ["value", "type"],+ "properties": {+ "type": {+ "type": "string",+ "enum": ["bool"]+ },+ "value": {+ "type": "boolean",+ "description": "A checkbox."+ }+ }+ },+ {+ "type": "object",+ "description": "A date-time.",+ "required": ["value", "type"],+ "properties": {+ "type": {+ "type": "string",+ "enum": ["date"]+ },+ "value": {+ "type": "string",+ "format": "date-time",+ "description": "A date-time."+ }+ }+ },+ {+ "type": "object",+ "description": "The selected option ids; one for single-select columns.",+ "required": ["value", "type"],+ "properties": {+ "type": {+ "type": "string",+ "enum": ["options"]+ },+ "value": {+ "type": "array",+ "items": {+ "$ref": "#/components/schemas/OptionId"+ },+ "description": "The selected option ids; one for single-select columns."+ }+ }+ },+ {+ "type": "object",+ "description": "The referenced entity ids; one for single-valued columns.",+ "required": ["value", "type"],+ "properties": {+ "type": {+ "type": "string",+ "enum": ["entities"]+ },+ "value": {+ "type": "array",+ "items": {+ "type": "string"+ },+ "description": "The referenced entity ids; one for single-valued columns."+ }+ }+ },+ {+ "type": "object",+ "description": "A table row's own id, the `row_id` column.",+ "required": ["value", "type"],+ "properties": {+ "type": {+ "type": "string",+ "enum": ["row"]+ },+ "value": {+ "$ref": "#/components/schemas/RowId",+ "description": "A table row's own id, the `row_id` column."+ }+ }+ }+ ],+ "description": "A cell as fetched. An absent cell is `NULL`; an absent multi-valued cell\nis the empty set."+ },+ "SqlEntityKind": {+ "type": "string",+ "description": "What an entity column's references point at: a kind of Macro entity, or\nthe rows of another table for a relation.\n\nSpelled as the properties system spells entity types (`USER`,\n`DATABASE_ROW`), on the wire and in SQL, where it parses\ncase-insensitively.",+ "enum": [+ "USER",+ "DOCUMENT",+ "TASK",+ "COMPANY",+ "CONTACT",+ "CALL_RECORD",+ "CHANNEL",+ "CHAT",+ "PROJECT",+ "THREAD",+ "CALENDAR_EVENT",+ "INITIATIVE",+ "DATABASE_ROW"+ ]+ },+ "SqlOutcome": {+ "type": "object",+ "description": "The answer to one statement.",+ "required": [+ "tableDatabases",+ "changesApplied",+ "insertedRowIds",+ "newVersions",+ "readVersions",+ "truncatedTables",+ "statement"+ ],+ "properties": {+ "changesApplied": {+ "type": "integer",+ "description": "How many rows a write changed.",+ "minimum": 0+ },+ "insertedRowIds": {+ "type": "array",+ "items": {+ "$ref": "#/components/schemas/RowId"+ },+ "description": "The rows an `INSERT` created, in statement order."+ },+ "newVersions": {+ "type": "object",+ "description": "The new version of every table written.",+ "additionalProperties": {+ "$ref": "#/components/schemas/TableVersion"+ },+ "propertyNames": {+ "type": "string",+ "format": "uuid",+ "description": "Identifier of one table (tab) within a database."+ }+ },+ "readVersions": {+ "type": "object",+ "description": "The version of every table read, for a follow-up write to guard on.",+ "additionalProperties": {+ "$ref": "#/components/schemas/TableVersion"+ },+ "propertyNames": {+ "type": "string",+ "format": "uuid",+ "description": "Identifier of one table (tab) within a database."+ }+ },+ "result": {+ "oneOf": [+ {+ "type": "null"+ },+ {+ "$ref": "#/components/schemas/ResultSet",+ "description": "The rows a `SELECT` returned; `None` for a write."+ }+ ]+ },+ "statement": {+ "$ref": "#/components/schemas/SqlStatement",+ "description": "What kind of statement ran, and what it wrote."+ },+ "tableDatabases": {+ "type": "object",+ "description": "Owning database of each visible table referenced by this outcome.",+ "additionalProperties": {+ "$ref": "#/components/schemas/DatabaseId"+ },+ "propertyNames": {+ "type": "string",+ "format": "uuid",+ "description": "Identifier of one table (tab) within a database."+ }+ },+ "truncatedTables": {+ "type": "array",+ "items": {+ "type": "string"+ },+ "description": "Every table the statement read, when any read hit the engine's row\ncap: the engine reports the cap per statement, so aggregates over any\nof them may be partial."+ }+ }+ },+ "SqlOutcomeKind": {+ "type": "string",+ "description": "The value kind of a result column.",+ "enum": ["text", "number", "boolean", "date", "select", "entity", "row"]+ },+ "SqlSelectOption": {+ "type": "object",+ "description": "One option of a select column.",+ "required": ["id", "label"],+ "properties": {+ "id": {+ "$ref": "#/components/schemas/OptionId",+ "description": "The option id."+ },+ "label": {+ "type": "string",+ "description": "The label users type in SQL."+ }+ }+ },+ "SqlStatement": {+ "oneOf": [+ {+ "type": "object",+ "description": "A committed schema command. IDs remain available even without a follow-up read.",+ "required": ["databaseId", "summary", "kind"],+ "properties": {+ "databaseId": {+ "$ref": "#/components/schemas/DatabaseId",+ "description": "Owning database."+ },+ "kind": {+ "type": "string",+ "enum": ["schema"]+ },+ "summary": {+ "type": "string",+ "description": "What changed and how to read the resulting schema."+ }+ }+ },+ {+ "type": "object",+ "description": "A `SELECT`.",+ "required": ["kind"],+ "properties": {+ "kind": {+ "type": "string",+ "enum": ["select"]+ }+ }+ },+ {+ "type": "object",+ "description": "An `INSERT`.",+ "required": ["tableId", "tableName", "kind"],+ "properties": {+ "kind": {+ "type": "string",+ "enum": ["insert"]+ },+ "tableId": {+ "$ref": "#/components/schemas/TableId",+ "description": "The table written."+ },+ "tableName": {+ "type": "string",+ "description": "Its name."+ }+ }+ },+ {+ "type": "object",+ "description": "An `UPDATE`.",+ "required": ["tableId", "tableName", "kind"],+ "properties": {+ "kind": {+ "type": "string",+ "enum": ["update"]+ },+ "tableId": {+ "$ref": "#/components/schemas/TableId",+ "description": "The table written."+ },+ "tableName": {+ "type": "string",+ "description": "Its name."+ }+ }+ },+ {+ "type": "object",+ "description": "A `DELETE`.",+ "required": ["tableId", "tableName", "kind"],+ "properties": {+ "kind": {+ "type": "string",+ "enum": ["delete"]+ },+ "tableId": {+ "$ref": "#/components/schemas/TableId",+ "description": "The table written."+ },+ "tableName": {+ "type": "string",+ "description": "Its name."+ }+ }+ },+ {+ "type": "object",+ "description": "An `ALTER COLUMN … TYPE`.",+ "required": [+ "tableId",+ "tableName",+ "columnId",+ "columnName",+ "to",+ "kind"+ ],+ "properties": {+ "columnId": {+ "$ref": "#/components/schemas/ColumnId",+ "description": "The column placement; its id survives the change."+ },+ "columnName": {+ "type": "string",+ "description": "The column's name."+ },+ "kind": {+ "type": "string",+ "enum": ["alterColumnType"]+ },+ "tableId": {+ "$ref": "#/components/schemas/TableId",+ "description": "The table."+ },+ "tableName": {+ "type": "string",+ "description": "Its name."+ },+ "to": {+ "type": "string",+ "description": "The type it became, as SQL spells it, e.g. `select[]`."+ }+ }+ }+ ],+ "description": "The statement that ran: a read, or the table (and for a type change, the\ncolumn) it wrote."+ },"StarterDatabase": {"type": "object","description": "Starter result. A missing database means the user already started or removed it.",@@ -39598,6 +40201,11 @@}}},+ "TableId": {+ "type": "string",+ "format": "uuid",+ "description": "Identifier of one table (tab) within a database."+ },"TableResult": {"oneOf": [{diff --git a/packages/sdk/src/coverage/check.ts b/packages/sdk/src/coverage/check.tsindex cf7e2f58bb..f9317ef3bf 100644--- a/packages/sdk/src/coverage/check.ts+++ b/packages/sdk/src/coverage/check.ts@@ -18,6 +18,8 @@ const ROOT = join(import.meta.dir, '..', '..');// ...). A service that is not wired into MacroClient cannot be wrapped.const ACCESSORS: Partial<Record<(typeof services)[number], string>> = {'agent-harness': 'agentHarness',+ 'scheduled-action': 'scheduledAction',+ unfurl: 'unfurl',auth: 'auth',calendar: 'calendar',cognition: 'cognition',@@ -37,6 +39,7 @@ function camel(service: string): string {// step 2 input: all hand-written source as one big string (minus this folder,// so the skip list itself doesn't count as a call site)let src = '';+for await (const path of new Bun.Glob('src/**/*.ts').scan(ROOT)) {if (path.startsWith('src/coverage/')) continue;src += await Bun.file(join(ROOT, path)).text();@@ -82,4 +85,5 @@ for (const service of services) {}if (failed) process.exit(1);+console.log('endpoint coverage OK');diff --git a/packages/sdk/src/coverage/skipped.ts b/packages/sdk/src/coverage/skipped.tsindex 609be1a3a5..7e3cfe559a 100644--- a/packages/sdk/src/coverage/skipped.ts+++ b/packages/sdk/src/coverage/skipped.ts@@ -39,15 +39,8 @@ export const agentHarnessExcluded = ['warmAgentSessionHandler',] as const satisfies readonly (keyof AgentHarnessSdk)[];-export const agentHarnessBacklog = [- 'answerAgentSessionToolApproval',- 'getAgentSessionPermissions',- // Agent conversation controls (DMs are flag-gated in the web app); not wrapped yet.- 'listAgentConversations',- 'retryAgentConversationTurn',- 'startFreshAgentConversation',- 'updateAgentSessionPermissions',-] as const satisfies readonly (keyof AgentHarnessSdk)[];+export const agentHarnessBacklog =+ [] as const satisfies readonly (keyof AgentHarnessSdk)[];export const authExcluded = ['appleLogin',@@ -143,22 +136,15 @@ export const authExcluded = ['verifyMergeRequest',];-export const authBacklog = [- 'macroApiToken',-] as const satisfies readonly (keyof AuthSdk)[];+export const authBacklog = [] as const satisfies readonly (keyof AuthSdk)[];export const calendarExcluded = [// Health probe is infra, not SDK surface.'healthHandler',] as const satisfies readonly (keyof CalendarSdk)[];-export const calendarBacklog = [- // Team sharing and availability preferences use the generated client for now.- 'getAvailabilityCalendars',- 'getTeamSharing',- 'setAvailabilityCalendar',- 'setTeamSharing',-] as const satisfies readonly (keyof CalendarSdk)[];+export const calendarBacklog =+ [] as const satisfies readonly (keyof CalendarSdk)[];export const cognitionExcluded = ['addMcpServer',@@ -197,11 +183,8 @@ export const cognitionExcluded = ['upsertAiProjection',] as const satisfies readonly (keyof CognitionSdk)[];-export const cognitionBacklog = [- 'getUsageHandler',- 'sendChatMessage',- 'stopChatStream',-] as const satisfies readonly (keyof CognitionSdk)[];+export const cognitionBacklog =+ [] as const satisfies readonly (keyof CognitionSdk)[];export const connectionExcluded = ['batchSendMessageHandler',@@ -236,22 +219,7 @@ export const emailExcluded = ['resyncLink',] as const satisfies readonly (keyof EmailSdk)[];-export const emailBacklog = [- 'addDraftAttachment',- 'addForwardedAttachment',- 'createDraft',- 'deleteDraft',- 'deleteEmailFilter',- 'deleteScheduledDraft',- 'getScheduledMessages',- 'getThreadCalendarInvitations',- 'listContacts',- 'listEmailFilters',- 'removeDraftAttachment',- 'removeForwardedAttachment',- 'upsertEmailFilter',- 'upsertScheduledMessage',-] as const satisfies readonly (keyof EmailSdk)[];+export const emailBacklog = [] as const satisfies readonly (keyof EmailSdk)[];export const notificationExcluded = ['bulkGetTypedNotificationsByEventItemIds',@@ -281,16 +249,8 @@ export const scheduledActionExcluded = ['scheduledActionHealth',] as const satisfies readonly (keyof ScheduledActionSdk)[];-export const scheduledActionBacklog = [- 'createScheduledAction',- 'deleteScheduledAction',- 'executeScheduledActionNow',- 'getScheduledAction',- 'listScheduledActionHistory',- 'listScheduledActions',- 'setScheduledActionEnabled',- 'updateScheduledAction',-] as const satisfies readonly (keyof ScheduledActionSdk)[];+export const scheduledActionBacklog =+ [] as const satisfies readonly (keyof ScheduledActionSdk)[];export const searchExcluded = ['simpleUnifiedSearch',@@ -409,106 +369,11 @@ export const storageExcluded = ['upsertUserDocumentViewLocation',] as const satisfies readonly (keyof StorageSdk)[];-export const storageBacklog = [- // Sharing requests and direct grants are available through the generated client.- 'accessRequestsCancel',- 'accessRequestsDirect',- 'accessRequestsRemoveDirect',- 'accessRequestsResolve',- 'accessRequestsSetDirect',- 'accessRequestsState',- 'accessRequestsSubmit',- // Email follow-ups are available through the generated client.- 'getEmailFollowup',- 'setEmailFollowup',- 'listEmailReminders',- // CRM pipelines fit the crm namespace but are not wrapped yet.- 'createCrmPipeline',- 'applyCrmPipelineOps',- 'getCrmPipeline',- 'getCrmPipelinePermissions',- 'getCrmPipelineRows',- 'queryCrmPipelineRows',- 'getCrmPipelineTable',- 'listCrmPipelines',- 'renameCrmPipeline',- 'shareCrmPipeline',- 'trashCrmPipeline',- 'updateCrmPipelinePermissions',- 'approveHarnessPairing',- 'claimHarnessPairing',- 'createAgent',- 'createAnchor',- 'createDocument',- 'createEntityMention',- 'createHarnessPairing',- 'createInitiative',- 'createUserApiKey',- 'deleteAnchor',- 'deleteEntityMention',- 'deleteHarness',- 'deleteInitiative',- 'deleteSelfHarness',- 'deleteUserApiKey',- 'editAnchor',- 'editCallTranscript',- 'editThreadV2',- 'entityMessageDeleteThread',- 'entityMessagePatchThread',- 'getActivity',- 'getDocumentAnchors',- 'getDocumentByTeamSlug',- 'getDocumentPermissionsToken',- 'getDocumentPermissionsV2',- 'getDocumentVersion',- 'getEntityPermission',- 'getGithubPullRequest',- 'getGithubPullRequestChanges',- 'getGithubPullRequestChangesPatch',- 'getProjectPermissionsV2',- 'getProjectUserAccessLevel',- 'getHarnessPairing',- 'getInitiative',- 'getSelfHarness',- 'listAgents',- 'listHarnessAgents',- 'listHarnessSessions',- 'listHarnesses',- 'listInitiatives',- 'listOccurrences',- // Read-only team projections use the generated client for now.- 'listTeamCalendar',- 'listTeamOutOfOffice',- 'listUserApiKeys',- // Meeting management uses the generated client.- 'meetingCancel',- 'meetingCreate',- 'meetingInvite',- 'meetingInvitePermissions',- 'meetingInviteUsers',- 'meetingList',- 'meetingListActive',- 'meetingLookup',- 'meetingShare',- 'meetingUpdate',- // Mixed message and activity timelines; Channel.messages() reads messages only.- 'messageTimelineEntries',- 'postActivity',- 'presaveDocumentHandler',- 'saveDocumentHandler',- 'setChannelPicture',- 'simpleSave',- 'toggleShareWithTeam',- 'updateAgent',- 'updateInitiative',- 'validateDocumentPermissionsToken',-] as const satisfies readonly (keyof StorageSdk)[];+export const storageBacklog =+ [] as const satisfies readonly (keyof StorageSdk)[];export const unfurlExcluded = ['proxyRequestHandler',] as const satisfies readonly (keyof UnfurlSdk)[];-export const unfurlBacklog = [- 'getUnfurl',- 'getUnfurlBulk',-] as const satisfies readonly (keyof UnfurlSdk)[];+export const unfurlBacklog = [] as const satisfies readonly (keyof UnfurlSdk)[];diff --git a/packages/sdk/src/entities/agent-sessions/agent-session.ts b/packages/sdk/src/entities/agent-sessions/agent-session.tsindex ffc5e555a0..a0d745a511 100644--- a/packages/sdk/src/entities/agent-sessions/agent-session.ts+++ b/packages/sdk/src/entities/agent-sessions/agent-session.ts@@ -12,10 +12,16 @@ import type {import { unwrap } from '../../utils';import type { MacroClient } from '../../utils/client';import { MacroEntity } from '../entity';+import { EntityAccess } from '../sharing/access';+import {+ type SharePermissionOptions,+ sharePermissionBody,+} from '../sharing/permissions';import { User } from '../users/user';import { CodeExecution } from './code-execution';import { QueuedAction } from './queued-action';import { type CreateReviewOptions, SessionReview } from './review';+import { ToolApproval } from './tool-approval';/** A GitHub pull request linked to a session. */export type SessionPullRequest = {@@ -68,6 +74,33 @@ export type CreateManagedSessionOptions = {/** A managed or externally hosted coding-agent session. */export class AgentSession extends MacroEntity<AgentSessionResponse> {+ /** Access requests and direct user grants. */+ readonly access = new EntityAccess(this.client, 'agent_session', this);++ /** Construct an approval handle scoped to this session. */+ toolApprovalById(id: string): ToolApproval {+ return ToolApproval.byId(this.client, this, id);+ }++ /** Sharing configuration. */+ async sharePermissions() {+ return unwrap(+ await this.client.agentHarness.getAgentSessionPermissions({+ path: { session_id: this.id },+ }),+ );+ }++ /** Replace sharing grants. */+ async updateSharePermissions(options: SharePermissionOptions) {+ return this.mutate((c) =>+ c.agentHarness.updateAgentSessionPermissions({+ path: { session_id: this.id },+ body: sharePermissionBody(options),+ }),+ );+ }+/** A handle to an agent session by id. Details load on first access. */static byId(client: MacroClient, id: string): AgentSession {return new AgentSession(client, id);diff --git a/packages/sdk/src/entities/agent-sessions/conversation.ts b/packages/sdk/src/entities/agent-sessions/conversation.tsnew file mode 100644index 0000000000..3bb4af983a--- /dev/null+++ b/packages/sdk/src/entities/agent-sessions/conversation.ts@@ -0,0 +1,102 @@+import type {+ AgentConversationDto,+ AgentConversationTurnDto,+} from '../../../generated/agent-harness/types.gen';+import { unwrap } from '../../utils';+import type { MacroClient } from '../../utils/client';+import { Agent } from '../agents/agent';+import type { Channel } from '../channels/channel';+import { Message } from '../channels/message';+import { AgentSession } from './agent-session';++/** An agent's conversation in one channel. */+export class AgentConversation {+ constructor(+ private readonly client: MacroClient,+ /** Parent channel. */+ readonly channel: Channel,+ private readonly record: AgentConversationDto,+ ) {}++ /** The agent taking part. */+ agent(): Agent {+ return Agent.byId(this.client, this.record.botId);+ }++ /** Conversation sessions with their current flag. */+ sessions() {+ return this.record.sessions.map((s) => ({+ session: AgentSession.byId(this.client, s.sessionId),+ isCurrent: s.isCurrent,+ createdAt: s.createdAt,+ }));+ }++ /** Recorded conversation turns. */+ turns(): ConversationTurn[] {+ return this.record.turns.map(+ (t) => new ConversationTurn(this.client, this, t),+ );+ }++ /** Start a fresh conversation from one of its sessions. */+ async startFresh(session: AgentSession): Promise<void> {+ unwrap(+ await this.client.agentHarness.startFreshAgentConversation({+ path: { channel_id: this.channel.id, bot_id: this.record.botId },+ body: { sessionId: session.id },+ }),+ );+ }++ /** Serialize scoped identity. */+ toJSON() {+ return { channelId: this.channel.id, agentId: this.record.botId };+ }+}++/** One agent conversation turn, identified by its source message. */+export class ConversationTurn {+ constructor(+ private readonly client: MacroClient,+ /** Parent conversation. */+ readonly conversation: AgentConversation,+ private readonly record: AgentConversationTurnDto,+ ) {}++ /** Originating message. */+ source(): Message {+ return Message.byId(+ this.client,+ this.conversation.channel.id,+ this.record.sourceMessageId,+ );+ }++ /** Session that handled this turn. */+ session(): AgentSession {+ return AgentSession.byId(this.client, this.record.sessionId);+ }++ /** Retry with a caller persisted action nonce. Never retries automatically. */+ async retry(actionId: string): Promise<void> {+ unwrap(+ await this.client.agentHarness.retryAgentConversationTurn({+ path: {+ channel_id: this.conversation.channel.id,+ bot_id: this.conversation.agent().id,+ source: this.record.sourceMessageId,+ },+ body: { actionId },+ }),+ );+ }++ /** Serialize scoped identity. */+ toJSON() {+ return {+ channelId: this.conversation.channel.id,+ sourceMessageId: this.record.sourceMessageId,+ };+ }+}diff --git a/packages/sdk/src/entities/agent-sessions/queued-action.ts b/packages/sdk/src/entities/agent-sessions/queued-action.tsindex becfc3ea6b..e9bc28acde 100644--- a/packages/sdk/src/entities/agent-sessions/queued-action.ts+++ b/packages/sdk/src/entities/agent-sessions/queued-action.ts@@ -20,14 +20,14 @@ export class QueuedAction {private constructor(private readonly client: MacroClient,private readonly sessionId: string,- private dto: QueuedActionDto+ private dto: QueuedActionDto,) {}/** Wrap a queue entry already in hand (e.g. from `AgentSession.queue()`). */static from(client: MacroClient,sessionId: string,- dto: QueuedActionDto+ dto: QueuedActionDto,): QueuedAction {return new QueuedAction(client, sessionId, dto);}@@ -75,7 +75,7 @@ export class QueuedAction {await this.client.agentHarness.editQueuedAction({path: { session_id: this.sessionId, action_id: this.actionId },body: { prompt },- })+ }),);this.dto = { ...this.dto, prompt };return this;@@ -86,7 +86,7 @@ export class QueuedAction {unwrap(await this.client.agentHarness.steerQueuedAction({path: { session_id: this.sessionId, action_id: this.actionId },- })+ }),);}@@ -95,7 +95,7 @@ export class QueuedAction {unwrap(await this.client.agentHarness.removeQueuedAction({path: { session_id: this.sessionId, action_id: this.actionId },- })+ }),);}}diff --git a/packages/sdk/src/entities/agent-sessions/tool-approval.ts b/packages/sdk/src/entities/agent-sessions/tool-approval.tsnew file mode 100644index 0000000000..349b1d004e--- /dev/null+++ b/packages/sdk/src/entities/agent-sessions/tool-approval.ts@@ -0,0 +1,39 @@+import type { AnswerToolApprovalRequest } from '../../../generated/agent-harness/types.gen';+import { unwrap } from '../../utils';+import type { MacroClient } from '../../utils/client';+import type { AgentSession } from './agent-session';++/** A permission request scoped to its originating agent session. */+export class ToolApproval {+ private constructor(+ private readonly client: MacroClient,+ /** Owning session. */+ readonly session: AgentSession,+ /** Approval identity. */+ readonly id: string,+ ) {}++ /** Construct a scoped approval handle. */+ static byId(+ client: MacroClient,+ session: AgentSession,+ id: string,+ ): ToolApproval {+ return new ToolApproval(client, session, id);+ }++ /** Answer the approval using the generated discriminated answer contract. */+ async answer(answer: AnswerToolApprovalRequest['answer']) {+ return unwrap(+ await this.client.agentHarness.answerAgentSessionToolApproval({+ path: { session_id: this.session.id, approval_id: this.id },+ body: { answer },+ }),+ );+ }++ /** Serialize scoped identity only. */+ toJSON() {+ return { id: this.id, sessionId: this.session.id };+ }+}diff --git a/packages/sdk/src/entities/agents/agent.ts b/packages/sdk/src/entities/agents/agent.tsnew file mode 100644index 0000000000..431b26f73e--- /dev/null+++ b/packages/sdk/src/entities/agents/agent.ts@@ -0,0 +1,117 @@+import type {+ Agent as AgentRecord,+ CreateAgentRequest,+} from '../../../generated/storage/types.gen';+import { MacroNotFoundError, unwrap } from '../../utils';+import type { MacroClient } from '../../utils/client';+import { Channel } from '../channels/channel';+import { MacroEntity } from '../entity';+import { Harness } from '../harnesses/harness';+import type { Team } from '../teams/team';++/** Agent creation and replacement settings. */+export type AgentOptions = Omit<+ CreateAgentRequest,+ | 'channel_ids'+ | 'team_id'+ | 'harness_id'+ | 'auto_accept_permissions'+ | 'avatar_url'+ | 'channel_scope'+ | 'default_model'+ | 'is_coding'+> & {+ /** Channels the agent can access. */+ channels?: Channel[];+ /** Owning team. */+ team?: Team;+ /** Host running the agent. */+ host?: Harness;+ /** Whether tool permissions are automatically accepted. */+ autoAcceptPermissions?: boolean;+ /** Avatar URL. */+ avatarUrl?: string;+ /** Channel visibility policy. */+ channelScope: CreateAgentRequest['channel_scope'];+ /** Default model. */+ defaultModel: string;+ /** Whether this is a coding agent. */+ isCoding: boolean;+};++/** A configurable agent backed by a bot identity. */+export class Agent extends MacroEntity<AgentRecord> {+ /** Construct a lazy agent handle. */+ static byId(client: MacroClient, id: string): Agent {+ return new Agent(client, id);+ }++ /** Seed from a listed or created agent. */+ static from(client: MacroClient, record: AgentRecord): Agent {+ return new Agent(client, record.bot.id, record);+ }++ protected async fetch(): Promise<AgentRecord> {+ const record = unwrap(await this.client.storage.listAgents()).find(+ (a) => a.bot.id === this.id,+ );+ if (!record)+ throw new MacroNotFoundError(`Agent ${this.id} is unavailable`);+ return record;+ }++ /** Display name. */+ readonly name = this.mappedField('bot', (bot) => bot.name);++ /** Agent instructions. */+ readonly instructions = this.field('instructions');++ /** Default model. */+ readonly defaultModel = this.field('default_model');++ /** Visible channels. */+ readonly channels = this.mappedField('channel_ids', (ids) =>+ ids.map((id) => Channel.byId(this.client, id)),+ );++ /** Host running this agent. */+ readonly host = this.mappedField('harness_id', (id) =>+ id ? Harness.byId(this.client, id) : undefined,+ );++ /** Replace agent settings. */+ async update(options: AgentOptions): Promise<void> {+ await this.mutate((c) =>+ c.storage.updateAgent({+ path: { agent_id: this.id },+ body: agentBody(options),+ }),+ );+ }+}++/** Convert entity references into the generated agent request. */+export function agentBody(options: AgentOptions): CreateAgentRequest {+ const {+ channels,+ team,+ host,+ autoAcceptPermissions,+ avatarUrl,+ channelScope,+ defaultModel,+ isCoding,+ ...rest+ } = options;+ return {+ ...rest,+ channel_ids: channels?.map((c) => c.id),+ team_id: team?.id,+ harness_id: host?.id,+ auto_accept_permissions: autoAcceptPermissions,+ avatar_url: avatarUrl,+ channel_scope: channelScope,+ default_model: defaultModel,+ is_coding: isCoding,+ };+}diff --git a/packages/sdk/src/entities/agents/namespace.ts b/packages/sdk/src/entities/agents/namespace.tsnew file mode 100644index 0000000000..7ae94483dc--- /dev/null+++ b/packages/sdk/src/entities/agents/namespace.ts@@ -0,0 +1,30 @@+import { unwrap } from '../../utils';+import type { MacroClient } from '../../utils/client';+import { Agent, type AgentOptions, agentBody } from './agent';++/** Configurable agents. */+export class AgentNamespace {+ constructor(private readonly client: MacroClient) {}++ /** Construct a lazy agent handle. */+ byId(id: string): Agent {+ return Agent.byId(this.client, id);+ }++ /** All accessible agents. */+ async list(): Promise<Agent[]> {+ return unwrap(await this.client.storage.listAgents()).map((a) =>+ Agent.from(this.client, a),+ );+ }++ /** Create an agent. */+ async create(options: AgentOptions): Promise<Agent> {+ return Agent.from(+ this.client,+ unwrap(+ await this.client.storage.createAgent({ body: agentBody(options) }),+ ),+ );+ }+}diff --git a/packages/sdk/src/entities/ai/namespace.ts b/packages/sdk/src/entities/ai/namespace.tsindex 478d787465..88267cda57 100644--- a/packages/sdk/src/entities/ai/namespace.ts+++ b/packages/sdk/src/entities/ai/namespace.ts@@ -3,9 +3,11 @@ import type {DecisionResponse,StructuredCompletionRequest,StructuredCompletionResponse,+ UsageRequest,} from '../../../generated/cognition/types.gen';import { unwrap } from '../../utils';import type { MacroClient } from '../../utils/client';+import type { User } from '../users/user';export type {DecisionRequest,@@ -16,6 +18,18 @@ export type {/** Shared cognition endpoints, charged to the authenticated acting user. */export class AiNamespace {+ /** Read AI usage over a time range, optionally restricting it to users. */+ async usage(+ options: Omit<UsageRequest, 'include_users'> & { users?: User[] } = {},+ ) {+ const { users, ...rest } = options;+ return unwrap(+ await this.client.cognition.getUsageHandler({+ body: { ...rest, include_users: users?.map((u) => u.id) },+ }),+ );+ }+constructor(private readonly client: MacroClient) {}/**diff --git a/packages/sdk/src/entities/api-keys/api-key.ts b/packages/sdk/src/entities/api-keys/api-key.tsnew file mode 100644index 0000000000..e43271080e--- /dev/null+++ b/packages/sdk/src/entities/api-keys/api-key.ts@@ -0,0 +1,43 @@+import type { UserApiKeyInfo } from '../../../generated/storage/types.gen';+import { MacroNotFoundError, unwrap } from '../../utils';+import type { MacroClient } from '../../utils/client';+import { MacroEntity } from '../entity';++/** A user API key's metadata. Secrets are returned only at creation. */+export class UserApiKey extends MacroEntity<UserApiKeyInfo> {+ /** Construct a lazy key handle. */+ static byId(client: MacroClient, id: string): UserApiKey {+ return new UserApiKey(client, id);+ }++ /** Seed from metadata, deliberately excluding the secret. */+ static from(client: MacroClient, record: UserApiKeyInfo): UserApiKey {+ return new UserApiKey(client, record.id, {+ id: record.id,+ name: record.name,+ createdAt: record.createdAt,+ });+ }++ protected async fetch(): Promise<UserApiKeyInfo> {+ const record = unwrap(+ await this.client.storage.listUserApiKeys(),+ ).keys.find((k) => k.id === this.id);+ if (!record)+ throw new MacroNotFoundError(`API key ${this.id} is unavailable`);+ return record;+ }++ /** Human readable label. */+ readonly name = this.field('name');++ /** Creation time. */+ readonly createdAt = this.field('createdAt');++ /** Revoke this key. */+ async delete(): Promise<void> {+ await this.mutate((c) =>+ c.storage.deleteUserApiKey({ path: { id: this.id } }),+ );+ }+}diff --git a/packages/sdk/src/entities/api-keys/namespace.ts b/packages/sdk/src/entities/api-keys/namespace.tsnew file mode 100644index 0000000000..5f25f533b5--- /dev/null+++ b/packages/sdk/src/entities/api-keys/namespace.ts@@ -0,0 +1,33 @@+import { unwrap } from '../../utils';+import type { MacroClient } from '../../utils/client';+import { UserApiKey } from './api-key';++/** User API key management. */+export class ApiKeyNamespace {+ constructor(private readonly client: MacroClient) {}++ /** Construct a lazy key handle. */+ byId(id: string): UserApiKey {+ return UserApiKey.byId(this.client, id);+ }++ /** List metadata for the caller's API keys. */+ async list(): Promise<UserApiKey[]> {+ return unwrap(await this.client.storage.listUserApiKeys()).keys.map((k) =>+ UserApiKey.from(this.client, k),+ );+ }++ /** Create a key. Save the secret now; it cannot be retrieved later. */+ async create(name: string): Promise<{ key: UserApiKey; secret: string }> {+ const record = unwrap(+ await this.client.storage.createUserApiKey({ body: { name } }),+ );+ return { key: UserApiKey.from(this.client, record), secret: record.key };+ }++ /** Exchange an email address for a Macro API token, subject to server authorization. */+ async tokenForEmail(email: string) {+ return unwrap(await this.client.auth.macroApiToken({ query: { email } }));+ }+}diff --git a/packages/sdk/src/entities/calendar/calendar.ts b/packages/sdk/src/entities/calendar/calendar.tsindex 9cab85772f..8045b1d08c 100644--- a/packages/sdk/src/entities/calendar/calendar.ts+++ b/packages/sdk/src/entities/calendar/calendar.ts@@ -11,6 +11,18 @@ import { MacroEntity } from '../entity';* handle loads its detail by listing the caller's calendars and matching on id.*/export class Calendar extends MacroEntity<VisibleCalendar> {+ /** Set whether this calendar contributes to the caller's availability. */+ async setContributesToAvailability(+ contributesToAvailability: boolean,+ ): Promise<void> {+ await this.mutate((c) =>+ c.calendar.setAvailabilityCalendar({+ path: { calendar_id: this.id },+ body: { contributesToAvailability },+ }),+ );+ }+protected async fetch(): Promise<VisibleCalendar> {const { calendars } = unwrap(await this.client.calendar.listCalendars());const found = calendars.find((calendar) => calendar.id === this.id);diff --git a/packages/sdk/src/entities/calendar/namespace.ts b/packages/sdk/src/entities/calendar/namespace.tsindex 2ebf8a3b5d..e475c54227 100644--- a/packages/sdk/src/entities/calendar/namespace.ts+++ b/packages/sdk/src/entities/calendar/namespace.ts@@ -7,10 +7,17 @@ import type {EventTransparency,EventVisibility,OutOfOfficeProperties,+ TeamCalendarSharing,} from '../../../generated/calendar/types.gen';-import { unwrap } from '../../utils';+import type {+ ListOccurrencesData,+ ListTeamCalendarData,+ ListTeamOutOfOfficeData,+} from '../../../generated/storage/types.gen';+import { paginate, unwrap } from '../../utils';import type { MacroClient } from '../../utils/client';import type { Link } from '../email/link';+import { User } from '../users/user';import { Calendar } from './calendar';import { CalendarEvent } from './event';import { CalendarReplacement } from './replacement';@@ -56,6 +63,88 @@ export interface CreateEventOptions {* SDK reaches it on the gateway's `/calendar` route).*/export class CalendarNamespace {+ /** Calendar availability settings, each referring to a typed calendar. */+ async availabilityCalendars() {+ return unwrap(+ await this.client.calendar.getAvailabilityCalendars(),+ ).calendars.map((record) => ({+ calendar: Calendar.byId(this.client, record.calendarId),+ name: record.name,+ isPrimary: record.isPrimary,+ contributesToAvailability: record.contributesToAvailability,+ }));+ }++ /** Current sharing preference for the team calendar. */+ async teamSharing(): Promise<TeamCalendarSharing> {+ return unwrap(await this.client.calendar.getTeamSharing()).sharing;+ }++ /** Replace the team calendar sharing preference. */+ async setTeamSharing(+ sharing: TeamCalendarSharing,+ ): Promise<TeamCalendarSharing> {+ return unwrap(+ await this.client.calendar.setTeamSharing({ body: { sharing } }),+ ).sharing;+ }++ /** Calendar occurrences in a viewport, automatically paginated. */+ occurrences(options: Omit<ListOccurrencesData['query'], 'cursor'>) {+ return paginate(async (cursor) => {+ const page = unwrap(+ await this.client.storage.listOccurrences({+ query: { ...options, cursor },+ }),+ );+ return {+ items: page.items.map((item) => ({+ event: CalendarEvent.fromRecord(this.client, item.event),+ occurrence: item.occurrence,+ })),+ nextCursor: page.nextCursor,+ };+ });+ }++ /** A page of team availability, including its roster and continuation cursor. */+ async teamPage(options: NonNullable<ListTeamCalendarData['query']>) {+ const page = unwrap(+ await this.client.storage.listTeamCalendar({ query: options }),+ );+ return {+ items: page.items.map(({ ownerId, ...item }) => ({+ ...item,+ owner: User.byId(this.client, ownerId),+ })),+ members: page.members.map((member) => ({+ user: User.byId(this.client, member.userId),+ sharing: member.sharing,+ coverage: member.coverage,+ })),+ nextCursor: page.nextCursor ?? undefined,+ };+ }++ /** Teammates' out-of-office occurrences in a bounded viewport. Check hasMore for truncation. */+ async teamOutOfOffice(+ options: NonNullable<ListTeamOutOfOfficeData['query']>,+ ) {+ const page = unwrap(+ await this.client.storage.listTeamOutOfOffice({ query: options }),+ );+ return {+ items: page.items.map((item) => ({+ event: CalendarEvent.byId(this.client, item.eventId),+ owner: User.byId(this.client, item.ownerId),+ occurrenceKey: item.occurrenceKey,+ time: item.time,+ title: item.title ?? undefined,+ })),+ hasMore: page.hasMore,+ };+ }+constructor(private readonly client: MacroClient) {}/** The caller's visible calendars, primaries and writable first. */diff --git a/packages/sdk/src/entities/calls/call-record.ts b/packages/sdk/src/entities/calls/call-record.tsindex e3eb9491a7..dc960a760e 100644--- a/packages/sdk/src/entities/calls/call-record.ts+++ b/packages/sdk/src/entities/calls/call-record.ts@@ -1,9 +1,19 @@-import type { GetCallRecordResponses } from '../../../generated/storage/types.gen';+import type {+ EditCallTranscriptRequest,+ GetCallRecordResponses,+} from '../../../generated/storage/types.gen';import { unwrap } from '../../utils';import type { MacroClient } from '../../utils/client';import { Channel } from '../channels/channel';import { FavoritableEntity } from '../entity';+import { Meeting } from '../meetings/meeting';+import {+ MessageThread,+ type TimelineOptions,+ timeline,+} from '../messages/thread';import { entitySearch } from '../search';+import { EntityAccess } from '../sharing/access';import { User } from '../users/user';import { CallMessage } from './message';@@ -11,12 +21,59 @@ type CallRecordDetail = GetCallRecordResponses[200];/** A Macro call record (an archived or still active call). */export class CallRecord extends FavoritableEntity<CallRecordDetail> {+ /** A shared message thread scoped to this resource. */+ messageThreadById(id: string): MessageThread {+ return MessageThread.byId(this.client, { type: 'call', entity: this }, id);+ }++ /** A mixed message and activity timeline page. */+ timelinePage(selection?: TimelineOptions<CallMessage>) {+ return timeline(+ this.client,+ { type: 'call', entity: this },+ (record) => CallMessage.from(this.client, this.id, record),+ selection,+ );+ }++ /** Access requests and direct user grants. */+ readonly access = new EntityAccess(this.client, 'call', this);++ /** Get or create a shareable meeting for this call. */+ async meeting(): Promise<Meeting> {+ return Meeting.from(+ this.client,+ unwrap(+ await this.client.storage.meetingShare({ path: { call_id: this.id } }),+ ),+ );+ }++ /** Update custom speaker assignments in the transcript. */+ async editTranscript(+ assignments: EditCallTranscriptRequest['assignments'],+ ): Promise<void> {+ await this.mutate((c) =>+ c.storage.editCallTranscript({+ path: { call_id: this.id },+ body: { assignments },+ }),+ );+ }++ /** Toggle the server's share-with-team setting and return its new value. */+ async toggleTeamShare(): Promise<boolean> {+ return this.mutate((c) =>+ c.storage.toggleShareWithTeam({ path: { call_id: this.id } }),+ );+ }+/** Favorites identify call records as `call`. */readonly entityType = 'call';protected async fetch(): Promise<CallRecordDetail> {return unwrap(- await this.client.storage.getCallRecord({ path: { call_id: this.id } })+ await this.client.storage.getCallRecord({ path: { call_id: this.id } }),);}@@ -35,7 +92,7 @@ export class CallRecord extends FavoritableEntity<CallRecordDetail> {/** The channel the call belongs to, if it is a channel call. */readonly channel = this.mappedField('channelId', (id) =>- id ? Channel.byId(this.client, id) : undefined+ id ? Channel.byId(this.client, id) : undefined,);/** The display name of the channel the call belongs to. */@@ -43,7 +100,7 @@ export class CallRecord extends FavoritableEntity<CallRecordDetail> {/** The user who started the call. */readonly creator = this.mappedField('createdBy', (id) =>- User.byId(this.client, id)+ User.byId(this.client, id),);/** Whether the call is still in progress. */@@ -105,7 +162,7 @@ export class CallRecord extends FavoritableEntity<CallRecordDetail> {c.storage.editCallRecord({path: { call_id: this.id },body: { customName: name ?? '' },- })+ }),);}@@ -122,14 +179,14 @@ export class CallRecord extends FavoritableEntity<CallRecordDetail> {body: {sharePermission: { teamShareAccessLevel: shared ? 'view' : null },},- })+ }),);}/** Delete the call record. */async delete(): Promise<void> {await this.mutate((c) =>- c.storage.deleteCallRecord({ path: { call_id: this.id } })+ c.storage.deleteCallRecord({ path: { call_id: this.id } }),);}diff --git a/packages/sdk/src/entities/calls/message.ts b/packages/sdk/src/entities/calls/message.tsindex f308e99ea4..ec033d9c23 100644--- a/packages/sdk/src/entities/calls/message.ts+++ b/packages/sdk/src/entities/calls/message.ts@@ -12,7 +12,7 @@ export class CallMessage extends MacroEntity<MessageRecord> {client: MacroClient,readonly callId: string,id: string,- seed?: MessageRecord+ seed?: MessageRecord,) {super(client, id, seed);}@@ -23,7 +23,7 @@ export class CallMessage extends MacroEntity<MessageRecord> {protected async fetch(): Promise<MessageRecord> {return unwrap(- await this.client.storage.entityMessageGetMessage({ path: this.path })+ await this.client.storage.entityMessageGetMessage({ path: this.path }),);}@@ -36,7 +36,7 @@ export class CallMessage extends MacroEntity<MessageRecord> {static from(client: MacroClient,callId: string,- record: MessageRecord+ record: MessageRecord,): CallMessage {return new CallMessage(client, callId, record.id, record);}@@ -66,7 +66,7 @@ export class CallMessage extends MacroEntity<MessageRecord> {await this.client.storage.entityMessageCreate({path: { parent_type: 'call', parent_id: this.callId },body: { ...toBody(body), thread_id: this.callId },- })+ }),);return CallMessage.from(this.client, this.callId, record);}@@ -78,7 +78,7 @@ export class CallMessage extends MacroEntity<MessageRecord> {client.storage.entityMessageEdit({path: this.path,body: { content, mentions },- })+ }),);return this;}@@ -86,7 +86,7 @@ export class CallMessage extends MacroEntity<MessageRecord> {/** Delete this message, preserving the rest of the call's chat. */async delete(): Promise<void> {await this.mutate((client) =>- client.storage.entityMessageDeleteMessage({ path: this.path })+ client.storage.entityMessageDeleteMessage({ path: this.path }),);}}diff --git a/packages/sdk/src/entities/channels/activity.ts b/packages/sdk/src/entities/channels/activity.tsnew file mode 100644index 0000000000..1e00ad8a48--- /dev/null+++ b/packages/sdk/src/entities/channels/activity.ts@@ -0,0 +1,51 @@+import type {+ ActivityType,+ ApiActivity,+} from '../../../generated/storage/types.gen';+import { unwrap } from '../../utils';+import type { MacroClient } from '../../utils/client';+import { User } from '../users/user';+import type { Channel } from './channel';++/** A user's channel activity marker. */+export class ChannelActivity {+ constructor(+ private readonly client: MacroClient,+ /** Related channel. */+ readonly channel: Channel,+ private readonly record: ApiActivity,+ ) {}++ /** Activity identity. */+ get id(): string {+ return this.record.id;+ }++ /** User who interacted. */+ user(): User {+ return User.byId(this.client, this.record.user_id);+ }++ /** Creation time. */+ createdAt(): string {+ return this.record.created_at;+ }++ /** Record a view or interaction in this channel. */+ async recordInteraction(type: ActivityType): Promise<ChannelActivity> {+ return new ChannelActivity(+ this.client,+ this.channel,+ unwrap(+ await this.client.storage.postActivity({+ body: { activity_type: type, channel_id: this.channel.id },+ }),+ ),+ );+ }++ /** Serialize activity without credentials. */+ toJSON() {+ return this.record;+ }+}diff --git a/packages/sdk/src/entities/channels/channel.ts b/packages/sdk/src/entities/channels/channel.tsindex 1fc39a01cc..3384b88345 100644--- a/packages/sdk/src/entities/channels/channel.ts+++ b/packages/sdk/src/entities/channels/channel.ts@@ -1,4 +1,5 @@import type {+ ActivityType,ChannelType,GetChannelAttachmentsResponses,GetChannelParticipantsResponses,@@ -9,11 +10,19 @@ import type {import { type RichMessage, toBody } from '../../mentions';import { paginate, unwrap } from '../../utils';import type { MacroClient } from '../../utils/client';+import { AgentConversation } from '../agent-sessions/conversation';import { PropertiedEntity } from '../entity';+import {+ MessageThread,+ type TimelineOptions,+ timeline,+} from '../messages/thread';import { entitySearch } from '../search';import type { Team } from '../teams/team';import type { User } from '../users/user';+import { ChannelActivity } from './activity';import { Message } from './message';+import type { ChannelPicture } from './picture';import { postToChannel } from './post';import type { Thread } from './thread';@@ -30,6 +39,59 @@ export type ChannelAttachment =* A channel.*/export class Channel extends PropertiedEntity<ChannelDetail> {+ /** Record a view or interaction in this channel. */+ async recordActivity(type: ActivityType): Promise<ChannelActivity> {+ return new ChannelActivity(+ this.client,+ this,+ unwrap(+ await this.client.storage.postActivity({+ body: { activity_type: type, channel_id: this.id },+ }),+ ),+ );+ }++ /** Set an uploaded profile picture, or clear it. */+ async setPicture(picture?: ChannelPicture): Promise<void> {+ await this.mutate((c) =>+ c.storage.setChannelPicture({+ path: { channel_id: this.id },+ body: { profile_picture_id: picture?.id ?? null },+ }),+ );+ }++ /** A shared message thread scoped to this resource. */+ messageThreadById(id: string): MessageThread {+ return MessageThread.byId(+ this.client,+ { type: 'channel', entity: this },+ id,+ );+ }++ /** A mixed message and activity timeline page. */+ timelinePage(selection?: TimelineOptions<Message>) {+ return timeline(+ this.client,+ { type: 'channel', entity: this },+ (record) => Message.from(this.client, this.id, record),+ selection,+ );+ }++ /** Conversations maintained by agents in this channel. */+ async agentConversations(): Promise<AgentConversation[]> {+ return unwrap(+ await this.client.agentHarness.listAgentConversations({+ path: { channel_id: this.id },+ }),+ ).conversations.map(+ (record) => new AgentConversation(this.client, this, record),+ );+ }+/** Favorites identify channels as `channel`. */readonly entityType = 'channel';diff --git a/packages/sdk/src/entities/channels/labels.ts b/packages/sdk/src/entities/channels/labels.tsindex 5827ea8eb1..3816bec231 100644--- a/packages/sdk/src/entities/channels/labels.ts+++ b/packages/sdk/src/entities/channels/labels.ts@@ -38,17 +38,17 @@ export class ChannelLabelsNamespace {return unwrap(await this.client.storage.createChannelLabel({body: { name, channelIds: channels.map((channel) => channel.id) },- })+ }),);}/** Create a smart tag whose membership follows an attribute rule automatically. */async createSmartTag(name: string,- rule: ChannelLabelRule+ rule: ChannelLabelRule,): Promise<ChannelLabel> {return unwrap(- await this.client.storage.createChannelLabel({ body: { name, rule } })+ await this.client.storage.createChannelLabel({ body: { name, rule } }),);}@@ -61,13 +61,13 @@ export class ChannelLabelsNamespace {async updateSmartTag(label: ChannelLabel,name: string,- rule: ChannelLabelRule+ rule: ChannelLabelRule,): Promise<ChannelLabel> {return unwrap(await this.client.storage.renameChannelLabel({path: { label_id: label.id },body: { name, rule },- })+ }),);}@@ -77,7 +77,7 @@ export class ChannelLabelsNamespace {await this.client.storage.renameChannelLabel({path: { label_id: label.id },body: { name },- })+ }),);}@@ -86,20 +86,20 @@ export class ChannelLabelsNamespace {unwrap(await this.client.storage.deleteChannelLabel({path: { label_id: label.id },- })+ }),);}/** Move a channel into `label`, or out of any label when `label` is `undefined`. */async setLabel(channel: Channel,- label: ChannelLabel | undefined+ label: ChannelLabel | undefined,): Promise<void> {unwrap(await this.client.storage.setChannelLabel({path: { channel_id: channel.id },body: { labelId: label?.id ?? null },- })+ }),);}}diff --git a/packages/sdk/src/entities/channels/namespace.ts b/packages/sdk/src/entities/channels/namespace.tsindex 3db8e36d40..2340fa020e 100644--- a/packages/sdk/src/entities/channels/namespace.ts+++ b/packages/sdk/src/entities/channels/namespace.ts@@ -4,10 +4,23 @@ import type { MacroClient } from '../../utils/client';import type { SearchOpts } from '../search';import type { Team } from '../teams/team';import type { User } from '../users/user';+import { ChannelActivity } from './activity';import { Channel } from './channel';import { ChannelLabelsNamespace } from './labels';export class ChannelNamespace {+ /** Recent channel activity, with channel and user handles. */+ async activity(): Promise<ChannelActivity[]> {+ return unwrap(await this.client.storage.getActivity()).map(+ (record) =>+ new ChannelActivity(+ this.client,+ Channel.byId(this.client, record.channel_id),+ record,+ ),+ );+ }+/** Team-shared labels that group channels in the Chat sidebar. */readonly labels: ChannelLabelsNamespace;diff --git a/packages/sdk/src/entities/channels/picture.ts b/packages/sdk/src/entities/channels/picture.tsnew file mode 100644index 0000000000..5b46a0b258--- /dev/null+++ b/packages/sdk/src/entities/channels/picture.ts@@ -0,0 +1,14 @@+/** An uploaded channel profile picture in static file storage. */+export class ChannelPicture {+ private constructor(/** Uploaded picture identity. */ readonly id: string) {}++ /** Construct a reference from the upload receipt. */+ static byId(id: string): ChannelPicture {+ return new ChannelPicture(id);+ }++ /** Serialize the uploaded picture reference. */+ toJSON() {+ return { id: this.id };+ }+}diff --git a/packages/sdk/src/entities/chats/chat.ts b/packages/sdk/src/entities/chats/chat.tsindex 2690564f12..7aa40230f0 100644--- a/packages/sdk/src/entities/chats/chat.ts+++ b/packages/sdk/src/entities/chats/chat.ts@@ -1,19 +1,57 @@import type {GetChatHistoryHandlerResponses,GetChatResponses,+ HttpSendChatMessageRequest,} from '../../../generated/cognition/types.gen';import { type Mentionable, type MentionPart, wrapXml } from '../../mentions';import { unwrap } from '../../utils';import type { MacroClient } from '../../utils/client';import { PropertiedEntity } from '../entity';import { Project } from '../projects/project';+import type { EntityReference } from '../reference';import { entitySearch } from '../search';+import { EntityAccess } from '../sharing/access';+import { ChatGeneration, ChatMessage } from './generation';type ChatDetail = GetChatResponses[200]['chat'];+type ChatHistory = GetChatHistoryHandlerResponses[200]['conversation'];/** A Macro AI chat. */export class Chat extends PropertiedEntity<ChatDetail> implements Mentionable {+ /** Send a message and start a background generation. Tools may perform writes. */+ async send(+ options: Omit<+ HttpSendChatMessageRequest,+ 'chat_id' | 'attachments' | 'additional_instructions'+ > & { attachments?: EntityReference[]; additionalInstructions?: string },+ ): Promise<ChatGeneration> {+ const { attachments, additionalInstructions, ...rest } = options;+ const result = await this.mutate((c) =>+ c.cognition.sendChatMessage({+ body: {+ ...rest,+ chat_id: this.id,+ additional_instructions: additionalInstructions,+ attachments: attachments?.map((a) => ({+ entity_id: a.entity.id,+ entity_type: a.type,+ })),+ },+ }),+ );+ const chat = Chat.byId(this.client, result.chat_id);+ return ChatGeneration.byId(+ this.client,+ chat,+ result.stream_id,+ ChatMessage.byId(this.client, chat, result.message_id),+ );+ }++ /** Access requests and direct user grants. */+ readonly access = new EntityAccess(this.client, 'chat', this);+/** Favorites identify chats as `chat`. */readonly entityType = 'chat';diff --git a/packages/sdk/src/entities/chats/generation.ts b/packages/sdk/src/entities/chats/generation.tsnew file mode 100644index 0000000000..2f90dcd6fc--- /dev/null+++ b/packages/sdk/src/entities/chats/generation.ts@@ -0,0 +1,87 @@+import type { ChatMessageWithAttachments } from '../../../generated/cognition/types.gen';+import { MacroNotFoundError, unwrap } from '../../utils';+import type { MacroClient } from '../../utils/client';+import { MacroEntity } from '../entity';+import type { Chat } from './chat';++/** A background chat generation. The stream belongs to exactly one chat. */+export class ChatGeneration {+ private constructor(+ private readonly client: MacroClient,+ /** Parent chat. */+ readonly chat: Chat,+ /** Stream identity. */+ readonly id: string,+ /** AI response message for this generation. */+ readonly message: ChatMessage,+ ) {}++ /** Construct from a send receipt. */+ static byId(+ client: MacroClient,+ chat: Chat,+ id: string,+ message: ChatMessage,+ ): ChatGeneration {+ return new ChatGeneration(client, chat, id, message);+ }++ /** Request cancellation of this generation. */+ async stop(): Promise<void> {+ unwrap(+ await this.client.cognition.stopChatStream({+ body: { chat_id: this.chat.id, stream_id: this.id },+ }),+ );+ }++ /** Serialize scoped identity. */+ toJSON() {+ return { id: this.id, chatId: this.chat.id, messageId: this.message.id };+ }+}++/** A message scoped to an AI chat. */+export class ChatMessage extends MacroEntity<ChatMessageWithAttachments> {+ private constructor(+ client: MacroClient,+ /** Parent chat. */+ readonly chat: Chat,+ id: string,+ ) {+ super(client, id);+ }++ /** Construct a chat message handle. */+ static byId(client: MacroClient, chat: Chat, id: string): ChatMessage {+ return new ChatMessage(client, chat, id);+ }++ protected async fetch(): Promise<ChatMessageWithAttachments> {+ const message = unwrap(+ await this.client.cognition.getChat({ path: { chat_id: this.chat.id } }),+ ).chat.messages.find((m) => m.id === this.id);+ if (!message)+ throw new MacroNotFoundError(+ `Chat message ${this.id} is not yet available`,+ );+ return message;+ }++ /** The message's generated content. */+ readonly content = this.field('content');++ /** Role of the message author. */+ readonly role = this.field('role');++ /** Reload after a running generation changes or finishes. */+ async refresh(): Promise<void> {+ this.detail.clear();+ await this.detail.get();+ }++ /** Serialize scoped identity and any loaded message. */+ override toJSON() {+ return { ...super.toJSON(), chatId: this.chat.id };+ }+}diff --git a/packages/sdk/src/entities/crm/company.ts b/packages/sdk/src/entities/crm/company.tsindex 6601e9cee4..be9b2ec023 100644--- a/packages/sdk/src/entities/crm/company.ts+++ b/packages/sdk/src/entities/crm/company.ts@@ -3,6 +3,11 @@ import type { RichMessage } from '../../mentions';import { unwrap } from '../../utils';import type { MacroClient } from '../../utils/client';import { PropertiedEntity } from '../entity';+import {+ MessageThread,+ type TimelineOptions,+ timeline,+} from '../messages/thread';import { entitySearch } from '../search';import { Team } from '../teams/team';import {@@ -18,6 +23,30 @@ type CompanyDetail = GetCompanyResponses[200];/** A CRM company: an organization the team has interacted with. */export class Company extends PropertiedEntity<CompanyDetail> {+ /** A shared message thread scoped to this resource. */+ messageThreadById(id: string): MessageThread {+ return MessageThread.byId(+ this.client,+ { type: 'crm_company', entity: this },+ id,+ );+ }++ /** A mixed message and activity timeline page. */+ timelinePage(selection?: TimelineOptions<CrmComment>) {+ return timeline(+ this.client,+ { type: 'crm_company', entity: this },+ (record) =>+ CrmComment.from(+ this.client,+ { type: 'crm_company', id: this.id },+ record,+ ),+ selection,+ );+ }+/** Favorites identify CRM companies as `crm_company`. */readonly entityType = 'crm_company';diff --git a/packages/sdk/src/entities/crm/contact.ts b/packages/sdk/src/entities/crm/contact.tsindex c8d419b370..984b92f3fc 100644--- a/packages/sdk/src/entities/crm/contact.ts+++ b/packages/sdk/src/entities/crm/contact.ts@@ -3,6 +3,11 @@ import type { RichMessage } from '../../mentions';import { unwrap } from '../../utils';import type { MacroClient } from '../../utils/client';import { FavoritableEntity } from '../entity';+import {+ MessageThread,+ type TimelineOptions,+ timeline,+} from '../messages/thread';import {CrmComment,type CrmCommentParent,@@ -16,6 +21,30 @@ type ContactDetail = GetContactResponses[200];/** A CRM contact: a person observed interacting with the team. */export class Contact extends FavoritableEntity<ContactDetail> {+ /** A shared message thread scoped to this resource. */+ messageThreadById(id: string): MessageThread {+ return MessageThread.byId(+ this.client,+ { type: 'crm_contact', entity: this },+ id,+ );+ }++ /** A mixed message and activity timeline page. */+ timelinePage(selection?: TimelineOptions<CrmComment>) {+ return timeline(+ this.client,+ { type: 'crm_contact', entity: this },+ (record) =>+ CrmComment.from(+ this.client,+ { type: 'crm_contact', id: this.id },+ record,+ ),+ selection,+ );+ }+/** Favorites identify CRM contacts as `crm_contact`. */readonly entityType = 'crm_contact';diff --git a/packages/sdk/src/entities/crm/namespace.ts b/packages/sdk/src/entities/crm/namespace.tsindex 02abb63ae3..e4eb0af5af 100644--- a/packages/sdk/src/entities/crm/namespace.ts+++ b/packages/sdk/src/entities/crm/namespace.ts@@ -9,9 +9,15 @@ import { unwrap } from '../../utils';import type { MacroClient } from '../../utils/client';import { Company } from './company';import { Contact } from './contact';+import { PipelineNamespace } from './pipelines';export class CrmNamespace {- constructor(private readonly client: MacroClient) {}+ /** Pipelines, their records and sharing settings. */+ readonly pipelines: PipelineNamespace;++ constructor(private readonly client: MacroClient) {+ this.pipelines = new PipelineNamespace(client);+ }/** A handle to a CRM company by id. */companyById(id: string): Company {@@ -28,7 +34,7 @@ export class CrmNamespace {const { contact } = unwrap(await this.client.storage.getContactByEmail({query: { email },- })+ }),);return contact ? Contact.from(this.client, contact) : undefined;}@@ -42,12 +48,12 @@ export class CrmNamespace {*/async searchContacts(query: string,- opts: { limit?: number } = {}+ opts: { limit?: number } = {},): Promise<Contact[]> {const { contacts } = unwrap(await this.client.storage.searchContacts({query: { query, limit: opts.limit },- })+ }),);return contacts.map((contact) => Contact.from(this.client, contact));}@@ -56,7 +62,7 @@ export class CrmNamespace {async createCompany(opts: CreateCrmCompanyRequest): Promise<Company> {return Company.from(this.client,- unwrap(await this.client.storage.createCrmCompany({ body: opts }))+ unwrap(await this.client.storage.createCrmCompany({ body: opts })),);}@@ -67,10 +73,10 @@ export class CrmNamespace {/** Partially update the caller's current team's CRM settings. */async updateSettings(- settings: UpdateCrmTeamSettingsRequest+ settings: UpdateCrmTeamSettingsRequest,): Promise<CrmTeamSettingsResponse> {return unwrap(- await this.client.storage.putCrmTeamSettings({ body: settings })+ await this.client.storage.putCrmTeamSettings({ body: settings }),);}diff --git a/packages/sdk/src/entities/crm/pipeline.ts b/packages/sdk/src/entities/crm/pipeline.tsnew file mode 100644index 0000000000..646eb605e5--- /dev/null+++ b/packages/sdk/src/entities/crm/pipeline.ts@@ -0,0 +1,335 @@+import type {+ AccessiblePipeline,+ ColumnDetail,+ CreatePipeline,+ DatabaseOp,+ OpBatch,+ StorageRow,+ StorageRowsQuery,+ TableDetail,+} from '../../../generated/storage/types.gen';+import { Lazy, MacroNotFoundError, paginate, unwrap } from '../../utils';+import type { MacroClient } from '../../utils/client';+import { MacroEntity } from '../entity';+import {+ type SharePermissionOptions,+ sharePermissionBody,+} from '../sharing/permissions';+import { Team } from '../teams/team';+import { User } from '../users/user';++/** A CRM pipeline with its own sharing boundary and backing table. */+export class CrmPipeline extends MacroEntity<AccessiblePipeline> {+ private readonly tableDetail = new Lazy(async () =>+ unwrap(+ await this.client.storage.getCrmPipelineTable({ path: { id: this.id } }),+ ),+ );++ /** Construct a lazy pipeline handle. */+ static byId(client: MacroClient, id: string): CrmPipeline {+ return new CrmPipeline(client, id);+ }++ /** Seed from a server record. */+ static from(client: MacroClient, record: AccessiblePipeline): CrmPipeline {+ return new CrmPipeline(client, record.id, record);+ }++ protected async fetch(): Promise<AccessiblePipeline> {+ return unwrap(+ await this.client.storage.getCrmPipeline({ path: { id: this.id } }),+ );+ }++ /** Display name. */+ readonly name = this.field('name');++ /** CRM record type. */+ readonly recordType = this.field('recordType');++ /** Current caller's access level. */+ readonly accessLevel = this.field('grant');++ /** Sharing scope. */+ readonly sharing = this.field('sharing');++ /** Owner. */+ readonly owner = this.mappedField('userId', (id) =>+ User.byId(this.client, id),+ );++ /** Owning team. */+ readonly team = this.mappedField('teamId', (id) =>+ Team.byId(this.client, id),+ );++ /** Rename this pipeline. */+ async rename(name: string): Promise<void> {+ await this.mutate((c) =>+ c.storage.renameCrmPipeline({ path: { id: this.id }, body: { name } }),+ );+ }++ /** Change its sharing scope. */+ async setSharing(sharing: CreatePipeline['sharing']): Promise<void> {+ if (sharing === undefined) throw new Error('Sharing is required');+ await this.mutate((c) =>+ c.storage.shareCrmPipeline({ path: { id: this.id }, body: { sharing } }),+ );+ }++ /** Trash or restore the pipeline. */+ async setTrashed(trashed: boolean): Promise<void> {+ await this.mutate((c) =>+ c.storage.trashCrmPipeline({ path: { id: this.id }, body: { trashed } }),+ );+ }++ /** Read sharing grants. */+ async sharePermissions() {+ return unwrap(+ await this.client.storage.getCrmPipelinePermissions({+ path: { id: this.id },+ }),+ );+ }++ /** Update sharing grants. */+ async updateSharePermissions(options: SharePermissionOptions) {+ return this.mutate((c) =>+ c.storage.updateCrmPipelinePermissions({+ path: { id: this.id },+ body: sharePermissionBody(options),+ }),+ );+ }++ /** Read the backing table through the pipeline's authorization boundary. */+ async table(): Promise<PipelineTable> {+ return PipelineTable.from(this.client, this, await this.tableRecord());+ }++ /** @internal Cached table snapshot shared by all pipeline table handles. */+ tableRecord(): Promise<TableDetail> {+ return this.tableDetail.get();+ }++ /** Rows in pipeline order, automatically paginated. */+ rows(): AsyncGenerator<PipelineRow> {+ return paginate(async (after) => {+ const page = unwrap(+ await this.client.storage.getCrmPipelineRows({+ path: { id: this.id },+ query: { after },+ }),+ );+ return {+ items: page.rows.map((r) => PipelineRow.from(this.client, this, r)),+ nextCursor: page.next,+ };+ });+ }++ /** Query pipeline rows, optionally restricting the query to typed row handles. */+ queryRows(+ options: { query?: StorageRowsQuery['query']; rows?: PipelineRow[] } = {},+ ): AsyncGenerator<PipelineRow> {+ if (options.rows?.some((r) => r.pipeline.id !== this.id))+ throw new Error('Rows belong to another pipeline');+ return paginate(async (after) => {+ const page = unwrap(+ await this.client.storage.queryCrmPipelineRows({+ path: { id: this.id },+ body: {+ after,+ query: options.query,+ rowIds: options.rows?.map((r) => r.id),+ },+ }),+ );+ return {+ items: page.rows.map((r) => PipelineRow.from(this.client, this, r)),+ nextCursor: page.next,+ };+ });+ }++ /** Apply an atomic generated database operation batch through this pipeline.+ * As with Database.applyOps, batch-local UUIDs may name resources minted earlier in the batch. */+ async applyOps(+ ops: DatabaseOp[],+ options?: { baseVersions?: { table: PipelineTable; version: number }[] },+ ) {+ if (options?.baseVersions?.some((v) => v.table.pipeline.id !== this.id))+ throw new Error('Table belongs to another pipeline');+ const body: OpBatch = {+ ops,+ baseVersions: options?.baseVersions+ ? Object.fromEntries(+ options.baseVersions.map((v) => [v.table.id, v.version]),+ )+ : undefined,+ };+ const result = await this.mutate((c) =>+ c.storage.applyCrmPipelineOps({ path: { id: this.id }, body }),+ );+ this.tableDetail.clear();+ return result;+ }+}++/** Backing table of a CRM pipeline. */+export class PipelineTable extends MacroEntity<TableDetail> {+ /** Serialize identity within its pipeline. */+ override toJSON() {+ return { ...super.toJSON(), pipelineId: this.pipeline.id };+ }++ private constructor(+ client: MacroClient,+ /** Parent pipeline. */+ readonly pipeline: CrmPipeline,+ record: TableDetail,+ ) {+ super(client, record.table.id, record);+ }++ /** Seed a table from a pipeline table response. */+ static from(+ client: MacroClient,+ pipeline: CrmPipeline,+ record: TableDetail,+ ): PipelineTable {+ return new PipelineTable(client, pipeline, record);+ }++ protected fetch(): Promise<TableDetail> {+ return this.pipeline.tableRecord();+ }++ /** Columns in this table. */+ async columns(): Promise<PipelineColumn[]> {+ return (await this.pipeline.tableRecord()).columns.map((c) =>+ PipelineColumn.from(this.client, this, c),+ );+ }++ /** Table version for optimistic operation batches. */+ async version(): Promise<number> {+ return (await this.pipeline.tableRecord()).table.version;+ }++ /** A scoped row handle. */+ rowById(id: string): PipelineRow {+ return PipelineRow.byId(this.client, this.pipeline, id);+ }++ /** Rows from the authorized pipeline surface. */+ rows(): AsyncGenerator<PipelineRow> {+ return this.pipeline.rows();+ }+}++/** One pipeline row. */+export class PipelineRow extends MacroEntity<StorageRow> {+ /** Serialize identity within its pipeline. */+ override toJSON() {+ return { ...super.toJSON(), pipelineId: this.pipeline.id };+ }++ private constructor(+ client: MacroClient,+ /** Parent pipeline. */+ readonly pipeline: CrmPipeline,+ id: string,+ record?: StorageRow,+ ) {+ super(client, id, record);+ }++ /** Construct a scoped row handle. */+ static byId(+ client: MacroClient,+ pipeline: CrmPipeline,+ id: string,+ ): PipelineRow {+ return new PipelineRow(client, pipeline, id);+ }++ /** Seed a listed row. */+ static from(+ client: MacroClient,+ pipeline: CrmPipeline,+ record: StorageRow,+ ): PipelineRow {+ return new PipelineRow(client, pipeline, record.rowId, record);+ }++ protected async fetch(): Promise<StorageRow> {+ for await (const row of this.pipeline.queryRows({ rows: [this] }))+ if (row.id === this.id) return row.detail.get();+ throw new MacroNotFoundError(`Pipeline row ${this.id} is unavailable`);+ }++ /** Values keyed by property definition. */+ readonly cells = this.field('cells');++ /** Reload this row after an operation batch. */+ async refresh(): Promise<void> {+ this.detail.clear();+ await this.detail.get();+ }+}++/** A column belonging to a pipeline table. */+export class PipelineColumn extends MacroEntity<ColumnDetail> {+ /** Serialize identity within its pipeline. */+ override toJSON() {+ return {+ ...super.toJSON(),+ pipelineId: this.table.pipeline.id,+ tableId: this.table.id,+ };+ }++ private constructor(+ client: MacroClient,+ /** Parent table. */+ readonly table: PipelineTable,+ record: ColumnDetail,+ ) {+ super(client, record.column.id, record);+ }++ /** Seed a column handle. */+ static from(+ client: MacroClient,+ table: PipelineTable,+ record: ColumnDetail,+ ): PipelineColumn {+ return new PipelineColumn(client, table, record);+ }++ protected async fetch(): Promise<ColumnDetail> {+ const record = (await this.table.pipeline.tableRecord()).columns.find(+ (c) => c.column.id === this.id,+ );+ if (!record)+ throw new MacroNotFoundError(`Pipeline column ${this.id} is unavailable`);+ return record;+ }++ /** Whether the caller can write this column. */+ async writable(): Promise<boolean> {+ return (await this.fetch()).writable;+ }++ /** Current column label. */+ async name(): Promise<string> {+ return (+ (await this.fetch()).column.display_name ??+ (await this.fetch()).definition.definition.display_name+ );+ }+}diff --git a/packages/sdk/src/entities/crm/pipelines.ts b/packages/sdk/src/entities/crm/pipelines.tsnew file mode 100644index 0000000000..d1d04fff40--- /dev/null+++ b/packages/sdk/src/entities/crm/pipelines.ts@@ -0,0 +1,29 @@+import type { CreatePipeline } from '../../../generated/storage/types.gen';+import { unwrap } from '../../utils';+import type { MacroClient } from '../../utils/client';+import { CrmPipeline } from './pipeline';++/** CRM pipelines in the caller's team. */+export class PipelineNamespace {+ constructor(private readonly client: MacroClient) {}++ /** Construct a lazy pipeline handle. */+ byId(id: string): CrmPipeline {+ return CrmPipeline.byId(this.client, id);+ }++ /** List accessible pipelines. */+ async list(): Promise<CrmPipeline[]> {+ return unwrap(await this.client.storage.listCrmPipelines()).map((p) =>+ CrmPipeline.from(this.client, p),+ );+ }++ /** Create a pipeline and its backing storage. */+ async create(options: CreatePipeline): Promise<CrmPipeline> {+ return CrmPipeline.from(+ this.client,+ unwrap(await this.client.storage.createCrmPipeline({ body: options })),+ );+ }+}diff --git a/packages/sdk/src/entities/databases/column.ts b/packages/sdk/src/entities/databases/column.tsindex 079c042599..12bb8c99c2 100644--- a/packages/sdk/src/entities/databases/column.ts+++ b/packages/sdk/src/entities/databases/column.ts@@ -27,7 +27,7 @@ export class DatabaseColumn {/** The table this column belongs to. */readonly table: DatabaseTable,/** Identifier of the column placement. */- readonly id: string+ readonly id: string,) {}/** A handle to a column by id, within a table. Details load on first access. */@@ -44,7 +44,7 @@ export class DatabaseColumn {const found = columns.find((column) => column.column.id === this.id);if (!found) {throw new MacroNotFoundError(- `column ${this.id} is not on table ${this.table.id}`+ `column ${this.id} is not on table ${this.table.id}`,);}return found;@@ -75,7 +75,7 @@ export class DatabaseColumn {/** Change this column's type. See {@link Database.changeColumnType}. */changeType(- options: ChangeColumnTypeOptions+ options: ChangeColumnTypeOptions,): Promise<OpResultOf<'column', 'type_changed'>> {return this.table.database.changeColumnType(this, options);}@@ -86,7 +86,7 @@ export class DatabaseColumn {* {@link Database.convertColumnIntoNewColumn}.*/convertIntoNewColumn(- options: ConvertIntoNewColumnOptions+ options: ConvertIntoNewColumnOptions,): Promise<DatabaseColumn> {return this.table.database.convertColumnIntoNewColumn(this, options);}diff --git a/packages/sdk/src/entities/databases/database.ts b/packages/sdk/src/entities/databases/database.tsindex 129740226b..c10b22d3fe 100644--- a/packages/sdk/src/entities/databases/database.ts+++ b/packages/sdk/src/entities/databases/database.ts@@ -27,8 +27,14 @@ import { MacroApiError, MacroError, unwrap } from '../../utils';import type { MacroClient } from '../../utils/client';import { MacroEntity } from '../entity';import type { PropertyDefinition } from '../properties/property-definition';+import { EntityAccess } from '../sharing/access';import { User } from '../users/user';import { DatabaseColumn } from './column';+import {+ type DatabaseQueryOptions,+ type DatabaseQueryResult,+ queryDatabases,+} from './query';import type { DatabaseRow } from './row';import { DatabaseTable } from './table';import type { DatabaseView } from './view';@@ -130,10 +136,13 @@ export type InferColumnTypeOptions = {export class MacroOpRefusedError extends MacroApiError {/** The refused op's index in the batch. */readonly op: number;+/** The row's index within the op, when one row is at fault. */readonly row: number | null;+/** The column placement at fault, when one is. */readonly column: string | null;+/** The minted id that is already taken, when that is the reason. */readonly taken: TakenId | null;@@ -241,6 +250,9 @@ function soleResult<* loads lazily on first field access and is dropped after any mutation.*/export class Database extends MacroEntity<DatabaseDetail> {+ /** Access requests and direct user grants. */+ readonly access = new EntityAccess(this.client, 'database', this);+protected async fetch(): Promise<DatabaseDetail> {return unwrap(await this.client.storage.getDatabase({ path: { id: this.id } }),@@ -274,6 +286,22 @@ export class Database extends MacroEntity<DatabaseDetail> {return listed.map((entry) => new Database(client, entry.database.id));}+ /** Run one SQL statement with this database as the default name scope. */+ query(+ sql: string,+ options?: Omit<DatabaseQueryOptions, 'database'>,+ ): Promise<DatabaseQueryResult> {+ return queryDatabases(this.client, Database.byId, sql, {+ ...options,+ database: this,+ });+ }++ /** @internal Drop the schema snapshot after a successful SQL write. */+ invalidateSchema(): void {+ this.detail.clear();+ }+/*** The full schema: the database record, the caller's access, and every* table with its columns and views. Cached until the next write.diff --git a/packages/sdk/src/entities/databases/namespace.ts b/packages/sdk/src/entities/databases/namespace.tsindex 8e4a4dbd48..1db2631b2c 100644--- a/packages/sdk/src/entities/databases/namespace.ts+++ b/packages/sdk/src/entities/databases/namespace.ts@@ -1,5 +1,10 @@import type { MacroClient } from '../../utils/client';import { Database } from './database';+import {+ type DatabaseQueryOptions,+ type DatabaseQueryResult,+ queryDatabases,+} from './query';/*** Macro databases: named collections of tables, owned and shared as one@@ -8,6 +13,14 @@ import { Database } from './database';export class DatabaseNamespace {constructor(private readonly client: MacroClient) {}+ /** Run one SQL statement over the caller's visible databases. Writes execute once. */+ query(+ sql: string,+ options?: DatabaseQueryOptions,+ ): Promise<DatabaseQueryResult> {+ return queryDatabases(this.client, Database.byId, sql, options);+ }+/** A handle to a database by id. Details load on first access. */byId(id: string): Database {return Database.byId(this.client, id);diff --git a/packages/sdk/src/entities/databases/query.ts b/packages/sdk/src/entities/databases/query.tsnew file mode 100644index 0000000000..cf0cee8ee5--- /dev/null+++ b/packages/sdk/src/entities/databases/query.ts@@ -0,0 +1,232 @@+import { match } from 'ts-pattern';+import type {+ ResultColumn,+ ResultSet,+ SqlOutcome,+ SqlStatement,+ TableVersion,+} from '../../../generated/storage/types.gen';+import { unwrap } from '../../utils';+import type { MacroClient } from '../../utils/client';+import { DatabaseColumn } from './column';+import type { Database } from './database';+import { DatabaseRow } from './row';+import { DatabaseTable } from './table';++/** A version observed on a typed table handle, reusable as a write guard. */+export interface QueryTableVersion {+ /** Table whose version was observed. */+ table: DatabaseTable;+ /** Opaque version to pass back as an optimistic write guard. */+ version: TableVersion;+}++/** Scope and optimistic concurrency for one SQL statement. */+export interface DatabaseQueryOptions {+ /** Default database for unqualified table names; visible databases remain joinable. */+ database?: Database;+ /** Refuse writes if these tables changed since they were read. */+ baseVersions?: QueryTableVersion[];+}++/** Result column metadata, including a typed relation target when visible. */+export type QueryColumn = Omit<ResultColumn, 'relatedTable'> & {+ /** Visible target table for a relation column. */+ relatedTable?: DatabaseTable;+};++/** SQL returns dynamically shaped, discriminated cells and optional source row handles. */+export interface QueryResultSet {+ /** Ordered metadata corresponding to each cell in a result row. */+ columns: QueryColumn[];+ /** Dynamic tagged cells in column order; empty cells are null. */+ rows: ResultSet['rows'];+ /** Persisted source table when results correspond to individual rows. */+ sourceTable?: DatabaseTable;+ /** Source row handles in result order; empty for aggregates and virtual tables. */+ rowHandles: DatabaseRow[];+}++/** What ran, with typed handles for resources written by the statement. */+export type QueryStatement =+ | Extract<SqlStatement, { kind: 'select' }>+ | {+ /** Schema change discriminator. */+ kind: 'schema';+ /** Database whose schema changed. */+ database: Database;+ /** Human-readable description of the schema change. */+ summary: string;+ }+ | {+ /** Row mutation discriminator. */+ kind: 'insert' | 'update' | 'delete';+ /** Table targeted by the mutation, including zero-match writes. */+ table: DatabaseTable;+ /** SQL name of the target table. */+ tableName: string;+ }+ | {+ /** Column type change discriminator. */+ kind: 'alterColumnType';+ /** Table containing the changed column. */+ table: DatabaseTable;+ /** SQL name of the target table. */+ tableName: string;+ /** Column whose type changed. */+ column: DatabaseColumn;+ /** SQL name of the changed column. */+ columnName: string;+ /** SQL type requested by the statement. */+ to: string;+ };++/** The committed outcome of one statement; write calls are never automatically retried. */+export interface DatabaseQueryResult {+ /** Returned result set, when the statement produces one. */+ result?: QueryResultSet;+ /** Number of changes committed by the statement. */+ changesApplied: number;+ /** Handles for newly inserted rows, in insertion order. */+ insertedRows: DatabaseRow[];+ /** Versions of tables after committed writes. */+ newVersions: QueryTableVersion[];+ /** Observed table versions, reusable as guards for a later write. */+ readVersions: QueryTableVersion[];+ /** SQL table names whose input hit the server row cap; aggregates may be partial. */+ truncatedTables: string[];+ /** Statement classification with typed handles for its targets. */+ statement: QueryStatement;+}++/** @internal Execute through the generated client and hydrate resource references. */+export async function queryDatabases(+ client: MacroClient,+ databaseById: typeof Database.byId,+ sql: string,+ options: DatabaseQueryOptions = {},+): Promise<DatabaseQueryResult> {+ const response = unwrap(+ await client.storage.queryDatabases({+ body: {+ sql,+ databaseId: options.database?.id,+ baseVersions: Object.fromEntries(+ (options.baseVersions ?? []).map(({ table, version }) => [+ table.id,+ version,+ ]),+ ),+ },+ }),+ );+ const databases = new Map<string, Set<Database>>();+ for (const handle of [+ options.database,+ ...(options.baseVersions ?? []).map(({ table }) => table.database),+ ]) {+ if (!handle) continue;+ const handles = databases.get(handle.id);+ if (handles) handles.add(handle);+ else databases.set(handle.id, new Set([handle]));+ }+ const database = (id: string): Database => {+ const known = databases.get(id)?.values().next().value;+ if (known) return known;+ const handle = databaseById(client, id);+ databases.set(id, new Set([handle]));+ return handle;+ };+ const table = (id: string): DatabaseTable => {+ const databaseId = response.tableDatabases[id];+ if (!databaseId)+ throw new Error(`SQL response is missing the owner of table ${id}`);+ return DatabaseTable.byId(database(databaseId), id);+ };+ const writtenDatabases = new Set(+ Object.keys(response.newVersions).map((id) => table(id).database.id),+ );+ if (response.statement.kind === 'schema')+ writtenDatabases.add(response.statement.databaseId);+ for (const id of writtenDatabases)+ for (const handle of databases.get(id) ?? []) handle.invalidateSchema();+ const statement = match(response.statement)+ .with({ kind: 'select' }, (value): QueryStatement => value)+ .with(+ { kind: 'schema' },+ ({ databaseId, summary }): QueryStatement => ({+ kind: 'schema',+ database: database(databaseId),+ summary,+ }),+ )+ .with(+ { kind: 'insert' },+ { kind: 'update' },+ { kind: 'delete' },+ ({ kind, tableId, tableName }): QueryStatement => ({+ kind,+ table: table(tableId),+ tableName,+ }),+ )+ .with(+ { kind: 'alterColumnType' },+ ({ tableId, tableName, columnId, columnName, to }): QueryStatement => {+ const target = table(tableId);+ return {+ kind: 'alterColumnType',+ table: target,+ tableName,+ column: DatabaseColumn.byId(target, columnId),+ columnName,+ to,+ };+ },+ )+ .exhaustive();+ return {+ result: response.result+ ? resultSet(response.result, table, response.tableDatabases)+ : undefined,+ changesApplied: response.changesApplied,+ insertedRows:+ statement.kind === 'insert'+ ? response.insertedRowIds.map((id) =>+ DatabaseRow.byId(statement.table, id),+ )+ : [],+ newVersions: Object.entries(response.newVersions).map(([id, version]) => ({+ table: table(id),+ version,+ })),+ readVersions: Object.entries(response.readVersions).map(+ ([id, version]) => ({ table: table(id), version }),+ ),+ truncatedTables: response.truncatedTables,+ statement,+ };+}++function resultSet(+ result: ResultSet,+ table: (id: string) => DatabaseTable,+ owners: SqlOutcome['tableDatabases'],+): QueryResultSet {+ const sourceTable =+ result.sourceTable && owners[result.sourceTable]+ ? table(result.sourceTable)+ : undefined;+ return {+ columns: result.columns.map(({ relatedTable, ...column }) => ({+ ...column,+ relatedTable:+ relatedTable && owners[relatedTable] ? table(relatedTable) : undefined,+ })),+ rows: result.rows,+ sourceTable,+ rowHandles: sourceTable+ ? result.rowIds.map((id) => DatabaseRow.byId(sourceTable, id))+ : [],+ };+}diff --git a/packages/sdk/src/entities/databases/row.ts b/packages/sdk/src/entities/databases/row.tsindex 6da3eedc83..f12e95c7ae 100644--- a/packages/sdk/src/entities/databases/row.ts+++ b/packages/sdk/src/entities/databases/row.ts@@ -12,7 +12,7 @@ export class DatabaseRow {/** The table this row belongs to. */readonly table: DatabaseTable,/** Identifier of the row. */- readonly id: string+ readonly id: string,) {}/** A handle to a row by id, within a table. */diff --git a/packages/sdk/src/entities/databases/view.ts b/packages/sdk/src/entities/databases/view.tsindex 73f3c53445..d8df65b19e 100644--- a/packages/sdk/src/entities/databases/view.ts+++ b/packages/sdk/src/entities/databases/view.ts@@ -21,7 +21,7 @@ export class DatabaseView {/** The table this view shows. */readonly table: DatabaseTable,/** Identifier of the view. */- readonly id: string+ readonly id: string,) {}/** A handle to a view by id, within a table. Details load on first access. */@@ -35,7 +35,7 @@ export class DatabaseView {const found = views.find((view) => view.id === this.id);if (!found) {throw new MacroNotFoundError(- `view ${this.id} is not on table ${this.table.id}`+ `view ${this.id} is not on table ${this.table.id}`,);}return found;diff --git a/packages/sdk/src/entities/documents/anchor.ts b/packages/sdk/src/entities/documents/anchor.tsnew file mode 100644index 0000000000..b1beebc635--- /dev/null+++ b/packages/sdk/src/entities/documents/anchor.ts@@ -0,0 +1,92 @@+import type {+ Anchor as AnchorRecord,+ EditPdfPlaceableCommentAnchorRequest,+} from '../../../generated/storage/types.gen';+import { MacroNotFoundError, unwrap } from '../../utils';+import type { MacroClient } from '../../utils/client';+import { MacroEntity } from '../entity';+import type { Document } from './document';++/** A PDF annotation scoped to its document. */+export class DocumentAnchor extends MacroEntity<AnchorRecord> {+ /** Serialize identity with its owning resource. */+ override toJSON() {+ return { ...super.toJSON(), documentId: this.document.id };+ }++ private constructor(+ client: MacroClient,+ /** Owning document. */+ readonly document: Document,+ id: string,+ seed?: AnchorRecord,+ ) {+ super(client, id, seed);+ }++ /** Construct a document scoped annotation handle. */+ static byId(+ client: MacroClient,+ document: Document,+ id: string,+ ): DocumentAnchor {+ return new DocumentAnchor(client, document, id);+ }++ /** Seed an annotation from a document annotation listing. */+ static from(+ client: MacroClient,+ document: Document,+ record: AnchorRecord,+ ): DocumentAnchor {+ return new DocumentAnchor(client, document, record.uuid, record);+ }++ protected async fetch(): Promise<AnchorRecord> {+ const record = unwrap(+ await this.client.storage.getDocumentAnchors({+ path: { document_id: this.document.id },+ }),+ ).data.find((a) => a.uuid === this.id);+ if (!record)+ throw new MacroNotFoundError(`Annotation ${this.id} is unavailable`);+ return record;+ }++ /** Annotation kind. */+ readonly kind = this.field('anchorType');++ /** Page containing the annotation. */+ readonly page = this.field('page');++ /** Edit a placeable comment's position and display settings. */+ async edit(+ options: Omit<EditPdfPlaceableCommentAnchorRequest, 'uuid'>,+ ): Promise<void> {+ if ((await this.kind()) !== 'placeable')+ throw new Error('Only placeable comment annotations can be edited');+ await this.mutate((c) =>+ c.storage.editAnchor({+ body: {+ ...options,+ uuid: this.id,+ anchorType: 'free-comment',+ fileType: 'pdf',+ },+ }),+ );+ }++ /** Delete a standalone highlight annotation. */+ async delete(): Promise<void> {+ if ((await this.kind()) !== 'highlight')+ throw new Error(+ 'Only standalone highlights can be deleted with this endpoint',+ );+ await this.mutate((c) =>+ c.storage.deleteAnchor({+ body: { uuid: this.id, anchorType: 'highlight', fileType: 'pdf' },+ }),+ );+ }+}diff --git a/packages/sdk/src/entities/documents/document.ts b/packages/sdk/src/entities/documents/document.tsindex 292ad6bdee..2677e36116 100644--- a/packages/sdk/src/entities/documents/document.ts+++ b/packages/sdk/src/entities/documents/document.ts@@ -6,6 +6,9 @@ import type {GithubPullRequest,MessageCursor,MessageListItem,+ PdfHighlightAnchorRequest,+ PreSaveDocumentRequest,+ SaveDocumentRequest,ThreadState,} from '../../../generated/storage/types.gen';import {@@ -18,10 +21,18 @@ import {import { MacroApiError, mapConcurrently, paginate, unwrap } from '../../utils';import type { MacroClient } from '../../utils/client';import { PropertiedEntity } from '../entity';+import {+ MessageThread,+ type TimelineOptions,+ timeline,+} from '../messages/thread';import { Project } from '../projects/project';import { entitySearch } from '../search';+import { EntityAccess } from '../sharing/access';import { User } from '../users/user';+import { DocumentAnchor } from './anchor';import { Comment } from './comment';+import { DocumentVersion } from './version';type DocumentDetail = GetDocumentResponses[200]['data']['documentMetadata'];@@ -44,6 +55,107 @@ export class Documentextends PropertiedEntity<DocumentDetail>implements Mentionable{+ /** PDF annotations in this document. */+ async anchors(): Promise<DocumentAnchor[]> {+ return unwrap(+ await this.client.storage.getDocumentAnchors({+ path: { document_id: this.id },+ }),+ ).data.map((a) => DocumentAnchor.from(this.client, this, a));+ }++ /** Create a standalone PDF highlight. */+ async createHighlight(+ options: Omit<PdfHighlightAnchorRequest, 'uuid'>,+ ): Promise<DocumentAnchor> {+ return DocumentAnchor.from(+ this.client,+ this,+ unwrap(+ await this.client.storage.createAnchor({+ path: { document_id: this.id },+ body: { ...options, fileType: 'pdf', anchorType: 'highlight' },+ }),+ ),+ );+ }++ /** A handle to an immutable version. */+ version(version: number): DocumentVersion {+ return DocumentVersion.byId(this.client, this, version);+ }++ /** Sharing configuration. */+ async sharePermissions() {+ return unwrap(+ await this.client.storage.getDocumentPermissionsV2({+ path: { document_id: this.id },+ }),+ ).documentPermissions;+ }++ /** Mint a scoped permissions token. */+ async permissionsToken(): Promise<string> {+ return unwrap(+ await this.client.storage.getDocumentPermissionsToken({+ path: { document_id: this.id },+ }),+ ).token;+ }++ /** Prepare multipart content saving and return the service's upload instructions. */+ async prepareSave(parts: PreSaveDocumentRequest['newBom']) {+ return unwrap(+ await this.client.storage.presaveDocumentHandler({+ path: { document_id: this.id },+ body: { newBom: parts },+ }),+ ).data;+ }++ /** Commit uploaded content. Does not retry uncertain writes. */+ async save(options: SaveDocumentRequest) {+ return (+ await this.mutate((c) =>+ c.storage.saveDocumentHandler({+ path: { document_id: this.id },+ body: options,+ }),+ )+ ).data;+ }++ /** Commit a simple document save. */+ async simpleSave() {+ return (+ await this.mutate((c) =>+ c.storage.simpleSave({ path: { document_id: this.id } }),+ )+ ).data;+ }++ /** A shared message thread scoped to this resource. */+ messageThreadById(id: string): MessageThread {+ return MessageThread.byId(+ this.client,+ { type: 'document', entity: this },+ id,+ );+ }++ /** A mixed message and activity timeline page. */+ timelinePage(selection?: TimelineOptions<Comment>) {+ return timeline(+ this.client,+ { type: 'document', entity: this },+ (record) => Comment.from(this.client, this.id, record),+ selection,+ );+ }++ /** Access requests and direct user grants. */+ readonly access = new EntityAccess(this.client, 'document', this);+protected async fetch(): Promise<DocumentDetail> {const { data } = unwrap(await this.client.storage.getDocument({diff --git a/packages/sdk/src/entities/documents/namespace.ts b/packages/sdk/src/entities/documents/namespace.tsindex bf69f576b6..d43599ded3 100644--- a/packages/sdk/src/entities/documents/namespace.ts+++ b/packages/sdk/src/entities/documents/namespace.ts@@ -1,10 +1,88 @@+import type { CreateDocumentRequest } from '../../../generated/storage/types.gen';+import { unwrap } from '../../utils';import type { MacroClient } from '../../utils/client';+import type { EmailAttachment } from '../email/attachment';import type { Project } from '../projects/project';import type { SearchOpts } from '../search';+import type { Team } from '../teams/team';+import { User } from '../users/user';import { Document } from './document';import { SystemSkill } from './system-skill';export class DocumentNamespace {+ /** Resolve a team task reference such as ENG-42. */+ async byTeamSlug(slug: string): Promise<Document> {+ // The generated operation currently references a colliding TypedSuccessResponse+ // schema. Validate the actual document response before constructing a handle.+ const result: unknown = unwrap(+ await this.client.storage.getDocumentByTeamSlug({ path: { slug } }),+ );+ if (+ typeof result !== 'object' ||+ result === null ||+ !('data' in result) ||+ typeof result.data !== 'object' ||+ result.data === null ||+ !('documentMetadata' in result.data) ||+ typeof result.data.documentMetadata !== 'object' ||+ result.data.documentMetadata === null ||+ !('documentId' in result.data.documentMetadata) ||+ typeof result.data.documentMetadata.documentId !== 'string'+ )+ throw new Error('Invalid team task document response');+ return Document.byId(this.client, result.data.documentMetadata.documentId);+ }++ /** Validate a permissions token, returning its document and optional user handles. */+ async validatePermissionsToken(token: string) {+ const result = unwrap(+ await this.client.storage.validateDocumentPermissionsToken({+ body: { token },+ }),+ );+ return {+ document: Document.byId(this.client, result.document_id),+ user: result.user_id ? User.byId(this.client, result.user_id) : undefined,+ accessLevel: result.access_level,+ expiresAt: result.exp,+ issuer: result.iss,+ };+ }++ /** Reserve a binary document and return upload instructions. Upload content before saving. */+ async createUpload(options: {+ name: string;+ sha: string;+ fileType?: string;+ mimeType?: string;+ project?: Project;+ team?: Team;+ branchedFrom?: Document;+ attachment?: EmailAttachment;+ isTask?: boolean;+ }) {+ const body: CreateDocumentRequest = {+ documentName: options.name,+ sha: options.sha,+ fileType: options.fileType,+ mimeType: options.mimeType,+ projectId: options.project?.id,+ teamId: options.team?.id,+ branchedFromId: options.branchedFrom?.id,+ emailAttachmentId: options.attachment?.id,+ isTask: options.isTask,+ };+ const result = unwrap(+ await this.client.storage.createDocument({ body }),+ ).data;+ return {+ document: Document.byId(this.client, result.documentMetadata.documentId),+ uploadUrl: result.presignedUrl ?? undefined,+ contentType: result.contentType,+ content: result.documentMetadata.content,+ };+ }+constructor(private readonly client: MacroClient) {}/** A handle to a document by id. Details load on first access. */diff --git a/packages/sdk/src/entities/documents/version.ts b/packages/sdk/src/entities/documents/version.tsnew file mode 100644index 0000000000..71a4caa445--- /dev/null+++ b/packages/sdk/src/entities/documents/version.ts@@ -0,0 +1,45 @@+import type { GetDocumentResponseData } from '../../../generated/storage/types.gen';+import { Lazy, unwrap } from '../../utils';+import type { MacroClient } from '../../utils/client';+import type { Document } from './document';++/** An immutable document version, scoped to its document. */+export class DocumentVersion {+ private readonly detail: Lazy<GetDocumentResponseData>;++ private constructor(+ private readonly client: MacroClient,+ /** Parent document. */+ readonly document: Document,+ /** Version number. */+ readonly id: number,+ ) {+ this.detail = new Lazy(+ async () =>+ unwrap(+ await this.client.storage.getDocumentVersion({+ path: { document_id: document.id, document_version_id: id },+ }),+ ).data,+ );+ }++ /** Construct a version handle. */+ static byId(+ client: MacroClient,+ document: Document,+ id: number,+ ): DocumentVersion {+ return new DocumentVersion(client, document, id);+ }++ /** Version metadata and the caller's access. */+ read(): Promise<GetDocumentResponseData> {+ return this.detail.get();+ }++ /** Serialize only scoped identity. */+ toJSON() {+ return { id: this.id, documentId: this.document.id };+ }+}diff --git a/packages/sdk/src/entities/email/draft.ts b/packages/sdk/src/entities/email/draft.tsnew file mode 100644index 0000000000..6ee562787a--- /dev/null+++ b/packages/sdk/src/entities/email/draft.ts@@ -0,0 +1,233 @@+import type {+ AddDraftAttachmentRequest,+ ApiDraftInput,+} from '../../../generated/email/types.gen';+import type { MacroClient } from '../../utils/client';+import type { EmailAttachment } from './attachment';+import { EmailMessage } from './message';+import type { EmailThread } from './thread';++/** Draft content; relationships use message and thread handles. */+export type DraftOptions = Omit<+ ApiDraftInput,+ | 'db_id'+ | 'provider_id'+ | 'provider_thread_id'+ | 'replying_to_id'+ | 'thread_db_id'+ | 'body_text'+ | 'body_html'+ | 'body_macro'+ | 'headers_json'+ | 'include_signature'+> & {+ /** Plain text body. */+ bodyText?: string;+ /** HTML body. */+ bodyHtml?: string;+ /** Macro body. */+ bodyMacro?: string;+ /** Extra headers. */+ headers?: ApiDraftInput['headers_json'];+ /** Include the inbox signature. */+ includeSignature?: boolean;+ /** Thread receiving this draft. */+ thread?: EmailThread;+ /** Message being replied to. */+ replyingTo?: EmailMessage;+};++/** A draft email. Sending remains an explicit separate operation. */+export class EmailDraft extends EmailMessage {+ private async inboxHeaders() {+ return { 'X-Email-Link-Id': (await this.link()).id };+ }++ /** Construct a lazy draft handle. */+ static byId(client: MacroClient, id: string): EmailDraft {+ return new EmailDraft(client, id);+ }++ /** Replace draft content without changing its identity or sending it. */+ async update(options: DraftOptions): Promise<void> {+ const headers = await this.inboxHeaders();+ await this.mutate((c) =>+ c.email.createDraft({+ headers,+ body: { draft: { ...draftBody(options), db_id: this.id } },+ }),+ );+ }++ /** Delete the draft. */+ async delete(): Promise<void> {+ const headers = await this.inboxHeaders();+ await this.mutate((c) =>+ c.email.deleteDraft({ path: { id: this.id }, headers }),+ );+ }++ /** Schedule this draft for sending. */+ async schedule(+ sendTime: string,+ options?: { includeSignature?: boolean },+ ): Promise<void> {+ const headers = await this.inboxHeaders();+ await this.mutate((c) =>+ c.email.upsertScheduledMessage({+ path: { id: this.id },+ headers,+ body: {+ send_time: sendTime,+ include_signature: options?.includeSignature,+ },+ }),+ );+ }++ /** Remove a scheduled send. */+ async unschedule(): Promise<void> {+ const headers = await this.inboxHeaders();+ await this.mutate((c) =>+ c.email.deleteScheduledDraft({ path: { message_id: this.id }, headers }),+ );+ }++ /** Reserve an attachment upload. Upload to the returned URL, then call complete(). */+ async addAttachment(options: {+ fileName: string;+ sha: string;+ size: number;+ uploadId?: string;+ }) {+ const body: AddDraftAttachmentRequest = {+ file_name: options.fileName,+ sha: options.sha,+ size: options.size,+ upload_id: options.uploadId,+ };+ const headers = await this.inboxHeaders();+ const result = await this.mutate((c) =>+ c.email.addDraftAttachment({ path: { id: this.id }, headers, body }),+ );+ return {+ attachment: DraftAttachment.byId(this.client, this, result.attachment_id),+ uploadUrl: result.upload_url,+ contentType: result.content_type,+ };+ }++ /** Forward an existing attachment into this draft. */+ async forwardAttachment(+ attachment: EmailAttachment,+ ): Promise<DraftAttachment> {+ const headers = await this.inboxHeaders();+ const result = await this.mutate((c) =>+ c.email.addForwardedAttachment({+ path: { id: this.id },+ headers,+ body: { attachment_id: attachment.id },+ }),+ );+ return DraftAttachment.byId(this.client, this, result.attachment_id, true);+ }++ /** Remove a draft attachment. */+ async removeAttachment(attachment: DraftAttachment): Promise<void> {+ if (attachment.draft.id !== this.id)+ throw new Error('Attachment belongs to another draft');+ const headers = await this.inboxHeaders();+ if (attachment.forwarded)+ await this.mutate((c) =>+ c.email.removeForwardedAttachment({+ path: { id: this.id, attachment_id: attachment.id },+ headers,+ }),+ );+ else+ await this.mutate((c) =>+ c.email.removeDraftAttachment({+ path: { id: this.id, attachment_id: attachment.id },+ headers,+ }),+ );+ }++ /** Complete verification of an uploaded attachment. */+ async verifyAttachment(attachment: DraftAttachment): Promise<void> {+ if (attachment.draft.id !== this.id || attachment.forwarded)+ throw new Error('Expected an uploaded attachment on this draft');+ await this.completeDraftAttachment(attachment.id);+ }+}++/** An uploaded or forwarded attachment belonging to a draft. */+export class DraftAttachment {+ private constructor(+ /** Parent draft. */+ readonly draft: EmailDraft,+ /** Attachment identity. */+ readonly id: string,+ /** Whether this attachment was forwarded. */+ readonly forwarded: boolean,+ ) {}++ /** Construct a draft scoped attachment handle. */+ static byId(+ _client: MacroClient,+ draft: EmailDraft,+ id: string,+ forwarded = false,+ ): DraftAttachment {+ return new DraftAttachment(draft, id, forwarded);+ }++ /** Complete verification after uploading the file. */+ complete(): Promise<void> {+ return this.draft.verifyAttachment(this);+ }++ /** Remove this attachment from its draft. */+ remove(): Promise<void> {+ return this.draft.removeAttachment(this);+ }++ /** Serialize identity without credentials. */+ toJSON() {+ return { id: this.id, draftId: this.draft.id, forwarded: this.forwarded };+ }+}++/** Translate draft content to the generated contract. */+export function draftBody(options: DraftOptions): ApiDraftInput {+ const {+ bodyText,+ bodyHtml,+ bodyMacro,+ headers,+ includeSignature,+ thread,+ replyingTo,+ ...rest+ } = options;+ return {+ ...rest,+ body_text: bodyText,+ body_html:+ bodyHtml === undefined+ ? undefined+ : btoa(+ Array.from(new TextEncoder().encode(bodyHtml), (byte) =>+ String.fromCharCode(byte),+ ).join(''),+ )+ .replaceAll('+', '-')+ .replaceAll('/', '_')+ .replaceAll('=', ''),+ body_macro: bodyMacro,+ headers_json: headers,+ include_signature: includeSignature,+ thread_db_id: thread?.id,+ replying_to_id: replyingTo?.id,+ };+}diff --git a/packages/sdk/src/entities/email/filter.ts b/packages/sdk/src/entities/email/filter.tsnew file mode 100644index 0000000000..840ec86f84--- /dev/null+++ b/packages/sdk/src/entities/email/filter.ts@@ -0,0 +1,88 @@+import type { ApiEmailFilter } from '../../../generated/email/types.gen';+import { MacroNotFoundError, unwrap } from '../../utils';+import type { MacroClient } from '../../utils/client';+import { MacroEntity } from '../entity';+import type { Link } from './link';++/** Sender importance rule. */+export interface EmailFilterOptions {+ /** Match an address. */+ emailAddress?: string;+ /** Match a domain. */+ emailDomain?: string;+ /** Whether matches are important. */+ isImportant: boolean;+}++/** An importance filter matched by sender address or domain. */+export class EmailFilter extends MacroEntity<ApiEmailFilter> {+ private constructor(+ client: MacroClient,+ id: string,+ seed?: ApiEmailFilter,+ private readonly inbox?: Link,+ ) {+ super(client, id, seed);+ }++ private get headers() {+ return this.inbox ? { 'X-Email-Link-Id': this.inbox.id } : undefined;+ }++ /** Construct a lazy filter handle. */+ static byId(client: MacroClient, id: string, inbox?: Link): EmailFilter {+ return new EmailFilter(client, id, undefined, inbox);+ }++ /** Seed from a server record. */+ static from(+ client: MacroClient,+ record: ApiEmailFilter,+ inbox?: Link,+ ): EmailFilter {+ return new EmailFilter(client, record.id, record, inbox);+ }++ protected async fetch(): Promise<ApiEmailFilter> {+ const record = unwrap(+ await this.client.email.listEmailFilters({ headers: this.headers }),+ ).filters.find((f) => f.id === this.id);+ if (!record)+ throw new MacroNotFoundError(`Email filter ${this.id} is unavailable`);+ return record;+ }++ /** Matched address. */+ readonly emailAddress = this.field('email_address');++ /** Matched domain. */+ readonly emailDomain = this.field('email_domain');++ /** Importance assigned by this filter. */+ readonly isImportant = this.field('is_important');++ /** Change the importance for the same sender selector. */+ async setImportant(isImportant: boolean): Promise<void> {+ const record = await this.detail.get();+ await this.mutate((c) =>+ c.email.upsertEmailFilter({+ headers: this.headers,+ body: {+ email_address: record.email_address,+ email_domain: record.email_domain,+ is_important: isImportant,+ },+ }),+ );+ }++ /** Delete this filter. */+ async delete(): Promise<void> {+ await this.mutate((c) =>+ c.email.deleteEmailFilter({+ path: { id: this.id },+ headers: this.headers,+ }),+ );+ }+}diff --git a/packages/sdk/src/entities/email/namespace.ts b/packages/sdk/src/entities/email/namespace.tsindex 9d3af9aec9..bda5f81c30 100644--- a/packages/sdk/src/entities/email/namespace.ts+++ b/packages/sdk/src/entities/email/namespace.ts@@ -3,10 +3,13 @@ import type {ApiSortMethod,TransferRecoveryResponse,} from '../../../generated/email/types.gen';+import type { ListEmailRemindersData } from '../../../generated/storage/types.gen';import { paginate, unwrap } from '../../utils';import type { MacroClient } from '../../utils/client';import type { SearchOpts } from '../search';import { EmailAttachment } from './attachment';+import { type DraftOptions, draftBody, EmailDraft } from './draft';+import { EmailFilter, type EmailFilterOptions } from './filter';import { Label } from './label';import { Link } from './link';import { EmailMessage, type SendEmailOptions } from './message';@@ -21,6 +24,107 @@ export interface InboxOptions {}export class EmailNamespace {+ /** Create a draft without sending it; the inbox defaults to the caller's primary. */+ async createDraft(options: DraftOptions, inbox?: Link): Promise<EmailDraft> {+ const result = unwrap(+ await this.client.email.createDraft({+ body: { draft: draftBody(options) },+ headers: inbox ? { 'X-Email-Link-Id': inbox.id } : undefined,+ }),+ );+ if (!result.draft.db_id)+ throw new Error('Draft response has no message id');+ return EmailDraft.byId(this.client, result.draft.db_id);+ }++ /** Construct a lazy draft handle. */+ draftById(id: string): EmailDraft {+ return EmailDraft.byId(this.client, id);+ }++ /** Scheduled drafts, fetched lazily in bounded pages. */+ async *scheduled(options?: {+ pageSize?: number;+ inbox?: Link;+ }): AsyncGenerator<EmailDraft> {+ const requestedLimit = options?.pageSize ?? 100;+ if (!Number.isInteger(requestedLimit) || requestedLimit < 1)+ throw new Error('pageSize must be positive');+ const limit = Math.min(requestedLimit, 1000);+ for (let offset = 0; ; offset += limit) {+ const page = unwrap(+ await this.client.email.getScheduledMessages({+ query: { offset, limit },+ headers: options?.inbox+ ? { 'X-Email-Link-Id': options.inbox.id }+ : undefined,+ }),+ );+ for (const message of page.messages)+ yield EmailDraft.byId(this.client, message.db_id);+ if (page.messages.length < limit) return;+ }+ }++ /** Importance filters. */+ async filters(inbox?: Link): Promise<EmailFilter[]> {+ return unwrap(+ await this.client.email.listEmailFilters({+ headers: inbox ? { 'X-Email-Link-Id': inbox.id } : undefined,+ }),+ ).filters.map((f) => EmailFilter.from(this.client, f, inbox));+ }++ /** Create or replace a filter matching an address or domain. */+ async upsertFilter(+ options: EmailFilterOptions,+ inbox?: Link,+ ): Promise<EmailFilter> {+ return EmailFilter.from(+ this.client,+ unwrap(+ await this.client.email.upsertEmailFilter({+ headers: inbox ? { 'X-Email-Link-Id': inbox.id } : undefined,+ body: {+ email_address: options.emailAddress,+ email_domain: options.emailDomain,+ is_important: options.isImportant,+ },+ }),+ ).filter,+ inbox,+ );+ }++ /** Address book contacts grouped by the service's interaction buckets. */+ async contacts() {+ return unwrap(await this.client.email.listContacts()).contacts;+ }++ /** Follow-up reminders with thread handles, automatically paginated. */+ reminders(+ options?: Omit<+ NonNullable<ListEmailRemindersData['query']>,+ 'inboxIds' | 'cursor'+ > & { inboxes?: Link[] },+ ) {+ const { inboxes, ...query } = options ?? {};+ return paginate(async (cursor) => {+ const page = unwrap(+ await this.client.storage.listEmailReminders({+ query: { ...query, inboxIds: inboxes?.map((i) => i.id), cursor },+ }),+ );+ return {+ items: page.items.map(({ threadId, ...item }) => ({+ ...item,+ thread: EmailThread.byId(this.client, threadId),+ })),+ nextCursor: page.nextCursor,+ };+ });+ }+constructor(private readonly client: MacroClient) {}/** A handle to an email thread by id. */diff --git a/packages/sdk/src/entities/email/thread.ts b/packages/sdk/src/entities/email/thread.tsindex 675af17ea5..a10c2e1e5c 100644--- a/packages/sdk/src/entities/email/thread.ts+++ b/packages/sdk/src/entities/email/thread.ts@@ -5,11 +5,17 @@ import type {MailboxOperation,UpdateThreadStateRequest,} from '../../../generated/email/types.gen';+import type { EmailFollowupCommand } from '../../../generated/storage/types.gen';import { unwrap } from '../../utils';import type { MacroClient } from '../../utils/client';import { PropertiedEntity } from '../entity';import { Project } from '../projects/project';import { entitySearch } from '../search';+import { EntityAccess } from '../sharing/access';+import {+ type SharePermissionOptions,+ sharePermissionBody,+} from '../sharing/permissions';import { EmailAttachment } from './attachment';import type { Label } from './label';import { Link } from './link';@@ -38,6 +44,58 @@ export interface ReplyEmailOptions {* up to the first 100 messages) loads lazily on first field access.*/export class EmailThread extends PropertiedEntity<ThreadDetail> {+ /** Access requests and direct user grants. */+ readonly access = new EntityAccess(this.client, 'email_thread', this);++ /** Read follow-up state for this thread. */+ async followup() {+ return unwrap(+ await this.client.storage.getEmailFollowup({+ path: { thread_id: this.id },+ }),+ );+ }++ /** Set or remove a follow-up using a persisted operation id and revision. */+ async setFollowup(command: EmailFollowupCommand) {+ return unwrap(+ await this.client.storage.setEmailFollowup({+ path: { thread_id: this.id },+ body: command,+ }),+ );+ }++ /** Calendar invitations resolved from this thread's messages. */+ async calendarInvitations() {+ return unwrap(+ await this.client.email.getThreadCalendarInvitations({+ path: { thread_id: this.id },+ }),+ );+ }++ /** Change project membership or share permissions for this thread. */+ async update(options: {+ project?: Project | null;+ sharePermission?: SharePermissionOptions;+ }): Promise<void> {+ await this.mutate((c) =>+ c.storage.editThreadV2({+ path: { thread_id: this.id },+ body: {+ projectId:+ options.project === undefined+ ? undefined+ : (options.project?.id ?? null),+ sharePermission: options.sharePermission+ ? sharePermissionBody(options.sharePermission)+ : undefined,+ },+ }),+ );+ }+/** Favorites identify email threads as `email_thread`. */readonly entityType = 'email_thread';diff --git a/packages/sdk/src/entities/entity-mentions/mention.ts b/packages/sdk/src/entities/entity-mentions/mention.tsnew file mode 100644index 0000000000..d23fb77da6--- /dev/null+++ b/packages/sdk/src/entities/entity-mentions/mention.ts@@ -0,0 +1,30 @@+import { unwrap } from '../../utils';+import type { MacroClient } from '../../utils/client';++/** A stored mention connecting two resources. */+export class EntityMention {+ private constructor(+ private readonly client: MacroClient,+ /** Mention identity. */+ readonly id: string,+ ) {}++ /** Construct a mention handle for removal. */+ static byId(client: MacroClient, id: string): EntityMention {+ return new EntityMention(client, id);+ }++ /** Remove this mention. */+ async delete(): Promise<void> {+ unwrap(+ await this.client.storage.deleteEntityMention({+ path: { mention_id: this.id },+ }),+ );+ }++ /** Serialize identity only. */+ toJSON() {+ return { id: this.id };+ }+}diff --git a/packages/sdk/src/entities/entity-mentions/namespace.ts b/packages/sdk/src/entities/entity-mentions/namespace.tsnew file mode 100644index 0000000000..f15c00b9d5--- /dev/null+++ b/packages/sdk/src/entities/entity-mentions/namespace.ts@@ -0,0 +1,32 @@+import { unwrap } from '../../utils';+import type { MacroClient } from '../../utils/client';+import type { EntityReference } from '../reference';+import { EntityMention } from './mention';++/** Stored entity mention relationships. */+export class EntityMentionNamespace {+ constructor(private readonly client: MacroClient) {}++ /** Construct a stored mention handle. */+ byId(id: string): EntityMention {+ return EntityMention.byId(this.client, id);+ }++ /** Create a mention from a source resource to a target resource. */+ async create(+ source: EntityReference,+ target: EntityReference,+ ): Promise<EntityMention> {+ const result = unwrap(+ await this.client.storage.createEntityMention({+ body: {+ source_entity_id: source.entity.id,+ source_entity_type: source.type,+ entity_id: target.entity.id,+ entity_type: target.type,+ },+ }),+ );+ return EntityMention.byId(this.client, result.id);+ }+}diff --git a/packages/sdk/src/entities/entity.ts b/packages/sdk/src/entities/entity.tsindex fbdf27797b..cda60afe7b 100644--- a/packages/sdk/src/entities/entity.ts+++ b/packages/sdk/src/entities/entity.ts@@ -119,6 +119,15 @@ export abstract class FavoritableEntity<Detail>/** How the entity-addressed APIs (favorites) identify this entity's type. */abstract readonly entityType: MacroEntityType;+ /** Read the caller's effective permission on this entity. */+ async permission() {+ return unwrap(+ await this.client.storage.getEntityPermission({+ path: { entity_type: this.entityType, entity_id: this.id },+ }),+ );+ }+/*** Add this entity to the user's favorites. Returns this handle for chaining.* Plain unwrap: favoriting alters the user's favorites collection, not thisdiff --git a/packages/sdk/src/entities/foreign/namespace.ts b/packages/sdk/src/entities/foreign/namespace.tsindex e41775d316..3fd4ebf3c4 100644--- a/packages/sdk/src/entities/foreign/namespace.ts+++ b/packages/sdk/src/entities/foreign/namespace.ts@@ -58,15 +58,15 @@ export class ForeignEntityNamespace {*/async bySource(source: string,- foreignEntityId: string+ foreignEntityId: string,): Promise<ForeignEntity> {return ForeignEntity.fromRecord(this.client,unwrap(await this.client.storage.getForeignEntityBySource({path: { source, foreign_entity_id: foreignEntityId },- })- )+ }),+ ),);}@@ -78,7 +78,7 @@ export class ForeignEntityNamespace {*/async githubPullRequestFacets(): Promise<GithubPullRequestFacets> {const { repositories, authors, assignees, labels } = unwrap(- await this.client.storage.getGithubPullRequestFacets()+ await this.client.storage.getGithubPullRequestFacets(),);return {repositories,diff --git a/packages/sdk/src/entities/github-pull-requests/namespace.ts b/packages/sdk/src/entities/github-pull-requests/namespace.tsnew file mode 100644index 0000000000..4b28e42517--- /dev/null+++ b/packages/sdk/src/entities/github-pull-requests/namespace.ts@@ -0,0 +1,18 @@+import type { MacroClient } from '../../utils/client';+import type { ForeignEntity } from '../foreign/foreign-entity';+import { GithubPullRequest } from './pull-request';++/** GitHub pull request snapshots and captured diffs. */+export class GithubPullRequestNamespace {+ constructor(private readonly client: MacroClient) {}++ /** Construct from a Macro foreign entity's identity. */+ byId(id: string): GithubPullRequest {+ return GithubPullRequest.byId(this.client, id);+ }++ /** Resolve a foreign entity as a pull request. */+ forEntity(entity: ForeignEntity): GithubPullRequest {+ return GithubPullRequest.byId(this.client, entity.id);+ }+}diff --git a/packages/sdk/src/entities/github-pull-requests/pull-request.ts b/packages/sdk/src/entities/github-pull-requests/pull-request.tsnew file mode 100644index 0000000000..fc86724b53--- /dev/null+++ b/packages/sdk/src/entities/github-pull-requests/pull-request.ts@@ -0,0 +1,79 @@+import type {+ ChangesetDto,+ StoredGithubPullRequest,+} from '../../../generated/storage/types.gen';+import { unwrap } from '../../utils';+import type { MacroClient } from '../../utils/client';+import { MacroEntity } from '../entity';++/** A stored GitHub pull request addressed by its Macro foreign entity. */+export class GithubPullRequest extends MacroEntity<StoredGithubPullRequest> {+ /** Construct a lazy pull request handle. */+ static byId(client: MacroClient, id: string): GithubPullRequest {+ return new GithubPullRequest(client, id);+ }++ protected async fetch(): Promise<StoredGithubPullRequest> {+ return unwrap(+ await this.client.storage.getGithubPullRequest({ path: { id: this.id } }),+ );+ }++ /** Pull request title. */+ readonly title = this.field('title');++ /** GitHub URL. */+ readonly url = this.field('url');++ /** Current state. */+ readonly status = this.field('status');++ /** Captured change metadata, when available. */+ async changes(): Promise<{+ changeset?: PullRequestChangeset;+ error?: string;+ }> {+ const result = unwrap(+ await this.client.storage.getGithubPullRequestChanges({+ path: { id: this.id },+ }),+ );+ return {+ changeset: result.changeset+ ? new PullRequestChangeset(this.client, this, result.changeset)+ : undefined,+ error: result.error ?? undefined,+ };+ }+}++/** One captured diff belonging to a pull request. */+export class PullRequestChangeset {+ constructor(+ private readonly client: MacroClient,+ /** Parent pull request. */+ readonly pullRequest: GithubPullRequest,+ /** Captured metadata. */+ readonly record: ChangesetDto,+ ) {}++ /** Captured identity. */+ get id(): string {+ return this.record.id;+ }++ /** Read the captured unified patch. */+ async patch(): Promise<string> {+ return unwrap(+ await this.client.storage.getGithubPullRequestChangesPatch({+ path: { id: this.pullRequest.id },+ query: { changeset: this.id },+ }),+ ).patch;+ }++ /** Serialize captured metadata and parent identity. */+ toJSON() {+ return { pullRequestId: this.pullRequest.id, ...this.record };+ }+}diff --git a/packages/sdk/src/entities/harnesses/harness.ts b/packages/sdk/src/entities/harnesses/harness.tsnew file mode 100644index 0000000000..38d2863766--- /dev/null+++ b/packages/sdk/src/entities/harnesses/harness.ts@@ -0,0 +1,42 @@+import type { Harness as HarnessRecord } from '../../../generated/storage/types.gen';+import { MacroNotFoundError, unwrap } from '../../utils';+import type { MacroClient } from '../../utils/client';+import { MacroEntity } from '../entity';++/** A registered host for coding agents. */+export class Harness extends MacroEntity<HarnessRecord> {+ /** Construct a lazy host handle. */+ static byId(client: MacroClient, id: string): Harness {+ return new Harness(client, id);+ }++ /** Seed from a listed host. */+ static from(client: MacroClient, record: HarnessRecord): Harness {+ return new Harness(client, record.id, record);+ }++ protected async fetch(): Promise<HarnessRecord> {+ const record = unwrap(await this.client.storage.listHarnesses()).find(+ (h) => h.id === this.id,+ );+ if (!record)+ throw new MacroNotFoundError(`Harness ${this.id} is unavailable`);+ return record;+ }++ /** Display name. */+ readonly name = this.field('name');++ /** Whether the host is connected. */+ readonly connected = this.field('connected');++ /** Runtime kind. */+ readonly kind = this.field('kind');++ /** Remove the host. */+ async delete(): Promise<void> {+ await this.mutate((c) =>+ c.storage.deleteHarness({ path: { harness_id: this.id } }),+ );+ }+}diff --git a/packages/sdk/src/entities/harnesses/namespace.ts b/packages/sdk/src/entities/harnesses/namespace.tsnew file mode 100644index 0000000000..85e5e002ce--- /dev/null+++ b/packages/sdk/src/entities/harnesses/namespace.ts@@ -0,0 +1,70 @@+import type { CreatePairingRequest } from '../../../generated/storage/types.gen';+import { unwrap } from '../../utils';+import type { MacroClient } from '../../utils/client';+import { AgentSession } from '../agent-sessions/agent-session';+import { Agent } from '../agents/agent';+import { Harness } from './harness';+import { DevicePairing, HarnessPairing } from './pairing';++/** Hosts and device pairing. Self operations require host credentials. */+export class HarnessNamespace {+ constructor(private readonly client: MacroClient) {}++ /** Construct a lazy host handle. */+ byId(id: string): Harness {+ return Harness.byId(this.client, id);+ }++ /** All hosts visible to the caller. */+ async list(): Promise<Harness[]> {+ return unwrap(await this.client.storage.listHarnesses()).map((h) =>+ Harness.from(this.client, h),+ );+ }++ /** The currently authenticated host. */+ async me(): Promise<Harness> {+ return Harness.from(+ this.client,+ unwrap(await this.client.storage.getSelfHarness()),+ );+ }++ /** Revoke the currently authenticated host. */+ async deleteSelf(): Promise<void> {+ unwrap(await this.client.storage.deleteSelfHarness());+ }++ /** Agent handles for the currently authenticated host. */+ async agents(): Promise<Agent[]> {+ return unwrap(await this.client.storage.listHarnessAgents()).map((a) =>+ Agent.byId(this.client, a.bot_id),+ );+ }++ /** Session handles for the currently authenticated host. */+ async sessions(): Promise<AgentSession[]> {+ return unwrap(await this.client.storage.listHarnessSessions()).map((s) =>+ AgentSession.byId(this.client, s.session_id),+ );+ }++ /** Construct a lazy pairing from its displayed code. */+ pairing(code: string): HarnessPairing {+ return HarnessPairing.byId(this.client, code);+ }++ /** Start pairing a device; persist the secret separately from the handles. */+ async createPairing(options: CreatePairingRequest) {+ const record = unwrap(+ await this.client.storage.createHarnessPairing({ body: options }),+ );+ return {+ pairing: HarnessPairing.byId(this.client, record.code),+ device: DevicePairing.byId(this.client, record.pairing_id),+ deviceSecret: record.device_secret,+ expiresAt: record.expires_at,+ pollIntervalSeconds: record.poll_interval_seconds,+ };+ }+}diff --git a/packages/sdk/src/entities/harnesses/pairing.ts b/packages/sdk/src/entities/harnesses/pairing.tsnew file mode 100644index 0000000000..491c41e9df--- /dev/null+++ b/packages/sdk/src/entities/harnesses/pairing.ts@@ -0,0 +1,85 @@+import type {+ ApprovePairingRequest,+ PairingDetails,+} from '../../../generated/storage/types.gen';+import { unwrap } from '../../utils';+import type { MacroClient } from '../../utils/client';+import { MacroEntity } from '../entity';+import type { Team } from '../teams/team';+import { Harness } from './harness';++/** A short lived host pairing, addressed by its displayed code. */+export class HarnessPairing extends MacroEntity<PairingDetails> {+ /** Construct a lazy pairing from a pairing code. */+ static byId(client: MacroClient, code: string): HarnessPairing {+ return new HarnessPairing(client, code);+ }++ protected async fetch(): Promise<PairingDetails> {+ return unwrap(+ await this.client.storage.getHarnessPairing({ path: { code: this.id } }),+ );+ }++ /** Requested name. */+ readonly name = this.field('requested_name');++ /** Expiration time. */+ readonly expiresAt = this.field('expires_at');++ /** Approve this pairing. */+ async approve(options?: {+ name?: string;+ team?: Team;+ allowPermissionBypass?: boolean;+ }): Promise<Harness> {+ const body: ApprovePairingRequest = {+ name: options?.name,+ team_id: options?.team?.id,+ allow_permission_bypass: options?.allowPermissionBypass,+ };+ return Harness.from(+ this.client,+ await this.mutate((c) =>+ c.storage.approveHarnessPairing({ path: { code: this.id }, body }),+ ),+ );+ }+}++/** Device side pairing identity. Keep the device secret outside the handle. */+export class DevicePairing {+ private constructor(+ private readonly client: MacroClient,+ /** Pairing identifier. */+ readonly id: string,+ ) {}++ /** Construct the device side handle. */+ static byId(client: MacroClient, id: string): DevicePairing {+ return new DevicePairing(client, id);+ }++ /** Attempt to claim an approved pairing. Pending claims return undefined. */+ async claim(+ deviceSecret: string,+ ): Promise<{ harness: Harness; token: string } | undefined> {+ const response = unwrap(+ await this.client.storage.claimHarnessPairing({+ path: { pairing_id: this.id },+ body: { device_secret: deviceSecret },+ }),+ );+ return 'harness' in response+ ? {+ harness: Harness.from(this.client, response.harness),+ token: response.token,+ }+ : undefined;+ }++ /** Serialize identity only. */+ toJSON() {+ return { id: this.id };+ }+}diff --git a/packages/sdk/src/entities/initiatives/initiative.ts b/packages/sdk/src/entities/initiatives/initiative.tsnew file mode 100644index 0000000000..8f84f7056b--- /dev/null+++ b/packages/sdk/src/entities/initiatives/initiative.ts@@ -0,0 +1,103 @@+import type {+ CreateInitiativeRequest,+ InitiativeDetail,+} from '../../../generated/storage/types.gen';+import { unwrap } from '../../utils';+import type { MacroClient } from '../../utils/client';+import { MacroEntity } from '../entity';+import { EntityAccess } from '../sharing/access';+import {+ type SharePermissionOptions,+ sharePermissionBody,+} from '../sharing/permissions';+import { Task } from '../tasks/task';+import { User } from '../users/user';++/** Initiative creation settings. */+export interface InitiativeOptions {+ /** Initiative name. */+ name: string;+ /** Collaborative description. */+ description?: string;+ /** Members assigned to this initiative. */+ members?: User[];+ /** Initial properties. */+ propertyValues?: CreateInitiativeRequest['propertyValues'];+ /** Whether the current team can access it. */+ shareWithTeam?: boolean;+}++/** A group of tasks and members working toward an outcome. */+export class Initiative extends MacroEntity<InitiativeDetail> {+ /** Access requests and direct user grants. */+ readonly access = new EntityAccess(this.client, 'initiative', this);++ /** Construct a lazy initiative handle. */+ static byId(client: MacroClient, id: string): Initiative {+ return new Initiative(client, id);+ }++ /** Seed from an initiative detail response. */+ static from(client: MacroClient, record: InitiativeDetail): Initiative {+ return new Initiative(client, record.id, record);+ }++ protected async fetch(): Promise<InitiativeDetail> {+ return unwrap(+ await this.client.storage.getInitiative({+ path: { initiative_id: this.id },+ }),+ );+ }++ /** Display name. */+ readonly name = this.field('name');++ /** Owner. */+ readonly owner = this.mappedField('ownerId', (id) =>+ User.byId(this.client, id),+ );++ /** Assigned members. */+ readonly members = this.mappedField('memberIds', (ids) =>+ ids.map((id) => User.byId(this.client, id)),+ );++ /** Tasks in this initiative. */+ readonly tasks = this.mappedField('taskIds', (ids) =>+ ids.map((id) => Task.byId(this.client, id)),+ );++ /** Current user's access. */+ readonly accessLevel = this.field('userAccessLevel');++ /** Sharing configuration. */+ readonly sharePermissions = this.field('sharePermission');++ /** Update the name, membership or sharing configuration. */+ async update(options: {+ name?: string;+ members?: User[];+ sharePermission?: SharePermissionOptions;+ }): Promise<void> {+ await this.mutate((c) =>+ c.storage.updateInitiative({+ path: { initiative_id: this.id },+ body: {+ name: options.name,+ memberIds: options.members?.map((u) => u.id),+ sharePermission: options.sharePermission+ ? sharePermissionBody(options.sharePermission)+ : undefined,+ },+ }),+ );+ }++ /** Delete this initiative. */+ async delete(): Promise<void> {+ await this.mutate((c) =>+ c.storage.deleteInitiative({ path: { initiative_id: this.id } }),+ );+ }+}diff --git a/packages/sdk/src/entities/initiatives/namespace.ts b/packages/sdk/src/entities/initiatives/namespace.tsnew file mode 100644index 0000000000..a108d35563--- /dev/null+++ b/packages/sdk/src/entities/initiatives/namespace.ts@@ -0,0 +1,38 @@+import { unwrap } from '../../utils';+import type { MacroClient } from '../../utils/client';+import { Initiative, type InitiativeOptions } from './initiative';++/** Initiatives in the caller's workspace. */+export class InitiativeNamespace {+ constructor(private readonly client: MacroClient) {}++ /** Construct a lazy initiative handle. */+ byId(id: string): Initiative {+ return Initiative.byId(this.client, id);+ }++ /** List accessible initiatives. */+ async list(): Promise<Initiative[]> {+ return unwrap(await this.client.storage.listInitiatives()).initiatives.map(+ (i) => Initiative.byId(this.client, i.id),+ );+ }++ /** Create an initiative. */+ async create(options: InitiativeOptions): Promise<Initiative> {+ return Initiative.from(+ this.client,+ unwrap(+ await this.client.storage.createInitiative({+ body: {+ name: options.name,+ description: options.description,+ memberIds: options.members?.map((u) => u.id),+ shareWithTeam: options.shareWithTeam,+ propertyValues: options.propertyValues,+ },+ }),+ ),+ );+ }+}diff --git a/packages/sdk/src/entities/meetings/meeting.ts b/packages/sdk/src/entities/meetings/meeting.tsnew file mode 100644index 0000000000..ccd949168a--- /dev/null+++ b/packages/sdk/src/entities/meetings/meeting.ts@@ -0,0 +1,114 @@+import type {+ Meeting as MeetingRecord,+ UpdateMeetingRequest,+} from '../../../generated/storage/types.gen';+import { MacroNotFoundError, unwrap } from '../../utils';+import type { MacroClient } from '../../utils/client';+import { CallRecord } from '../calls/call-record';+import { Channel } from '../channels/channel';+import { MacroEntity } from '../entity';+import type { User } from '../users/user';++/** A meeting's schedule and invitation link. */+export class Meeting extends MacroEntity<MeetingRecord> {+ private lookupToken?: string;++ private constructor(client: MacroClient, id: string, record?: MeetingRecord) {+ super(client, id, record);+ this.lookupToken = record?.shareToken;+ }++ /** Construct a lazy meeting handle. */+ static byId(client: MacroClient, id: string): Meeting {+ return new Meeting(client, id);+ }++ /** Seed a meeting from a server response. */+ static from(client: MacroClient, record: MeetingRecord): Meeting {+ return new Meeting(client, record.id, record);+ }++ protected async fetch(): Promise<MeetingRecord> {+ if (this.lookupToken)+ return unwrap(+ await this.client.storage.meetingLookup({+ path: { token: this.lookupToken },+ }),+ );++ const record = unwrap(+ await this.client.storage.meetingList(),+ ).meetings.find((m) => m.id === this.id);+ if (!record)+ throw new MacroNotFoundError(`Meeting ${this.id} is unavailable`);+ this.lookupToken = record.shareToken;+ return record;+ }++ /** Display title. */+ readonly title = this.field('title');++ /** Scheduled start. */+ readonly scheduledStart = this.field('scheduledStart');++ /** Scheduled end. */+ readonly scheduledEnd = this.field('scheduledEnd');++ /** Associated channel. */+ readonly channel = this.mappedField('channelId', (id) =>+ id ? Channel.byId(this.client, id) : undefined,+ );++ /** Associated call record. */+ readonly call = this.mappedField('callId', (id) =>+ id ? CallRecord.byId(this.client, id) : undefined,+ );++ /** Update schedule or title. */+ async update(options: UpdateMeetingRequest): Promise<void> {+ await this.mutate((c) =>+ c.storage.meetingUpdate({ path: { meeting_id: this.id }, body: options }),+ );+ }++ /** Cancel this meeting. */+ async cancel(): Promise<void> {+ await this.mutate((c) =>+ c.storage.meetingCancel({ path: { meeting_id: this.id } }),+ );+ }++ /** Whether the caller can send invitations. */+ async invitePermissions() {+ return unwrap(+ await this.client.storage.meetingInvitePermissions({+ path: { token: (await this.detail.get()).shareToken },+ }),+ );+ }++ /** Invite an email address. */+ async invite(email: string): Promise<void> {+ unwrap(+ await this.client.storage.meetingInvite({+ path: { token: (await this.detail.get()).shareToken },+ body: { email },+ }),+ );+ }++ /** Invite Macro users. */+ async inviteUsers(users: User[]): Promise<void> {+ unwrap(+ await this.client.storage.meetingInviteUsers({+ path: { token: (await this.detail.get()).shareToken },+ body: { userIds: users.map((u) => u.id) },+ }),+ );+ }++ /** Shareable meeting link. */+ async webUrl(): Promise<string> {+ return `${this.client.webAppUrl}/app/meet/join/${encodeURIComponent((await this.detail.get()).shareToken)}`;+ }+}diff --git a/packages/sdk/src/entities/meetings/namespace.ts b/packages/sdk/src/entities/meetings/namespace.tsnew file mode 100644index 0000000000..8ae2f2b183--- /dev/null+++ b/packages/sdk/src/entities/meetings/namespace.ts@@ -0,0 +1,46 @@+import type { CreateMeetingRequest } from '../../../generated/storage/types.gen';+import { unwrap } from '../../utils';+import type { MacroClient } from '../../utils/client';+import { Meeting } from './meeting';++/** Meeting schedules and invitation lookup. */+export class MeetingNamespace {+ constructor(private readonly client: MacroClient) {}++ /** Construct a handle to one of the caller's newest 100 standalone meetings. Use lookup for invitations. */+ byId(id: string): Meeting {+ return Meeting.byId(this.client, id);+ }++ /** Create a meeting. */+ async create(+ options: Omit<CreateMeetingRequest, 'preparationId'>,+ ): Promise<Meeting> {+ return Meeting.from(+ this.client,+ unwrap(await this.client.storage.meetingCreate({ body: options })),+ );+ }++ /** List the caller's newest 100 standalone meetings. */+ async list(): Promise<Meeting[]> {+ return unwrap(await this.client.storage.meetingList()).meetings.map((m) =>+ Meeting.from(this.client, m),+ );+ }++ /** List active meetings. */+ async active(): Promise<Meeting[]> {+ return unwrap(await this.client.storage.meetingListActive()).meetings.map(+ (m) => Meeting.from(this.client, m),+ );+ }++ /** Resolve a meeting's invitation token. */+ async lookup(token: string): Promise<Meeting> {+ return Meeting.from(+ this.client,+ unwrap(await this.client.storage.meetingLookup({ path: { token } })),+ );+ }+}diff --git a/packages/sdk/src/entities/messages/thread.ts b/packages/sdk/src/entities/messages/thread.tsnew file mode 100644index 0000000000..2bc8447a5f--- /dev/null+++ b/packages/sdk/src/entities/messages/thread.ts@@ -0,0 +1,187 @@+import type {+ MessageListItem,+ MessageTimelineQuery,+ ThreadPatch,+ ThreadState,+} from '../../../generated/storage/types.gen';+import { unwrap } from '../../utils';+import type { MacroClient } from '../../utils/client';+import type { CallRecord } from '../calls/call-record';+import type { CallMessage } from '../calls/message';+import type { Channel } from '../channels/channel';+import type { Message } from '../channels/message';+import type { CrmComment } from '../crm/comment';+import type { Company } from '../crm/company';+import type { Contact } from '../crm/contact';+import type { Comment } from '../documents/comment';+import type { Document } from '../documents/document';+import { MacroEntity } from '../entity';+import { User } from '../users/user';++/** A message handle accepted by a mixed timeline selector. */+export type TimelineMessage = Message | Comment | CrmComment | CallMessage;++/** Timeline selection with typed message references and camel case options. */+export interface TimelineOptions<+ TMessage extends TimelineMessage = TimelineMessage,+> {+ /** Opaque continuation cursor from a previous page. */+ cursor?: MessageTimelineQuery['cursor'];+ /** Fetch around this message. */+ around?: TMessage;+ /** Restrict selection to these messages. */+ messages?: TMessage[];+ /** Inclusive activity lower bound. */+ activityAfter?: string;+ /** Exclusive activity upper bound. */+ activityBefore?: string;+ /** Select anchored threads. */+ anchored?: boolean;+ /** Page direction. */+ direction?: MessageTimelineQuery['direction'];+ /** Include deleted threads. */+ includeDeletedThreads?: boolean;+ /** Page size. */+ limit?: number;+}++/** The typed parent of a shared message thread. */+export type MessageParent =+ | { type: 'channel'; entity: Channel }+ | { type: 'document'; entity: Document }+ | { type: 'crm_company'; entity: Company }+ | { type: 'crm_contact'; entity: Contact }+ | { type: 'call'; entity: CallRecord };++/** A shared message thread with resolution and deletion operations. */+export class MessageThread extends MacroEntity<ThreadState> {+ /** Serialize identity with its owning resource. */+ override toJSON() {+ return {+ ...super.toJSON(),+ parentType: this.parent.type,+ parentId: this.parent.entity.id,+ };+ }++ private constructor(+ client: MacroClient,+ /** The entity containing this thread. */+ readonly parent: MessageParent,+ id: string,+ ) {+ super(client, id);+ }++ /** Construct a scoped thread handle. */+ static byId(+ client: MacroClient,+ parent: MessageParent,+ id: string,+ ): MessageThread {+ return new MessageThread(client, parent, id);+ }++ private get path() {+ return {+ parent_type: this.parent.type,+ parent_id: this.parent.entity.id,+ id: this.id,+ };+ }++ protected async fetch(): Promise<ThreadState> {+ return unwrap(+ await this.client.storage.entityMessageGetThread({ path: this.path }),+ ).state;+ }++ /** Whether the thread is resolved. */+ readonly resolved = this.field('resolved');++ /** Resolve the thread or detach its annotation anchor. */+ async update(options: {+ resolved?: boolean;+ detachAnchor?: boolean;+ nonce?: string;+ }): Promise<void> {+ const body: ThreadPatch = {+ resolved: options.resolved,+ detach_anchor: options.detachAnchor,+ nonce: options.nonce,+ };+ await this.mutate((c) =>+ c.storage.entityMessagePatchThread({ path: this.path, body }),+ );+ }++ /** Delete the entire thread, including replies. */+ async delete(nonce?: string): Promise<void> {+ await this.mutate((c) =>+ c.storage.entityMessageDeleteThread({+ path: this.path,+ query: { nonce },+ }),+ );+ }+}++/** A bounded mixed message/activity page with typed message handles. */+export async function timeline<TMessage extends TimelineMessage>(+ client: MacroClient,+ parent: MessageParent,+ map: (record: MessageListItem) => TMessage,+ selection?: TimelineOptions<TMessage>,+) {+ for (const message of [+ ...(selection?.messages ?? []),+ ...(selection?.around ? [selection.around] : []),+ ]) {+ const scope =+ 'channelId' in message+ ? { type: 'channel', id: message.channelId }+ : 'documentId' in message+ ? { type: 'document', id: message.documentId }+ : 'callId' in message+ ? { type: 'call', id: message.callId }+ : message.parent;+ if (scope.type !== parent.type || scope.id !== parent.entity.id)+ throw new Error('Timeline message belongs to another resource');+ }+ const page = unwrap(+ await client.storage.messageTimelineEntries({+ path: { parent_type: parent.type, parent_id: parent.entity.id },+ query: {+ selection: selection+ ? JSON.stringify({+ cursor: selection.cursor,+ around: selection.around?.id,+ ids: selection.messages?.map((m) => m.id),+ activity_after: selection.activityAfter,+ activity_before: selection.activityBefore,+ anchored: selection.anchored,+ direction: selection.direction,+ include_deleted_threads: selection.includeDeletedThreads,+ limit: selection.limit,+ } satisfies MessageTimelineQuery)+ : undefined,+ },+ }),+ );+ return {+ entries: page.entries.map((entry) => {+ if (entry.type === 'activity')+ return {+ type: 'activity' as const,+ activity: {+ ...entry.activity,+ actor: User.byId(client, entry.activity.actor_id),+ },+ };+ const message = map(entry.message);+ return { type: 'message' as const, message };+ }),+ nextCursor: page.next_cursor ?? undefined,+ previousCursor: page.previous_cursor ?? undefined,+ };+}diff --git a/packages/sdk/src/entities/projects/project.ts b/packages/sdk/src/entities/projects/project.tsindex 3ffab1eecf..396368eeb1 100644--- a/packages/sdk/src/entities/projects/project.ts+++ b/packages/sdk/src/entities/projects/project.ts@@ -6,13 +6,36 @@ import { unwrap } from '../../utils';import type { MacroClient } from '../../utils/client';import { PropertiedEntity } from '../entity';import { entitySearch } from '../search';+import { EntityAccess } from '../sharing/access';type ProjectDetail = GetProjectHandlerResponses[200]['data']['projectMetadata'];+type ProjectItem =GetProjectContentHandlerResponses[200]['data'][number]['item'];/** A Macro project: a folder-like container for documents, chats, and subprojects. */export class Project extends PropertiedEntity<ProjectDetail> {+ /** Read this project's sharing configuration. */+ async sharePermissions() {+ return unwrap(+ await this.client.storage.getProjectPermissionsV2({+ path: { id: this.id },+ }),+ );+ }++ /** Read the caller's effective access level. */+ async accessLevel() {+ return unwrap(+ await this.client.storage.getProjectUserAccessLevel({+ path: { id: this.id },+ }),+ );+ }++ /** Access requests and direct user grants. */+ readonly access = new EntityAccess(this.client, 'project', this);+/** Favorites identify projects as `project`. */readonly entityType = 'project';diff --git a/packages/sdk/src/entities/reference.ts b/packages/sdk/src/entities/reference.tsnew file mode 100644index 0000000000..42f46226a8--- /dev/null+++ b/packages/sdk/src/entities/reference.ts@@ -0,0 +1,43 @@+import type { AgentSession } from './agent-sessions/agent-session';+import type { CalendarEvent } from './calendar/event';+import type { CallRecord } from './calls/call-record';+import type { Channel } from './channels/channel';+import type { Message } from './channels/message';+import type { Chat } from './chats/chat';+import type { Company } from './crm/company';+import type { Contact } from './crm/contact';+import type { CrmPipeline } from './crm/pipeline';+import type { Database } from './databases/database';+import type { DatabaseRow } from './databases/row';+import type { Document } from './documents/document';+import type { EmailThread } from './email/thread';+import type { ForeignEntity } from './foreign/foreign-entity';+import type { Form } from './forms/form';+import type { Initiative } from './initiatives/initiative';+import type { Project } from './projects/project';+import type { Routine } from './routines/routine';+import type { Team } from './teams/team';+import type { User } from './users/user';++/** Typed entity references accepted by cross-resource APIs. */+export type EntityReference =+ | { type: 'user'; entity: User }+ | { type: 'team'; entity: Team }+ | { type: 'document'; entity: Document }+ | { type: 'chat'; entity: Chat }+ | { type: 'channel'; entity: Channel }+ | { type: 'channel_message'; entity: Message }+ | { type: 'project'; entity: Project }+ | { type: 'email_thread'; entity: EmailThread }+ | { type: 'calendar_event'; entity: CalendarEvent }+ | { type: 'call'; entity: CallRecord }+ | { type: 'foreign_entity'; entity: ForeignEntity }+ | { type: 'crm_company'; entity: Company }+ | { type: 'crm_contact'; entity: Contact }+ | { type: 'crm_pipeline'; entity: CrmPipeline }+ | { type: 'agent_session'; entity: AgentSession }+ | { type: 'scheduled_action'; entity: Routine }+ | { type: 'initiative'; entity: Initiative }+ | { type: 'database'; entity: Database }+ | { type: 'database_row'; entity: DatabaseRow }+ | { type: 'form'; entity: Form };diff --git a/packages/sdk/src/entities/routines/namespace.ts b/packages/sdk/src/entities/routines/namespace.tsnew file mode 100644index 0000000000..c7ac22bef9--- /dev/null+++ b/packages/sdk/src/entities/routines/namespace.ts@@ -0,0 +1,34 @@+import { unwrap } from '../../utils';+import type { MacroClient } from '../../utils/client';+import { Routine, type RoutineOptions, routineBody } from './routine';++/** Scheduled and event-triggered routines. */+export class RoutineNamespace {+ constructor(private readonly client: MacroClient) {}++ /** Construct a lazy routine handle. */+ byId(id: string): Routine {+ return Routine.byId(this.client, id);+ }++ /** Create an agent routine. */+ async create(options: RoutineOptions): Promise<Routine> {+ return Routine.from(+ this.client,+ unwrap(+ await this.client.scheduledAction.createScheduledAction({+ body: { ...routineBody(options), enabled: options.enabled ?? true },+ }),+ ),+ );+ }++ /** List routines, optionally including event triggers. */+ async list(options?: { includeEvents?: boolean }): Promise<Routine[]> {+ return unwrap(+ await this.client.scheduledAction.listScheduledActions({+ query: { include_events: options?.includeEvents },+ }),+ ).map((record) => Routine.from(this.client, record));+ }+}diff --git a/packages/sdk/src/entities/routines/routine.ts b/packages/sdk/src/entities/routines/routine.tsnew file mode 100644index 0000000000..0cc4c0ce12--- /dev/null+++ b/packages/sdk/src/entities/routines/routine.ts@@ -0,0 +1,211 @@+import { match } from 'ts-pattern';+import type {+ ActionTrigger,+ AgentTask,+ EventFilter,+ RoutineModelId,+ RoutineTrigger,+ ScheduledActionResponse,+} from '../../../generated/scheduled-action/types.gen';+import { unwrap } from '../../utils';+import type { MacroClient } from '../../utils/client';+import { AgentSession } from '../agent-sessions/agent-session';+import type { Agent } from '../agents/agent';+import { Chat } from '../chats/chat';+import { MacroEntity } from '../entity';+import type { EntityReference } from '../reference';+import { User } from '../users/user';++/** An event selector references resources by typed handles. */+export type RoutineEventFilter = Omit<EventFilter, 'ids' | 'condition'> & {+ /** Resource selectors for these events. Omit to match all resources. */+ entities?: EntityReference[];+ /** Optional yes/no condition on the triggering content. */+ condition?: string;+};++/** One schedule or set of event selectors. */+export type SingleRoutineTrigger =+ | Extract<RoutineTrigger, { type: 'cron' }>+ | { type: 'events'; filters: RoutineEventFilter[] };++/** One or multiple routine triggers. */+export type RoutineTriggerOptions =+ | SingleRoutineTrigger+ | { type: 'multiple'; triggers: SingleRoutineTrigger[] };++function singleTriggerBody(trigger: SingleRoutineTrigger): RoutineTrigger {+ return match(trigger)+ .with({ type: 'cron' }, (value) => value)+ .with({ type: 'events' }, (value) => ({+ type: 'events' as const,+ filters: value.filters.map(({ entities, ...filter }) => ({+ ...filter,+ ids: entities?.map((entity) => entity.entity.id),+ })),+ }))+ .exhaustive();+}++function triggerBody(trigger: RoutineTriggerOptions): ActionTrigger {+ return match(trigger)+ .with({ type: 'multiple' }, (value) => ({+ type: 'multiple' as const,+ triggers: value.triggers.map(singleTriggerBody),+ }))+ .with({ type: 'cron' }, singleTriggerBody)+ .with({ type: 'events' }, singleTriggerBody)+ .exhaustive();+}++/** Configuration of an agent routine. */+export interface RoutineOptions {+ /** Display name. */+ name: string;+ /** Schedules or Macro events that start the routine. */+ trigger: RoutineTriggerOptions;+ /** Instructions delivered to the agent. */+ prompt: string;+ /** Original user instructions. */+ userPrompt: string;+ /** Model override. */+ model?: RoutineModelId;+ /** Agent to run the task. */+ agent?: Agent;+ /** Whether triggers can start executions. Defaults to true on creation. */+ enabled?: boolean;+}++/** A scheduled or event-triggered agent task. */+export class Routine extends MacroEntity<ScheduledActionResponse> {+ /** Construct a lazy routine handle. */+ static byId(client: MacroClient, id: string): Routine {+ return new Routine(client, id);+ }++ /** Seed a handle from a server record. */+ static from(client: MacroClient, record: ScheduledActionResponse): Routine {+ if (!record.id) throw new Error('Routine response has no id');+ return new Routine(client, record.id, record);+ }++ protected async fetch(): Promise<ScheduledActionResponse> {+ return unwrap(+ await this.client.scheduledAction.getScheduledAction({+ path: { id: this.id },+ }),+ );+ }++ /** Routine name. */+ readonly name = this.field('name');++ /** Configured triggers. */+ readonly trigger = this.field('trigger');++ /** Whether the routine is enabled. */+ readonly enabled = this.field('enabled');++ /** Next scheduled execution. */+ readonly nextRunAt = this.field('next_run_at');++ /** Configuration revision. */+ readonly revision = this.field('configuration_revision');++ /** Routine owner. */+ readonly owner = this.mappedField('owner', (id) =>+ User.byId(this.client, id),+ );++ /** Replace the routine's task and trigger configuration. */+ async update(options: RoutineOptions): Promise<void> {+ await this.mutate((c) =>+ c.scheduledAction.updateScheduledAction({+ path: { id: this.id },+ body: routineBody(options),+ }),+ );+ }++ /** Enable or disable triggering. */+ async setEnabled(enabled: boolean): Promise<void> {+ await this.mutate((c) =>+ c.scheduledAction.setScheduledActionEnabled({+ path: { id: this.id },+ body: { enabled },+ }),+ );+ }++ /** Start an execution immediately and return its transcript handle if available. */+ async execute(): Promise<Chat | AgentSession | undefined> {+ const result = unwrap(+ await this.client.scheduledAction.executeScheduledActionNow({+ path: { id: this.id },+ }),+ );+ if (result.resource)+ return match(result.resource)+ .with({ type: 'agent' }, (resource) =>+ AgentSession.byId(this.client, resource.id),+ )+ .with({ type: 'chat' }, (resource) =>+ Chat.byId(this.client, resource.id),+ )+ .exhaustive();+ return result.chat_id ? Chat.byId(this.client, result.chat_id) : undefined;+ }++ /** Completed executions, with their routine scoped identity. */+ async history(): Promise<RoutineExecution[]> {+ return unwrap(+ await this.client.scheduledAction.listScheduledActionHistory({+ path: { id: this.id },+ }),+ ).map((record) => new RoutineExecution(this, record));+ }++ /** Delete the routine. */+ async delete(): Promise<void> {+ await this.mutate((c) =>+ c.scheduledAction.deleteScheduledAction({ path: { id: this.id } }),+ );+ }+}++/** A completed routine execution, as recorded by the service. */+export class RoutineExecution {+ constructor(+ /** Parent routine. */+ readonly routine: Routine,+ /** Execution snapshot. */+ readonly record: import('../../../generated/scheduled-action/types.gen').ActionExecutionRecord,+ ) {}++ /** Execution identity, when assigned. */+ get id(): string | undefined {+ return this.record.id ?? undefined;+ }++ /** Serialize without the authenticated client. */+ toJSON() {+ return { routine: this.routine.id, ...this.record };+ }+}++/** Translate typed routine options into the generated wire contract. */+export function routineBody(options: RoutineOptions) {+ const task: AgentTask = {+ prompt: options.prompt,+ user_prompt: options.userPrompt,+ model: options.model,+ agent: options.agent ? { bot_id: options.agent.id } : undefined,+ };+ return {+ kind: 'Agent' as const,+ name: options.name,+ enabled: options.enabled,+ trigger: triggerBody(options.trigger),+ task: { ...task },+ };+}diff --git a/packages/sdk/src/entities/sharing/access.ts b/packages/sdk/src/entities/sharing/access.tsnew file mode 100644index 0000000000..1e195ebc99--- /dev/null+++ b/packages/sdk/src/entities/sharing/access.ts@@ -0,0 +1,187 @@+import type {+ AccessLevel,+ AccessRequest as RequestRecord,+ ResolveRequest,+ ShareEntityType,+} from '../../../generated/storage/types.gen';+import { MacroNotFoundError, unwrap } from '../../utils';+import type { MacroClient } from '../../utils/client';+import { MacroEntity } from '../entity';+import { User } from '../users/user';++/** Access requests and direct grants scoped to a shareable entity. */+export class EntityAccess {+ constructor(+ private readonly client: MacroClient,+ private readonly entityType: ShareEntityType,+ private readonly entity: { readonly id: string },+ ) {}++ private get path() {+ return { entity_type: this.entityType, entity_id: this.entity.id };+ }++ /** A page of access requests, including the caller's own request and review rights. */+ async state(offset?: number) {+ const state = unwrap(+ await this.client.storage.accessRequestsState({+ path: this.path,+ query: { offset },+ }),+ );+ return {+ accessLevel: state.accessLevel ?? undefined,+ canReview: state.canReview,+ owner: state.owner ? User.byId(this.client, state.owner) : undefined,+ pendingCount: state.pendingCount,+ supportedLevels: state.supportedLevels,+ nextOffset: state.nextOffset ?? undefined,+ mine: state.mine+ ? AccessRequest.from(this.client, this, state.mine)+ : undefined,+ requests: state.requests.map((r) =>+ AccessRequest.from(this.client, this, r),+ ),+ };+ }++ /** Request access, optionally naming the revision of an earlier request. */+ async submit(+ requestedLevel: AccessLevel,+ revision?: number,+ ): Promise<AccessRequest> {+ return AccessRequest.from(+ this.client,+ this,+ unwrap(+ await this.client.storage.accessRequestsSubmit({+ path: this.path,+ body: { requestedLevel, revision },+ }),+ ),+ );+ }++ /** Cancel the caller's own request at its observed revision. */+ async cancel(revision: number): Promise<void> {+ unwrap(+ await this.client.storage.accessRequestsCancel({+ path: this.path,+ query: { revision },+ }),+ );+ }++ /** Direct grants expressed as user handles. */+ async direct() {+ return unwrap(+ await this.client.storage.accessRequestsDirect({ path: this.path }),+ ).map((g) => ({+ user: User.byId(this.client, g.userId),+ accessLevel: g.accessLevel,+ }));+ }++ /** Grant direct access, or remove it by omitting the access level. */+ async grant(user: User, accessLevel?: AccessLevel): Promise<void> {+ unwrap(+ await this.client.storage.accessRequestsSetDirect({+ path: { ...this.path, user_id: user.id },+ body: { accessLevel },+ }),+ );+ }++ /** Remove one user's direct grant. */+ async remove(user: User): Promise<void> {+ unwrap(+ await this.client.storage.accessRequestsRemoveDirect({+ path: { ...this.path, user_id: user.id },+ }),+ );+ }++ /** Resolve a request belonging to this entity at an observed revision. */+ async resolve(+ request: AccessRequest,+ resolution: ResolveRequest,+ ): Promise<RequestRecord> {+ const owner = request.access.toJSON();+ if (+ owner.entity_type !== this.entityType ||+ owner.entity_id !== this.entity.id+ )+ throw new Error('Access request belongs to another entity');+ return unwrap(+ await this.client.storage.accessRequestsResolve({+ path: { ...this.path, request_id: request.id },+ body: resolution,+ }),+ );+ }++ /** Serialize the entity reference without credentials. */+ toJSON() {+ return this.path;+ }+}++/** One access request; resolutions preserve optimistic concurrency. */+export class AccessRequest extends MacroEntity<RequestRecord> {+ private resolvedRecord?: RequestRecord;++ private constructor(+ client: MacroClient,+ /** Entity access surface owning the request. */+ readonly access: EntityAccess,+ record: RequestRecord,+ ) {+ super(client, record.id, record);+ }++ /** Seed a request from a state or submission response. */+ static from(+ client: MacroClient,+ access: EntityAccess,+ record: RequestRecord,+ ): AccessRequest {+ return new AccessRequest(client, access, record);+ }++ protected async fetch(): Promise<RequestRecord> {+ if (this.resolvedRecord) return this.resolvedRecord;+ let offset: number | undefined;+ do {+ const state = await this.access.state(offset);+ const found = [state.mine, ...state.requests].find(+ (r) => r?.id === this.id,+ );+ if (found) return found.detail.get();+ offset = state.nextOffset;+ } while (offset !== undefined);+ throw new MacroNotFoundError(`Access request ${this.id} is unavailable`);+ }++ /** Request revision. */+ readonly revision = this.field('revision');++ /** Current request state. */+ readonly status = this.field('status');++ /** Requested access. */+ readonly requestedLevel = this.field('requestedLevel');++ /** Requesting user. */+ readonly requester = this.mappedField('requesterId', (id) =>+ User.byId(this.client, id),+ );++ /** Approve with an access level, or decline by omitting it. */+ async resolve(grantedLevel?: AccessLevel): Promise<void> {+ this.resolvedRecord = await this.access.resolve(this, {+ revision: await this.revision(),+ grantedLevel,+ });+ this.detail.clear();+ }+}diff --git a/packages/sdk/src/entities/sharing/permissions.ts b/packages/sdk/src/entities/sharing/permissions.tsnew file mode 100644index 0000000000..b466003281--- /dev/null+++ b/packages/sdk/src/entities/sharing/permissions.ts@@ -0,0 +1,39 @@+import type {+ AccessLevel,+ UpdateChannelSharePermission,+ UpdateSharePermissionRequestV2,+} from '../../../generated/storage/types.gen';+import type { Channel } from '../channels/channel';++/** Sharing updates reference channels by handle. Null clears the corresponding grant collection. */+export type SharePermissionOptions = Omit<+ UpdateSharePermissionRequestV2,+ 'channelSharePermissions'+> & {+ /** Channel grants to create or replace. */+ channelSharePermissions?:+ | {+ channel: Channel;+ accessLevel?: AccessLevel;+ operation: UpdateChannelSharePermission['operation'];+ }[]+ | null;+};++/** Convert sharing options into the generated backend contract. */+export function sharePermissionBody(+ options: SharePermissionOptions,+): UpdateSharePermissionRequestV2 {+ return {+ ...options,+ channelSharePermissions:+ options.channelSharePermissions === undefined ||+ options.channelSharePermissions === null+ ? options.channelSharePermissions+ : options.channelSharePermissions.map((g) => ({+ channelId: g.channel.id,+ accessLevel: g.accessLevel,+ operation: g.operation,+ })),+ };+}diff --git a/packages/sdk/src/entities/unfurls/namespace.ts b/packages/sdk/src/entities/unfurls/namespace.tsnew file mode 100644index 0000000000..feec59bae5--- /dev/null+++ b/packages/sdk/src/entities/unfurls/namespace.ts@@ -0,0 +1,19 @@+import { unwrap } from '../../utils';+import type { MacroClient } from '../../utils/client';++/** URL metadata lookup. */+export class UnfurlNamespace {+ constructor(private readonly client: MacroClient) {}++ /** Read title, description and preview metadata for a URL. */+ async get(url: string) {+ return unwrap(await this.client.unfurl.getUnfurl({ query: { url } }));+ }++ /** Read metadata for multiple URLs in one request. */+ async bulk(urls: string[]) {+ return unwrap(+ await this.client.unfurl.getUnfurlBulk({ body: { url_list: urls } }),+ );+ }+}diff --git a/packages/sdk/src/events/hydrate/message.ts b/packages/sdk/src/events/hydrate/message.tsindex 1440628251..93f3505cf9 100644--- a/packages/sdk/src/events/hydrate/message.ts+++ b/packages/sdk/src/events/hydrate/message.ts@@ -55,7 +55,7 @@ function target(thread_id?: string | null;root_id: string;},- mentions: SimpleMention[] = []+ mentions: SimpleMention[] = [],): MessageEventTarget {const parent = metadata.parent;if (parent.type === 'call') {diff --git a/packages/sdk/src/macro.ts b/packages/sdk/src/macro.tsindex c4f5c348c1..4f9534e0db 100644--- a/packages/sdk/src/macro.ts+++ b/packages/sdk/src/macro.ts@@ -1,6 +1,8 @@import type { MacroOpts } from './config';import { AgentSessionNamespace } from './entities/agent-sessions/namespace';+import { AgentNamespace } from './entities/agents/namespace';import { AiNamespace } from './entities/ai/namespace';+import { ApiKeyNamespace } from './entities/api-keys/namespace';import { BotsNamespace } from './entities/bots/namespace';import { CalendarNamespace } from './entities/calendar/namespace';import { CallRecordNamespace } from './entities/calls/namespace';@@ -10,15 +12,22 @@ import { CrmNamespace } from './entities/crm/namespace';import { DatabaseNamespace } from './entities/databases/namespace';import { DocumentNamespace } from './entities/documents/namespace';import { EmailNamespace } from './entities/email/namespace';+import { EntityMentionNamespace } from './entities/entity-mentions/namespace';import { FavoritesNamespace } from './entities/favorites/namespace';import { ForeignEntityNamespace } from './entities/foreign/namespace';import { FormNamespace } from './entities/forms/namespace';+import { GithubPullRequestNamespace } from './entities/github-pull-requests/namespace';+import { HarnessNamespace } from './entities/harnesses/namespace';+import { InitiativeNamespace } from './entities/initiatives/namespace';+import { MeetingNamespace } from './entities/meetings/namespace';import { NotificationNamespace } from './entities/notifications/namespace';import { PinsNamespace } from './entities/pins/namespace';import { ProjectNamespace } from './entities/projects/namespace';import { PropertiesNamespace } from './entities/properties/namespace';+import { RoutineNamespace } from './entities/routines/namespace';import { TaskNamespace } from './entities/tasks/namespace';import { TeamNamespace } from './entities/teams/namespace';+import { UnfurlNamespace } from './entities/unfurls/namespace';import { UserNamespace } from './entities/users/namespace';import type { User } from './entities/users/user';import { WebhooksNamespace } from './entities/webhooks/namespace';@@ -78,44 +87,105 @@ export {wrapXml,} from './mentions';export type { RequestActivity } from './utils/activity';-export class Macro<T extends MacroOpts = MacroOpts> {+ /** routines resources and operations. */+ readonly routines: RoutineNamespace;++ /** unfurls resources and operations. */+ readonly unfurls: UnfurlNamespace;++ /** agents resources and operations. */+ readonly agents: AgentNamespace;++ /** initiatives resources and operations. */+ readonly initiatives: InitiativeNamespace;++ /** apiKeys resources and operations. */+ readonly apiKeys: ApiKeyNamespace;++ /** harnesses resources and operations. */+ readonly harnesses: HarnessNamespace;++ /** meetings resources and operations. */+ readonly meetings: MeetingNamespace;++ /** githubPullRequests resources and operations. */+ readonly githubPullRequests: GithubPullRequestNamespace;++ /** entityMentions resources and operations. */+ readonly entityMentions: EntityMentionNamespace;+readonly agentSessions: AgentSessionNamespace;+readonly ai: AiNamespace;+readonly bots: BotsNamespace;+readonly calendar: CalendarNamespace;+readonly calls: CallRecordNamespace;+readonly channels: ChannelNamespace;+readonly chats: ChatNamespace;+readonly crm: CrmNamespace;+readonly databases: DatabaseNamespace;+readonly documents: DocumentNamespace;+readonly email: EmailNamespace;+readonly favorites: FavoritesNamespace;+readonly foreignEntities: ForeignEntityNamespace;+/** Build forms and submit answers without granting respondents database access. */readonly forms: FormNamespace;+readonly notifications: NotificationNamespace;+readonly pins: PinsNamespace;+readonly projects: ProjectNamespace;+readonly properties: PropertiesNamespace;+readonly tasks: TaskNamespace;+readonly teams: TeamNamespace;+readonly users: UserNamespace;+readonly webhooks: WebhooksNamespace;+/** Browse workspace activity with type, task, time, tag and inbox filters. */readonly workspace: WorkspaceNamespace;+readonly events: MacroEvents;+/** Base URL of the Macro web app, used to build entity URLs. */readonly webAppUrl: string;+/** Direct access to the underlying hey-api service clients. */readonly _client: MacroClient;+private readonly opts: T;constructor(opts: T) {this.opts = opts;const client = new MacroClient(opts);this._client = client;+ this.routines = new RoutineNamespace(client);+ this.unfurls = new UnfurlNamespace(client);+ this.agents = new AgentNamespace(client);+ this.initiatives = new InitiativeNamespace(client);+ this.apiKeys = new ApiKeyNamespace(client);+ this.harnesses = new HarnessNamespace(client);+ this.meetings = new MeetingNamespace(client);+ this.githubPullRequests = new GithubPullRequestNamespace(client);+ this.entityMentions = new EntityMentionNamespace(client);this.agentSessions = new AgentSessionNamespace(client);this.ai = new AiNamespace(client);this.bots = new BotsNamespace(client);@@ -160,12 +230,71 @@ export class Macro<T extends MacroOpts = MacroOpts> {}export type { CodeResult } from './entities/agent-sessions/code-execution';+export {+ AgentConversation,+ ConversationTurn,+} from './entities/agent-sessions/conversation';export type {CreateReviewOptions,ReviewCalendarDraft,ReviewEmailDraft,} from './entities/agent-sessions/review';export { ReviewItem, SessionReview } from './entities/agent-sessions/review';+export { ToolApproval } from './entities/agent-sessions/tool-approval';+export { Agent, type AgentOptions } from './entities/agents/agent';+export { UserApiKey } from './entities/api-keys/api-key';+export { ChannelActivity } from './entities/channels/activity';+export { ChannelPicture } from './entities/channels/picture';+export { ChatGeneration, ChatMessage } from './entities/chats/generation';+export {+ CrmPipeline,+ PipelineColumn,+ PipelineRow,+ PipelineTable,+} from './entities/crm/pipeline';+export type {+ DatabaseQueryOptions,+ DatabaseQueryResult,+ QueryColumn,+ QueryResultSet,+ QueryStatement,+ QueryTableVersion,+} from './entities/databases/query';+export { DocumentAnchor } from './entities/documents/anchor';+export { DocumentVersion } from './entities/documents/version';+export {+ DraftAttachment,+ type DraftOptions,+ EmailDraft,+} from './entities/email/draft';+export { EmailFilter, type EmailFilterOptions } from './entities/email/filter';+export { EntityMention } from './entities/entity-mentions/mention';+export {+ GithubPullRequest,+ PullRequestChangeset,+} from './entities/github-pull-requests/pull-request';+export { Harness } from './entities/harnesses/harness';+export { DevicePairing, HarnessPairing } from './entities/harnesses/pairing';+export {+ Initiative,+ type InitiativeOptions,+} from './entities/initiatives/initiative';+export { Meeting } from './entities/meetings/meeting';+export type { TimelineOptions } from './entities/messages/thread';+export { type MessageParent, MessageThread } from './entities/messages/thread';+export type { EntityReference } from './entities/reference';+export type {+ RoutineEventFilter,+ RoutineTriggerOptions,+ SingleRoutineTrigger,+} from './entities/routines/routine';+export {+ Routine,+ RoutineExecution,+ type RoutineOptions,+} from './entities/routines/routine';+export { AccessRequest, EntityAccess } from './entities/sharing/access';+export type { SharePermissionOptions } from './entities/sharing/permissions';export type {WorkspaceFilters,WorkspaceItem,diff --git a/packages/sdk/src/utils/client.ts b/packages/sdk/src/utils/client.tsindex 88d37baf10..71a5815283 100644--- a/packages/sdk/src/utils/client.ts+++ b/packages/sdk/src/utils/client.ts@@ -7,10 +7,12 @@ import { Sdk as ContactsSdk } from '../../generated/contacts/sdk.gen';import { Sdk as EmailSdk } from '../../generated/email/sdk.gen';import { Sdk as NotificationSdk } from '../../generated/notification/sdk.gen';import { Sdk as PropertiesSdk } from '../../generated/properties/sdk.gen';+import { Sdk as ScheduledActionSdk } from '../../generated/scheduled-action/sdk.gen';import { Sdk as SearchSdk } from '../../generated/search/sdk.gen';import { createClient } from '../../generated/storage/client';import { Sdk as StorageSdk } from '../../generated/storage/sdk.gen';import type { Bot } from '../../generated/storage/types.gen';+import { Sdk as UnfurlSdk } from '../../generated/unfurl/sdk.gen';import {type Env,HOSTS,@@ -27,7 +29,9 @@ import { type LocalPortmap, resolveLocalPortmap } from '../local-portmap';import { observeSdk } from './activity';const USER_API_KEY_HEADER = 'x-macro-user-api-key';+const USER_API_KEY_PREFIX = 'mak_';+const BOT_TOKEN_PREFIX = 'mbot_';type CredentialHeader = readonly [name: string, value: string];@@ -95,28 +99,50 @@ export async function requestAuthHeaders(}export class MacroClient {+ readonly scheduledAction: ScheduledActionSdk;++ readonly unfurl: UnfurlSdk;+readonly agentHarness: AgentHarnessSdk;+readonly auth: AuthSdk;+readonly calendar: CalendarSdk;+readonly cognition: CognitionSdk;+readonly contacts: ContactsSdk;+readonly email: EmailSdk;+readonly notification: NotificationSdk;+readonly properties: PropertiesSdk;+readonly search: SearchSdk;+readonly storage: StorageSdk;+readonly webAppUrl: string;+readonly wsVerify?: string;+readonly events: MacroEvents;+/** Resolved authentication config (distinct from `auth`, the auth-service SDK). */readonly authConfig: MacroAuth;+/** Resolved service base urls: env defaults, then the local-stack portmap,* then `opts.hosts` overrides. */readonly hosts: Record<ServiceName, string>;+/** The local stack's generated port map; only set when env is `local`. */readonly localPortmap?: LocalPortmap;+private readonly requestedAs?: string;+private selfBotRecord?: Promise<Bot>;+private selfPrincipal?: Promise<string>;constructor(opts: MacroOpts) {@@ -141,6 +167,18 @@ export class MacroClient {}this.wsVerify = opts.wsVerify;+ this.scheduledAction = observeSdk(+ new ScheduledActionSdk({+ client: this.makeClient(hosts['scheduled-action']),+ }),+ 'scheduled-action',+ opts.onRequest,+ );+ this.unfurl = observeSdk(+ new UnfurlSdk({ client: this.makeClient(hosts.unfurl) }),+ 'unfurl',+ opts.onRequest,+ );this.agentHarness = observeSdk(new AgentHarnessSdk({client: this.makeClient(hosts['agent-harness']),diff --git a/packages/sdk/tests/backlog-contracts.types.ts b/packages/sdk/tests/backlog-contracts.types.tsnew file mode 100644index 0000000000..387bb4c27b--- /dev/null+++ b/packages/sdk/tests/backlog-contracts.types.ts@@ -0,0 +1,128 @@+import type { Agent } from '../src/entities/agents/agent';+import type { Message } from '../src/entities/channels/message';+import type { PipelineRow } from '../src/entities/crm/pipeline';+import type { Comment } from '../src/entities/documents/comment';+import type { Document } from '../src/entities/documents/document';+import type {+ EntityReference,+ Macro,+ RoutineEventFilter,+ SharePermissionOptions,+ TimelineOptions,+} from '../src/macro';++type AssertFalse<T extends false> = T;+type AssertTrue<T extends true> = T;+type Accepts<Input, Value> = Value extends Input ? true : false;++/** Compiled with the SDK: changing an entity parameter back into an ID fails here. */+export type EntityInputContracts = [+ AssertFalse<+ Accepts<+ NonNullable<Parameters<Macro['routines']['create']>[0]['agent']>,+ string+ >+ >,+ AssertTrue<+ Accepts<+ NonNullable<Parameters<Macro['routines']['create']>[0]['agent']>,+ Agent+ >+ >,+ AssertFalse<+ Accepts<+ NonNullable<+ Parameters<Macro['initiatives']['create']>[0]['members']+ >[number],+ string+ >+ >,+ AssertFalse<+ Accepts<+ Parameters<Macro['entityMentions']['create']>[0],+ { type: 'document'; entity: string }+ >+ >,+ AssertFalse<+ Accepts<Parameters<Macro['crm']['pipelines']['byId']>[0], number>+ >,+ AssertFalse<+ Accepts<+ NonNullable<+ SharePermissionOptions['channelSharePermissions']+ >[number]['channel'],+ string+ >+ >,+ AssertFalse<+ Accepts<NonNullable<RoutineEventFilter['entities']>[number], string>+ >,+ AssertTrue<Accepts<EntityReference, { type: 'document'; entity: Document }>>,+ AssertFalse<Accepts<EntityReference, { type: 'channel'; entity: Document }>>,+ AssertFalse<+ Accepts<NonNullable<TimelineOptions<Message>['around']>, Comment>+ >,+ AssertFalse<+ Accepts<+ Parameters<+ ReturnType<Macro['email']['draftById']>['removeAttachment']+ >[0],+ string+ >+ >,+ AssertFalse<+ Accepts<+ Parameters<ReturnType<Macro['documents']['byId']>['access']['grant']>[0],+ string+ >+ >,+];++/** Lists and receipts keep resources as handles, including nested subresources. */+export type EntityOutputContracts = [+ AssertTrue<+ Accepts<+ { id: string; delete(): Promise<void> },+ Awaited<ReturnType<Macro['routines']['create']>>+ >+ >,+ AssertFalse<+ Accepts<Awaited<ReturnType<Macro['apiKeys']['create']>>['key'], string>+ >,+ AssertTrue<+ Accepts<+ Awaited<ReturnType<Macro['crm']['pipelines']['create']>>['rows'] extends (+ ...args: never[]+ ) => AsyncGenerator<infer Row>+ ? Row+ : never,+ PipelineRow+ >+ >,+];++/** SQL scopes and write guards accept database/table handles rather than raw IDs. */+export type QueryInputContracts = [+ AssertFalse<+ Accepts<+ NonNullable<Parameters<Macro['databases']['query']>[1]>['database'],+ string+ >+ >,+ AssertFalse<+ Accepts<+ NonNullable<+ NonNullable<Parameters<Macro['databases']['query']>[1]>['baseVersions']+ >[number]['table'],+ string+ >+ >,+ AssertTrue<+ Accepts<+ NonNullable<+ NonNullable<Parameters<Macro['databases']['query']>[1]>['baseVersions']+ >[number],+ Awaited<ReturnType<Macro['databases']['query']>>['readVersions'][number]+ >+ >,+];diff --git a/packages/sdk/tests/backlog-entities.test.ts b/packages/sdk/tests/backlog-entities.test.tsnew file mode 100644index 0000000000..dfab0fd2b4--- /dev/null+++ b/packages/sdk/tests/backlog-entities.test.ts@@ -0,0 +1,516 @@+import { afterEach, expect, test } from 'bun:test';+import type { ParsedMessage } from '../generated/email/types.gen';+import type {+ AccessiblePipeline,+ AccessRequest,+ Meeting,+ TableDetail,+} from '../generated/storage/types.gen';+import { DraftAttachment, Macro } from '../src/macro';+import { MacroApiError } from '../src/utils';++const originalFetch = globalThis.fetch;+afterEach(() => {+ globalThis.fetch = originalFetch;+});++const draftMessage: ParsedMessage = {+ db_id: 'draft-1',+ link_id: 'secondary-inbox',+ thread_db_id: 'thread-1',+ bcc: [],+ cc: [],+ to: [],+ labels: [],+};++test('draft editing encodes Unicode HTML and every write stays in the draft inbox', async () => {+ const writes: Request[] = [];+ globalThis.fetch = Object.assign(+ async (input: RequestInfo | URL) => {+ const request = input instanceof Request ? input : new Request(input);+ if (request.method === 'GET') return Response.json(draftMessage);+ writes.push(request);+ if (request.headers.get('X-Email-Link-Id') !== 'secondary-inbox')+ return Response.json({ error: 'wrong inbox' }, { status: 403 });+ if (request.url.endsWith('/attachments'))+ return Response.json({+ attachment_id: 'attachment-1',+ upload_url: 'https://uploads.test/file',+ content_type: 'text/plain',+ });+ if (request.url.endsWith('/forwarded-attachments'))+ return Response.json({ attachment_id: 'attachment-2' });+ if (request.url.endsWith('/drafts'))+ return Response.json({+ draft: {+ db_id: 'draft-1',+ link_id: 'secondary-inbox',+ subject: 'Updated',+ },+ });+ return new Response(null, { status: 204 });+ },+ { preconnect: originalFetch.preconnect },+ );+ const macro = new Macro({+ token: 'token',+ hosts: { email: 'https://email.test' },+ });+ const draft = macro.email.draftById('draft-1');+ await draft.update({+ subject: 'Updated',+ bodyHtml: '<p>café ☕</p>',+ thread: macro.email.byId('thread-1'),+ replyingTo: macro.email.message('message-1'),+ });+ expect(await writes[0].json()).toEqual({+ draft: {+ db_id: 'draft-1',+ subject: 'Updated',+ body_html: Buffer.from('<p>café ☕</p>').toString('base64url'),+ thread_db_id: 'thread-1',+ replying_to_id: 'message-1',+ },+ });+ const upload = await draft.addAttachment({+ fileName: 'notes.txt',+ sha: 'abc',+ size: 12,+ });+ expect(upload.attachment.draft).toBe(draft);+ await upload.attachment.complete();+ await upload.attachment.remove();+ const forwarded = await draft.forwardAttachment(+ macro.email.attachment('source-attachment'),+ );+ await forwarded.remove();+ await draft.schedule('2026-11-01T09:00:00Z');+ await draft.unschedule();+ await draft.delete();+ expect(writes).toHaveLength(9);+ expect(+ writes.every((r) => r.headers.get('X-Email-Link-Id') === 'secondary-inbox'),+ ).toBe(true);+ expect(JSON.stringify(upload.attachment)).toBe(+ '{"id":"attachment-1","draftId":"draft-1","forwarded":false}',+ );+});++test('attachments cannot be removed through a different draft', async () => {+ let requests = 0;+ globalThis.fetch = Object.assign(+ async () => {+ requests++;+ return new Response(null, { status: 204 });+ },+ { preconnect: originalFetch.preconnect },+ );+ const macro = new Macro({ token: 'token' });+ const first = macro.email.draftById('one');+ const second = macro.email.draftById('two');+ const attachment = DraftAttachment.byId(macro._client, first, 'attachment');+ await expect(second.removeAttachment(attachment)).rejects.toThrow(+ 'another draft',+ );+ expect(requests).toBe(0);+});++test('scheduled draft iteration is lazy, keeps inbox selection, and stops on break', async () => {+ const requests: Request[] = [];+ globalThis.fetch = Object.assign(+ async (input: RequestInfo | URL) => {+ const request = input instanceof Request ? input : new Request(input);+ requests.push(request);+ const offset = new URL(request.url).searchParams.get('offset');+ return Response.json({+ messages:+ offset === '0' ? [{ db_id: 'draft-1' }, { db_id: 'draft-2' }] : [],+ });+ },+ { preconnect: originalFetch.preconnect },+ );+ const macro = new Macro({+ token: 'token',+ hosts: { email: 'https://email.test' },+ });+ const iterator = macro.email.scheduled({+ pageSize: 2,+ inbox: macro.email.link('secondary-inbox'),+ });+ expect(requests).toHaveLength(0);+ for await (const draft of iterator) {+ expect(draft.id).toBe('draft-1');+ break;+ }+ expect(requests).toHaveLength(1);+ expect(requests[0].headers.get('X-Email-Link-Id')).toBe('secondary-inbox');+ const all = await Array.fromAsync(+ macro.email.scheduled({+ pageSize: 2,+ inbox: macro.email.link('secondary-inbox'),+ }),+ );+ expect(all.map((d) => d.id)).toEqual(['draft-1', 'draft-2']);+ expect(new URL(requests[2].url).searchParams.get('offset')).toBe('2');+});++test('meeting mutations keep invitation lookup for channel and older meetings', async () => {+ const record: Meeting = {+ id: 'meeting-1',+ title: 'Standup',+ shareToken: 'invite-token',+ channelId: 'channel-1',+ callId: 'call-1',+ };+ const requests: Request[] = [];+ globalThis.fetch = Object.assign(+ async (input: RequestInfo | URL) => {+ const request = input instanceof Request ? input : new Request(input);+ requests.push(request);+ if (request.method === 'PATCH') record.title = 'New title';+ if (request.url.endsWith('/meetings'))+ return Response.json({ meetings: [] });+ return Response.json(record);+ },+ { preconnect: originalFetch.preconnect },+ );+ const macro = new Macro({+ token: 'token',+ webAppUrl: 'https://web.test',+ hosts: { storage: 'https://storage.test' },+ });+ const meeting = await macro.meetings.lookup('invite-token');+ expect((await meeting.channel())?.id).toBe('channel-1');+ await meeting.update({ title: 'New title' });+ expect(await meeting.title()).toBe('New title');+ expect(await meeting.webUrl()).toBe(+ 'https://web.test/app/meet/join/invite-token',+ );+ expect(requests.map((r) => new URL(r.url).pathname)).toEqual([+ '/call/join/invite-token',+ '/call/meetings/meeting-1',+ '/call/join/invite-token',+ ]);+});++const requestRecord: AccessRequest = {+ id: 'request-1',+ createdAt: '',+ updatedAt: '',+ requesterId: 'macro|[email protected]',+ requestedLevel: 'view',+ revision: 4,+ status: 'pending',+};+test('access resolution preserves the resolved snapshot when pending listings no longer include it', async () => {+ const writes: Request[] = [];+ let resolved = false;+ globalThis.fetch = Object.assign(+ async (input: RequestInfo | URL) => {+ const request = input instanceof Request ? input : new Request(input);+ if (request.method === 'POST') {+ writes.push(request);+ resolved = true;+ return Response.json({+ ...requestRecord,+ status: 'granted',+ revision: 5,+ grantedLevel: 'view',+ });+ }+ return Response.json({+ canReview: true,+ pendingCount: resolved ? 0 : 1,+ supportedLevels: ['view'],+ requests: resolved ? [] : [requestRecord],+ });+ },+ { preconnect: originalFetch.preconnect },+ );+ const macro = new Macro({+ token: 'token',+ hosts: { storage: 'https://storage.test' },+ });+ const access = macro.documents.byId('doc-1').access;+ const [request] = (await access.state()).requests;+ expect((await request.requester()).id).toBe(requestRecord.requesterId);+ await request.resolve('view');+ expect(await request.status()).toBe('granted');+ expect(await request.revision()).toBe(5);+ expect((await access.state()).requests).toHaveLength(0);+ expect(await writes[0].json()).toEqual({ revision: 4, grantedLevel: 'view' });+ expect(new URL(writes[0].url).pathname).toBe(+ '/entities/document/doc-1/access-requests/request-1/resolve',+ );+});++test('API key metadata serialization excludes creation secrets and deletion errors propagate', async () => {+ globalThis.fetch = Object.assign(+ async (input: RequestInfo | URL) => {+ const request = input instanceof Request ? input : new Request(input);+ if (request.method === 'DELETE')+ return Response.json({ error: 'denied' }, { status: 403 });+ return Response.json(+ { id: 'key-1', name: 'Automation', createdAt: '', key: 'mak_secret' },+ { status: 201 },+ );+ },+ { preconnect: originalFetch.preconnect },+ );+ const macro = new Macro({+ token: 'caller-token',+ hosts: { storage: 'https://storage.test' },+ });+ const created = await macro.apiKeys.create('Automation');+ expect(created.secret).toBe('mak_secret');+ expect(await created.key.name()).toBe('Automation');+ expect(JSON.stringify(created.key)).not.toContain('mak_secret');+ expect(JSON.stringify(created.key)).not.toContain('caller-token');+ await expect(created.key.delete()).rejects.toBeInstanceOf(MacroApiError);+});++test('pairing claims distinguish pending responses and expose credentials separately from handles', async () => {+ let pending = true;+ const requests: Request[] = [];+ globalThis.fetch = Object.assign(+ async (input: RequestInfo | URL) => {+ const request = input instanceof Request ? input : new Request(input);+ requests.push(request);+ if (request.url.endsWith('/claim'))+ return pending+ ? Response.json({ status: 'pending' }, { status: 202 })+ : Response.json({+ harness: { id: 'host-1', name: 'Laptop' },+ token: 'host-secret',+ });+ return Response.json(+ {+ pairing_id: 'pairing-1',+ code: 'CODE',+ device_secret: 'device-secret',+ expires_at: '',+ poll_interval_seconds: 5,+ },+ { status: 201 },+ );+ },+ { preconnect: originalFetch.preconnect },+ );+ const macro = new Macro({+ token: 'token',+ hosts: { storage: 'https://storage.test' },+ });+ const created = await macro.harnesses.createPairing({ name: 'Laptop' });+ expect(await created.device.claim(created.deviceSecret)).toBeUndefined();+ pending = false;+ const claimed = await created.device.claim(created.deviceSecret);+ expect(claimed?.harness.id).toBe('host-1');+ expect(claimed?.token).toBe('host-secret');+ expect(JSON.stringify(created.device)).not.toContain('device-secret');+ expect(JSON.stringify(claimed?.harness)).not.toContain('host-secret');+ expect(await requests[1].json()).toEqual({ device_secret: 'device-secret' });+});++const pipelineRecord: AccessiblePipeline = {+ id: 'pipeline-1',+ name: 'Sales',+ databaseId: 'database-1',+ tableId: 'table-1',+ primaryColumnId: 'column-1',+ recordType: 'company',+ sharing: 'team',+ grant: 'edit',+ teamId: 'team-1',+ userId: 'owner-1',+ createdAt: '',+ trashedAt: null,+};+const tableRecord: TableDetail = {+ table: {+ id: 'table-1',+ database_id: 'database-1',+ name: 'Sales',+ position: 'a',+ version: 1,+ },+ columns: [],+ views: [],+ sql_name: 'sales',+};+test('pipeline reads and ops stay under its sharing boundary and invalidate the shared table cache', async () => {+ const requests: Request[] = [];+ let version = 1;+ globalThis.fetch = Object.assign(+ async (input: RequestInfo | URL) => {+ const request = input instanceof Request ? input : new Request(input);+ requests.push(request);+ if (request.url.endsWith('/ops')) {+ version++;+ return Response.json({ results: [], changes: [] });+ }+ if (request.url.endsWith('/table'))+ return Response.json({+ ...tableRecord,+ table: { ...tableRecord.table, version },+ });+ if (request.url.includes('/rows'))+ return Response.json({+ version,+ rows: [{ rowId: 'row-1', cells: {} }],+ });+ return Response.json(pipelineRecord);+ },+ { preconnect: originalFetch.preconnect },+ );+ const macro = new Macro({+ token: 'token',+ hosts: { storage: 'https://storage.test' },+ });+ const pipeline = macro.crm.pipelines.byId('pipeline-1');+ expect(await pipeline.name()).toBe('Sales');+ const table = await pipeline.table();+ expect(await table.version()).toBe(1);+ expect(await table.version()).toBe(1);+ expect(requests).toHaveLength(2);+ await pipeline.applyOps([], { baseVersions: [{ table, version: 1 }] });+ expect(await table.version()).toBe(2);+ expect(await requests[2].json()).toEqual({+ ops: [],+ baseVersions: { 'table-1': 1 },+ });+ const [row] = await Array.fromAsync(+ pipeline.queryRows({ rows: [table.rowById('row-1')] }),+ );+ expect(await row.cells()).toEqual({});+ expect(row.pipeline).toBe(pipeline);+ expect(JSON.stringify(row)).toContain('"pipelineId":"pipeline-1"');+ expect(+ requests.every((r) =>+ new URL(r.url).pathname.startsWith('/crm/pipelines/pipeline-1'),+ ),+ ).toBe(true);+ const before = requests.length;+ await expect(+ macro.crm.pipelines+ .byId('pipeline-2')+ .applyOps([], { baseVersions: [{ table, version: 2 }] }),+ ).rejects.toThrow('another pipeline');+ expect(requests).toHaveLength(before);+});++test('typed sharing grants translate channel handles and preserve explicit grant clearing', async () => {+ const writes: Request[] = [];+ globalThis.fetch = Object.assign(+ async (input: RequestInfo | URL) => {+ const request = input instanceof Request ? input : new Request(input);+ writes.push(request);+ return Response.json({ id: 'permissions-1', owner: 'owner' });+ },+ { preconnect: originalFetch.preconnect },+ );+ const macro = new Macro({+ token: 'token',+ hosts: {+ 'agent-harness': 'https://agents.test',+ storage: 'https://storage.test',+ },+ });+ await macro.agentSessions.byId('session-1').updateSharePermissions({+ channelSharePermissions: [+ {+ channel: macro.channels.byId('channel-1'),+ operation: 'add',+ accessLevel: 'view',+ },+ ],+ });+ expect(await writes[0].json()).toEqual({+ channelSharePermissions: [+ { channelId: 'channel-1', operation: 'add', accessLevel: 'view' },+ ],+ });+ await macro.crm.pipelines+ .byId('pipeline-1')+ .updateSharePermissions({ channelSharePermissions: null });+ expect(await writes[1].json()).toEqual({ channelSharePermissions: null });+});++test('team slug lookup validates the actual document response rather than trusting the colliding generated schema', async () => {+ let malformed = false;+ globalThis.fetch = Object.assign(+ async () =>+ Response.json(+ malformed+ ? { data: { items: [] } }+ : { data: { documentMetadata: { documentId: 'task-1' } } },+ ),+ { preconnect: originalFetch.preconnect },+ );+ const macro = new Macro({+ token: 'token',+ hosts: { storage: 'https://storage.test' },+ });+ expect((await macro.documents.byTeamSlug('ENG-42')).id).toBe('task-1');+ malformed = true;+ await expect(macro.documents.byTeamSlug('ENG-42')).rejects.toThrow(+ 'Invalid team task document response',+ );+});++test('chat send receipts expose a scoped response message and cancellation never retries', async () => {+ const requests: Request[] = [];+ globalThis.fetch = Object.assign(+ async (input: RequestInfo | URL) => {+ const request = input instanceof Request ? input : new Request(input);+ requests.push(request);+ if (request.url.endsWith('/stop'))+ return Response.json({ error: 'forbidden' }, { status: 403 });+ if (request.method === 'GET')+ return Response.json({+ chat: {+ messages: [+ {+ id: 'response-1',+ content: 'Hello',+ role: 'assistant',+ attachments: [],+ },+ ],+ },+ });+ return Response.json({+ chat_id: 'chat-1',+ message_id: 'response-1',+ stream_id: 'stream-1',+ });+ },+ { preconnect: originalFetch.preconnect },+ );+ const macro = new Macro({+ token: 'token',+ hosts: { cognition: 'https://ai.test' },+ });+ const generation = await macro.chats.byId('chat-1').send({+ content: 'Hello',+ model: 'model',+ toolset: { type: 'none' },+ attachments: [{ type: 'document', entity: macro.documents.byId('doc-1') }],+ });+ expect(generation.chat.id).toBe('chat-1');+ expect(generation.message.id).toBe('response-1');+ expect(await generation.message.content()).toBe('Hello');+ expect(await requests[0].json()).toEqual({+ chat_id: 'chat-1',+ content: 'Hello',+ model: 'model',+ toolset: { type: 'none' },+ attachments: [{ entity_id: 'doc-1', entity_type: 'document' }],+ });+ await expect(generation.stop()).rejects.toBeInstanceOf(MacroApiError);+ expect(requests).toHaveLength(3);+ expect(await requests[2].json()).toEqual({+ chat_id: 'chat-1',+ stream_id: 'stream-1',+ });+});diff --git a/packages/sdk/tests/backlog-timeline.test.ts b/packages/sdk/tests/backlog-timeline.test.tsnew file mode 100644index 0000000000..48cf74cb92--- /dev/null+++ b/packages/sdk/tests/backlog-timeline.test.ts@@ -0,0 +1,124 @@+import { afterEach, expect, test } from 'bun:test';+import type { MessageListItem } from '../generated/storage/types.gen';+import { Macro } from '../src/macro';++const originalFetch = globalThis.fetch;+afterEach(() => {+ globalThis.fetch = originalFetch;+});+const message: MessageListItem = {+ id: 'message-1',+ parent: { type: 'channel', id: 'channel-1' },+ sender_id: 'owner-1',+ content: 'Snapshot content',+ created_at: '',+ updated_at: '',+ mentions: [],+ reactions: [],+ attachments: [],+ state: {+ root_id: 'message-1',+ resolved: false,+ user_id: 'owner-1',+ created_at: '',+ updated_at: '',+ },+ thread: { reply_count: 0, preview: [] },+};+test('mixed timeline seeds typed messages without refetching and maps typed selectors', async () => {+ const requests: Request[] = [];+ globalThis.fetch = Object.assign(+ async (input: RequestInfo | URL) => {+ const request = input instanceof Request ? input : new Request(input);+ requests.push(request);+ return Response.json({+ entries: [+ { type: 'message', message },+ {+ type: 'activity',+ activity: {+ id: 'activity-1',+ actor_id: 'actor-1',+ action: 'updated',+ occurred_at: '',+ },+ },+ ],+ });+ },+ { preconnect: originalFetch.preconnect },+ );+ const macro = new Macro({+ token: 'token',+ hosts: { storage: 'https://storage.test' },+ });+ const channel = macro.channels.byId('channel-1');+ const page = await channel.timelinePage({+ messages: [channel.message('message-1')],+ includeDeletedThreads: true,+ activityAfter: '2026-10-01T00:00:00Z',+ });+ const first = page.entries[0];+ if (first.type !== 'message') throw new Error('Expected message');+ expect(await first.message.content()).toBe('Snapshot content');+ const second = page.entries[1];+ if (second.type !== 'activity') throw new Error('Expected activity');+ expect(second.activity.actor.id).toBe('actor-1');+ expect(requests).toHaveLength(1);+ expect(+ JSON.parse(new URL(requests[0].url).searchParams.get('selection') ?? '{}'),+ ).toEqual({+ ids: ['message-1'],+ include_deleted_threads: true,+ activity_after: '2026-10-01T00:00:00Z',+ });+ await expect(+ channel.timelinePage({+ around: macro.channels.byId('other-channel').message('message-1'),+ }),+ ).rejects.toThrow('another resource');+ expect(requests).toHaveLength(1);+});++test('thread mutation paths retain document parent scope across cache invalidation', async () => {+ const requests: Request[] = [];+ let resolved = false;+ globalThis.fetch = Object.assign(+ async (input: RequestInfo | URL) => {+ const request = input instanceof Request ? input : new Request(input);+ requests.push(request);+ if (request.method === 'PATCH') resolved = true;+ const state = {+ root_id: 'thread-1',+ resolved,+ user_id: 'owner',+ created_at: '',+ updated_at: '',+ };+ return Response.json(+ request.method === 'GET' ? { state, root: {}, replies: [] } : state,+ );+ },+ { preconnect: originalFetch.preconnect },+ );+ const macro = new Macro({+ token: 'token',+ hosts: { storage: 'https://storage.test' },+ });+ const thread = macro.documents.byId('doc-1').messageThreadById('thread-1');+ expect(await thread.resolved()).toBe(false);+ await thread.update({ resolved: true, nonce: 'operation-1' });+ expect(await thread.resolved()).toBe(true);+ await thread.delete('operation-2');+ expect(+ requests.every(+ (r) =>+ new URL(r.url).pathname === '/messages/document/doc-1/threads/thread-1',+ ),+ ).toBe(true);+ expect(await requests[1].json()).toEqual({+ resolved: true,+ nonce: 'operation-1',+ });+ expect(JSON.stringify(thread)).toContain('"parentId":"doc-1"');+});diff --git a/packages/sdk/tests/database-query.test.ts b/packages/sdk/tests/database-query.test.tsnew file mode 100644index 0000000000..63974cc19d--- /dev/null+++ b/packages/sdk/tests/database-query.test.ts@@ -0,0 +1,204 @@+import { afterEach, expect, test } from 'bun:test';+import { DatabaseTable } from '../src/entities/databases/table';+import { Macro } from '../src/macro';++const originalFetch = globalThis.fetch;++afterEach(() => {+ globalThis.fetch = originalFetch;+});++const selected = {+ tableDatabases: { 'table-1': 'db-1', 'table-2': 'db-2' },+ result: {+ sourceTable: 'table-1',+ columns: [{ name: 'Name', kind: 'text', relatedTable: 'table-2' }],+ rows: [[{ type: 'text', value: 'Sam' }]],+ rowIds: ['row-1'],+ },+ changesApplied: 0,+ insertedRowIds: [],+ newVersions: {},+ readVersions: { 'table-1': 3, 'table-2': 8 },+ truncatedTables: ['Guests'],+ statement: { kind: 'select' },+};++test('SQL queries hydrate source rows, cross-database relations and reusable version guards', async () => {+ const requests: Request[] = [];+ globalThis.fetch = Object.assign(+ async (input: RequestInfo | URL) => {+ const request = input instanceof Request ? input : new Request(input);+ requests.push(request);+ return Response.json(selected);+ },+ { preconnect: originalFetch.preconnect },+ );+ const macro = new Macro({+ token: 'token',+ hosts: { storage: 'https://storage.test' },+ });+ const database = macro.databases.byId('db-1');+ const result = await database.query('SELECT Name FROM Guests');+ expect(new URL(requests[0].url).pathname).toBe('/databases/query');+ expect(requests[0].headers.get('Authorization')).toBe('Bearer token');+ expect(await requests[0].json()).toEqual({+ sql: 'SELECT Name FROM Guests',+ databaseId: 'db-1',+ baseVersions: {},+ });+ expect(result.result?.rowHandles[0].table.database).toBe(database);+ expect(result.result?.rowHandles[0].id).toBe('row-1');+ expect(result.result?.columns[0].relatedTable?.database.id).toBe('db-2');+ expect(+ result.readVersions.map(({ table, version }) => [+ table.id,+ table.database.id,+ version,+ ]),+ ).toEqual([+ ['table-1', 'db-1', 3],+ ['table-2', 'db-2', 8],+ ]);+ expect(result.truncatedTables).toEqual(['Guests']);+ await macro.databases.query('SELECT Name FROM Guests', {+ database,+ baseVersions: result.readVersions,+ });+ expect(await requests[1].json()).toEqual({+ sql: 'SELECT Name FROM Guests',+ databaseId: 'db-1',+ baseVersions: { 'table-1': 3, 'table-2': 8 },+ });+});++test('successful SQL writes return inserted row handles and invalidate the scoped schema', async () => {+ let reads = 0;+ let writes = 0;+ globalThis.fetch = Object.assign(+ async (input: RequestInfo | URL) => {+ const request = input instanceof Request ? input : new Request(input);+ if (request.method === 'GET') {+ reads++;+ return Response.json({+ database: { id: 'db-1', name: reads === 1 ? 'Before' : 'After' },+ tables: [],+ });+ }+ writes++;+ if (writes === 2)+ return Response.json({ message: 'Unavailable' }, { status: 503 });+ return Response.json({+ ...selected,+ result: null,+ changesApplied: 1,+ insertedRowIds: ['new-row'],+ newVersions: { 'table-1': 4 },+ statement: { kind: 'insert', tableId: 'table-1', tableName: 'Guests' },+ });+ },+ { preconnect: originalFetch.preconnect },+ );+ const macro = new Macro({ token: 'token' });+ const database = macro.databases.byId('db-1');+ expect(await database.name()).toBe('Before');+ const result = await database.query(+ "INSERT INTO Guests (Name) VALUES ('Sam')",+ );+ expect(result.insertedRows[0].id).toBe('new-row');+ expect(result.insertedRows[0].table.database).toBe(database);+ expect(result.newVersions[0].version).toBe(4);+ expect(await database.name()).toBe('After');+ await expect(+ database.query("INSERT INTO Guests (Name) VALUES ('Lee')"),+ ).rejects.toThrow();+ expect(await database.name()).toBe('After');+ expect(reads).toBe(2);+ expect(writes).toBe(2);+});++test('SQL aggregates and virtual people results do not invent database row handles', async () => {+ globalThis.fetch = Object.assign(+ async () =>+ Response.json({+ ...selected,+ tableDatabases: {},+ result: {+ columns: [{ name: 'count', kind: 'number' }],+ rows: [[{ type: 'number', value: 2 }]],+ rowIds: [],+ },+ readVersions: {},+ }),+ { preconnect: originalFetch.preconnect },+ );+ const macro = new Macro({ token: 'token' });+ const result = await macro.databases.query(+ 'SELECT COUNT(*) FROM macro.people',+ );+ expect(result.result?.sourceTable).toBeUndefined();+ expect(result.result?.rowHandles).toEqual([]);+ expect(result.result?.rows).toEqual([[{ type: 'number', value: 2 }]]);+});++test('SQL writes invalidate equivalent database handles without replacing the scoped handle', async () => {+ let written = false;+ globalThis.fetch = Object.assign(+ async (input: RequestInfo | URL) => {+ const request = input instanceof Request ? input : new Request(input);+ if (request.method === 'GET')+ return Response.json({+ database: { id: 'db-1', name: written ? 'After' : 'Before' },+ tables: [],+ });+ written = true;+ return Response.json({+ ...selected,+ result: null,+ changesApplied: 1,+ newVersions: { 'table-1': 4 },+ statement: { kind: 'update', tableId: 'table-1', tableName: 'Guests' },+ });+ },+ { preconnect: originalFetch.preconnect },+ );+ const macro = new Macro({ token: 'token' });+ const scoped = macro.databases.byId('db-1');+ const other = macro.databases.byId('db-1');+ expect(await scoped.name()).toBe('Before');+ expect(await other.name()).toBe('Before');+ const result = await scoped.query('UPDATE Guests SET Name = Name', {+ baseVersions: [{ table: DatabaseTable.byId(other, 'table-1'), version: 3 }],+ });+ expect(+ result.statement.kind === 'update' && result.statement.table.database,+ ).toBe(scoped);+ expect(await scoped.name()).toBe('After');+ expect(await other.name()).toBe('After');+});++test('zero-match SQL writes return a typed target without fabricating changed versions', async () => {+ globalThis.fetch = Object.assign(+ async () =>+ Response.json({+ tableDatabases: { 'table-1': 'db-1' },+ result: null,+ changesApplied: 0,+ insertedRowIds: [],+ newVersions: {},+ readVersions: {},+ truncatedTables: [],+ statement: { kind: 'delete', tableId: 'table-1', tableName: 'Guests' },+ }),+ { preconnect: originalFetch.preconnect },+ );+ const macro = new Macro({ token: 'token' });+ const result = await macro.databases.query(+ "DELETE FROM Guests WHERE Name = 'Nobody'",+ );+ expect(result.changesApplied).toBe(0);+ expect(result.newVersions).toEqual([]);+ expect(result.statement.kind === 'delete' && result.statement.table.id).toBe(+ 'table-1',+ );+});diff --git a/packages/sdk/tests/messages.test.ts b/packages/sdk/tests/messages.test.tsindex 58e84d08b2..5a74a1b0b5 100644--- a/packages/sdk/tests/messages.test.ts+++ b/packages/sdk/tests/messages.test.ts@@ -80,91 +80,89 @@ function macro() {}describe('shared message API contracts', () => {- test.each([callId, replyId])(- 'call message events hydrate call handles and keep replies in the call thread (%s)',- async (messageId) => {- const parent = { type: 'call', id: callId } as const;- const path = `/messages/call/${callId}`;- let record = message({- id: messageId,- parent,- thread_id: messageId === callId ? null : callId,- });- const requests = serve(async (request) => {- const url = new URL(request.url);- if (url.pathname === `${path}/items/${messageId}`) {- if (request.method === 'PATCH') {- record = { ...record, ...(await request.json()) };- }- if (request.method === 'DELETE') {- record = { ...record, deleted_at: timestamp, content: '' };- }- return Response.json(record);+ test.each([+ callId,+ replyId,+ ])('call message events hydrate call handles and keep replies in the call thread (%s)', async (messageId) => {+ const parent = { type: 'call', id: callId } as const;+ const path = `/messages/call/${callId}`;+ let record = message({+ id: messageId,+ parent,+ thread_id: messageId === callId ? null : callId,+ });+ const requests = serve(async (request) => {+ const url = new URL(request.url);+ if (url.pathname === `${path}/items/${messageId}`) {+ if (request.method === 'PATCH') {+ record = { ...record, ...(await request.json()) };}- if (url.pathname === path && request.method === 'POST') {- const body = await request.json();- expect(body.thread_id).toBe(callId);- return Response.json(- message({ ...body, parent, id: rootId, thread_id: callId })- );+ if (request.method === 'DELETE') {+ record = { ...record, deleted_at: timestamp, content: '' };}- return new Response(null, { status: 404 });- });- const client = macro();- const event = hydrateMessageEvent(client._client, {- event_type: 'message.posted',- metadata: {- parent,- root_id: callId,- message_id: messageId,- thread_id: record.thread_id,- content: record.content,- sender: record.sender_id,- created_at: timestamp,- attachments: [],- mentions: [],- },- });- if (event.target.type !== 'call') throw new Error(event.target.type);- expect(requests).toHaveLength(0);- expect(event.target.call.id).toBe(callId);- expect(event.target.threadId).toBe(callId);- expect(event.target.message.id).toBe(messageId);- expect(event.target.message.call().id).toBe(callId);- expect(client.calls.byId(callId).message(messageId).callId).toBe(callId);- await expect(event.target.message.content()).resolves.toBe(- record.content- );- expect((await event.target.message.author()).id).toBe(record.sender_id);+ return Response.json(record);+ }+ if (url.pathname === path && request.method === 'POST') {+ const body = await request.json();+ expect(body.thread_id).toBe(callId);+ return Response.json(+ message({ ...body, parent, id: rootId, thread_id: callId }),+ );+ }+ return new Response(null, { status: 404 });+ });+ const client = macro();+ const event = hydrateMessageEvent(client._client, {+ event_type: 'message.posted',+ metadata: {+ parent,+ root_id: callId,+ message_id: messageId,+ thread_id: record.thread_id,+ content: record.content,+ sender: record.sender_id,+ created_at: timestamp,+ attachments: [],+ mentions: [],+ },+ });+ if (event.target.type !== 'call') throw new Error(event.target.type);+ expect(requests).toHaveLength(0);+ expect(event.target.call.id).toBe(callId);+ expect(event.target.threadId).toBe(callId);+ expect(event.target.message.id).toBe(messageId);+ expect(event.target.message.call().id).toBe(callId);+ expect(client.calls.byId(callId).message(messageId).callId).toBe(callId);+ await expect(event.target.message.content()).resolves.toBe(record.content);+ expect((await event.target.message.author()).id).toBe(record.sender_id);- await event.target.message.edit('Edited call message');- await expect(event.target.message.content()).resolves.toBe(- 'Edited call message'- );- const body = msg`Thanks ${client.users.byId('macro|[email protected]')}`;- const reply = await event.target.message.reply(body);- expect(reply.callId).toBe(callId);- await expect(reply.content()).resolves.toBe(body.content);- await event.target.message.delete();+ await event.target.message.edit('Edited call message');+ await expect(event.target.message.content()).resolves.toBe(+ 'Edited call message',+ );+ const body = msg`Thanks ${client.users.byId('macro|[email protected]')}`;+ const reply = await event.target.message.reply(body);+ expect(reply.callId).toBe(callId);+ await expect(reply.content()).resolves.toBe(body.content);+ await event.target.message.delete();- expect(- requests.map((request) => [- request.method,- new URL(request.url).pathname,- ])- ).toEqual([- ['GET', `${path}/items/${messageId}`],- ['PATCH', `${path}/items/${messageId}`],- ['GET', `${path}/items/${messageId}`],- ['POST', path],- ['DELETE', `${path}/items/${messageId}`],- ]);- await expect(requests[3]?.json()).resolves.toMatchObject({- ...body,- thread_id: callId,- });- }- );+ expect(+ requests.map((request) => [+ request.method,+ new URL(request.url).pathname,+ ]),+ ).toEqual([+ ['GET', `${path}/items/${messageId}`],+ ['PATCH', `${path}/items/${messageId}`],+ ['GET', `${path}/items/${messageId}`],+ ['POST', path],+ ['DELETE', `${path}/items/${messageId}`],+ ]);+ await expect(requests[3]?.json()).resolves.toMatchObject({+ ...body,+ thread_id: callId,+ });+ });test('channel posts, lazy reads, edits, reactions, and deletes use message routes', async () => {let record = message();@@ -215,8 +213,8 @@ describe('shared message API contracts', () => {]);expect(requests.every(- (r) => r.headers.get('authorization') === 'Bearer user-token'- )+ (r) => r.headers.get('authorization') === 'Bearer user-token',+ ),).toBe(true);await expect(requests[0]?.json()).resolves.toMatchObject(body);await expect(requests[4]?.json()).resolves.toEqual({@@ -382,7 +380,7 @@ describe('shared message API contracts', () => {id: `reply-${index}`,thread_id: rootId,content: `Reply ${index}`,- })+ }),);const full = thread(root, replies);const cursor = { id: root.id, created_at: timestamp };@@ -398,7 +396,7 @@ describe('shared message API contracts', () => {return Response.json(selection.cursor? { items: [listItem(thread(secondRoot))], next_cursor: null }- : { items: [listItem(full)], next_cursor: cursor }+ : { items: [listItem(full)], next_cursor: cursor },);}return new Response(null, { status: 404 });@@ -437,7 +435,7 @@ describe('shared message API contracts', () => {if (url.pathname === path && request.method === 'POST') {const body = await request.json();return Response.json(- body.thread_id ? reply : { ...root, content: body.content }+ body.thread_id ? reply : { ...root, content: body.content },);}if (url.pathname === `${path}/items/${replyId}`) {@@ -464,7 +462,7 @@ describe('shared message API contracts', () => {const writes = requests.filter((request) => request.method !== 'GET');expect(- writes.map((request) => [request.method, new URL(request.url).pathname])+ writes.map((request) => [request.method, new URL(request.url).pathname]),).toEqual([['POST', path],['POST', path],@@ -482,7 +480,7 @@ describe('shared message API contracts', () => {const parent = { type: 'crm_contact', id: contactId } as const;const path = `/messages/crm_contact/${contactId}`;const requests = serve(() =>- Response.json(message({ parent, content: 'Met at the conference' }))+ Response.json(message({ parent, content: 'Met at the conference' })),);const comment = await macro().crm.contactById(contactId)@@ -517,7 +515,7 @@ describe('shared message API contracts', () => {await user.channels.byId(channelId).send('User bot');expect(requests[3]?.headers.get('x-macro-bot-scope')).toBe('user');await expect(- user.channels.byId(channelId).message(rootId).reply('Reply')+ user.channels.byId(channelId).message(rootId).reply('Reply'),).rejects.toThrow('does not support threads');expect(requests).toHaveLength(4);});diff --git a/packages/sdk/tests/review-regressions.test.ts b/packages/sdk/tests/review-regressions.test.tsnew file mode 100644index 0000000000..0b0266a4d2--- /dev/null+++ b/packages/sdk/tests/review-regressions.test.ts@@ -0,0 +1,122 @@+import { afterEach, expect, test } from 'bun:test';+import { Macro } from '../src/macro';++const originalFetch = globalThis.fetch;++afterEach(() => {+ globalThis.fetch = originalFetch;+});++test('scheduled drafts clamp page size and advance by the actual request limit', async () => {+ const queries: URLSearchParams[] = [];+ globalThis.fetch = Object.assign(+ async (input: RequestInfo | URL) => {+ const request = input instanceof Request ? input : new Request(input);+ const query = new URL(request.url).searchParams;+ queries.push(query);+ return Response.json({+ messages:+ query.get('offset') === '0'+ ? Array.from({ length: 1000 }, (_, i) => ({ db_id: `draft-${i}` }))+ : [],+ });+ },+ { preconnect: originalFetch.preconnect },+ );+ const macro = new Macro({+ token: 'token',+ hosts: { storage: 'https://storage.test' },+ });+ expect(+ await Array.fromAsync(macro.email.scheduled({ pageSize: 2000 })),+ ).toHaveLength(1000);+ expect(queries.map((q) => [q.get('offset'), q.get('limit')])).toEqual([+ ['0', '1000'],+ ['1000', '1000'],+ ]);+ for (const pageSize of [0, -1, 1.5, Number.NaN, Number.POSITIVE_INFINITY]) {+ await expect(+ Array.fromAsync(macro.email.scheduled({ pageSize })),+ ).rejects.toThrow('pageSize must be positive');+ }+ expect(queries).toHaveLength(2);+});++test('reminders and team calendar replace relation IDs with handles', async () => {+ globalThis.fetch = Object.assign(+ async (input: RequestInfo | URL) => {+ const request = input instanceof Request ? input : new Request(input);+ if (new URL(request.url).pathname === '/reminders/email/collection') {+ return Response.json({+ items: [{ threadId: 'thread-1', title: 'Follow up' }],+ });+ }+ return Response.json({+ items: [{ ownerId: 'user-1', title: 'Busy' }],+ members: [],+ });+ },+ { preconnect: originalFetch.preconnect },+ );+ const macro = new Macro({+ token: 'token',+ hosts: { storage: 'https://storage.test' },+ });+ const [reminder] = await Array.fromAsync(macro.email.reminders());+ expect(reminder.thread.id).toBe('thread-1');+ expect(reminder).not.toHaveProperty('threadId');+ const page = await macro.calendar.teamPage({+ start: '2026-10-20T00:00:00Z',+ end: '2026-10-21T00:00:00Z',+ });+ expect(page.items[0].owner.id).toBe('user-1');+ expect(page.items[0]).not.toHaveProperty('ownerId');+ expect(page.items[0]).toHaveProperty('title', 'Busy');+});++test('access resolution accepts equivalent handles and rejects different entities', async () => {+ const requests: Request[] = [];+ globalThis.fetch = Object.assign(+ async (input: RequestInfo | URL) => {+ const request = input instanceof Request ? input : new Request(input);+ requests.push(request);+ const record = {+ id: 'request-1',+ requesterId: 'user-1',+ requestedLevel: 'view',+ revision: 1,+ status: 'pending',+ createdAt: '',+ updatedAt: '',+ };+ return Response.json(+ request.method === 'GET'+ ? {+ requests: [record],+ canReview: true,+ pendingCount: 1,+ supportedLevels: ['view'],+ }+ : { ...record, status: 'granted', revision: 2 },+ );+ },+ { preconnect: originalFetch.preconnect },+ );+ const macro = new Macro({+ token: 'token',+ hosts: { storage: 'https://storage.test' },+ });+ const [request] = (await macro.documents.byId('doc-1').access.state())+ .requests;+ await macro.documents+ .byId('doc-1')+ .access.resolve(request, { revision: 1, grantedLevel: 'view' });+ expect(requests[1].method).toBe('POST');+ await expect(+ macro.documents.byId('doc-2').access.resolve(request, { revision: 1 }),+ ).rejects.toThrow('another entity');+ await expect(+ macro.chats.byId('doc-1').access.resolve(request, { revision: 1 }),+ ).rejects.toThrow('another entity');+ expect(requests).toHaveLength(2);+});diff --git a/packages/sdk/tests/routines.test.ts b/packages/sdk/tests/routines.test.tsnew file mode 100644index 0000000000..742975c9a6--- /dev/null+++ b/packages/sdk/tests/routines.test.ts@@ -0,0 +1,141 @@+import { afterEach, expect, test } from 'bun:test';+import type { ScheduledActionResponse } from '../generated/scheduled-action/types.gen';+import { Macro } from '../src/macro';+import { MacroApiError } from '../src/utils';++const originalFetch = globalThis.fetch;+afterEach(() => {+ globalThis.fetch = originalFetch;+});+const record: ScheduledActionResponse = {+ id: 'routine-1',+ name: 'Daily report',+ kind: 'Agent',+ enabled: true,+ configuration_revision: 1,+ owner: 'macro|[email protected]',+ created_at: '2026-10-19T00:00:00Z',+ updated_at: '2026-10-19T00:00:00Z',+ trigger: { type: 'cron', schedule: '0 9 * * *', timezone: 'UTC' },+ task: { prompt: 'Summarize', user_prompt: 'Daily summary' },+};+test('routine creation maps agent handles, seeds detail and uses shared auth and observation', async () => {+ const requests: Request[] = [];+ const events: string[] = [];+ globalThis.fetch = Object.assign(+ async (input: RequestInfo | URL) => {+ const request = input instanceof Request ? input : new Request(input);+ requests.push(request);+ return Response.json(record, { status: 201 });+ },+ { preconnect: originalFetch.preconnect },+ );+ const macro = new Macro({+ auth: { type: 'bot', token: 'mbot_test' },+ requestedAs: record.owner,+ hosts: { 'scheduled-action': 'https://routines.test' },+ onRequest: (e) => events.push(`${e.service}.${e.operation}:${e.status}`),+ });+ const routine = await macro.routines.create({+ name: 'Daily report',+ trigger: { type: 'cron', schedule: '0 9 * * *', timezone: 'UTC' },+ prompt: 'Summarize',+ userPrompt: 'Daily summary',+ agent: macro.agents.byId('agent-1'),+ });+ expect(await routine.name()).toBe('Daily report');+ expect((await routine.owner()).id).toBe(record.owner);+ expect(requests).toHaveLength(1);+ expect(await requests[0].json()).toEqual({+ name: 'Daily report',+ kind: 'Agent',+ enabled: true,+ trigger: record.trigger,+ task: {+ prompt: 'Summarize',+ user_prompt: 'Daily summary',+ agent: { bot_id: 'agent-1' },+ },+ });+ expect(requests[0].headers.get('x-macro-bot-token')).toBe('mbot_test');+ expect(requests[0].headers.get('x-macro-bot-for-macro-user-id')).toBe(+ record.owner,+ );+ expect(events).toEqual([+ 'scheduled-action.createScheduledAction:started',+ 'scheduled-action.createScheduledAction:completed',+ ]);+ expect(JSON.stringify(routine)).not.toContain('mbot_test');+});+test('routine writes invalidate detail only after success', async () => {+ let enabled = true;+ let reads = 0;+ let reject = false;+ globalThis.fetch = Object.assign(+ async (input: RequestInfo | URL) => {+ const request = input instanceof Request ? input : new Request(input);+ if (request.method !== 'GET') {+ if (reject)+ return Response.json({ error: 'forbidden' }, { status: 403 });+ enabled = false;+ return Response.json({ ...record, enabled });+ }+ reads++;+ return Response.json({ ...record, enabled });+ },+ { preconnect: originalFetch.preconnect },+ );+ const routine = new Macro({+ token: 'user',+ hosts: { 'scheduled-action': 'https://routines.test' },+ }).routines.byId('routine-1');+ expect(reads).toBe(0);+ expect(await routine.enabled()).toBe(true);+ expect(await routine.enabled()).toBe(true);+ expect(reads).toBe(1);+ await routine.setEnabled(false);+ expect(await routine.enabled()).toBe(false);+ expect(reads).toBe(2);+ reject = true;+ await expect(routine.setEnabled(true)).rejects.toBeInstanceOf(MacroApiError);+ expect(await routine.enabled()).toBe(false);+ expect(reads).toBe(2);+});+test('routine execution returns typed transcript handles and scoped history', async () => {+ let resource: 'agent' | 'chat' = 'agent';+ globalThis.fetch = Object.assign(+ async (input: RequestInfo | URL) => {+ const request = input instanceof Request ? input : new Request(input);+ if (request.url.endsWith('/history'))+ return Response.json([+ {+ id: 'run-1',+ action_id: 'routine-1',+ created_at: '',+ start_time: '',+ end_time: '',+ is_success: true,+ result: {},+ },+ ]);+ return Response.json({+ action_id: 'routine-1',+ resource: { type: resource, id: 'transcript-1' },+ });+ },+ { preconnect: originalFetch.preconnect },+ );+ const routine = new Macro({+ token: 'user',+ hosts: { 'scheduled-action': 'https://routines.test' },+ }).routines.byId('routine-1');+ const agent = await routine.execute();+ expect(agent?.id).toBe('transcript-1');+ expect(agent && 'prompt' in agent).toBe(true);+ resource = 'chat';+ const chat = await routine.execute();+ expect(chat && 'history' in chat).toBe(true);+ const [run] = await routine.history();+ expect(run.routine).toBe(routine);+ expect(run.id).toBe('run-1');+});diff --git a/services/document_storage_service/AGENTS.md b/services/document_storage_service/AGENTS.mdindex c943d256ee..fa7c698c7b 100644--- a/services/document_storage_service/AGENTS.md+++ b/services/document_storage_service/AGENTS.md@@ -11,6 +11,7 @@ threads, pins, recents, notifications, folders, activity.- `src/api.rs`: route module list — `documents`, `items`, `entity`,`folders_query`, `graphql_soup`, `threads`, `annotations`, `history`,`pins`, `recents`, `notification`, `instructions`, `internal`.+- `/databases/query` mounts the `databases_sql` HTTP adapter, sharing the database/access services and the primary Soup reader; SQL authorization stays in its domain service.- `src/api/graphql_soup.rs`: the `/soup/graphql` (+ `/soup/graphql/ws`subscriptions) GraphQL API — the frontend's main read path for Home/Recent/search ("Soup" items); see `crates/graphql_soup` for resolvers/loaders.diff --git a/services/document_storage_service/Cargo.toml b/services/document_storage_service/Cargo.tomlindex ab022e9db9..5cac998fe7 100644--- a/services/document_storage_service/Cargo.toml+++ b/services/document_storage_service/Cargo.toml@@ -98,6 +98,7 @@ channel_labels = { path = "../../crates/channel_labels", features = ["postgres",] }crm = { path = "../../crates/crm" }+databases_sql = { path = "../../crates/databases_sql", features = ["inbound"] }databases = { path = "../../crates/databases", features = ["entity_mutation","gateway",diff --git a/services/document_storage_service/src/api.rs b/services/document_storage_service/src/api.rsindex 21d7accce7..79ef33d1d6 100644--- a/services/document_storage_service/src/api.rs+++ b/services/document_storage_service/src/api.rs@@ -289,6 +289,9 @@ fn api_router(state: ApiContext) -> Router {.nest("/databases",databases::inbound::axum_router::databases_router(state.databases_state.clone())+ .merge(databases_sql::inbound::axum_router::sql_router(+ state.sql_state.clone(),+ )).merge(databases::inbound::starter_router::starter_router(state.database_starter_state.clone(),))diff --git a/services/document_storage_service/src/api/context.rs b/services/document_storage_service/src/api/context.rsindex 76e69bb1c6..c799221be6 100644--- a/services/document_storage_service/src/api/context.rs+++ b/services/document_storage_service/src/api/context.rs@@ -577,6 +577,18 @@ pub(crate) type DssUserApiKeyState =pub(crate) type DatabasesServiceType =PgDatabasesService<GatewayTableEventPublisher, DssEventBroker, EntityAccessService>;+/// HTTP SQL queries over the same database, access and Soup services.+pub(crate) type DssSqlState = databases_sql::inbound::axum_router::SqlRouterState<+ DatabasesServiceType,+ EntityAccessService,+ DssSoupService,+ contacts::domain::service::ContactsDomainService<+ contacts::outbound::repository::DbContactsRepository,+ Option<contacts::outbound::gateway::ConnectionGatewayNotifier>,+ >,+ AuthorizationService,+>;+/// Type alias for the databases router state.pub(crate) type DssDatabasesState =DatabasesRouterState<DatabasesServiceType, EntityAccessService, AuthorizationService>;@@ -859,6 +871,7 @@ pub(crate) struct ApiContext {pub graphql_primary_soup_item_loader: graphql_soup::PrimarySoupItemLoader,pub graphql_soup_item_loader: graphql_soup::SoupItemDataLoader,pub databases_state: DssDatabasesState,+ pub sql_state: DssSqlState,pub database_webhooks_state: DssDatabaseWebhooksState,pub forms_state: DssFormsState,pub database_starter_state: DssDatabaseStarterState,diff --git a/services/document_storage_service/src/api/swagger.rs b/services/document_storage_service/src/api/swagger.rsindex b15ce510f9..60fe5b6a7b 100644--- a/services/document_storage_service/src/api/swagger.rs+++ b/services/document_storage_service/src/api/swagger.rs@@ -463,6 +463,7 @@ use utoipa::OpenApi;initiative::inbound::axum_router::update::update_initiative_handler,initiative::inbound::axum_router::delete::delete_initiative_handler,// databases+ databases_sql::inbound::axum_router::query_databases_handler,databases::inbound::axum_router::list_databases_handler,databases::inbound::starter_router::ensure_starter_handler,databases::inbound::axum_router::create_database_handler,diff --git a/services/document_storage_service/src/server.rs b/services/document_storage_service/src/server.rsindex 7460bc96b8..a1ad04c9e3 100644--- a/services/document_storage_service/src/server.rs+++ b/services/document_storage_service/src/server.rs@@ -1590,6 +1590,18 @@ pub async fn run() -> anyhow::Result<()> {)),);+ // SQL predicates and follow-up reads use the primary, matching the catalog+ // versions and writes; replica lag must not select stale rows for an edit.+ let sql_service = databases_sql::DatabasesSql::new(+ databases_service.clone(),+ entity_access_service.clone(),+ primary_entity_soup.clone(),+ Arc::new(contacts::domain::service::ContactsDomainService {+ repository: contacts::outbound::repository::DbContactsRepository::new(db.clone()),+ notifier: None::<contacts::outbound::gateway::ConnectionGatewayNotifier>,+ }),+ );+let favorites_service = Arc::new(FavoritesServiceImpl::new(PgFavoritesRepo::new(db.clone())));// Keep the replica-backed Soup reader alongside the primary-backed email@@ -2140,6 +2152,10 @@ pub async fn run() -> anyhow::Result<()> {entity_access_service.clone(),authorization_state.clone(),),+ sql_state: databases_sql::inbound::axum_router::SqlRouterState::new(+ sql_service,+ authorization_state.clone(),+ ),databases_state: databases::inbound::axum_router::DatabasesRouterState::new(databases_service,entity_access_service.clone(),diff --git a/tooling/just/check.just b/tooling/just/check.justindex 8fde3b3fcd..f5590a5769 100644--- a/tooling/just/check.just+++ b/tooling/just/check.just@@ -81,14 +81,15 @@ check *ARGS:ox_other_paths+=("$PWD/$f")fidone <<<"$js"+ # A generated-client-only web diff can be entirely ignored by oxlint.echo "── oxlint (docs/development/style-guide.md FE-12, FE-13)"if [ "${#ox_web_paths[@]}" -gt 0 ]; then(\cd apps/web && npm exec --yes [email protected] \- [email protected] -- oxlint --type-aware "${ox_web_paths[@]}") \+ [email protected] -- oxlint --type-aware --no-error-on-unmatched-pattern "${ox_web_paths[@]}") \|| { echo " fix: await, return, or .catch the promise; void only if it cannot reject (FE-13)"; fail=1; }fiif [ "${#ox_other_paths[@]}" -gt 0 ]; then- (\cd apps/web && bunx --yes [email protected] "${ox_other_paths[@]}") || fail=1+ (\cd apps/web && bunx --yes [email protected] --no-error-on-unmatched-pattern "${ox_other_paths[@]}") || fail=1fifiif [ -n "$sg" ]; then