From 74a052db24d275a818b1bd40ca58bf387c6c663a Mon Sep 17 00:00:00 2001 From: stlc-bot Date: Wed, 2 Sep 2026 05:16:40 +0000 Subject: [PATCH] feat(api): sync generated SDK from staging 5ef86adb1e3ea98e2be0d6b81f91189761429e95 Source: hyperspell/node-sdk-staging@5ef86adb1e3ea98e2be0d6b81f91189761429e95 Promoted by: https://github.com/hyperspell/hyperspell/actions/runs/33593999613 --- .github/workflows/ci.yml | 60 +- .github/workflows/sdk-tests.yml | 33 + .stats.yml | 2 +- MIGRATION.md | 15 +- README.md | 20 +- api.md | 55 +- bin/migration-config.json | 4 + packages/mcp-server/README.md | 1 - packages/mcp-server/src/code-tool-worker.ts | 14 +- packages/mcp-server/src/code-tool.ts | 15 +- packages/mcp-server/src/http.ts | 10 +- packages/mcp-server/src/local-docs-search.ts | 1005 +++++--- packages/mcp-server/src/methods.ts | 78 +- packages/mcp-server/tests/auth.test.ts | 32 + scripts/mock | 2 +- src/client.ts | 51 +- src/core/pagination.ts | 52 + src/internal/qs/LICENSE.md | 13 - src/internal/qs/README.md | 3 - src/internal/qs/formats.ts | 10 - src/internal/qs/index.ts | 13 - src/internal/qs/stringify.ts | 385 --- src/internal/qs/types.ts | 71 - src/internal/qs/utils.ts | 265 -- src/internal/utils/query.ts | 20 +- src/resources/actions.ts | 54 +- src/resources/auth.ts | 40 +- src/resources/connections.ts | 44 +- src/resources/context-documents.ts | 3 + src/resources/context-documents/config.ts | 148 ++ .../context-documents/context-documents.ts | 200 ++ src/resources/context-documents/digests.ts | 103 + src/resources/context-documents/index.ts | 34 + src/resources/context-documents/trees.ts | 250 ++ src/resources/evaluate.ts | 4 +- src/resources/index.ts | 9 + src/resources/integrations/google-calendar.ts | 53 - src/resources/integrations/index.ts | 2 - src/resources/integrations/integrations.ts | 86 +- src/resources/integrations/slack.ts | 58 - src/resources/integrations/web-crawler.ts | 33 +- src/resources/memories.ts | 711 +++++- src/resources/sessions.ts | 2 +- src/resources/shared.ts | 728 +++--- tests/api-resources/actions.test.ts | 8 +- .../context-documents/config.test.ts | 44 + .../context-documents.test.ts | 58 + .../digests.test.ts} | 25 +- .../context-documents/trees.test.ts | 76 + .../integrations/google-calendar.test.ts | 22 - tests/api-resources/memories.test.ts | 6 +- tests/qs/empty-keys-cases.ts | 271 -- tests/qs/stringify.test.ts | 2232 ----------------- tests/qs/utils.test.ts | 169 -- tests/stringifyQuery.test.ts | 6 + 55 files changed, 3145 insertions(+), 4563 deletions(-) create mode 100644 .github/workflows/sdk-tests.yml create mode 100644 packages/mcp-server/tests/auth.test.ts delete mode 100644 src/internal/qs/LICENSE.md delete mode 100644 src/internal/qs/README.md delete mode 100644 src/internal/qs/formats.ts delete mode 100644 src/internal/qs/index.ts delete mode 100644 src/internal/qs/stringify.ts delete mode 100644 src/internal/qs/types.ts delete mode 100644 src/internal/qs/utils.ts create mode 100644 src/resources/context-documents.ts create mode 100644 src/resources/context-documents/config.ts create mode 100644 src/resources/context-documents/context-documents.ts create mode 100644 src/resources/context-documents/digests.ts create mode 100644 src/resources/context-documents/index.ts create mode 100644 src/resources/context-documents/trees.ts delete mode 100644 src/resources/integrations/google-calendar.ts delete mode 100644 src/resources/integrations/slack.ts create mode 100644 tests/api-resources/context-documents/config.test.ts create mode 100644 tests/api-resources/context-documents/context-documents.test.ts rename tests/api-resources/{integrations/slack.test.ts => context-documents/digests.test.ts} (60%) create mode 100644 tests/api-resources/context-documents/trees.test.ts delete mode 100644 tests/api-resources/integrations/google-calendar.test.ts delete mode 100644 tests/qs/empty-keys-cases.ts delete mode 100644 tests/qs/stringify.test.ts delete mode 100644 tests/qs/utils.test.ts diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e9d1d58d..b7a9d229 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: lint: timeout-minutes: 10 name: lint - runs-on: ${{ github.repository == 'stainless-sdks/hyperspell-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + runs-on: ubuntu-latest if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 @@ -42,7 +42,7 @@ jobs: build: timeout-minutes: 5 name: build - runs-on: ${{ github.repository == 'stainless-sdks/hyperspell-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + runs-on: ubuntu-latest if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') permissions: contents: read @@ -65,59 +65,3 @@ jobs: - name: Check build run: ./scripts/build - - - name: Get GitHub OIDC Token - if: |- - github.repository == 'stainless-sdks/hyperspell-typescript' && - !startsWith(github.ref, 'refs/heads/stl/') - id: github-oidc - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 - with: - script: core.setOutput('github_token', await core.getIDToken()); - - - name: Upload tarball - if: |- - github.repository == 'stainless-sdks/hyperspell-typescript' && - !startsWith(github.ref, 'refs/heads/stl/') - env: - URL: https://pkg.stainless.com/s - AUTH: ${{ steps.github-oidc.outputs.github_token }} - SHA: ${{ github.sha }} - run: ./scripts/utils/upload-artifact.sh - - - name: Upload MCP Server tarball - if: |- - github.repository == 'stainless-sdks/hyperspell-typescript' && - !startsWith(github.ref, 'refs/heads/stl/') - env: - URL: https://pkg.stainless.com/s?subpackage=mcp-server - AUTH: ${{ steps.github-oidc.outputs.github_token }} - SHA: ${{ github.sha }} - BASE_PATH: packages/mcp-server - run: ./scripts/utils/upload-artifact.sh - test: - timeout-minutes: 10 - name: test - runs-on: ${{ github.repository == 'stainless-sdks/hyperspell-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} - if: github.event_name == 'push' || github.event.pull_request.head.repo.fork - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - - name: Set up Node - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 - with: - node-version: '22' - - - name: Set up pnpm - uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0 - with: - version: '10.30.1' - - - name: Bootstrap - run: ./scripts/bootstrap - - - name: Build - run: ./scripts/build - - - name: Run tests - run: ./scripts/test diff --git a/.github/workflows/sdk-tests.yml b/.github/workflows/sdk-tests.yml new file mode 100644 index 00000000..6723ff89 --- /dev/null +++ b/.github/workflows/sdk-tests.yml @@ -0,0 +1,33 @@ +name: SDK tests + +on: + push: + branches: ['**'] + pull_request: + +jobs: + test: + name: test + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - name: Set up Node.js + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 + with: + node-version: 22 + + - name: Enable pnpm + run: corepack enable pnpm + + - name: Bootstrap + run: ./scripts/bootstrap + + - name: Build + run: ./scripts/build + + - name: Run tests + run: | + ./scripts/test + pnpm --filter @hyperspell/hyperspell-mcp test diff --git a/.stats.yml b/.stats.yml index 423e2f9a..1fd29914 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1 +1 @@ -configured_endpoints: 31 +configured_endpoints: 41 diff --git a/MIGRATION.md b/MIGRATION.md index b08a80d2..077c5774 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -90,7 +90,10 @@ This affects the following methods: - `client.folders.list()` - `client.integrations.connect()` -- `client.integrations.slack.list()` +- `client.contextDocuments.list()` +- `client.contextDocuments.trees.generate()` +- `client.contextDocuments.trees.getLatest()` +- `client.contextDocuments.digests.list()` - `client.memories.list()` - `client.evaluate.listQueries()` - `client.vaults.list()` @@ -111,6 +114,7 @@ import { HttpsProxyAgent } from 'https-proxy-agent'; // Configure the default for all requests: const client = new Hyperspell({ + userID: 'My User ID', httpAgent: new HttpsProxyAgent(process.env.PROXY_URL), }); ``` @@ -237,8 +241,8 @@ The `for await` syntax **is not affected**. This still works as-is: ```ts // Automatically fetches more pages as needed. -for await (const memoryListResponse of client.memories.list()) { - console.log(memoryListResponse); +for await (const contextDocumentListResponse of client.contextDocuments.list()) { + console.log(contextDocumentListResponse); } ``` @@ -260,10 +264,11 @@ Page classes for individual methods are now type aliases: ```ts // Before -export class MemoryListResponsesCursorPage extends CursorPage {} +export class ContextDocumentListResponsesContextDocumentsCursorPage extends ContextDocumentsCursorPage {} // After -export type MemoryListResponsesCursorPage = CursorPage; +export type ContextDocumentListResponsesContextDocumentsCursorPage = + ContextDocumentsCursorPage; ``` If you were importing these classes at runtime, you'll need to switch to importing the base class or only import them at the type-level. diff --git a/README.md b/README.md index 411eaa79..e01d9e25 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ The full API of this library can be found in [api.md](api.md). import Hyperspell from '@hyperspell/hyperspell'; const client = new Hyperspell({ + userID: 'My User ID', apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted }); @@ -49,6 +50,7 @@ This library includes TypeScript definitions for all request params and response import Hyperspell from '@hyperspell/hyperspell'; const client = new Hyperspell({ + userID: 'My User ID', apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted }); @@ -131,6 +133,7 @@ You can use the `maxRetries` option to configure or disable this: ```js // Configure the default for all requests: const client = new Hyperspell({ + userID: 'My User ID', maxRetries: 0, // default is 2 }); @@ -148,6 +151,7 @@ Requests time out after 1 minute by default. You can configure this with a `time ```ts // Configure the default for all requests: const client = new Hyperspell({ + userID: 'My User ID', timeout: 20 * 1000, // 20 seconds (default is 1 minute) }); @@ -167,22 +171,22 @@ List methods in the Hyperspell API are paginated. You can use the `for await … of` syntax to iterate through items across all pages: ```ts -async function fetchAllMemoryListResponses(params) { - const allMemoryListResponses = []; +async function fetchAllContextDocumentListResponses(params) { + const allContextDocumentListResponses = []; // Automatically fetches more pages as needed. - for await (const memoryListResponse of client.memories.list()) { - allMemoryListResponses.push(memoryListResponse); + for await (const contextDocumentListResponse of client.contextDocuments.list()) { + allContextDocumentListResponses.push(contextDocumentListResponse); } - return allMemoryListResponses; + return allContextDocumentListResponses; } ``` Alternatively, you can request a single page at a time: ```ts -let page = await client.memories.list(); -for (const memoryListResponse of page.items) { - console.log(memoryListResponse); +let page = await client.contextDocuments.list(); +for (const contextDocumentListResponse of page.documents) { + console.log(contextDocumentListResponse); } // Convenience methods are provided for manually paginating: diff --git a/api.md b/api.md index 294b3ad6..7b3cd731 100644 --- a/api.md +++ b/api.md @@ -24,6 +24,7 @@ Types: - ListItem - Message - Metadata +- Page - Paragraph - Person - Provenance @@ -87,35 +88,71 @@ Methods: - client.integrations.list() -> IntegrationListResponse - client.integrations.connect(integrationID, { ...params }) -> IntegrationConnectResponse -## GoogleCalendar +## WebCrawler Types: -- Calendar +- WebCrawlerIndexResponse Methods: -- client.integrations.googleCalendar.list() -> Calendar +- client.integrations.webCrawler.index({ ...params }) -> WebCrawlerIndexResponse -## WebCrawler +# ContextDocuments Types: -- WebCrawlerIndexResponse +- ContextDocumentListResponse +- ContextDocumentGenerateResponse +- ContextDocumentGetResponse Methods: -- client.integrations.webCrawler.index({ ...params }) -> WebCrawlerIndexResponse +- client.contextDocuments.generate({ ...params }) -> ContextDocumentGenerateResponse +- client.contextDocuments.list({ ...params }) -> ContextDocumentListResponsesContextDocumentsCursorPage +- client.contextDocuments.get(documentID) -> ContextDocumentGetResponse + +## Trees + +Types: + +- TreeGenerateResponse +- TreeGetResponse +- TreeGetLatestResponse +- TreeProgressResponse + +Methods: + +- client.contextDocuments.trees.generate({ ...params }) -> TreeGenerateResponse +- client.contextDocuments.trees.getLatest({ ...params }) -> TreeGetLatestResponse +- client.contextDocuments.trees.get(treeID) -> TreeGetResponse +- client.contextDocuments.trees.progress(treeID) -> TreeProgressResponse + +## Digests + +Types: + +- DigestListResponse +- DigestGenerateResponse + +Methods: + +- client.contextDocuments.digests.generate({ ...params }) -> DigestGenerateResponse +- client.contextDocuments.digests.list({ ...params }) -> DigestListResponse -## Slack +## Config Types: -- SlackListResponse +- ConfigUpdateResponse +- ConfigGetResponse +- ConfigResetResponse Methods: -- client.integrations.slack.list({ ...params }) -> unknown +- client.contextDocuments.config.get() -> ConfigGetResponse +- client.contextDocuments.config.update({ ...params }) -> ConfigUpdateResponse +- client.contextDocuments.config.reset() -> ConfigResetResponse # Memories diff --git a/bin/migration-config.json b/bin/migration-config.json index 74f4c438..b97d7103 100644 --- a/bin/migration-config.json +++ b/bin/migration-config.json @@ -101,6 +101,10 @@ "key": "resource_id", "location": "path" }, + { + "type": "params", + "maybeOverload": true + }, { "type": "options" } diff --git a/packages/mcp-server/README.md b/packages/mcp-server/README.md index d73bd3b2..c932d778 100644 --- a/packages/mcp-server/README.md +++ b/packages/mcp-server/README.md @@ -86,7 +86,6 @@ Additionally, authorization can be provided via the following headers: | Header | Equivalent client option | Security scheme | | ---------------------- | ------------------------ | --------------- | | `x-hyperspell-api-key` | `apiKey` | APIKey | -| `X-As-User` | `userID` | AsUser | A configuration JSON for this server might look like this, assuming the server is hosted at `http://localhost:3000`: diff --git a/packages/mcp-server/src/code-tool-worker.ts b/packages/mcp-server/src/code-tool-worker.ts index 6dae892c..21eefc75 100644 --- a/packages/mcp-server/src/code-tool-worker.ts +++ b/packages/mcp-server/src/code-tool-worker.ts @@ -116,9 +116,19 @@ const fuse = new Fuse( 'client.folders.setPolicies', 'client.integrations.connect', 'client.integrations.list', - 'client.integrations.googleCalendar.list', 'client.integrations.webCrawler.index', - 'client.integrations.slack.list', + 'client.contextDocuments.generate', + 'client.contextDocuments.get', + 'client.contextDocuments.list', + 'client.contextDocuments.trees.generate', + 'client.contextDocuments.trees.get', + 'client.contextDocuments.trees.getLatest', + 'client.contextDocuments.trees.progress', + 'client.contextDocuments.digests.generate', + 'client.contextDocuments.digests.list', + 'client.contextDocuments.config.get', + 'client.contextDocuments.config.reset', + 'client.contextDocuments.config.update', 'client.memories.add', 'client.memories.addBulk', 'client.memories.delete', diff --git a/packages/mcp-server/src/code-tool.ts b/packages/mcp-server/src/code-tool.ts index 9eeeb3f5..f0a692b2 100644 --- a/packages/mcp-server/src/code-tool.ts +++ b/packages/mcp-server/src/code-tool.ts @@ -159,10 +159,7 @@ const localDenoHandler = async ({ } } - // Deno 2.9.0 moved unix sockets behind the net permission (--allow-net=unix:), part of - // the 2.8.2–2.9.1 socket-hardening series (denoland/deno#34395, #35835). Older Denos must NOT - // receive the token: 2.0–2.8 reject it at startup ("invalid port") and 1.x panics — and their - // legacy read/write grant still works. So gate the grant on exactly >= 2.9. + // Deno >= 2.9 requires unix sockets to be included in --allow-net. let denoNeedsUnixNetGrant = true; try { const versionOutput = execSync(`"${denoPath}" --version`, { encoding: 'utf8' }); @@ -207,14 +204,8 @@ const localDenoHandler = async ({ '--allow-env', ], printOutput: true, - // deno-http-worker grants its internal unix socket via --allow-read/--allow-write (the - // pre-2.9 permission model — unchanged upstream as of 2.0.3, so a version bump is not a fix), - // which on Deno >= 2.9 kills the worker at startup ("Deno exited before being ready"). - // The socket path is generated inside newDenoHTTPWorker, so no flag can be scoped up front - // (Deno accepts only exact socket paths — no globs/prefixes — and rejects repeated - // --allow-net flags). Instead, intercept the spawn, pluck the socket path out of the - // --allow-write flag the library injects, and comma-merge unix: onto the existing - // --allow-net scope. + // deno-http-worker creates the socket path internally, so add it when the + // subprocess is spawned instead of granting access to every unix socket. ...(denoNeedsUnixNetGrant && { spawnFunc: ( command: string, diff --git a/packages/mcp-server/src/http.ts b/packages/mcp-server/src/http.ts index fa893308..dcd8a132 100644 --- a/packages/mcp-server/src/http.ts +++ b/packages/mcp-server/src/http.ts @@ -127,9 +127,17 @@ const del = async (req: express.Request, res: express.Response) => { const redactHeaders = (headers: Record) => { const hiddenHeaders = /auth|cookie|key|token|x-stainless-mcp-client-envs/i; + const sensitiveHeaders = new Set([ + 'authorization', + 'api-key', + 'x-api-key', + 'cookie', + 'set-cookie', + 'x-as-user', + ]); const filtered = { ...headers }; Object.keys(filtered).forEach((key) => { - if (hiddenHeaders.test(key)) { + if (hiddenHeaders.test(key) || sensitiveHeaders.has(key.toLowerCase())) { filtered[key] = '[REDACTED]'; } }); diff --git a/packages/mcp-server/src/local-docs-search.ts b/packages/mcp-server/src/local-docs-search.ts index 0aaed090..bb0d1f83 100644 --- a/packages/mcp-server/src/local-docs-search.ts +++ b/packages/mcp-server/src/local-docs-search.ts @@ -56,23 +56,18 @@ const EMBEDDED_METHODS: MethodEntry[] = [ httpMethod: 'delete', summary: 'Revoke connection', description: - 'Revoke Hyperspell\'s access to a provider and delete this user\'s stored data.\n\nThe external OAuth/Unified revoke and the (potentially large) data purge run in\na background Temporal workflow; this returns ``202 Accepted`` immediately. A\nheavy provider — a Gmail account can carry hundreds of thousands of chunks —\nplus a slow third-party revoke would otherwise outrun the request timeout: the\nold synchronous path "timed out" for the caller while still finishing\nserver-side, making the outcome invisible. Idempotent per (app, user, provider).', + "Revoke Hyperspell's access to a provider and delete this user's stored data.\n\nRevocation and deletion are processed asynchronously, so the endpoint returns\n``202 Accepted`` immediately. Repeated requests for the same app, user, and\nprovider are safe.", stainlessPath: '(resource) connections > (method) revoke', qualified: 'client.connections.revoke', params: ['connection_id: string;'], response: '{ message: string; success: boolean; }', markdown: - "## revoke\n\n`client.connections.revoke(connection_id: string): { message: string; success: boolean; }`\n\n**delete** `/connections/{connection_id}/revoke`\n\nRevoke Hyperspell's access to a provider and delete this user's stored data.\n\nThe external OAuth/Unified revoke and the (potentially large) data purge run in\na background Temporal workflow; this returns ``202 Accepted`` immediately. A\nheavy provider — a Gmail account can carry hundreds of thousands of chunks —\nplus a slow third-party revoke would otherwise outrun the request timeout: the\nold synchronous path \"timed out\" for the caller while still finishing\nserver-side, making the outcome invisible. Idempotent per (app, user, provider).\n\n### Parameters\n\n- `connection_id: string`\n\n### Returns\n\n- `{ message: string; success: boolean; }`\n\n - `message: string`\n - `success: boolean`\n\n### Example\n\n```typescript\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell();\n\nconst response = await client.connections.revoke('connection_id');\n\nconsole.log(response);\n```", + "## revoke\n\n`client.connections.revoke(connection_id: string): { message: string; success: boolean; }`\n\n**delete** `/connections/{connection_id}/revoke`\n\nRevoke Hyperspell's access to a provider and delete this user's stored data.\n\nRevocation and deletion are processed asynchronously, so the endpoint returns\n``202 Accepted`` immediately. Repeated requests for the same app, user, and\nprovider are safe.\n\n### Parameters\n\n- `connection_id: string`\n\n### Returns\n\n- `{ message: string; success: boolean; }`\n\n - `message: string`\n - `success: boolean`\n\n### Example\n\n```typescript\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell();\n\nconst response = await client.connections.revoke('connection_id');\n\nconsole.log(response);\n```", perLanguage: { go: { method: 'client.Connections.Revoke', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Connections.Revoke(context.TODO(), "connection_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Message)\n}\n', - }, - cli: { - method: 'connections revoke', - example: - "hyperspell connections revoke \\\n --api-key 'My API Key' \\\n --connection-id connection_id", + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t\toption.WithUserID("My User ID"),\n\t)\n\tresponse, err := client.Connections.Revoke(context.TODO(), "connection_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Message)\n}\n', }, python: { method: 'connections.revoke', @@ -82,12 +77,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [ typescript: { method: 'client.connections.revoke', example: - "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.connections.revoke('connection_id');\n\nconsole.log(response.message);", + "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n userID: 'My User ID',\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.connections.revoke('connection_id');\n\nconsole.log(response.message);", }, http: { example: 'curl https://api.hyperspell.com/connections/$CONNECTION_ID/revoke \\\n -X DELETE \\\n -H "Authorization: Bearer $HYPERSPELL_API_KEY"', }, + cli: { + method: 'connections revoke', + example: + "hyperspell connections revoke \\\n --api-key 'My API Key' \\\n --user-id 'My User ID' \\\n --connection-id connection_id", + }, }, }, { @@ -99,18 +99,14 @@ const EMBEDDED_METHODS: MethodEntry[] = [ stainlessPath: '(resource) connections > (method) list', qualified: 'client.connections.list', response: - '{ connections: { id: string; integration_id: string; label: string; provider: string; selected_count?: number; }[]; }', + "{ connections: { id: string; integration_id: string; label: string; provider: string; backfill_state?: 'backfilling' | 'quiesced' | 'completed' | 'unknown'; scope?: 'user' | 'app'; selected_count?: number; }[]; }", markdown: - "## list\n\n`client.connections.list(): { connections: object[]; }`\n\n**get** `/connections/list`\n\nList all connections for the user.\n\n### Returns\n\n- `{ connections: { id: string; integration_id: string; label: string; provider: string; selected_count?: number; }[]; }`\n\n - `connections: { id: string; integration_id: string; label: string; provider: string; selected_count?: number; }[]`\n\n### Example\n\n```typescript\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell();\n\nconst connections = await client.connections.list();\n\nconsole.log(connections);\n```", + "## list\n\n`client.connections.list(): { connections: object[]; }`\n\n**get** `/connections/list`\n\nList all connections for the user.\n\n### Returns\n\n- `{ connections: { id: string; integration_id: string; label: string; provider: string; backfill_state?: 'backfilling' | 'quiesced' | 'completed' | 'unknown'; scope?: 'user' | 'app'; selected_count?: number; }[]; }`\n\n - `connections: { id: string; integration_id: string; label: string; provider: string; backfill_state?: 'backfilling' | 'quiesced' | 'completed' | 'unknown'; scope?: 'user' | 'app'; selected_count?: number; }[]`\n\n### Example\n\n```typescript\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell();\n\nconst connections = await client.connections.list();\n\nconsole.log(connections);\n```", perLanguage: { go: { method: 'client.Connections.List', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tconnections, err := client.Connections.List(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", connections.Connections)\n}\n', - }, - cli: { - method: 'connections list', - example: "hyperspell connections list \\\n --api-key 'My API Key'", + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t\toption.WithUserID("My User ID"),\n\t)\n\tconnections, err := client.Connections.List(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", connections.Connections)\n}\n', }, python: { method: 'connections.list', @@ -120,12 +116,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ typescript: { method: 'client.connections.list', example: - "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst connections = await client.connections.list();\n\nconsole.log(connections.connections);", + "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n userID: 'My User ID',\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst connections = await client.connections.list();\n\nconsole.log(connections.connections);", }, http: { example: 'curl https://api.hyperspell.com/connections/list \\\n -H "Authorization: Bearer $HYPERSPELL_API_KEY"', }, + cli: { + method: 'connections list', + example: "hyperspell connections list \\\n --api-key 'My API Key' \\\n --user-id 'My User ID'", + }, }, }, { @@ -146,12 +146,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [ go: { method: 'client.Folders.List', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tfolders, err := client.Folders.List(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\thyperspell.FolderListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", folders.Folders)\n}\n', - }, - cli: { - method: 'folders list', - example: - "hyperspell folders list \\\n --api-key 'My API Key' \\\n --connection-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t\toption.WithUserID("My User ID"),\n\t)\n\tfolders, err := client.Folders.List(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\thyperspell.FolderListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", folders.Folders)\n}\n', }, python: { method: 'folders.list', @@ -161,12 +156,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [ typescript: { method: 'client.folders.list', example: - "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst folders = await client.folders.list('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(folders.folders);", + "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n userID: 'My User ID',\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst folders = await client.folders.list('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(folders.folders);", }, http: { example: 'curl https://api.hyperspell.com/connections/$CONNECTION_ID/folders \\\n -H "Authorization: Bearer $HYPERSPELL_API_KEY"', }, + cli: { + method: 'folders list', + example: + "hyperspell folders list \\\n --api-key 'My API Key' \\\n --user-id 'My User ID' \\\n --connection-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + }, }, }, { @@ -186,12 +186,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [ go: { method: 'client.Folders.ListPolicies', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Folders.ListPolicies(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Policies)\n}\n', - }, - cli: { - method: 'folders list_policies', - example: - "hyperspell folders list-policies \\\n --api-key 'My API Key' \\\n --connection-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t\toption.WithUserID("My User ID"),\n\t)\n\tresponse, err := client.Folders.ListPolicies(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Policies)\n}\n', }, python: { method: 'folders.list_policies', @@ -201,12 +196,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [ typescript: { method: 'client.folders.listPolicies', example: - "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.folders.listPolicies('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(response.policies);", + "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n userID: 'My User ID',\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.folders.listPolicies('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(response.policies);", }, http: { example: 'curl https://api.hyperspell.com/connections/$CONNECTION_ID/folder-policies \\\n -H "Authorization: Bearer $HYPERSPELL_API_KEY"', }, + cli: { + method: 'folders list_policies', + example: + "hyperspell folders list-policies \\\n --api-key 'My API Key' \\\n --user-id 'My User ID' \\\n --connection-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + }, }, }, { @@ -233,12 +233,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [ go: { method: 'client.Folders.SetPolicies', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Folders.SetPolicies(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\thyperspell.FolderSetPoliciesParams{\n\t\t\tProviderFolderID: "provider_folder_id",\n\t\t\tSyncMode: hyperspell.FolderSetPoliciesParamsSyncModeSync,\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.ID)\n}\n', - }, - cli: { - method: 'folders set_policies', - example: - "hyperspell folders set-policies \\\n --api-key 'My API Key' \\\n --connection-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e \\\n --provider-folder-id provider_folder_id \\\n --sync-mode sync", + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t\toption.WithUserID("My User ID"),\n\t)\n\tresponse, err := client.Folders.SetPolicies(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\thyperspell.FolderSetPoliciesParams{\n\t\t\tProviderFolderID: "provider_folder_id",\n\t\t\tSyncMode: hyperspell.FolderSetPoliciesParamsSyncModeSync,\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.ID)\n}\n', }, python: { method: 'folders.set_policies', @@ -248,12 +243,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [ typescript: { method: 'client.folders.setPolicies', example: - "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.folders.setPolicies('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {\n provider_folder_id: 'provider_folder_id',\n sync_mode: 'sync',\n});\n\nconsole.log(response.id);", + "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n userID: 'My User ID',\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.folders.setPolicies('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {\n provider_folder_id: 'provider_folder_id',\n sync_mode: 'sync',\n});\n\nconsole.log(response.id);", }, http: { example: 'curl https://api.hyperspell.com/connections/$CONNECTION_ID/folder-policies \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $HYPERSPELL_API_KEY" \\\n -d \'{\n "provider_folder_id": "provider_folder_id",\n "sync_mode": "sync"\n }\'', }, + cli: { + method: 'folders set_policies', + example: + "hyperspell folders set-policies \\\n --api-key 'My API Key' \\\n --user-id 'My User ID' \\\n --connection-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e \\\n --provider-folder-id provider_folder_id \\\n --sync-mode sync", + }, }, }, { @@ -272,12 +272,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [ go: { method: 'client.Folders.DeletePolicy', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Folders.DeletePolicy(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\thyperspell.FolderDeletePolicyParams{\n\t\t\tConnectionID: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Success)\n}\n', - }, - cli: { - method: 'folders delete_policy', - example: - "hyperspell folders delete-policy \\\n --api-key 'My API Key' \\\n --connection-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e \\\n --policy-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t\toption.WithUserID("My User ID"),\n\t)\n\tresponse, err := client.Folders.DeletePolicy(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\thyperspell.FolderDeletePolicyParams{\n\t\t\tConnectionID: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Success)\n}\n', }, python: { method: 'folders.delete_policy', @@ -287,12 +282,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [ typescript: { method: 'client.folders.deletePolicy', example: - "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.folders.deletePolicy('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {\n connection_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n});\n\nconsole.log(response.success);", + "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n userID: 'My User ID',\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.folders.deletePolicy('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {\n connection_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n});\n\nconsole.log(response.success);", }, http: { example: 'curl https://api.hyperspell.com/connections/$CONNECTION_ID/folder-policies/$POLICY_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $HYPERSPELL_API_KEY"', }, + cli: { + method: 'folders delete_policy', + example: + "hyperspell folders delete-policy \\\n --api-key 'My API Key' \\\n --user-id 'My User ID' \\\n --connection-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e \\\n --policy-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + }, }, }, { @@ -304,18 +304,14 @@ const EMBEDDED_METHODS: MethodEntry[] = [ stainlessPath: '(resource) integrations > (method) list', qualified: 'client.integrations.list', response: - "{ integrations: { id: string; allow_multiple_connections: boolean; auth_provider: 'nango' | 'unified' | 'whitelabel'; icon: string; name: string; provider: string; actions_only?: boolean; requires_channel_selection?: boolean; }[]; }", + "{ integrations: { id: string; allow_multiple_connections: boolean; auth_provider: 'nango' | 'unified' | 'whitelabel'; icon: string; name: string; provider: string; actions_only?: boolean; channel_selection_required?: boolean; connected_via_service_account?: boolean; folder_selection_required?: boolean; private_channels_included?: boolean; public_channels_included?: boolean; requires_channel_selection?: boolean; supports_channel_selection?: boolean; supports_folder_selection?: boolean; }[]; }", markdown: - "## list\n\n`client.integrations.list(): { integrations: object[]; }`\n\n**get** `/integrations/list`\n\nList all integrations for the user.\n\n### Returns\n\n- `{ integrations: { id: string; allow_multiple_connections: boolean; auth_provider: 'nango' | 'unified' | 'whitelabel'; icon: string; name: string; provider: string; actions_only?: boolean; requires_channel_selection?: boolean; }[]; }`\n\n - `integrations: { id: string; allow_multiple_connections: boolean; auth_provider: 'nango' | 'unified' | 'whitelabel'; icon: string; name: string; provider: string; actions_only?: boolean; requires_channel_selection?: boolean; }[]`\n\n### Example\n\n```typescript\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell();\n\nconst integrations = await client.integrations.list();\n\nconsole.log(integrations);\n```", + "## list\n\n`client.integrations.list(): { integrations: object[]; }`\n\n**get** `/integrations/list`\n\nList all integrations for the user.\n\n### Returns\n\n- `{ integrations: { id: string; allow_multiple_connections: boolean; auth_provider: 'nango' | 'unified' | 'whitelabel'; icon: string; name: string; provider: string; actions_only?: boolean; channel_selection_required?: boolean; connected_via_service_account?: boolean; folder_selection_required?: boolean; private_channels_included?: boolean; public_channels_included?: boolean; requires_channel_selection?: boolean; supports_channel_selection?: boolean; supports_folder_selection?: boolean; }[]; }`\n\n - `integrations: { id: string; allow_multiple_connections: boolean; auth_provider: 'nango' | 'unified' | 'whitelabel'; icon: string; name: string; provider: string; actions_only?: boolean; channel_selection_required?: boolean; connected_via_service_account?: boolean; folder_selection_required?: boolean; private_channels_included?: boolean; public_channels_included?: boolean; requires_channel_selection?: boolean; supports_channel_selection?: boolean; supports_folder_selection?: boolean; }[]`\n\n### Example\n\n```typescript\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell();\n\nconst integrations = await client.integrations.list();\n\nconsole.log(integrations);\n```", perLanguage: { go: { method: 'client.Integrations.List', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tintegrations, err := client.Integrations.List(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", integrations.Integrations)\n}\n', - }, - cli: { - method: 'integrations list', - example: "hyperspell integrations list \\\n --api-key 'My API Key'", + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t\toption.WithUserID("My User ID"),\n\t)\n\tintegrations, err := client.Integrations.List(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", integrations.Integrations)\n}\n', }, python: { method: 'integrations.list', @@ -325,12 +321,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ typescript: { method: 'client.integrations.list', example: - "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst integrations = await client.integrations.list();\n\nconsole.log(integrations.integrations);", + "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n userID: 'My User ID',\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst integrations = await client.integrations.list();\n\nconsole.log(integrations.integrations);", }, http: { example: 'curl https://api.hyperspell.com/integrations/list \\\n -H "Authorization: Bearer $HYPERSPELL_API_KEY"', }, + cli: { + method: 'integrations list', + example: "hyperspell integrations list \\\n --api-key 'My API Key' \\\n --user-id 'My User ID'", + }, }, }, { @@ -349,12 +349,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [ go: { method: 'client.Integrations.Connect', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Integrations.Connect(\n\t\tcontext.TODO(),\n\t\t"integration_id",\n\t\thyperspell.IntegrationConnectParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.ExpiresAt)\n}\n', - }, - cli: { - method: 'integrations connect', - example: - "hyperspell integrations connect \\\n --api-key 'My API Key' \\\n --integration-id integration_id", + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t\toption.WithUserID("My User ID"),\n\t)\n\tresponse, err := client.Integrations.Connect(\n\t\tcontext.TODO(),\n\t\t"integration_id",\n\t\thyperspell.IntegrationConnectParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.ExpiresAt)\n}\n', }, python: { method: 'integrations.connect', @@ -364,133 +359,546 @@ const EMBEDDED_METHODS: MethodEntry[] = [ typescript: { method: 'client.integrations.connect', example: - "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.integrations.connect('integration_id');\n\nconsole.log(response.expires_at);", + "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n userID: 'My User ID',\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.integrations.connect('integration_id');\n\nconsole.log(response.expires_at);", }, http: { example: 'curl https://api.hyperspell.com/integrations/$INTEGRATION_ID/connect \\\n -H "Authorization: Bearer $HYPERSPELL_API_KEY"', }, + cli: { + method: 'integrations connect', + example: + "hyperspell integrations connect \\\n --api-key 'My API Key' \\\n --user-id 'My User ID' \\\n --integration-id integration_id", + }, + }, + }, + { + name: 'index', + endpoint: '/integrations/web_crawler/index', + httpMethod: 'get', + summary: 'Crawl a website for indexed search', + description: 'Recursively crawl a website to make it available for indexed search.', + stainlessPath: '(resource) integrations.web_crawler > (method) index', + qualified: 'client.integrations.webCrawler.index', + params: ['url: string;', 'limit?: number;', 'max_depth?: number;'], + response: '{ resource_id: string; source: string; status: string; }', + markdown: + "## index\n\n`client.integrations.webCrawler.index(url: string, limit?: number, max_depth?: number): { resource_id: string; source: string; status: string; }`\n\n**get** `/integrations/web_crawler/index`\n\nRecursively crawl a website to make it available for indexed search.\n\n### Parameters\n\n- `url: string`\n The base URL of the website to crawl\n\n- `limit?: number`\n Maximum number of pages to crawl in total\n\n- `max_depth?: number`\n Maximum depth of links to follow during crawling\n\n### Returns\n\n- `{ resource_id: string; source: string; status: string; }`\n\n - `resource_id: string`\n - `source: string`\n - `status: string`\n\n### Example\n\n```typescript\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell();\n\nconst response = await client.integrations.webCrawler.index({ url: 'url' });\n\nconsole.log(response);\n```", + perLanguage: { + go: { + method: 'client.Integrations.WebCrawler.Index', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t\toption.WithUserID("My User ID"),\n\t)\n\tresponse, err := client.Integrations.WebCrawler.Index(context.TODO(), hyperspell.IntegrationWebCrawlerIndexParams{\n\t\tURL: "url",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.ResourceID)\n}\n', + }, + python: { + method: 'integrations.web_crawler.index', + example: + 'import os\nfrom hyperspell import Hyperspell\n\nclient = Hyperspell(\n api_key=os.environ.get("HYPERSPELL_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.integrations.web_crawler.index(\n url="url",\n)\nprint(response.resource_id)', + }, + typescript: { + method: 'client.integrations.webCrawler.index', + example: + "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n userID: 'My User ID',\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.integrations.webCrawler.index({ url: 'url' });\n\nconsole.log(response.resource_id);", + }, + http: { + example: + 'curl https://api.hyperspell.com/integrations/web_crawler/index \\\n -H "Authorization: Bearer $HYPERSPELL_API_KEY"', + }, + cli: { + method: 'web_crawler index', + example: + "hyperspell integrations:web-crawler index \\\n --api-key 'My API Key' \\\n --user-id 'My User ID' \\\n --url url", + }, + }, + }, + { + name: 'generate', + endpoint: '/context-documents/generate', + httpMethod: 'post', + summary: 'Generate a context document', + description: + "Generate an LLM-synthesized context document from the app's synced data.\n\nGeneration runs asynchronously. The endpoint returns immediately with status\n``PROCESSING``; synthesis time depends on the amount of source data.", + stainlessPath: '(resource) context_documents > (method) generate', + qualified: 'client.contextDocuments.generate', + params: ['model?: string;', 'prompt?: string;', 'sources?: string[];', 'user_id?: string;'], + response: '{ created_at: string; document_id: string; status: string; }', + markdown: + "## generate\n\n`client.contextDocuments.generate(model?: string, prompt?: string, sources?: string[], user_id?: string): { created_at: string; document_id: string; status: string; }`\n\n**post** `/context-documents/generate`\n\nGenerate an LLM-synthesized context document from the app's synced data.\n\nGeneration runs asynchronously. The endpoint returns immediately with status\n``PROCESSING``; synthesis time depends on the amount of source data.\n\n### Parameters\n\n- `model?: string`\n Model used for final synthesis.\n\n- `prompt?: string`\n Custom prompt template. Replaces the standard summary prompt.\n\n- `sources?: string[]`\n Integration sources to include (e.g., ['gmail', 'slack']). Defaults to all connected integrations.\n\n- `user_id?: string`\n Scope generation to a specific user's data.\n\n### Returns\n\n- `{ created_at: string; document_id: string; status: string; }`\n\n - `created_at: string`\n - `document_id: string`\n - `status: string`\n\n### Example\n\n```typescript\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell();\n\nconst response = await client.contextDocuments.generate();\n\nconsole.log(response);\n```", + perLanguage: { + go: { + method: 'client.ContextDocuments.Generate', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t\toption.WithUserID("My User ID"),\n\t)\n\tresponse, err := client.ContextDocuments.Generate(context.TODO(), hyperspell.ContextDocumentGenerateParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.DocumentID)\n}\n', + }, + python: { + method: 'context_documents.generate', + example: + 'import os\nfrom hyperspell import Hyperspell\n\nclient = Hyperspell(\n api_key=os.environ.get("HYPERSPELL_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.context_documents.generate()\nprint(response.document_id)', + }, + typescript: { + method: 'client.contextDocuments.generate', + example: + "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n userID: 'My User ID',\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.contextDocuments.generate();\n\nconsole.log(response.document_id);", + }, + http: { + example: + "curl https://api.hyperspell.com/context-documents/generate \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: Bearer $HYPERSPELL_API_KEY\" \\\n -d '{}'", + }, + cli: { + method: 'context_documents generate', + example: + "hyperspell context-documents generate \\\n --api-key 'My API Key' \\\n --user-id 'My User ID'", + }, }, }, { name: 'list', - endpoint: '/integrations/google_calendar/list', + endpoint: '/context-documents', httpMethod: 'get', - summary: 'List available calendars', + summary: 'List context documents', + description: 'List context documents for the authenticated app, most recent first.', + stainlessPath: '(resource) context_documents > (method) list', + qualified: 'client.contextDocuments.list', + params: ['cursor?: string;', 'limit?: number;', "status?: 'processing' | 'completed' | 'failed';"], + response: + '{ completed_at: string; created_at: string; document_id: string; model: string; sources: string[]; status: string; token_count: number; error?: string; }', + markdown: + "## list\n\n`client.contextDocuments.list(cursor?: string, limit?: number, status?: 'processing' | 'completed' | 'failed'): { completed_at: string; created_at: string; document_id: string; model: string; sources: string[]; status: string; token_count: number; error?: string; }`\n\n**get** `/context-documents`\n\nList context documents for the authenticated app, most recent first.\n\n### Parameters\n\n- `cursor?: string`\n\n- `limit?: number`\n\n- `status?: 'processing' | 'completed' | 'failed'`\n\n### Returns\n\n- `{ completed_at: string; created_at: string; document_id: string; model: string; sources: string[]; status: string; token_count: number; error?: string; }`\n\n - `completed_at: string`\n - `created_at: string`\n - `document_id: string`\n - `model: string`\n - `sources: string[]`\n - `status: string`\n - `token_count: number`\n - `error?: string`\n\n### Example\n\n```typescript\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell();\n\n// Automatically fetches more pages as needed.\nfor await (const contextDocumentListResponse of client.contextDocuments.list()) {\n console.log(contextDocumentListResponse);\n}\n```", + perLanguage: { + go: { + method: 'client.ContextDocuments.List', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t\toption.WithUserID("My User ID"),\n\t)\n\tpage, err := client.ContextDocuments.List(context.TODO(), hyperspell.ContextDocumentListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', + }, + python: { + method: 'context_documents.list', + example: + 'import os\nfrom hyperspell import Hyperspell\n\nclient = Hyperspell(\n api_key=os.environ.get("HYPERSPELL_API_KEY"), # This is the default and can be omitted\n)\npage = client.context_documents.list()\npage = page.documents[0]\nprint(page.document_id)', + }, + typescript: { + method: 'client.contextDocuments.list', + example: + "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n userID: 'My User ID',\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const contextDocumentListResponse of client.contextDocuments.list()) {\n console.log(contextDocumentListResponse.document_id);\n}", + }, + http: { + example: + 'curl https://api.hyperspell.com/context-documents \\\n -H "Authorization: Bearer $HYPERSPELL_API_KEY"', + }, + cli: { + method: 'context_documents list', + example: + "hyperspell context-documents list \\\n --api-key 'My API Key' \\\n --user-id 'My User ID'", + }, + }, + }, + { + name: 'get', + endpoint: '/context-documents/{document_id}', + httpMethod: 'get', + summary: 'Get a context document', + description: 'Get a specific context document by ID.', + stainlessPath: '(resource) context_documents > (method) get', + qualified: 'client.contextDocuments.get', + params: ['document_id: string;'], + response: + '{ completed_at: string; content: string; created_at: string; document_id: string; error: string; metadata: object; model: string; prompt: string; sources: string[]; status: string; token_usage: object; user_id: string; }', + markdown: + "## get\n\n`client.contextDocuments.get(document_id: string): { completed_at: string; content: string; created_at: string; document_id: string; error: string; metadata: object; model: string; prompt: string; sources: string[]; status: string; token_usage: object; user_id: string; }`\n\n**get** `/context-documents/{document_id}`\n\nGet a specific context document by ID.\n\n### Parameters\n\n- `document_id: string`\n\n### Returns\n\n- `{ completed_at: string; content: string; created_at: string; document_id: string; error: string; metadata: object; model: string; prompt: string; sources: string[]; status: string; token_usage: object; user_id: string; }`\n\n - `completed_at: string`\n - `content: string`\n - `created_at: string`\n - `document_id: string`\n - `error: string`\n - `metadata: object`\n - `model: string`\n - `prompt: string`\n - `sources: string[]`\n - `status: string`\n - `token_usage: object`\n - `user_id: string`\n\n### Example\n\n```typescript\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell();\n\nconst contextDocument = await client.contextDocuments.get('document_id');\n\nconsole.log(contextDocument);\n```", + perLanguage: { + go: { + method: 'client.ContextDocuments.Get', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t\toption.WithUserID("My User ID"),\n\t)\n\tcontextDocument, err := client.ContextDocuments.Get(context.TODO(), "document_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", contextDocument.DocumentID)\n}\n', + }, + python: { + method: 'context_documents.get', + example: + 'import os\nfrom hyperspell import Hyperspell\n\nclient = Hyperspell(\n api_key=os.environ.get("HYPERSPELL_API_KEY"), # This is the default and can be omitted\n)\ncontext_document = client.context_documents.get(\n "document_id",\n)\nprint(context_document.document_id)', + }, + typescript: { + method: 'client.contextDocuments.get', + example: + "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n userID: 'My User ID',\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst contextDocument = await client.contextDocuments.get('document_id');\n\nconsole.log(contextDocument.document_id);", + }, + http: { + example: + 'curl https://api.hyperspell.com/context-documents/$DOCUMENT_ID \\\n -H "Authorization: Bearer $HYPERSPELL_API_KEY"', + }, + cli: { + method: 'context_documents get', + example: + "hyperspell context-documents get \\\n --api-key 'My API Key' \\\n --user-id 'My User ID' \\\n --document-id document_id", + }, + }, + }, + { + name: 'generate', + endpoint: '/context-documents/tree', + httpMethod: 'post', + summary: 'Generate a three-tier context document tree', description: - 'List available calendars for a user. This can be used to ie. populate a dropdown for the user to select a calendar.', - stainlessPath: '(resource) integrations.google_calendar > (method) list', - qualified: 'client.integrations.googleCalendar.list', - response: '{ items: { id: string; name: string; primary: boolean; timezone: string; }[]; }', + "Generate a three-tier context document tree for local push delivery.\n\nCreates company, workstream, and personal context documents from the app's\nsynced data. Returns immediately with a tree ID; use\n``GET /context-documents/tree/latest`` to retrieve the result.", + stainlessPath: '(resource) context_documents.trees > (method) generate', + qualified: 'client.contextDocuments.trees.generate', + params: ['sources?: string[];', 'user_id?: string;', 'workstream_name?: string;'], + response: '{ created_at: string; status: string; tree_id: string; }', markdown: - "## list\n\n`client.integrations.googleCalendar.list(): { items: object[]; }`\n\n**get** `/integrations/google_calendar/list`\n\nList available calendars for a user. This can be used to ie. populate a dropdown for the user to select a calendar.\n\n### Returns\n\n- `{ items: { id: string; name: string; primary: boolean; timezone: string; }[]; }`\n\n - `items: { id: string; name: string; primary: boolean; timezone: string; }[]`\n\n### Example\n\n```typescript\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell();\n\nconst calendar = await client.integrations.googleCalendar.list();\n\nconsole.log(calendar);\n```", + "## generate\n\n`client.contextDocuments.trees.generate(sources?: string[], user_id?: string, workstream_name?: string): { created_at: string; status: string; tree_id: string; }`\n\n**post** `/context-documents/tree`\n\nGenerate a three-tier context document tree for local push delivery.\n\nCreates company, workstream, and personal context documents from the app's\nsynced data. Returns immediately with a tree ID; use\n``GET /context-documents/tree/latest`` to retrieve the result.\n\n### Parameters\n\n- `sources?: string[]`\n Integration sources to include (e.g., ['gmail', 'slack']). Defaults to all.\n\n- `user_id?: string`\n User ID for personal tier scoping. When set, personal/context.md is generated from this user's data only. Company and workstream tiers still use all data.\n\n- `workstream_name?: string`\n Generate docs for this workstream only (skip auto-detection).\n\n### Returns\n\n- `{ created_at: string; status: string; tree_id: string; }`\n\n - `created_at: string`\n - `status: string`\n - `tree_id: string`\n\n### Example\n\n```typescript\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell();\n\nconst response = await client.contextDocuments.trees.generate();\n\nconsole.log(response);\n```", perLanguage: { go: { - method: 'client.Integrations.GoogleCalendar.List', + method: 'client.ContextDocuments.Trees.Generate', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t\toption.WithUserID("My User ID"),\n\t)\n\tresponse, err := client.ContextDocuments.Trees.Generate(context.TODO(), hyperspell.ContextDocumentTreeGenerateParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.TreeID)\n}\n', + }, + python: { + method: 'context_documents.trees.generate', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tcalendar, err := client.Integrations.GoogleCalendar.List(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", calendar.Items)\n}\n', + 'import os\nfrom hyperspell import Hyperspell\n\nclient = Hyperspell(\n api_key=os.environ.get("HYPERSPELL_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.context_documents.trees.generate()\nprint(response.tree_id)', + }, + typescript: { + method: 'client.contextDocuments.trees.generate', + example: + "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n userID: 'My User ID',\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.contextDocuments.trees.generate();\n\nconsole.log(response.tree_id);", + }, + http: { + example: + 'curl https://api.hyperspell.com/context-documents/tree \\\n -X POST \\\n -H "Authorization: Bearer $HYPERSPELL_API_KEY"', }, cli: { - method: 'google_calendar list', - example: "hyperspell integrations:google-calendar list \\\n --api-key 'My API Key'", + method: 'trees generate', + example: + "hyperspell context-documents:trees generate \\\n --api-key 'My API Key' \\\n --user-id 'My User ID'", + }, + }, + }, + { + name: 'get_latest', + endpoint: '/context-documents/tree/latest', + httpMethod: 'get', + summary: 'Get the latest context document tree', + description: + 'Get the most recent context document tree for the authenticated app.\n\nBy default, the endpoint returns the latest ready tree. Readiness depends\non whether the app has ``require_review`` enabled:\n\n- `require_review=False` (default): return the latest completed tree.\n- `require_review=True`: return the latest published tree.\n\n``status`` filters to a specific status (case-insensitive). When no ready\ntree exists yet, the endpoint returns the newest available generation\nstate.', + stainlessPath: '(resource) context_documents.trees > (method) get_latest', + qualified: 'client.contextDocuments.trees.getLatest', + params: ['status?: string;'], + response: + "{ completed_at: string; created_at: string; error: string; files: { content: string; path: string; team: string; tier: string; updated_at: string; error?: string; provenance?: object; status?: string; }[]; meta: object; status: string; tree_id: string; version: number; generating?: { created_at: string; status: 'processing' | 'failed'; tree_id: string; error?: string; progress?: object; }; }", + markdown: + "## get_latest\n\n`client.contextDocuments.trees.getLatest(status?: string): { completed_at: string; created_at: string; error: string; files: object[]; meta: object; status: string; tree_id: string; version: number; generating?: object; }`\n\n**get** `/context-documents/tree/latest`\n\nGet the most recent context document tree for the authenticated app.\n\nBy default, the endpoint returns the latest ready tree. Readiness depends\non whether the app has ``require_review`` enabled:\n\n- `require_review=False` (default): return the latest completed tree.\n- `require_review=True`: return the latest published tree.\n\n``status`` filters to a specific status (case-insensitive). When no ready\ntree exists yet, the endpoint returns the newest available generation\nstate.\n\n### Parameters\n\n- `status?: string`\n\n### Returns\n\n- `{ completed_at: string; created_at: string; error: string; files: { content: string; path: string; team: string; tier: string; updated_at: string; error?: string; provenance?: object; status?: string; }[]; meta: object; status: string; tree_id: string; version: number; generating?: { created_at: string; status: 'processing' | 'failed'; tree_id: string; error?: string; progress?: object; }; }`\n\n - `completed_at: string`\n - `created_at: string`\n - `error: string`\n - `files: { content: string; path: string; team: string; tier: string; updated_at: string; error?: string; provenance?: object; status?: string; }[]`\n - `meta: object`\n - `status: string`\n - `tree_id: string`\n - `version: number`\n - `generating?: { created_at: string; status: 'processing' | 'failed'; tree_id: string; error?: string; progress?: object; }`\n\n### Example\n\n```typescript\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell();\n\nconst response = await client.contextDocuments.trees.getLatest();\n\nconsole.log(response);\n```", + perLanguage: { + go: { + method: 'client.ContextDocuments.Trees.GetLatest', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t\toption.WithUserID("My User ID"),\n\t)\n\tresponse, err := client.ContextDocuments.Trees.GetLatest(context.TODO(), hyperspell.ContextDocumentTreeGetLatestParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.TreeID)\n}\n', }, python: { - method: 'integrations.google_calendar.list', + method: 'context_documents.trees.get_latest', example: - 'import os\nfrom hyperspell import Hyperspell\n\nclient = Hyperspell(\n api_key=os.environ.get("HYPERSPELL_API_KEY"), # This is the default and can be omitted\n)\ncalendar = client.integrations.google_calendar.list()\nprint(calendar.items)', + 'import os\nfrom hyperspell import Hyperspell\n\nclient = Hyperspell(\n api_key=os.environ.get("HYPERSPELL_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.context_documents.trees.get_latest()\nprint(response.tree_id)', }, typescript: { - method: 'client.integrations.googleCalendar.list', + method: 'client.contextDocuments.trees.getLatest', example: - "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst calendar = await client.integrations.googleCalendar.list();\n\nconsole.log(calendar.items);", + "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n userID: 'My User ID',\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.contextDocuments.trees.getLatest();\n\nconsole.log(response.tree_id);", }, http: { example: - 'curl https://api.hyperspell.com/integrations/google_calendar/list \\\n -H "Authorization: Bearer $HYPERSPELL_API_KEY"', + 'curl https://api.hyperspell.com/context-documents/tree/latest \\\n -H "Authorization: Bearer $HYPERSPELL_API_KEY"', + }, + cli: { + method: 'trees get_latest', + example: + "hyperspell context-documents:trees get-latest \\\n --api-key 'My API Key' \\\n --user-id 'My User ID'", }, }, }, { - name: 'index', - endpoint: '/integrations/web_crawler/index', + name: 'get', + endpoint: '/context-documents/tree/by-id/{tree_id}', httpMethod: 'get', - summary: 'Crawl a website for indexed search', - description: 'Recursively crawl a website to make it available for indexed search.', - stainlessPath: '(resource) integrations.web_crawler > (method) index', - qualified: 'client.integrations.webCrawler.index', - params: ['url: string;', 'limit?: number;', 'max_depth?: number;'], + summary: 'Get a context document tree', + description: 'Fetch a specific tree by its tree ID instead of selecting the latest one.', + stainlessPath: '(resource) context_documents.trees > (method) get', + qualified: 'client.contextDocuments.trees.get', + params: ['tree_id: string;'], response: - "{ resource_id: string; source: string; status: 'pending' | 'processing' | 'completed' | 'failed' | 'pending_review' | 'skipped'; }", + "{ completed_at: string; created_at: string; error: string; files: { content: string; path: string; team: string; tier: string; updated_at: string; error?: string; provenance?: object; status?: string; }[]; meta: object; status: string; tree_id: string; version: number; generating?: { created_at: string; status: 'processing' | 'failed'; tree_id: string; error?: string; progress?: object; }; }", markdown: - "## index\n\n`client.integrations.webCrawler.index(url: string, limit?: number, max_depth?: number): { resource_id: string; source: string; status: 'pending' | 'processing' | 'completed' | 'failed' | 'pending_review' | 'skipped'; }`\n\n**get** `/integrations/web_crawler/index`\n\nRecursively crawl a website to make it available for indexed search.\n\n### Parameters\n\n- `url: string`\n The base URL of the website to crawl\n\n- `limit?: number`\n Maximum number of pages to crawl in total\n\n- `max_depth?: number`\n Maximum depth of links to follow during crawling\n\n### Returns\n\n- `{ resource_id: string; source: string; status: 'pending' | 'processing' | 'completed' | 'failed' | 'pending_review' | 'skipped'; }`\n\n - `resource_id: string`\n - `source: string`\n - `status: 'pending' | 'processing' | 'completed' | 'failed' | 'pending_review' | 'skipped'`\n\n### Example\n\n```typescript\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell();\n\nconst response = await client.integrations.webCrawler.index({ url: 'url' });\n\nconsole.log(response);\n```", + "## get\n\n`client.contextDocuments.trees.get(tree_id: string): { completed_at: string; created_at: string; error: string; files: object[]; meta: object; status: string; tree_id: string; version: number; generating?: object; }`\n\n**get** `/context-documents/tree/by-id/{tree_id}`\n\nFetch a specific tree by its tree ID instead of selecting the latest one.\n\n### Parameters\n\n- `tree_id: string`\n\n### Returns\n\n- `{ completed_at: string; created_at: string; error: string; files: { content: string; path: string; team: string; tier: string; updated_at: string; error?: string; provenance?: object; status?: string; }[]; meta: object; status: string; tree_id: string; version: number; generating?: { created_at: string; status: 'processing' | 'failed'; tree_id: string; error?: string; progress?: object; }; }`\n\n - `completed_at: string`\n - `created_at: string`\n - `error: string`\n - `files: { content: string; path: string; team: string; tier: string; updated_at: string; error?: string; provenance?: object; status?: string; }[]`\n - `meta: object`\n - `status: string`\n - `tree_id: string`\n - `version: number`\n - `generating?: { created_at: string; status: 'processing' | 'failed'; tree_id: string; error?: string; progress?: object; }`\n\n### Example\n\n```typescript\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell();\n\nconst tree = await client.contextDocuments.trees.get('tree_id');\n\nconsole.log(tree);\n```", perLanguage: { go: { - method: 'client.Integrations.WebCrawler.Index', + method: 'client.ContextDocuments.Trees.Get', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t\toption.WithUserID("My User ID"),\n\t)\n\ttree, err := client.ContextDocuments.Trees.Get(context.TODO(), "tree_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", tree.TreeID)\n}\n', + }, + python: { + method: 'context_documents.trees.get', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Integrations.WebCrawler.Index(context.TODO(), hyperspell.IntegrationWebCrawlerIndexParams{\n\t\tURL: "url",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.ResourceID)\n}\n', + 'import os\nfrom hyperspell import Hyperspell\n\nclient = Hyperspell(\n api_key=os.environ.get("HYPERSPELL_API_KEY"), # This is the default and can be omitted\n)\ntree = client.context_documents.trees.get(\n "tree_id",\n)\nprint(tree.tree_id)', + }, + typescript: { + method: 'client.contextDocuments.trees.get', + example: + "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n userID: 'My User ID',\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst tree = await client.contextDocuments.trees.get('tree_id');\n\nconsole.log(tree.tree_id);", + }, + http: { + example: + 'curl https://api.hyperspell.com/context-documents/tree/by-id/$TREE_ID \\\n -H "Authorization: Bearer $HYPERSPELL_API_KEY"', }, cli: { - method: 'web_crawler index', - example: "hyperspell integrations:web-crawler index \\\n --api-key 'My API Key' \\\n --url url", + method: 'trees get', + example: + "hyperspell context-documents:trees get \\\n --api-key 'My API Key' \\\n --user-id 'My User ID' \\\n --tree-id tree_id", + }, + }, + }, + { + name: 'progress', + endpoint: '/context-documents/tree/{tree_id}/progress', + httpMethod: 'get', + summary: 'Get tree generation progress', + description: + 'Return the generation progress for a single tree.\n\nActive generations include phase and counter data. Completed generations,\nand generations without detailed progress data, return status only.', + stainlessPath: '(resource) context_documents.trees > (method) progress', + qualified: 'client.contextDocuments.trees.progress', + params: ['tree_id: string;'], + response: + '{ status: string; tree_id: string; completed_docs?: number; failed_docs?: number; failed_keys?: string[]; phase?: string; total_docs?: number; }', + markdown: + "## progress\n\n`client.contextDocuments.trees.progress(tree_id: string): { status: string; tree_id: string; completed_docs?: number; failed_docs?: number; failed_keys?: string[]; phase?: string; total_docs?: number; }`\n\n**get** `/context-documents/tree/{tree_id}/progress`\n\nReturn the generation progress for a single tree.\n\nActive generations include phase and counter data. Completed generations,\nand generations without detailed progress data, return status only.\n\n### Parameters\n\n- `tree_id: string`\n\n### Returns\n\n- `{ status: string; tree_id: string; completed_docs?: number; failed_docs?: number; failed_keys?: string[]; phase?: string; total_docs?: number; }`\n Response shape for GET /context-documents/tree/{tree_id}/progress.\n\n - `status: string`\n - `tree_id: string`\n - `completed_docs?: number`\n - `failed_docs?: number`\n - `failed_keys?: string[]`\n - `phase?: string`\n - `total_docs?: number`\n\n### Example\n\n```typescript\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell();\n\nconst response = await client.contextDocuments.trees.progress('tree_id');\n\nconsole.log(response);\n```", + perLanguage: { + go: { + method: 'client.ContextDocuments.Trees.Progress', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t\toption.WithUserID("My User ID"),\n\t)\n\tresponse, err := client.ContextDocuments.Trees.Progress(context.TODO(), "tree_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.TreeID)\n}\n', }, python: { - method: 'integrations.web_crawler.index', + method: 'context_documents.trees.progress', example: - 'import os\nfrom hyperspell import Hyperspell\n\nclient = Hyperspell(\n api_key=os.environ.get("HYPERSPELL_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.integrations.web_crawler.index(\n url="url",\n)\nprint(response.resource_id)', + 'import os\nfrom hyperspell import Hyperspell\n\nclient = Hyperspell(\n api_key=os.environ.get("HYPERSPELL_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.context_documents.trees.progress(\n "tree_id",\n)\nprint(response.tree_id)', }, typescript: { - method: 'client.integrations.webCrawler.index', + method: 'client.contextDocuments.trees.progress', example: - "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.integrations.webCrawler.index({ url: 'url' });\n\nconsole.log(response.resource_id);", + "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n userID: 'My User ID',\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.contextDocuments.trees.progress('tree_id');\n\nconsole.log(response.tree_id);", }, http: { example: - 'curl https://api.hyperspell.com/integrations/web_crawler/index \\\n -H "Authorization: Bearer $HYPERSPELL_API_KEY"', + 'curl https://api.hyperspell.com/context-documents/tree/$TREE_ID/progress \\\n -H "Authorization: Bearer $HYPERSPELL_API_KEY"', + }, + cli: { + method: 'trees progress', + example: + "hyperspell context-documents:trees progress \\\n --api-key 'My API Key' \\\n --user-id 'My User ID' \\\n --tree-id tree_id", + }, + }, + }, + { + name: 'generate', + endpoint: '/context-documents/digest', + httpMethod: 'post', + summary: 'Generate a daily company digest', + description: + 'Generate a date-windowed "what the company did today" digest.\n\nReturns immediately with a tree ID. Poll\n``GET /context-documents/tree/{tree_id}/progress`` for completion or fetch\nthe result with ``GET /context-documents/tree/by-id/{tree_id}``.', + stainlessPath: '(resource) context_documents.digests > (method) generate', + qualified: 'client.contextDocuments.digests.generate', + params: ['period?: string;', 'sources?: string[];', 'window_end?: string;', 'window_start?: string;'], + response: '{ created_at: string; status: string; tree_id: string; }', + markdown: + "## generate\n\n`client.contextDocuments.digests.generate(period?: string, sources?: string[], window_end?: string, window_start?: string): { created_at: string; status: string; tree_id: string; }`\n\n**post** `/context-documents/digest`\n\nGenerate a date-windowed \"what the company did today\" digest.\n\nReturns immediately with a tree ID. Poll\n``GET /context-documents/tree/{tree_id}/progress`` for completion or fetch\nthe result with ``GET /context-documents/tree/by-id/{tree_id}``.\n\n### Parameters\n\n- `period?: string`\n Digest cadence: 'daily' or 'weekly'. Sets the default window when none is given.\n\n- `sources?: string[]`\n Integration sources to include (e.g., ['slack', 'github']). Defaults to all.\n\n- `window_end?: string`\n Exclusive upper bound of the digest window. Defaults to now.\n\n- `window_start?: string`\n Inclusive lower bound of the digest window. Defaults to midnight UTC today (paired with window_end=now) when omitted. Both bounds must be supplied together.\n\n### Returns\n\n- `{ created_at: string; status: string; tree_id: string; }`\n\n - `created_at: string`\n - `status: string`\n - `tree_id: string`\n\n### Example\n\n```typescript\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell();\n\nconst response = await client.contextDocuments.digests.generate();\n\nconsole.log(response);\n```", + perLanguage: { + go: { + method: 'client.ContextDocuments.Digests.Generate', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t\toption.WithUserID("My User ID"),\n\t)\n\tresponse, err := client.ContextDocuments.Digests.Generate(context.TODO(), hyperspell.ContextDocumentDigestGenerateParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.TreeID)\n}\n', + }, + python: { + method: 'context_documents.digests.generate', + example: + 'import os\nfrom hyperspell import Hyperspell\n\nclient = Hyperspell(\n api_key=os.environ.get("HYPERSPELL_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.context_documents.digests.generate()\nprint(response.tree_id)', + }, + typescript: { + method: 'client.contextDocuments.digests.generate', + example: + "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n userID: 'My User ID',\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.contextDocuments.digests.generate();\n\nconsole.log(response.tree_id);", + }, + http: { + example: + "curl https://api.hyperspell.com/context-documents/digest \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: Bearer $HYPERSPELL_API_KEY\" \\\n -d '{}'", + }, + cli: { + method: 'digests generate', + example: + "hyperspell context-documents:digests generate \\\n --api-key 'My API Key' \\\n --user-id 'My User ID'", }, }, }, { name: 'list', - endpoint: '/integrations/slack/list', + endpoint: '/context-documents/digest/list', + httpMethod: 'get', + summary: 'List daily digests for the app', + description: + 'List recent digest summaries, newest first.\n\nFilter by cadence with ``period=daily`` or ``period=weekly``. Fetch full\ncontent with ``GET /context-documents/tree/by-id/{tree_id}``.', + stainlessPath: '(resource) context_documents.digests > (method) list', + qualified: 'client.contextDocuments.digests.list', + params: ['limit?: number;', 'period?: string;'], + response: + '{ digests: { completed_at: string; created_at: string; period: string; status: string; tree_id: string; window_end: string; window_start: string; }[]; }', + markdown: + "## list\n\n`client.contextDocuments.digests.list(limit?: number, period?: string): { digests: object[]; }`\n\n**get** `/context-documents/digest/list`\n\nList recent digest summaries, newest first.\n\nFilter by cadence with ``period=daily`` or ``period=weekly``. Fetch full\ncontent with ``GET /context-documents/tree/by-id/{tree_id}``.\n\n### Parameters\n\n- `limit?: number`\n\n- `period?: string`\n\n### Returns\n\n- `{ digests: { completed_at: string; created_at: string; period: string; status: string; tree_id: string; window_end: string; window_start: string; }[]; }`\n\n - `digests: { completed_at: string; created_at: string; period: string; status: string; tree_id: string; window_end: string; window_start: string; }[]`\n\n### Example\n\n```typescript\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell();\n\nconst digests = await client.contextDocuments.digests.list();\n\nconsole.log(digests);\n```", + perLanguage: { + go: { + method: 'client.ContextDocuments.Digests.List', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t\toption.WithUserID("My User ID"),\n\t)\n\tdigests, err := client.ContextDocuments.Digests.List(context.TODO(), hyperspell.ContextDocumentDigestListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", digests.Digests)\n}\n', + }, + python: { + method: 'context_documents.digests.list', + example: + 'import os\nfrom hyperspell import Hyperspell\n\nclient = Hyperspell(\n api_key=os.environ.get("HYPERSPELL_API_KEY"), # This is the default and can be omitted\n)\ndigests = client.context_documents.digests.list()\nprint(digests.digests)', + }, + typescript: { + method: 'client.contextDocuments.digests.list', + example: + "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n userID: 'My User ID',\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst digests = await client.contextDocuments.digests.list();\n\nconsole.log(digests.digests);", + }, + http: { + example: + 'curl https://api.hyperspell.com/context-documents/digest/list \\\n -H "Authorization: Bearer $HYPERSPELL_API_KEY"', + }, + cli: { + method: 'digests list', + example: + "hyperspell context-documents:digests list \\\n --api-key 'My API Key' \\\n --user-id 'My User ID'", + }, + }, + }, + { + name: 'get', + endpoint: '/context-documents/config', httpMethod: 'get', - summary: 'List available Slack conversations', + summary: 'Get brain generation settings', + description: 'Read the customer-editable generation config for the authenticated app.', + stainlessPath: '(resource) context_documents.config > (method) get', + qualified: 'client.contextDocuments.config.get', + response: + '{ prompts: object; source_weights: object; structure: object; detected_domain?: string; domain?: string; }', + markdown: + "## get\n\n`client.contextDocuments.config.get(): { prompts: object; source_weights: object; structure: object; detected_domain?: string; domain?: string; }`\n\n**get** `/context-documents/config`\n\nRead the customer-editable generation config for the authenticated app.\n\n### Returns\n\n- `{ prompts: object; source_weights: object; structure: object; detected_domain?: string; domain?: string; }`\n Brain-generation settings that customers can view and edit.\n\n - `prompts: object`\n - `source_weights: object`\n - `structure: object`\n - `detected_domain?: string`\n - `domain?: string`\n\n### Example\n\n```typescript\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell();\n\nconst config = await client.contextDocuments.config.get();\n\nconsole.log(config);\n```", + perLanguage: { + go: { + method: 'client.ContextDocuments.Config.Get', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t\toption.WithUserID("My User ID"),\n\t)\n\tconfig, err := client.ContextDocuments.Config.Get(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", config.Prompts)\n}\n', + }, + python: { + method: 'context_documents.config.get', + example: + 'import os\nfrom hyperspell import Hyperspell\n\nclient = Hyperspell(\n api_key=os.environ.get("HYPERSPELL_API_KEY"), # This is the default and can be omitted\n)\nconfig = client.context_documents.config.get()\nprint(config.prompts)', + }, + typescript: { + method: 'client.contextDocuments.config.get', + example: + "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n userID: 'My User ID',\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst config = await client.contextDocuments.config.get();\n\nconsole.log(config.prompts);", + }, + http: { + example: + 'curl https://api.hyperspell.com/context-documents/config \\\n -H "Authorization: Bearer $HYPERSPELL_API_KEY"', + }, + cli: { + method: 'config get', + example: + "hyperspell context-documents:config get \\\n --api-key 'My API Key' \\\n --user-id 'My User ID'", + }, + }, + }, + { + name: 'update', + endpoint: '/context-documents/config', + httpMethod: 'patch', + summary: 'Update brain generation settings', description: - "List Slack conversations accessible to the user via the live Nango connection.\n\nReturns minimal channel metadata suitable for selection UIs. If required\nscopes are missing, Slack's error is propagated with details.\n\nSupports filtering by channels, including/excluding private channels, DMs,\ngroup DMs, and archived channels based on the provided search options.", - stainlessPath: '(resource) integrations.slack > (method) list', - qualified: 'client.integrations.slack.list', + 'Update the supplied generation settings.\n\nChanges apply to the next generation. This endpoint does not start a\ngeneration or modify existing context documents.', + stainlessPath: '(resource) context_documents.config > (method) update', + qualified: 'client.contextDocuments.config.update', params: [ - 'channels?: string[];', - 'exclude_archived?: boolean;', - 'include_dms?: boolean;', - 'include_group_dms?: boolean;', - 'include_private?: boolean;', + 'company_prompts?: object;', + 'detection_prompt?: string;', + 'domain?: string;', + 'personal_prompt?: string;', + 'source_weights?: object;', + 'structure?: { company?: { filename: string; key: string; prompt: string; search_queries: string[]; }[]; workstream?: { filename: string; key: string; prompt: string; search_queries: string[]; }[]; };', + 'workstream_prompts?: object;', ], - response: 'object', + response: + '{ prompts: object; source_weights: object; structure: object; detected_domain?: string; domain?: string; }', markdown: - "## list\n\n`client.integrations.slack.list(channels?: string[], exclude_archived?: boolean, include_dms?: boolean, include_group_dms?: boolean, include_private?: boolean): object`\n\n**get** `/integrations/slack/list`\n\nList Slack conversations accessible to the user via the live Nango connection.\n\nReturns minimal channel metadata suitable for selection UIs. If required\nscopes are missing, Slack's error is propagated with details.\n\nSupports filtering by channels, including/excluding private channels, DMs,\ngroup DMs, and archived channels based on the provided search options.\n\n### Parameters\n\n- `channels?: string[]`\n List of Slack channels to include (by id, name, or #name).\n\n- `exclude_archived?: boolean`\n If set, pass 'exclude_archived' to Slack. If None, omit the param.\n\n- `include_dms?: boolean`\n Include direct messages (im) when listing conversations.\n\n- `include_group_dms?: boolean`\n Include group DMs (mpim) when listing conversations.\n\n- `include_private?: boolean`\n Include private channels when constructing Slack 'types'.\n\n### Returns\n\n- `object`\n\n### Example\n\n```typescript\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell();\n\nconst slacks = await client.integrations.slack.list();\n\nconsole.log(slacks);\n```", + "## update\n\n`client.contextDocuments.config.update(company_prompts?: object, detection_prompt?: string, domain?: string, personal_prompt?: string, source_weights?: object, structure?: { company?: { filename: string; key: string; prompt: string; search_queries: string[]; }[]; workstream?: { filename: string; key: string; prompt: string; search_queries: string[]; }[]; }, workstream_prompts?: object): { prompts: object; source_weights: object; structure: object; detected_domain?: string; domain?: string; }`\n\n**patch** `/context-documents/config`\n\nUpdate the supplied generation settings.\n\nChanges apply to the next generation. This endpoint does not start a\ngeneration or modify existing context documents.\n\n### Parameters\n\n- `company_prompts?: object`\n\n- `detection_prompt?: string`\n\n- `domain?: string`\n\n- `personal_prompt?: string`\n\n- `source_weights?: object`\n\n- `structure?: { company?: { filename: string; key: string; prompt: string; search_queries: string[]; }[]; workstream?: { filename: string; key: string; prompt: string; search_queries: string[]; }[]; }`\n Per-tier document definitions for custom generation.\n - `company?: { filename: string; key: string; prompt: string; search_queries: string[]; }[]`\n - `workstream?: { filename: string; key: string; prompt: string; search_queries: string[]; }[]`\n\n- `workstream_prompts?: object`\n\n### Returns\n\n- `{ prompts: object; source_weights: object; structure: object; detected_domain?: string; domain?: string; }`\n Brain-generation settings that customers can view and edit.\n\n - `prompts: object`\n - `source_weights: object`\n - `structure: object`\n - `detected_domain?: string`\n - `domain?: string`\n\n### Example\n\n```typescript\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell();\n\nconst config = await client.contextDocuments.config.update();\n\nconsole.log(config);\n```", perLanguage: { go: { - method: 'client.Integrations.Slack.List', + method: 'client.ContextDocuments.Config.Update', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tslacks, err := client.Integrations.Slack.List(context.TODO(), hyperspell.IntegrationSlackListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", slacks)\n}\n', + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t\toption.WithUserID("My User ID"),\n\t)\n\tconfig, err := client.ContextDocuments.Config.Update(context.TODO(), hyperspell.ContextDocumentConfigUpdateParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", config.Prompts)\n}\n', + }, + python: { + method: 'context_documents.config.update', + example: + 'import os\nfrom hyperspell import Hyperspell\n\nclient = Hyperspell(\n api_key=os.environ.get("HYPERSPELL_API_KEY"), # This is the default and can be omitted\n)\nconfig = client.context_documents.config.update()\nprint(config.prompts)', + }, + typescript: { + method: 'client.contextDocuments.config.update', + example: + "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n userID: 'My User ID',\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst config = await client.contextDocuments.config.update();\n\nconsole.log(config.prompts);", + }, + http: { + example: + "curl https://api.hyperspell.com/context-documents/config \\\n -X PATCH \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: Bearer $HYPERSPELL_API_KEY\" \\\n -d '{}'", }, cli: { - method: 'slack list', - example: "hyperspell integrations:slack list \\\n --api-key 'My API Key'", + method: 'config update', + example: + "hyperspell context-documents:config update \\\n --api-key 'My API Key' \\\n --user-id 'My User ID'", + }, + }, + }, + { + name: 'reset', + endpoint: '/context-documents/config/reset', + httpMethod: 'post', + summary: 'Reset brain generation settings', + description: + 'Reset customer-editable generation settings to their defaults.\n\nExisting context documents remain unchanged. ``detected_domain`` is retained\nand used for future generations unless a new domain override is set.', + stainlessPath: '(resource) context_documents.config > (method) reset', + qualified: 'client.contextDocuments.config.reset', + response: + '{ prompts: object; source_weights: object; structure: object; detected_domain?: string; domain?: string; }', + markdown: + "## reset\n\n`client.contextDocuments.config.reset(): { prompts: object; source_weights: object; structure: object; detected_domain?: string; domain?: string; }`\n\n**post** `/context-documents/config/reset`\n\nReset customer-editable generation settings to their defaults.\n\nExisting context documents remain unchanged. ``detected_domain`` is retained\nand used for future generations unless a new domain override is set.\n\n### Returns\n\n- `{ prompts: object; source_weights: object; structure: object; detected_domain?: string; domain?: string; }`\n Brain-generation settings that customers can view and edit.\n\n - `prompts: object`\n - `source_weights: object`\n - `structure: object`\n - `detected_domain?: string`\n - `domain?: string`\n\n### Example\n\n```typescript\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell();\n\nconst response = await client.contextDocuments.config.reset();\n\nconsole.log(response);\n```", + perLanguage: { + go: { + method: 'client.ContextDocuments.Config.Reset', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t\toption.WithUserID("My User ID"),\n\t)\n\tresponse, err := client.ContextDocuments.Config.Reset(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Prompts)\n}\n', }, python: { - method: 'integrations.slack.list', + method: 'context_documents.config.reset', example: - 'import os\nfrom hyperspell import Hyperspell\n\nclient = Hyperspell(\n api_key=os.environ.get("HYPERSPELL_API_KEY"), # This is the default and can be omitted\n)\nslacks = client.integrations.slack.list()\nprint(slacks)', + 'import os\nfrom hyperspell import Hyperspell\n\nclient = Hyperspell(\n api_key=os.environ.get("HYPERSPELL_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.context_documents.config.reset()\nprint(response.prompts)', }, typescript: { - method: 'client.integrations.slack.list', + method: 'client.contextDocuments.config.reset', example: - "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst slacks = await client.integrations.slack.list();\n\nconsole.log(slacks);", + "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n userID: 'My User ID',\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.contextDocuments.config.reset();\n\nconsole.log(response.prompts);", }, http: { example: - 'curl https://api.hyperspell.com/integrations/slack/list \\\n -H "Authorization: Bearer $HYPERSPELL_API_KEY"', + 'curl https://api.hyperspell.com/context-documents/config/reset \\\n -X POST \\\n -H "Authorization: Bearer $HYPERSPELL_API_KEY"', + }, + cli: { + method: 'config reset', + example: + "hyperspell context-documents:config reset \\\n --api-key 'My API Key' \\\n --user-id 'My User ID'", }, }, }, @@ -511,19 +919,14 @@ const EMBEDDED_METHODS: MethodEntry[] = [ 'resource_id?: string;', 'title?: string;', ], - response: - "{ resource_id: string; source: string; status: 'pending' | 'processing' | 'completed' | 'failed' | 'pending_review' | 'skipped'; }", + response: '{ resource_id: string; source: string; status: string; }', markdown: - "## add\n\n`client.memories.add(text: string, collection?: string, date?: string, metadata?: object, resource_id?: string, title?: string): { resource_id: string; source: string; status: 'pending' | 'processing' | 'completed' | 'failed' | 'pending_review' | 'skipped'; }`\n\n**post** `/memories/add`\n\nAdds an arbitrary document to the index. This can be any text, email,\ncall transcript, etc. The document will be processed and made available for\nquerying once the processing is complete.\n\n### Parameters\n\n- `text: string`\n Full text of the document.\n\n- `collection?: string`\n The collection to add the document to — deprecated, set the collection using metadata instead.\n\n- `date?: string`\n Date of the document. Depending on the document, this could be the creation date or date the document was last updated (eg. for a chat transcript, this would be the date of the last message). This helps the ranking algorithm and allows you to filter by date range.\n\n- `metadata?: object`\n Custom metadata for filtering. Keys must be alphanumeric with underscores, max 64 chars. Values must be string, number, boolean, or null.\n\n- `resource_id?: string`\n The resource ID to add the document to. If not provided, a new resource ID will be generated. If provided, the document will be updated if it already exists.\n\n- `title?: string`\n Title of the document.\n\n### Returns\n\n- `{ resource_id: string; source: string; status: 'pending' | 'processing' | 'completed' | 'failed' | 'pending_review' | 'skipped'; }`\n\n - `resource_id: string`\n - `source: string`\n - `status: 'pending' | 'processing' | 'completed' | 'failed' | 'pending_review' | 'skipped'`\n\n### Example\n\n```typescript\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell();\n\nconst memoryStatus = await client.memories.add({ text: '...' });\n\nconsole.log(memoryStatus);\n```", + "## add\n\n`client.memories.add(text: string, collection?: string, date?: string, metadata?: object, resource_id?: string, title?: string): { resource_id: string; source: string; status: string; }`\n\n**post** `/memories/add`\n\nAdds an arbitrary document to the index. This can be any text, email,\ncall transcript, etc. The document will be processed and made available for\nquerying once the processing is complete.\n\n### Parameters\n\n- `text: string`\n Full text of the document.\n\n- `collection?: string`\n The collection to add the document to — deprecated, set the collection using metadata instead.\n\n- `date?: string`\n Date of the document. Depending on the document, this could be the creation date or date the document was last updated (eg. for a chat transcript, this would be the date of the last message). This helps the ranking algorithm and allows you to filter by date range.\n\n- `metadata?: object`\n Custom metadata for filtering. Keys must be alphanumeric with underscores, max 64 chars. Values must be string, number, boolean, or null.\n\n- `resource_id?: string`\n The resource ID to add the document to. If not provided, a new resource ID will be generated. If provided, the document will be updated if it already exists.\n\n- `title?: string`\n Title of the document.\n\n### Returns\n\n- `{ resource_id: string; source: string; status: string; }`\n\n - `resource_id: string`\n - `source: string`\n - `status: string`\n\n### Example\n\n```typescript\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell();\n\nconst memoryStatus = await client.memories.add({ text: '...' });\n\nconsole.log(memoryStatus);\n```", perLanguage: { go: { method: 'client.Memories.Add', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tmemoryStatus, err := client.Memories.Add(context.TODO(), hyperspell.MemoryAddParams{\n\t\tText: "...",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", memoryStatus.ResourceID)\n}\n', - }, - cli: { - method: 'memories add', - example: "hyperspell memories add \\\n --api-key 'My API Key' \\\n --text ...", + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t\toption.WithUserID("My User ID"),\n\t)\n\tmemoryStatus, err := client.Memories.Add(context.TODO(), hyperspell.MemoryAddParams{\n\t\tText: "...",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", memoryStatus.ResourceID)\n}\n', }, python: { method: 'memories.add', @@ -533,12 +936,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [ typescript: { method: 'client.memories.add', example: - "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst memoryStatus = await client.memories.add({ text: '...' });\n\nconsole.log(memoryStatus.resource_id);", + "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n userID: 'My User ID',\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst memoryStatus = await client.memories.add({ text: '...' });\n\nconsole.log(memoryStatus.resource_id);", }, http: { example: 'curl https://api.hyperspell.com/memories/add \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $HYPERSPELL_API_KEY" \\\n -d \'{\n "text": "...",\n "collection": "my-collection",\n "metadata": {\n "author": "John Doe",\n "date": "2025-05-20T02:31:00Z",\n "rating": 3\n },\n "title": "My Document"\n }\'', }, + cli: { + method: 'memories add', + example: + "hyperspell memories add \\\n --api-key 'My API Key' \\\n --user-id 'My User ID' \\\n --text ...", + }, }, }, { @@ -547,25 +955,21 @@ const EMBEDDED_METHODS: MethodEntry[] = [ httpMethod: 'post', summary: 'Add multiple memories', description: - 'Adds multiple documents to the index in a single request.\n\nAll items are validated before any database operations occur. If any item\nfails validation, the entire batch is rejected with a 422 error detailing\nwhich items failed and why.\n\nMaximum 100 items per request. Each item follows the same schema as the\nsingle-item /memories/add endpoint.', + 'Adds multiple documents to the index in a single request.\n\nAll items are validated before processing begins. If any item fails\nvalidation, the entire batch is rejected with a 422 error detailing which\nitems failed and why.\n\nMaximum 100 items per request. Each item follows the same schema as the\nsingle-item /memories/add endpoint.', stainlessPath: '(resource) memories > (method) add_bulk', qualified: 'client.memories.addBulk', params: [ 'items: { text: string; collection?: string; date?: string; metadata?: object; resource_id?: string; title?: string; }[];', ], response: - "{ count: number; items: { resource_id: string; source: string; status: 'pending' | 'processing' | 'completed' | 'failed' | 'pending_review' | 'skipped'; }[]; success?: boolean; }", + '{ count: number; items: { resource_id: string; source: string; status: string; }[]; skipped?: { reason: string; resource_id: string; }[]; success?: boolean; }', markdown: - "## add_bulk\n\n`client.memories.addBulk(items: { text: string; collection?: string; date?: string; metadata?: object; resource_id?: string; title?: string; }[]): { count: number; items: memory_status[]; success?: boolean; }`\n\n**post** `/memories/add/bulk`\n\nAdds multiple documents to the index in a single request.\n\nAll items are validated before any database operations occur. If any item\nfails validation, the entire batch is rejected with a 422 error detailing\nwhich items failed and why.\n\nMaximum 100 items per request. Each item follows the same schema as the\nsingle-item /memories/add endpoint.\n\n### Parameters\n\n- `items: { text: string; collection?: string; date?: string; metadata?: object; resource_id?: string; title?: string; }[]`\n List of memories to ingest. Maximum 100 items.\n\n### Returns\n\n- `{ count: number; items: { resource_id: string; source: string; status: 'pending' | 'processing' | 'completed' | 'failed' | 'pending_review' | 'skipped'; }[]; success?: boolean; }`\n Response schema for successful bulk ingestion.\n\n - `count: number`\n - `items: { resource_id: string; source: string; status: 'pending' | 'processing' | 'completed' | 'failed' | 'pending_review' | 'skipped'; }[]`\n - `success?: boolean`\n\n### Example\n\n```typescript\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell();\n\nconst response = await client.memories.addBulk({ items: [{ text: '...' }] });\n\nconsole.log(response);\n```", + "## add_bulk\n\n`client.memories.addBulk(items: { text: string; collection?: string; date?: string; metadata?: object; resource_id?: string; title?: string; }[]): { count: number; items: memory_status[]; skipped?: object[]; success?: boolean; }`\n\n**post** `/memories/add/bulk`\n\nAdds multiple documents to the index in a single request.\n\nAll items are validated before processing begins. If any item fails\nvalidation, the entire batch is rejected with a 422 error detailing which\nitems failed and why.\n\nMaximum 100 items per request. Each item follows the same schema as the\nsingle-item /memories/add endpoint.\n\n### Parameters\n\n- `items: { text: string; collection?: string; date?: string; metadata?: object; resource_id?: string; title?: string; }[]`\n List of memories to ingest. Maximum 100 items.\n\n### Returns\n\n- `{ count: number; items: { resource_id: string; source: string; status: string; }[]; skipped?: { reason: string; resource_id: string; }[]; success?: boolean; }`\n Response schema for successful bulk ingestion.\n\n - `count: number`\n - `items: { resource_id: string; source: string; status: string; }[]`\n - `skipped?: { reason: string; resource_id: string; }[]`\n - `success?: boolean`\n\n### Example\n\n```typescript\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell();\n\nconst response = await client.memories.addBulk({ items: [{ text: '...' }] });\n\nconsole.log(response);\n```", perLanguage: { go: { method: 'client.Memories.AddBulk', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Memories.AddBulk(context.TODO(), hyperspell.MemoryAddBulkParams{\n\t\tItems: []hyperspell.MemoryAddBulkParamsItem{{\n\t\t\tText: "...",\n\t\t}},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Count)\n}\n', - }, - cli: { - method: 'memories add_bulk', - example: "hyperspell memories add-bulk \\\n --api-key 'My API Key' \\\n --item '{text: ...}'", + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t\toption.WithUserID("My User ID"),\n\t)\n\tresponse, err := client.Memories.AddBulk(context.TODO(), hyperspell.MemoryAddBulkParams{\n\t\tItems: []hyperspell.MemoryAddBulkParamsItem{{\n\t\t\tText: "...",\n\t\t}},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Count)\n}\n', }, python: { method: 'memories.add_bulk', @@ -575,12 +979,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [ typescript: { method: 'client.memories.addBulk', example: - "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.memories.addBulk({ items: [{ text: '...' }] });\n\nconsole.log(response.count);", + "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n userID: 'My User ID',\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.memories.addBulk({ items: [{ text: '...' }] });\n\nconsole.log(response.count);", }, http: { example: 'curl https://api.hyperspell.com/memories/add/bulk \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $HYPERSPELL_API_KEY" \\\n -d \'{\n "items": [\n {\n "text": "...",\n "collection": "my-collection",\n "metadata": {\n "author": "John Doe",\n "date": "2025-05-20T02:31:00Z",\n "rating": 3\n },\n "title": "My Document"\n }\n ]\n }\'', }, + cli: { + method: 'memories add_bulk', + example: + "hyperspell memories add-bulk \\\n --api-key 'My API Key' \\\n --user-id 'My User ID' \\\n --item '{text: ...}'", + }, }, }, { @@ -593,19 +1002,14 @@ const EMBEDDED_METHODS: MethodEntry[] = [ stainlessPath: '(resource) memories > (method) upload', qualified: 'client.memories.upload', params: ['file: string;', 'collection?: string;', 'metadata?: string;'], - response: - "{ resource_id: string; source: string; status: 'pending' | 'processing' | 'completed' | 'failed' | 'pending_review' | 'skipped'; }", + response: '{ resource_id: string; source: string; status: string; }', markdown: - "## upload\n\n`client.memories.upload(file: string, collection?: string, metadata?: string): { resource_id: string; source: string; status: 'pending' | 'processing' | 'completed' | 'failed' | 'pending_review' | 'skipped'; }`\n\n**post** `/memories/upload`\n\nThis endpoint will upload a file to the index and return a resource_id.\nThe file will be processed in the background and the memory will be available for querying once the processing is complete.\nYou can use the `resource_id` to query the memory later, and check the status of the memory.\n\n### Parameters\n\n- `file: string`\n The file to ingest.\n\n- `collection?: string`\n The collection to add the document to — deprecated, set the collection using metadata instead.\n\n- `metadata?: string`\n Custom metadata as JSON string for filtering. Keys must be alphanumeric with underscores, max 64 chars. Values must be string, number, or boolean.\n\n### Returns\n\n- `{ resource_id: string; source: string; status: 'pending' | 'processing' | 'completed' | 'failed' | 'pending_review' | 'skipped'; }`\n\n - `resource_id: string`\n - `source: string`\n - `status: 'pending' | 'processing' | 'completed' | 'failed' | 'pending_review' | 'skipped'`\n\n### Example\n\n```typescript\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell();\n\nconst memoryStatus = await client.memories.upload({ file: fs.createReadStream('path/to/file') });\n\nconsole.log(memoryStatus);\n```", + "## upload\n\n`client.memories.upload(file: string, collection?: string, metadata?: string): { resource_id: string; source: string; status: string; }`\n\n**post** `/memories/upload`\n\nThis endpoint will upload a file to the index and return a resource_id.\nThe file will be processed in the background and the memory will be available for querying once the processing is complete.\nYou can use the `resource_id` to query the memory later, and check the status of the memory.\n\n### Parameters\n\n- `file: string`\n The file to ingest.\n\n- `collection?: string`\n The collection to add the document to — deprecated, set the collection using metadata instead.\n\n- `metadata?: string`\n Custom metadata as JSON string for filtering. Keys must be alphanumeric with underscores, max 64 chars. Values must be string, number, or boolean.\n\n### Returns\n\n- `{ resource_id: string; source: string; status: string; }`\n\n - `resource_id: string`\n - `source: string`\n - `status: string`\n\n### Example\n\n```typescript\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell();\n\nconst memoryStatus = await client.memories.upload({ file: fs.createReadStream('path/to/file') });\n\nconsole.log(memoryStatus);\n```", perLanguage: { go: { method: 'client.Memories.Upload', example: - 'package main\n\nimport (\n\t"bytes"\n\t"context"\n\t"fmt"\n\t"io"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tmemoryStatus, err := client.Memories.Upload(context.TODO(), hyperspell.MemoryUploadParams{\n\t\tFile: io.Reader(bytes.NewBuffer([]byte("Example data"))),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", memoryStatus.ResourceID)\n}\n', - }, - cli: { - method: 'memories upload', - example: "hyperspell memories upload \\\n --api-key 'My API Key' \\\n --file 'Example data'", + 'package main\n\nimport (\n\t"bytes"\n\t"context"\n\t"fmt"\n\t"io"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t\toption.WithUserID("My User ID"),\n\t)\n\tmemoryStatus, err := client.Memories.Upload(context.TODO(), hyperspell.MemoryUploadParams{\n\t\tFile: io.Reader(bytes.NewBuffer([]byte("Example data"))),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", memoryStatus.ResourceID)\n}\n', }, python: { method: 'memories.upload', @@ -615,12 +1019,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [ typescript: { method: 'client.memories.upload', example: - "import fs from 'fs';\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst memoryStatus = await client.memories.upload({ file: fs.createReadStream('path/to/file') });\n\nconsole.log(memoryStatus.resource_id);", + "import fs from 'fs';\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n userID: 'My User ID',\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst memoryStatus = await client.memories.upload({ file: fs.createReadStream('path/to/file') });\n\nconsole.log(memoryStatus.resource_id);", }, http: { example: "curl https://api.hyperspell.com/memories/upload \\\n -H 'Content-Type: multipart/form-data' \\\n -H \"Authorization: Bearer $HYPERSPELL_API_KEY\" \\\n -F 'file=@/path/to/file'", }, + cli: { + method: 'memories upload', + example: + "hyperspell memories upload \\\n --api-key 'My API Key' \\\n --user-id 'My User ID' \\\n --file 'Example data'", + }, }, }, { @@ -641,20 +1050,14 @@ const EMBEDDED_METHODS: MethodEntry[] = [ 'text?: string | object;', 'title?: string | object;', ], - response: - "{ resource_id: string; source: string; status: 'pending' | 'processing' | 'completed' | 'failed' | 'pending_review' | 'skipped'; }", + response: '{ resource_id: string; source: string; status: string; }', markdown: - "## update\n\n`client.memories.update(source: string, resource_id: string, collection?: string | object, date?: string | object, metadata?: object | object, text?: string | object, title?: string | object): { resource_id: string; source: string; status: 'pending' | 'processing' | 'completed' | 'failed' | 'pending_review' | 'skipped'; }`\n\n**post** `/memories/update/{source}/{resource_id}`\n\nUpdates an existing document in the index. You can update the text, collection,\ntitle, and metadata. The document must already exist or a 404 will be returned.\nThis works for documents from any source (vault, slack, gmail, etc.).\n\nTo remove a collection, set it to null explicitly.\n\n### Parameters\n\n- `source: string`\n\n- `resource_id: string`\n\n- `collection?: string | object`\n The collection to move the document to — deprecated, set the collection using metadata instead.\n\n- `date?: string | object`\n Date of the document for ranking and filtering.\n\n- `metadata?: object | object`\n Custom metadata for filtering. Keys must be alphanumeric with underscores, max 64 chars. Values must be string, number, boolean, or null. Will be merged with existing metadata.\n\n- `text?: string | object`\n Full text of the document. If provided, the document will be re-indexed.\n\n- `title?: string | object`\n Title of the document.\n\n### Returns\n\n- `{ resource_id: string; source: string; status: 'pending' | 'processing' | 'completed' | 'failed' | 'pending_review' | 'skipped'; }`\n\n - `resource_id: string`\n - `source: string`\n - `status: 'pending' | 'processing' | 'completed' | 'failed' | 'pending_review' | 'skipped'`\n\n### Example\n\n```typescript\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell();\n\nconst memoryStatus = await client.memories.update('resource_id', { source: 'reddit' });\n\nconsole.log(memoryStatus);\n```", + "## update\n\n`client.memories.update(source: string, resource_id: string, collection?: string | object, date?: string | object, metadata?: object | object, text?: string | object, title?: string | object): { resource_id: string; source: string; status: string; }`\n\n**post** `/memories/update/{source}/{resource_id}`\n\nUpdates an existing document in the index. You can update the text, collection,\ntitle, and metadata. The document must already exist or a 404 will be returned.\nThis works for documents from any source (vault, slack, gmail, etc.).\n\nTo remove a collection, set it to null explicitly.\n\n### Parameters\n\n- `source: string`\n\n- `resource_id: string`\n\n- `collection?: string | object`\n The collection to move the document to — deprecated, set the collection using metadata instead.\n\n- `date?: string | object`\n Date of the document for ranking and filtering.\n\n- `metadata?: object | object`\n Custom metadata for filtering. Keys must be alphanumeric with underscores, max 64 chars. Values must be string, number, boolean, or null. Will be merged with existing metadata.\n\n- `text?: string | object`\n Full text of the document. If provided, the document will be re-indexed.\n\n- `title?: string | object`\n Title of the document.\n\n### Returns\n\n- `{ resource_id: string; source: string; status: string; }`\n\n - `resource_id: string`\n - `source: string`\n - `status: string`\n\n### Example\n\n```typescript\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell();\n\nconst memoryStatus = await client.memories.update('resource_id', { source: 'reddit' });\n\nconsole.log(memoryStatus);\n```", perLanguage: { go: { method: 'client.Memories.Update', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tmemoryStatus, err := client.Memories.Update(\n\t\tcontext.TODO(),\n\t\t"resource_id",\n\t\thyperspell.MemoryUpdateParams{\n\t\t\tSource: hyperspell.MemoryUpdateParamsSourceReddit,\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", memoryStatus.ResourceID)\n}\n', - }, - cli: { - method: 'memories update', - example: - "hyperspell memories update \\\n --api-key 'My API Key' \\\n --source reddit \\\n --resource-id resource_id", + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t\toption.WithUserID("My User ID"),\n\t)\n\tmemoryStatus, err := client.Memories.Update(\n\t\tcontext.TODO(),\n\t\t"resource_id",\n\t\thyperspell.MemoryUpdateParams{\n\t\t\tSource: hyperspell.MemoryUpdateParamsSourceReddit,\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", memoryStatus.ResourceID)\n}\n', }, python: { method: 'memories.update', @@ -664,12 +1067,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [ typescript: { method: 'client.memories.update', example: - "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst memoryStatus = await client.memories.update('resource_id', { source: 'reddit' });\n\nconsole.log(memoryStatus.resource_id);", + "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n userID: 'My User ID',\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst memoryStatus = await client.memories.update('resource_id', { source: 'reddit' });\n\nconsole.log(memoryStatus.resource_id);", }, http: { example: "curl https://api.hyperspell.com/memories/update/$SOURCE/$RESOURCE_ID \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: Bearer $HYPERSPELL_API_KEY\" \\\n -d '{}'", }, + cli: { + method: 'memories update', + example: + "hyperspell memories update \\\n --api-key 'My API Key' \\\n --user-id 'My User ID' \\\n --source reddit \\\n --resource-id resource_id", + }, }, }, { @@ -685,23 +1093,20 @@ const EMBEDDED_METHODS: MethodEntry[] = [ 'collection?: string;', 'cursor?: string;', 'filter?: string;', + 'include_chunks?: number;', 'size?: number;', 'source?: string;', - "status?: 'pending' | 'processing' | 'completed' | 'failed' | 'pending_review' | 'skipped';", + 'status?: string;', ], response: - "{ document: object | object | object | object | object | object | object | object | object | object | object | object; resource_id: string; source: string; type: string; collection?: string; document_date?: string; ingested_at?: string; last_modified_at?: string; metadata?: object; status?: 'pending' | 'processing' | 'completed' | 'failed' | 'pending_review' | 'skipped'; title?: string; }", + "{ document: object | object | object | object | object | object | object | object | object | object | object | object | { id?: string; attachment_names?: string[]; balance_amount?: number; cancelled_at?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; contact_id?: string; contact_name?: string; currency?: string; due_at?: string; invoice_type?: string; metadata?: metadata; notes?: string; number?: string; organization_id?: string; paid_amount?: number; paid_at?: string; posted_at?: string; reference?: string; refund_amount?: number; refund_reason?: string; refunded_at?: string; status?: string; tax_amount?: number; text?: string; total_amount?: number; type?: 'invoice'; }; resource_id: string; source: string; type: string; chunks?: { chunk_id: string; summary?: string; }[]; collection?: string; document_date?: string; ingested_at?: string; last_modified_at?: string; metadata?: object; status?: string; title?: string; }", markdown: - "## list\n\n`client.memories.list(collection?: string, cursor?: string, filter?: string, size?: number, source?: string, status?: 'pending' | 'processing' | 'completed' | 'failed' | 'pending_review' | 'skipped'): { document: document | website | task | person | message | event | file | conversation | trace | transcript | company | deal; resource_id: string; source: string; type: string; collection?: string; document_date?: string; ingested_at?: string; last_modified_at?: string; metadata?: object; status?: 'pending' | 'processing' | 'completed' | 'failed' | 'pending_review' | 'skipped'; title?: string; }`\n\n**get** `/memories/list`\n\nThis endpoint allows you to paginate through all documents in the index.\nYou can filter the documents by title, date, metadata, etc.\n\n### Parameters\n\n- `collection?: string`\n Filter documents by collection.\n\n- `cursor?: string`\n\n- `filter?: string`\n Filter documents by metadata using MongoDB-style operators. Example: {\"department\": \"engineering\", \"priority\": {\"$gt\": 3}}\n\n- `size?: number`\n\n- `source?: string`\n Filter documents by source.\n\n- `status?: 'pending' | 'processing' | 'completed' | 'failed' | 'pending_review' | 'skipped'`\n Filter documents by status.\n\n### Returns\n\n- `{ document: { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; title?: string; type?: 'document'; } | { url: string; id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; description?: string; favicon?: string; image_url?: string; language?: string; metadata?: metadata; text?: string; title?: string; type?: 'website'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; comments?: message[]; due_at?: string; metadata?: metadata; priority?: 'urgent' | 'high' | 'medium' | 'low'; status?: 'completed' | 'not_started' | 'in_progress' | 'cancelled'; text?: string; type?: 'task'; } | { id?: string; address?: string; alt_names?: string[]; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; company?: string; company_ids?: string[]; date_of_birth?: string; deal_ids?: string[]; email?: string; emails?: string[]; image_url?: string; job_title?: string; link_urls?: string[]; metadata?: metadata; name?: string; phone_numbers?: string[]; tags?: string[]; text?: string; type?: 'person'; username?: string; } | { date: string; sender: person; id?: string; channel?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; external_id?: string; is_self?: boolean; mentioned_users?: person[]; metadata?: metadata; num_replies?: number; replies?: message[]; text?: string; thread_id?: string; title?: string; type?: 'message'; updated_at?: string; upvotes?: number; } | { id?: string; attendees?: person[]; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; end_at?: string; location?: string; meeting_url?: string; metadata?: metadata; start_at?: string; text?: string; title?: string; type?: 'event'; } | { content_type: string; filename: string; id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; path?: string[]; text?: string; title?: string; type?: 'file'; } | { id?: string; channel?: string; children?: message[]; metadata?: metadata; text?: string; title?: string; type?: 'conversation'; } | { id?: string; children?: trace_message | tool_call | tool_result[]; metadata?: metadata; text?: string; title?: string; type?: 'trace'; } | { id?: string; children?: utterance[]; ended_at?: string; metadata?: metadata; participants?: person[]; started_at?: string; text?: string; title?: string; type?: 'transcript'; } | { id?: string; address?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; contact_ids?: string[]; deal_ids?: string[]; description?: string; emails?: string[]; employees?: number; image_url?: string; industry?: string; is_active?: boolean; metadata?: metadata; name?: string; phone_numbers?: string[]; tags?: string[]; text?: string; timezone?: string; type?: 'company'; websites?: string[]; } | { id?: string; amount?: number; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; closed_at?: string; company_ids?: string[]; contact_ids?: string[]; currency?: string; deal_source?: string; lost_reason?: string; metadata?: metadata; name?: string; pipeline?: string; probability?: number; stage?: string; tags?: string[]; text?: string; type?: 'deal'; won_reason?: string; }; resource_id: string; source: string; type: string; collection?: string; document_date?: string; ingested_at?: string; last_modified_at?: string; metadata?: object; status?: 'pending' | 'processing' | 'completed' | 'failed' | 'pending_review' | 'skipped'; title?: string; }`\n A document-shaped API response carrying the hyperdoc tree (ENG-2479/D12).\n\n - `document: { id?: string; children?: { data: string; mimetype: string; id?: string; metadata?: metadata; type?: 'blob'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; title?: string; type?: 'callout'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'chunk'; } | { text: string; id?: string; language?: string; metadata?: metadata; type?: 'code'; } | { text: string; id?: string; created_at?: string; metadata?: metadata; type?: 'comment'; } | { id?: string; metadata?: metadata; type?: 'divider'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'equation'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'footnote'; } | { level: number; id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'heading'; } | { src: string; text: string; id?: string; metadata?: metadata; type?: 'image'; } | { text: string; url: string; id?: string; metadata?: metadata; type?: 'link'; } | { id?: string; metadata?: metadata; type?: 'line_break'; } | { id?: string; children?: list_item | to_do[]; metadata?: metadata; ordered?: boolean; text?: string; type?: 'list'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'list_item'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'paragraph'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'quote'; } | { id?: string; children?: table_row[]; has_header?: boolean; metadata?: metadata; text?: string; type?: 'table'; } | { id?: string; align?: 'left' | 'center' | 'right'; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'table_cell'; } | { id?: string; children?: table_cell[]; metadata?: metadata; text?: string; type?: 'table_row'; } | { text: string; id?: string; marks?: 'bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | 'math'[]; metadata?: metadata; type?: 'text'; } | { id?: string; checked?: boolean; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'todo'; } | { tool_call_id: string; tool_name: string; id?: string; args?: object; metadata?: metadata; type?: 'tool_call'; } | { output: string | object | object[]; tool_call_id: string; tool_name: string; id?: string; is_error?: boolean; metadata?: metadata; type?: 'tool_result'; } | { text: string; id?: string; message_type?: 'message' | 'thinking'; metadata?: metadata; role?: 'user' | 'assistant'; timestamp?: string; type?: 'trace_message'; } | { text: string; id?: string; end?: number; metadata?: metadata; speaker?: person; start?: number; type?: 'utterance'; }[]; metadata?: { edited_by?: string; sources?: object[]; }; text?: string; title?: string; type?: 'document'; } | { url: string; id?: string; children?: { data: string; mimetype: string; id?: string; metadata?: metadata; type?: 'blob'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; title?: string; type?: 'callout'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'chunk'; } | { text: string; id?: string; language?: string; metadata?: metadata; type?: 'code'; } | { text: string; id?: string; created_at?: string; metadata?: metadata; type?: 'comment'; } | { id?: string; metadata?: metadata; type?: 'divider'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'equation'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'footnote'; } | { level: number; id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'heading'; } | { src: string; text: string; id?: string; metadata?: metadata; type?: 'image'; } | { text: string; url: string; id?: string; metadata?: metadata; type?: 'link'; } | { id?: string; metadata?: metadata; type?: 'line_break'; } | { id?: string; children?: list_item | to_do[]; metadata?: metadata; ordered?: boolean; text?: string; type?: 'list'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'list_item'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'paragraph'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'quote'; } | { id?: string; children?: table_row[]; has_header?: boolean; metadata?: metadata; text?: string; type?: 'table'; } | { id?: string; align?: 'left' | 'center' | 'right'; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'table_cell'; } | { id?: string; children?: table_cell[]; metadata?: metadata; text?: string; type?: 'table_row'; } | { text: string; id?: string; marks?: 'bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | 'math'[]; metadata?: metadata; type?: 'text'; } | { id?: string; checked?: boolean; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'todo'; } | { tool_call_id: string; tool_name: string; id?: string; args?: object; metadata?: metadata; type?: 'tool_call'; } | { output: string | object | object[]; tool_call_id: string; tool_name: string; id?: string; is_error?: boolean; metadata?: metadata; type?: 'tool_result'; } | { text: string; id?: string; message_type?: 'message' | 'thinking'; metadata?: metadata; role?: 'user' | 'assistant'; timestamp?: string; type?: 'trace_message'; } | { text: string; id?: string; end?: number; metadata?: metadata; speaker?: person; start?: number; type?: 'utterance'; }[]; description?: string; favicon?: string; image_url?: string; language?: string; metadata?: { edited_by?: string; sources?: object[]; }; text?: string; title?: string; type?: 'website'; } | { id?: string; children?: { data: string; mimetype: string; id?: string; metadata?: metadata; type?: 'blob'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; title?: string; type?: 'callout'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'chunk'; } | { text: string; id?: string; language?: string; metadata?: metadata; type?: 'code'; } | { text: string; id?: string; created_at?: string; metadata?: metadata; type?: 'comment'; } | { id?: string; metadata?: metadata; type?: 'divider'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'equation'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'footnote'; } | { level: number; id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'heading'; } | { src: string; text: string; id?: string; metadata?: metadata; type?: 'image'; } | { text: string; url: string; id?: string; metadata?: metadata; type?: 'link'; } | { id?: string; metadata?: metadata; type?: 'line_break'; } | { id?: string; children?: list_item | to_do[]; metadata?: metadata; ordered?: boolean; text?: string; type?: 'list'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'list_item'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'paragraph'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'quote'; } | { id?: string; children?: table_row[]; has_header?: boolean; metadata?: metadata; text?: string; type?: 'table'; } | { id?: string; align?: 'left' | 'center' | 'right'; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'table_cell'; } | { id?: string; children?: table_cell[]; metadata?: metadata; text?: string; type?: 'table_row'; } | { text: string; id?: string; marks?: 'bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | 'math'[]; metadata?: metadata; type?: 'text'; } | { id?: string; checked?: boolean; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'todo'; } | { tool_call_id: string; tool_name: string; id?: string; args?: object; metadata?: metadata; type?: 'tool_call'; } | { output: string | object | object[]; tool_call_id: string; tool_name: string; id?: string; is_error?: boolean; metadata?: metadata; type?: 'tool_result'; } | { text: string; id?: string; message_type?: 'message' | 'thinking'; metadata?: metadata; role?: 'user' | 'assistant'; timestamp?: string; type?: 'trace_message'; } | { text: string; id?: string; end?: number; metadata?: metadata; speaker?: person; start?: number; type?: 'utterance'; }[]; comments?: { date: string; sender: person; id?: string; channel?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; external_id?: string; is_self?: boolean; mentioned_users?: person[]; metadata?: metadata; num_replies?: number; replies?: message[]; text?: string; thread_id?: string; title?: string; type?: 'message'; updated_at?: string; upvotes?: number; }[]; due_at?: string; metadata?: { edited_by?: string; sources?: object[]; }; priority?: 'urgent' | 'high' | 'medium' | 'low'; status?: 'completed' | 'not_started' | 'in_progress' | 'cancelled'; text?: string; type?: 'task'; } | { id?: string; address?: string; alt_names?: string[]; children?: { data: string; mimetype: string; id?: string; metadata?: metadata; type?: 'blob'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; title?: string; type?: 'callout'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'chunk'; } | { text: string; id?: string; language?: string; metadata?: metadata; type?: 'code'; } | { text: string; id?: string; created_at?: string; metadata?: metadata; type?: 'comment'; } | { id?: string; metadata?: metadata; type?: 'divider'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'equation'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'footnote'; } | { level: number; id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'heading'; } | { src: string; text: string; id?: string; metadata?: metadata; type?: 'image'; } | { text: string; url: string; id?: string; metadata?: metadata; type?: 'link'; } | { id?: string; metadata?: metadata; type?: 'line_break'; } | { id?: string; children?: list_item | to_do[]; metadata?: metadata; ordered?: boolean; text?: string; type?: 'list'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'list_item'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'paragraph'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'quote'; } | { id?: string; children?: table_row[]; has_header?: boolean; metadata?: metadata; text?: string; type?: 'table'; } | { id?: string; align?: 'left' | 'center' | 'right'; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'table_cell'; } | { id?: string; children?: table_cell[]; metadata?: metadata; text?: string; type?: 'table_row'; } | { text: string; id?: string; marks?: 'bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | 'math'[]; metadata?: metadata; type?: 'text'; } | { id?: string; checked?: boolean; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'todo'; } | { tool_call_id: string; tool_name: string; id?: string; args?: object; metadata?: metadata; type?: 'tool_call'; } | { output: string | object | object[]; tool_call_id: string; tool_name: string; id?: string; is_error?: boolean; metadata?: metadata; type?: 'tool_result'; } | { text: string; id?: string; message_type?: 'message' | 'thinking'; metadata?: metadata; role?: 'user' | 'assistant'; timestamp?: string; type?: 'trace_message'; } | { text: string; id?: string; end?: number; metadata?: metadata; speaker?: person; start?: number; type?: 'utterance'; }[]; company?: string; company_ids?: string[]; date_of_birth?: string; deal_ids?: string[]; email?: string; emails?: string[]; image_url?: string; job_title?: string; link_urls?: string[]; metadata?: { edited_by?: string; sources?: object[]; }; name?: string; phone_numbers?: string[]; tags?: string[]; text?: string; type?: 'person'; username?: string; } | { date: string; sender: { id?: string; address?: string; alt_names?: string[]; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; company?: string; company_ids?: string[]; date_of_birth?: string; deal_ids?: string[]; email?: string; emails?: string[]; image_url?: string; job_title?: string; link_urls?: string[]; metadata?: metadata; name?: string; phone_numbers?: string[]; tags?: string[]; text?: string; type?: 'person'; username?: string; }; id?: string; channel?: string; children?: { data: string; mimetype: string; id?: string; metadata?: metadata; type?: 'blob'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; title?: string; type?: 'callout'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'chunk'; } | { text: string; id?: string; language?: string; metadata?: metadata; type?: 'code'; } | { text: string; id?: string; created_at?: string; metadata?: metadata; type?: 'comment'; } | { id?: string; metadata?: metadata; type?: 'divider'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'equation'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'footnote'; } | { level: number; id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'heading'; } | { src: string; text: string; id?: string; metadata?: metadata; type?: 'image'; } | { text: string; url: string; id?: string; metadata?: metadata; type?: 'link'; } | { id?: string; metadata?: metadata; type?: 'line_break'; } | { id?: string; children?: list_item | to_do[]; metadata?: metadata; ordered?: boolean; text?: string; type?: 'list'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'list_item'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'paragraph'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'quote'; } | { id?: string; children?: table_row[]; has_header?: boolean; metadata?: metadata; text?: string; type?: 'table'; } | { id?: string; align?: 'left' | 'center' | 'right'; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'table_cell'; } | { id?: string; children?: table_cell[]; metadata?: metadata; text?: string; type?: 'table_row'; } | { text: string; id?: string; marks?: 'bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | 'math'[]; metadata?: metadata; type?: 'text'; } | { id?: string; checked?: boolean; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'todo'; } | { tool_call_id: string; tool_name: string; id?: string; args?: object; metadata?: metadata; type?: 'tool_call'; } | { output: string | object | object[]; tool_call_id: string; tool_name: string; id?: string; is_error?: boolean; metadata?: metadata; type?: 'tool_result'; } | { text: string; id?: string; message_type?: 'message' | 'thinking'; metadata?: metadata; role?: 'user' | 'assistant'; timestamp?: string; type?: 'trace_message'; } | { text: string; id?: string; end?: number; metadata?: metadata; speaker?: person; start?: number; type?: 'utterance'; }[]; external_id?: string; is_self?: boolean; mentioned_users?: { id?: string; address?: string; alt_names?: string[]; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; company?: string; company_ids?: string[]; date_of_birth?: string; deal_ids?: string[]; email?: string; emails?: string[]; image_url?: string; job_title?: string; link_urls?: string[]; metadata?: metadata; name?: string; phone_numbers?: string[]; tags?: string[]; text?: string; type?: 'person'; username?: string; }[]; metadata?: { edited_by?: string; sources?: object[]; }; num_replies?: number; replies?: { date: string; sender: person; id?: string; channel?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; external_id?: string; is_self?: boolean; mentioned_users?: person[]; metadata?: metadata; num_replies?: number; replies?: message[]; text?: string; thread_id?: string; title?: string; type?: 'message'; updated_at?: string; upvotes?: number; }[]; text?: string; thread_id?: string; title?: string; type?: 'message'; updated_at?: string; upvotes?: number; } | { id?: string; attendees?: { id?: string; address?: string; alt_names?: string[]; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; company?: string; company_ids?: string[]; date_of_birth?: string; deal_ids?: string[]; email?: string; emails?: string[]; image_url?: string; job_title?: string; link_urls?: string[]; metadata?: metadata; name?: string; phone_numbers?: string[]; tags?: string[]; text?: string; type?: 'person'; username?: string; }[]; children?: { data: string; mimetype: string; id?: string; metadata?: metadata; type?: 'blob'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; title?: string; type?: 'callout'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'chunk'; } | { text: string; id?: string; language?: string; metadata?: metadata; type?: 'code'; } | { text: string; id?: string; created_at?: string; metadata?: metadata; type?: 'comment'; } | { id?: string; metadata?: metadata; type?: 'divider'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'equation'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'footnote'; } | { level: number; id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'heading'; } | { src: string; text: string; id?: string; metadata?: metadata; type?: 'image'; } | { text: string; url: string; id?: string; metadata?: metadata; type?: 'link'; } | { id?: string; metadata?: metadata; type?: 'line_break'; } | { id?: string; children?: list_item | to_do[]; metadata?: metadata; ordered?: boolean; text?: string; type?: 'list'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'list_item'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'paragraph'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'quote'; } | { id?: string; children?: table_row[]; has_header?: boolean; metadata?: metadata; text?: string; type?: 'table'; } | { id?: string; align?: 'left' | 'center' | 'right'; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'table_cell'; } | { id?: string; children?: table_cell[]; metadata?: metadata; text?: string; type?: 'table_row'; } | { text: string; id?: string; marks?: 'bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | 'math'[]; metadata?: metadata; type?: 'text'; } | { id?: string; checked?: boolean; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'todo'; } | { tool_call_id: string; tool_name: string; id?: string; args?: object; metadata?: metadata; type?: 'tool_call'; } | { output: string | object | object[]; tool_call_id: string; tool_name: string; id?: string; is_error?: boolean; metadata?: metadata; type?: 'tool_result'; } | { text: string; id?: string; message_type?: 'message' | 'thinking'; metadata?: metadata; role?: 'user' | 'assistant'; timestamp?: string; type?: 'trace_message'; } | { text: string; id?: string; end?: number; metadata?: metadata; speaker?: person; start?: number; type?: 'utterance'; }[]; end_at?: string; location?: string; meeting_url?: string; metadata?: { edited_by?: string; sources?: object[]; }; start_at?: string; text?: string; title?: string; type?: 'event'; } | { content_type: string; filename: string; id?: string; children?: { data: string; mimetype: string; id?: string; metadata?: metadata; type?: 'blob'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; title?: string; type?: 'callout'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'chunk'; } | { text: string; id?: string; language?: string; metadata?: metadata; type?: 'code'; } | { text: string; id?: string; created_at?: string; metadata?: metadata; type?: 'comment'; } | { id?: string; metadata?: metadata; type?: 'divider'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'equation'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'footnote'; } | { level: number; id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'heading'; } | { src: string; text: string; id?: string; metadata?: metadata; type?: 'image'; } | { text: string; url: string; id?: string; metadata?: metadata; type?: 'link'; } | { id?: string; metadata?: metadata; type?: 'line_break'; } | { id?: string; children?: list_item | to_do[]; metadata?: metadata; ordered?: boolean; text?: string; type?: 'list'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'list_item'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'paragraph'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'quote'; } | { id?: string; children?: table_row[]; has_header?: boolean; metadata?: metadata; text?: string; type?: 'table'; } | { id?: string; align?: 'left' | 'center' | 'right'; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'table_cell'; } | { id?: string; children?: table_cell[]; metadata?: metadata; text?: string; type?: 'table_row'; } | { text: string; id?: string; marks?: 'bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | 'math'[]; metadata?: metadata; type?: 'text'; } | { id?: string; checked?: boolean; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'todo'; } | { tool_call_id: string; tool_name: string; id?: string; args?: object; metadata?: metadata; type?: 'tool_call'; } | { output: string | object | object[]; tool_call_id: string; tool_name: string; id?: string; is_error?: boolean; metadata?: metadata; type?: 'tool_result'; } | { text: string; id?: string; message_type?: 'message' | 'thinking'; metadata?: metadata; role?: 'user' | 'assistant'; timestamp?: string; type?: 'trace_message'; } | { text: string; id?: string; end?: number; metadata?: metadata; speaker?: person; start?: number; type?: 'utterance'; }[]; metadata?: { edited_by?: string; sources?: object[]; }; path?: string[]; text?: string; title?: string; type?: 'file'; } | { id?: string; channel?: string; children?: { date: string; sender: person; id?: string; channel?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; external_id?: string; is_self?: boolean; mentioned_users?: person[]; metadata?: metadata; num_replies?: number; replies?: message[]; text?: string; thread_id?: string; title?: string; type?: 'message'; updated_at?: string; upvotes?: number; }[]; metadata?: { edited_by?: string; sources?: object[]; }; text?: string; title?: string; type?: 'conversation'; } | { id?: string; children?: { text: string; id?: string; message_type?: 'message' | 'thinking'; metadata?: metadata; role?: 'user' | 'assistant'; timestamp?: string; type?: 'trace_message'; } | { tool_call_id: string; tool_name: string; id?: string; args?: object; metadata?: metadata; type?: 'tool_call'; } | { output: string | object | object[]; tool_call_id: string; tool_name: string; id?: string; is_error?: boolean; metadata?: metadata; type?: 'tool_result'; }[]; metadata?: { edited_by?: string; sources?: object[]; }; text?: string; title?: string; type?: 'trace'; } | { id?: string; children?: { text: string; id?: string; end?: number; metadata?: metadata; speaker?: person; start?: number; type?: 'utterance'; }[]; ended_at?: string; metadata?: { edited_by?: string; sources?: object[]; }; participants?: { id?: string; address?: string; alt_names?: string[]; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; company?: string; company_ids?: string[]; date_of_birth?: string; deal_ids?: string[]; email?: string; emails?: string[]; image_url?: string; job_title?: string; link_urls?: string[]; metadata?: metadata; name?: string; phone_numbers?: string[]; tags?: string[]; text?: string; type?: 'person'; username?: string; }[]; started_at?: string; text?: string; title?: string; type?: 'transcript'; } | { id?: string; address?: string; children?: { data: string; mimetype: string; id?: string; metadata?: metadata; type?: 'blob'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; title?: string; type?: 'callout'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'chunk'; } | { text: string; id?: string; language?: string; metadata?: metadata; type?: 'code'; } | { text: string; id?: string; created_at?: string; metadata?: metadata; type?: 'comment'; } | { id?: string; metadata?: metadata; type?: 'divider'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'equation'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'footnote'; } | { level: number; id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'heading'; } | { src: string; text: string; id?: string; metadata?: metadata; type?: 'image'; } | { text: string; url: string; id?: string; metadata?: metadata; type?: 'link'; } | { id?: string; metadata?: metadata; type?: 'line_break'; } | { id?: string; children?: list_item | to_do[]; metadata?: metadata; ordered?: boolean; text?: string; type?: 'list'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'list_item'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'paragraph'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'quote'; } | { id?: string; children?: table_row[]; has_header?: boolean; metadata?: metadata; text?: string; type?: 'table'; } | { id?: string; align?: 'left' | 'center' | 'right'; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'table_cell'; } | { id?: string; children?: table_cell[]; metadata?: metadata; text?: string; type?: 'table_row'; } | { text: string; id?: string; marks?: 'bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | 'math'[]; metadata?: metadata; type?: 'text'; } | { id?: string; checked?: boolean; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'todo'; } | { tool_call_id: string; tool_name: string; id?: string; args?: object; metadata?: metadata; type?: 'tool_call'; } | { output: string | object | object[]; tool_call_id: string; tool_name: string; id?: string; is_error?: boolean; metadata?: metadata; type?: 'tool_result'; } | { text: string; id?: string; message_type?: 'message' | 'thinking'; metadata?: metadata; role?: 'user' | 'assistant'; timestamp?: string; type?: 'trace_message'; } | { text: string; id?: string; end?: number; metadata?: metadata; speaker?: person; start?: number; type?: 'utterance'; }[]; contact_ids?: string[]; deal_ids?: string[]; description?: string; emails?: string[]; employees?: number; image_url?: string; industry?: string; is_active?: boolean; metadata?: { edited_by?: string; sources?: object[]; }; name?: string; phone_numbers?: string[]; tags?: string[]; text?: string; timezone?: string; type?: 'company'; websites?: string[]; } | { id?: string; amount?: number; children?: { data: string; mimetype: string; id?: string; metadata?: metadata; type?: 'blob'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; title?: string; type?: 'callout'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'chunk'; } | { text: string; id?: string; language?: string; metadata?: metadata; type?: 'code'; } | { text: string; id?: string; created_at?: string; metadata?: metadata; type?: 'comment'; } | { id?: string; metadata?: metadata; type?: 'divider'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'equation'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'footnote'; } | { level: number; id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'heading'; } | { src: string; text: string; id?: string; metadata?: metadata; type?: 'image'; } | { text: string; url: string; id?: string; metadata?: metadata; type?: 'link'; } | { id?: string; metadata?: metadata; type?: 'line_break'; } | { id?: string; children?: list_item | to_do[]; metadata?: metadata; ordered?: boolean; text?: string; type?: 'list'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'list_item'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'paragraph'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'quote'; } | { id?: string; children?: table_row[]; has_header?: boolean; metadata?: metadata; text?: string; type?: 'table'; } | { id?: string; align?: 'left' | 'center' | 'right'; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'table_cell'; } | { id?: string; children?: table_cell[]; metadata?: metadata; text?: string; type?: 'table_row'; } | { text: string; id?: string; marks?: 'bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | 'math'[]; metadata?: metadata; type?: 'text'; } | { id?: string; checked?: boolean; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'todo'; } | { tool_call_id: string; tool_name: string; id?: string; args?: object; metadata?: metadata; type?: 'tool_call'; } | { output: string | object | object[]; tool_call_id: string; tool_name: string; id?: string; is_error?: boolean; metadata?: metadata; type?: 'tool_result'; } | { text: string; id?: string; message_type?: 'message' | 'thinking'; metadata?: metadata; role?: 'user' | 'assistant'; timestamp?: string; type?: 'trace_message'; } | { text: string; id?: string; end?: number; metadata?: metadata; speaker?: person; start?: number; type?: 'utterance'; }[]; closed_at?: string; company_ids?: string[]; contact_ids?: string[]; currency?: string; deal_source?: string; lost_reason?: string; metadata?: { edited_by?: string; sources?: object[]; }; name?: string; pipeline?: string; probability?: number; stage?: string; tags?: string[]; text?: string; type?: 'deal'; won_reason?: string; }`\n - `resource_id: string`\n - `source: string`\n - `type: string`\n - `collection?: string`\n - `document_date?: string`\n - `ingested_at?: string`\n - `last_modified_at?: string`\n - `metadata?: object`\n - `status?: 'pending' | 'processing' | 'completed' | 'failed' | 'pending_review' | 'skipped'`\n - `title?: string`\n\n### Example\n\n```typescript\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell();\n\n// Automatically fetches more pages as needed.\nfor await (const memoryListResponse of client.memories.list()) {\n console.log(memoryListResponse);\n}\n```", + "## list\n\n`client.memories.list(collection?: string, cursor?: string, filter?: string, include_chunks?: number, size?: number, source?: string, status?: string): { document: document | website | task | person | message | event | file | conversation | trace | transcript | company | deal | object; resource_id: string; source: string; type: string; chunks?: object[]; collection?: string; document_date?: string; ingested_at?: string; last_modified_at?: string; metadata?: object; status?: string; title?: string; }`\n\n**get** `/memories/list`\n\nThis endpoint allows you to paginate through all documents in the index.\nYou can filter the documents by title, date, metadata, etc.\n\n### Parameters\n\n- `collection?: string`\n Filter documents by collection.\n\n- `cursor?: string`\n\n- `filter?: string`\n Filter documents by metadata using MongoDB-style operators. Example: {\"department\": \"engineering\", \"priority\": {\"$gt\": 3}}\n\n- `include_chunks?: number`\n When > 0, include up to this many extracted memories (chunks with summaries) per document in each item's `chunks` field, in document order. 0 (default) omits them.\n\n- `size?: number`\n\n- `source?: string`\n Filter documents by source.\n\n- `status?: string`\n Filter documents by status.\n\n### Returns\n\n- `{ document: { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; title?: string; type?: 'document'; } | { url: string; id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; description?: string; favicon?: string; image_url?: string; language?: string; metadata?: metadata; text?: string; title?: string; type?: 'website'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; comments?: message[]; due_at?: string; metadata?: metadata; priority?: 'urgent' | 'high' | 'medium' | 'low'; status?: 'completed' | 'not_started' | 'in_progress' | 'cancelled'; text?: string; type?: 'task'; } | { id?: string; address?: string; alt_names?: string[]; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; company?: string; company_ids?: string[]; date_of_birth?: string; deal_ids?: string[]; email?: string; emails?: string[]; image_url?: string; is_app_user?: boolean; is_bot?: boolean; job_title?: string; link_urls?: string[]; metadata?: metadata; name?: string; phone_numbers?: string[]; tags?: string[]; text?: string; type?: 'person'; username?: string; } | { date: string; sender: person; id?: string; channel?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; external_id?: string; is_self?: boolean; mentioned_users?: person[]; metadata?: metadata; num_replies?: number; replies?: message[]; text?: string; thread_id?: string; title?: string; type?: 'message'; updated_at?: string; upvotes?: number; } | { id?: string; attendees?: person[]; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; end_at?: string; location?: string; meeting_url?: string; metadata?: metadata; start_at?: string; text?: string; title?: string; type?: 'event'; } | { content_type: string; filename: string; id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; content_truncated?: boolean; metadata?: metadata; path?: string[]; text?: string; title?: string; type?: 'file'; } | { id?: string; channel?: string; children?: message[]; metadata?: metadata; participants?: person[]; text?: string; title?: string; type?: 'conversation'; } | { id?: string; children?: trace_message | tool_call | tool_result[]; metadata?: metadata; text?: string; title?: string; type?: 'trace'; } | { id?: string; children?: utterance[]; ended_at?: string; metadata?: metadata; participants?: person[]; started_at?: string; text?: string; title?: string; type?: 'transcript'; } | { id?: string; address?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; contact_ids?: string[]; deal_ids?: string[]; description?: string; emails?: string[]; employees?: number; image_url?: string; industry?: string; is_active?: boolean; metadata?: metadata; name?: string; phone_numbers?: string[]; tags?: string[]; text?: string; timezone?: string; type?: 'company'; websites?: string[]; } | { id?: string; amount?: number; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; closed_at?: string; company_ids?: string[]; contact_ids?: string[]; currency?: string; deal_source?: string; lost_reason?: string; metadata?: metadata; name?: string; pipeline?: string; probability?: number; stage?: string; tags?: string[]; text?: string; type?: 'deal'; won_reason?: string; } | { id?: string; attachment_names?: string[]; balance_amount?: number; cancelled_at?: string; children?: object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object[]; contact_id?: string; contact_name?: string; currency?: string; due_at?: string; invoice_type?: string; metadata?: object; notes?: string; number?: string; organization_id?: string; paid_amount?: number; paid_at?: string; posted_at?: string; reference?: string; refund_amount?: number; refund_reason?: string; refunded_at?: string; status?: string; tax_amount?: number; text?: string; total_amount?: number; type?: 'invoice'; }; resource_id: string; source: string; type: string; chunks?: { chunk_id: string; summary?: string; }[]; collection?: string; document_date?: string; ingested_at?: string; last_modified_at?: string; metadata?: object; status?: string; title?: string; }`\n A document-shaped API response containing the hyperdoc tree.\n\n - `document: { id?: string; children?: { data: string; mimetype: string; id?: string; metadata?: metadata; type?: 'blob'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; title?: string; type?: 'callout'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'chunk'; } | { text: string; id?: string; language?: string; metadata?: metadata; type?: 'code'; } | { text: string; id?: string; created_at?: string; metadata?: metadata; type?: 'comment'; } | { id?: string; metadata?: metadata; type?: 'divider'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'equation'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'footnote'; } | { level: number; id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'heading'; } | { src: string; text: string; id?: string; metadata?: metadata; type?: 'image'; } | { text: string; url: string; id?: string; metadata?: metadata; type?: 'link'; } | { id?: string; metadata?: metadata; type?: 'line_break'; } | { id?: string; children?: list_item | to_do[]; metadata?: metadata; ordered?: boolean; text?: string; type?: 'list'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'list_item'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; page_number?: number; preview_url?: string; text?: string; type?: 'page'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'paragraph'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'quote'; } | { id?: string; children?: table_row[]; has_header?: boolean; metadata?: metadata; text?: string; type?: 'table'; } | { id?: string; align?: 'left' | 'center' | 'right'; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'table_cell'; } | { id?: string; children?: table_cell[]; metadata?: metadata; text?: string; type?: 'table_row'; } | { text: string; id?: string; marks?: 'bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | 'math'[]; metadata?: metadata; type?: 'text'; } | { id?: string; checked?: boolean; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'todo'; } | { tool_call_id: string; tool_name: string; id?: string; args?: object; metadata?: metadata; type?: 'tool_call'; } | { output: string | object | object[]; tool_call_id: string; tool_name: string; id?: string; is_error?: boolean; metadata?: metadata; type?: 'tool_result'; } | { text: string; id?: string; message_type?: 'message' | 'thinking'; metadata?: metadata; role?: 'user' | 'assistant'; timestamp?: string; type?: 'trace_message'; } | { text: string; id?: string; end?: number; metadata?: metadata; speaker?: person; start?: number; type?: 'utterance'; }[]; metadata?: { edited_by?: string; sources?: object[]; }; text?: string; title?: string; type?: 'document'; } | { url: string; id?: string; children?: { data: string; mimetype: string; id?: string; metadata?: metadata; type?: 'blob'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; title?: string; type?: 'callout'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'chunk'; } | { text: string; id?: string; language?: string; metadata?: metadata; type?: 'code'; } | { text: string; id?: string; created_at?: string; metadata?: metadata; type?: 'comment'; } | { id?: string; metadata?: metadata; type?: 'divider'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'equation'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'footnote'; } | { level: number; id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'heading'; } | { src: string; text: string; id?: string; metadata?: metadata; type?: 'image'; } | { text: string; url: string; id?: string; metadata?: metadata; type?: 'link'; } | { id?: string; metadata?: metadata; type?: 'line_break'; } | { id?: string; children?: list_item | to_do[]; metadata?: metadata; ordered?: boolean; text?: string; type?: 'list'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'list_item'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; page_number?: number; preview_url?: string; text?: string; type?: 'page'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'paragraph'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'quote'; } | { id?: string; children?: table_row[]; has_header?: boolean; metadata?: metadata; text?: string; type?: 'table'; } | { id?: string; align?: 'left' | 'center' | 'right'; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'table_cell'; } | { id?: string; children?: table_cell[]; metadata?: metadata; text?: string; type?: 'table_row'; } | { text: string; id?: string; marks?: 'bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | 'math'[]; metadata?: metadata; type?: 'text'; } | { id?: string; checked?: boolean; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'todo'; } | { tool_call_id: string; tool_name: string; id?: string; args?: object; metadata?: metadata; type?: 'tool_call'; } | { output: string | object | object[]; tool_call_id: string; tool_name: string; id?: string; is_error?: boolean; metadata?: metadata; type?: 'tool_result'; } | { text: string; id?: string; message_type?: 'message' | 'thinking'; metadata?: metadata; role?: 'user' | 'assistant'; timestamp?: string; type?: 'trace_message'; } | { text: string; id?: string; end?: number; metadata?: metadata; speaker?: person; start?: number; type?: 'utterance'; }[]; description?: string; favicon?: string; image_url?: string; language?: string; metadata?: { edited_by?: string; sources?: object[]; }; text?: string; title?: string; type?: 'website'; } | { id?: string; children?: { data: string; mimetype: string; id?: string; metadata?: metadata; type?: 'blob'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; title?: string; type?: 'callout'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'chunk'; } | { text: string; id?: string; language?: string; metadata?: metadata; type?: 'code'; } | { text: string; id?: string; created_at?: string; metadata?: metadata; type?: 'comment'; } | { id?: string; metadata?: metadata; type?: 'divider'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'equation'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'footnote'; } | { level: number; id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'heading'; } | { src: string; text: string; id?: string; metadata?: metadata; type?: 'image'; } | { text: string; url: string; id?: string; metadata?: metadata; type?: 'link'; } | { id?: string; metadata?: metadata; type?: 'line_break'; } | { id?: string; children?: list_item | to_do[]; metadata?: metadata; ordered?: boolean; text?: string; type?: 'list'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'list_item'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; page_number?: number; preview_url?: string; text?: string; type?: 'page'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'paragraph'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'quote'; } | { id?: string; children?: table_row[]; has_header?: boolean; metadata?: metadata; text?: string; type?: 'table'; } | { id?: string; align?: 'left' | 'center' | 'right'; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'table_cell'; } | { id?: string; children?: table_cell[]; metadata?: metadata; text?: string; type?: 'table_row'; } | { text: string; id?: string; marks?: 'bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | 'math'[]; metadata?: metadata; type?: 'text'; } | { id?: string; checked?: boolean; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'todo'; } | { tool_call_id: string; tool_name: string; id?: string; args?: object; metadata?: metadata; type?: 'tool_call'; } | { output: string | object | object[]; tool_call_id: string; tool_name: string; id?: string; is_error?: boolean; metadata?: metadata; type?: 'tool_result'; } | { text: string; id?: string; message_type?: 'message' | 'thinking'; metadata?: metadata; role?: 'user' | 'assistant'; timestamp?: string; type?: 'trace_message'; } | { text: string; id?: string; end?: number; metadata?: metadata; speaker?: person; start?: number; type?: 'utterance'; }[]; comments?: { date: string; sender: person; id?: string; channel?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; external_id?: string; is_self?: boolean; mentioned_users?: person[]; metadata?: metadata; num_replies?: number; replies?: message[]; text?: string; thread_id?: string; title?: string; type?: 'message'; updated_at?: string; upvotes?: number; }[]; due_at?: string; metadata?: { edited_by?: string; sources?: object[]; }; priority?: 'urgent' | 'high' | 'medium' | 'low'; status?: 'completed' | 'not_started' | 'in_progress' | 'cancelled'; text?: string; type?: 'task'; } | { id?: string; address?: string; alt_names?: string[]; children?: { data: string; mimetype: string; id?: string; metadata?: metadata; type?: 'blob'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; title?: string; type?: 'callout'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'chunk'; } | { text: string; id?: string; language?: string; metadata?: metadata; type?: 'code'; } | { text: string; id?: string; created_at?: string; metadata?: metadata; type?: 'comment'; } | { id?: string; metadata?: metadata; type?: 'divider'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'equation'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'footnote'; } | { level: number; id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'heading'; } | { src: string; text: string; id?: string; metadata?: metadata; type?: 'image'; } | { text: string; url: string; id?: string; metadata?: metadata; type?: 'link'; } | { id?: string; metadata?: metadata; type?: 'line_break'; } | { id?: string; children?: list_item | to_do[]; metadata?: metadata; ordered?: boolean; text?: string; type?: 'list'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'list_item'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; page_number?: number; preview_url?: string; text?: string; type?: 'page'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'paragraph'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'quote'; } | { id?: string; children?: table_row[]; has_header?: boolean; metadata?: metadata; text?: string; type?: 'table'; } | { id?: string; align?: 'left' | 'center' | 'right'; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'table_cell'; } | { id?: string; children?: table_cell[]; metadata?: metadata; text?: string; type?: 'table_row'; } | { text: string; id?: string; marks?: 'bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | 'math'[]; metadata?: metadata; type?: 'text'; } | { id?: string; checked?: boolean; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'todo'; } | { tool_call_id: string; tool_name: string; id?: string; args?: object; metadata?: metadata; type?: 'tool_call'; } | { output: string | object | object[]; tool_call_id: string; tool_name: string; id?: string; is_error?: boolean; metadata?: metadata; type?: 'tool_result'; } | { text: string; id?: string; message_type?: 'message' | 'thinking'; metadata?: metadata; role?: 'user' | 'assistant'; timestamp?: string; type?: 'trace_message'; } | { text: string; id?: string; end?: number; metadata?: metadata; speaker?: person; start?: number; type?: 'utterance'; }[]; company?: string; company_ids?: string[]; date_of_birth?: string; deal_ids?: string[]; email?: string; emails?: string[]; image_url?: string; is_app_user?: boolean; is_bot?: boolean; job_title?: string; link_urls?: string[]; metadata?: { edited_by?: string; sources?: object[]; }; name?: string; phone_numbers?: string[]; tags?: string[]; text?: string; type?: 'person'; username?: string; } | { date: string; sender: { id?: string; address?: string; alt_names?: string[]; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; company?: string; company_ids?: string[]; date_of_birth?: string; deal_ids?: string[]; email?: string; emails?: string[]; image_url?: string; is_app_user?: boolean; is_bot?: boolean; job_title?: string; link_urls?: string[]; metadata?: metadata; name?: string; phone_numbers?: string[]; tags?: string[]; text?: string; type?: 'person'; username?: string; }; id?: string; channel?: string; children?: { data: string; mimetype: string; id?: string; metadata?: metadata; type?: 'blob'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; title?: string; type?: 'callout'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'chunk'; } | { text: string; id?: string; language?: string; metadata?: metadata; type?: 'code'; } | { text: string; id?: string; created_at?: string; metadata?: metadata; type?: 'comment'; } | { id?: string; metadata?: metadata; type?: 'divider'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'equation'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'footnote'; } | { level: number; id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'heading'; } | { src: string; text: string; id?: string; metadata?: metadata; type?: 'image'; } | { text: string; url: string; id?: string; metadata?: metadata; type?: 'link'; } | { id?: string; metadata?: metadata; type?: 'line_break'; } | { id?: string; children?: list_item | to_do[]; metadata?: metadata; ordered?: boolean; text?: string; type?: 'list'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'list_item'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; page_number?: number; preview_url?: string; text?: string; type?: 'page'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'paragraph'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'quote'; } | { id?: string; children?: table_row[]; has_header?: boolean; metadata?: metadata; text?: string; type?: 'table'; } | { id?: string; align?: 'left' | 'center' | 'right'; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'table_cell'; } | { id?: string; children?: table_cell[]; metadata?: metadata; text?: string; type?: 'table_row'; } | { text: string; id?: string; marks?: 'bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | 'math'[]; metadata?: metadata; type?: 'text'; } | { id?: string; checked?: boolean; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'todo'; } | { tool_call_id: string; tool_name: string; id?: string; args?: object; metadata?: metadata; type?: 'tool_call'; } | { output: string | object | object[]; tool_call_id: string; tool_name: string; id?: string; is_error?: boolean; metadata?: metadata; type?: 'tool_result'; } | { text: string; id?: string; message_type?: 'message' | 'thinking'; metadata?: metadata; role?: 'user' | 'assistant'; timestamp?: string; type?: 'trace_message'; } | { text: string; id?: string; end?: number; metadata?: metadata; speaker?: person; start?: number; type?: 'utterance'; }[]; external_id?: string; is_self?: boolean; mentioned_users?: { id?: string; address?: string; alt_names?: string[]; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; company?: string; company_ids?: string[]; date_of_birth?: string; deal_ids?: string[]; email?: string; emails?: string[]; image_url?: string; is_app_user?: boolean; is_bot?: boolean; job_title?: string; link_urls?: string[]; metadata?: metadata; name?: string; phone_numbers?: string[]; tags?: string[]; text?: string; type?: 'person'; username?: string; }[]; metadata?: { edited_by?: string; sources?: object[]; }; num_replies?: number; replies?: { date: string; sender: person; id?: string; channel?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; external_id?: string; is_self?: boolean; mentioned_users?: person[]; metadata?: metadata; num_replies?: number; replies?: message[]; text?: string; thread_id?: string; title?: string; type?: 'message'; updated_at?: string; upvotes?: number; }[]; text?: string; thread_id?: string; title?: string; type?: 'message'; updated_at?: string; upvotes?: number; } | { id?: string; attendees?: { id?: string; address?: string; alt_names?: string[]; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; company?: string; company_ids?: string[]; date_of_birth?: string; deal_ids?: string[]; email?: string; emails?: string[]; image_url?: string; is_app_user?: boolean; is_bot?: boolean; job_title?: string; link_urls?: string[]; metadata?: metadata; name?: string; phone_numbers?: string[]; tags?: string[]; text?: string; type?: 'person'; username?: string; }[]; children?: { data: string; mimetype: string; id?: string; metadata?: metadata; type?: 'blob'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; title?: string; type?: 'callout'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'chunk'; } | { text: string; id?: string; language?: string; metadata?: metadata; type?: 'code'; } | { text: string; id?: string; created_at?: string; metadata?: metadata; type?: 'comment'; } | { id?: string; metadata?: metadata; type?: 'divider'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'equation'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'footnote'; } | { level: number; id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'heading'; } | { src: string; text: string; id?: string; metadata?: metadata; type?: 'image'; } | { text: string; url: string; id?: string; metadata?: metadata; type?: 'link'; } | { id?: string; metadata?: metadata; type?: 'line_break'; } | { id?: string; children?: list_item | to_do[]; metadata?: metadata; ordered?: boolean; text?: string; type?: 'list'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'list_item'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; page_number?: number; preview_url?: string; text?: string; type?: 'page'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'paragraph'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'quote'; } | { id?: string; children?: table_row[]; has_header?: boolean; metadata?: metadata; text?: string; type?: 'table'; } | { id?: string; align?: 'left' | 'center' | 'right'; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'table_cell'; } | { id?: string; children?: table_cell[]; metadata?: metadata; text?: string; type?: 'table_row'; } | { text: string; id?: string; marks?: 'bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | 'math'[]; metadata?: metadata; type?: 'text'; } | { id?: string; checked?: boolean; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'todo'; } | { tool_call_id: string; tool_name: string; id?: string; args?: object; metadata?: metadata; type?: 'tool_call'; } | { output: string | object | object[]; tool_call_id: string; tool_name: string; id?: string; is_error?: boolean; metadata?: metadata; type?: 'tool_result'; } | { text: string; id?: string; message_type?: 'message' | 'thinking'; metadata?: metadata; role?: 'user' | 'assistant'; timestamp?: string; type?: 'trace_message'; } | { text: string; id?: string; end?: number; metadata?: metadata; speaker?: person; start?: number; type?: 'utterance'; }[]; end_at?: string; location?: string; meeting_url?: string; metadata?: { edited_by?: string; sources?: object[]; }; start_at?: string; text?: string; title?: string; type?: 'event'; } | { content_type: string; filename: string; id?: string; children?: { data: string; mimetype: string; id?: string; metadata?: metadata; type?: 'blob'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; title?: string; type?: 'callout'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'chunk'; } | { text: string; id?: string; language?: string; metadata?: metadata; type?: 'code'; } | { text: string; id?: string; created_at?: string; metadata?: metadata; type?: 'comment'; } | { id?: string; metadata?: metadata; type?: 'divider'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'equation'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'footnote'; } | { level: number; id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'heading'; } | { src: string; text: string; id?: string; metadata?: metadata; type?: 'image'; } | { text: string; url: string; id?: string; metadata?: metadata; type?: 'link'; } | { id?: string; metadata?: metadata; type?: 'line_break'; } | { id?: string; children?: list_item | to_do[]; metadata?: metadata; ordered?: boolean; text?: string; type?: 'list'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'list_item'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; page_number?: number; preview_url?: string; text?: string; type?: 'page'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'paragraph'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'quote'; } | { id?: string; children?: table_row[]; has_header?: boolean; metadata?: metadata; text?: string; type?: 'table'; } | { id?: string; align?: 'left' | 'center' | 'right'; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'table_cell'; } | { id?: string; children?: table_cell[]; metadata?: metadata; text?: string; type?: 'table_row'; } | { text: string; id?: string; marks?: 'bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | 'math'[]; metadata?: metadata; type?: 'text'; } | { id?: string; checked?: boolean; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'todo'; } | { tool_call_id: string; tool_name: string; id?: string; args?: object; metadata?: metadata; type?: 'tool_call'; } | { output: string | object | object[]; tool_call_id: string; tool_name: string; id?: string; is_error?: boolean; metadata?: metadata; type?: 'tool_result'; } | { text: string; id?: string; message_type?: 'message' | 'thinking'; metadata?: metadata; role?: 'user' | 'assistant'; timestamp?: string; type?: 'trace_message'; } | { text: string; id?: string; end?: number; metadata?: metadata; speaker?: person; start?: number; type?: 'utterance'; }[]; content_truncated?: boolean; metadata?: { edited_by?: string; sources?: object[]; }; path?: string[]; text?: string; title?: string; type?: 'file'; } | { id?: string; channel?: string; children?: { date: string; sender: person; id?: string; channel?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; external_id?: string; is_self?: boolean; mentioned_users?: person[]; metadata?: metadata; num_replies?: number; replies?: message[]; text?: string; thread_id?: string; title?: string; type?: 'message'; updated_at?: string; upvotes?: number; }[]; metadata?: { edited_by?: string; sources?: object[]; }; participants?: { id?: string; address?: string; alt_names?: string[]; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; company?: string; company_ids?: string[]; date_of_birth?: string; deal_ids?: string[]; email?: string; emails?: string[]; image_url?: string; is_app_user?: boolean; is_bot?: boolean; job_title?: string; link_urls?: string[]; metadata?: metadata; name?: string; phone_numbers?: string[]; tags?: string[]; text?: string; type?: 'person'; username?: string; }[]; text?: string; title?: string; type?: 'conversation'; } | { id?: string; children?: { text: string; id?: string; message_type?: 'message' | 'thinking'; metadata?: metadata; role?: 'user' | 'assistant'; timestamp?: string; type?: 'trace_message'; } | { tool_call_id: string; tool_name: string; id?: string; args?: object; metadata?: metadata; type?: 'tool_call'; } | { output: string | object | object[]; tool_call_id: string; tool_name: string; id?: string; is_error?: boolean; metadata?: metadata; type?: 'tool_result'; }[]; metadata?: { edited_by?: string; sources?: object[]; }; text?: string; title?: string; type?: 'trace'; } | { id?: string; children?: { text: string; id?: string; end?: number; metadata?: metadata; speaker?: person; start?: number; type?: 'utterance'; }[]; ended_at?: string; metadata?: { edited_by?: string; sources?: object[]; }; participants?: { id?: string; address?: string; alt_names?: string[]; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; company?: string; company_ids?: string[]; date_of_birth?: string; deal_ids?: string[]; email?: string; emails?: string[]; image_url?: string; is_app_user?: boolean; is_bot?: boolean; job_title?: string; link_urls?: string[]; metadata?: metadata; name?: string; phone_numbers?: string[]; tags?: string[]; text?: string; type?: 'person'; username?: string; }[]; started_at?: string; text?: string; title?: string; type?: 'transcript'; } | { id?: string; address?: string; children?: { data: string; mimetype: string; id?: string; metadata?: metadata; type?: 'blob'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; title?: string; type?: 'callout'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'chunk'; } | { text: string; id?: string; language?: string; metadata?: metadata; type?: 'code'; } | { text: string; id?: string; created_at?: string; metadata?: metadata; type?: 'comment'; } | { id?: string; metadata?: metadata; type?: 'divider'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'equation'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'footnote'; } | { level: number; id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'heading'; } | { src: string; text: string; id?: string; metadata?: metadata; type?: 'image'; } | { text: string; url: string; id?: string; metadata?: metadata; type?: 'link'; } | { id?: string; metadata?: metadata; type?: 'line_break'; } | { id?: string; children?: list_item | to_do[]; metadata?: metadata; ordered?: boolean; text?: string; type?: 'list'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'list_item'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; page_number?: number; preview_url?: string; text?: string; type?: 'page'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'paragraph'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'quote'; } | { id?: string; children?: table_row[]; has_header?: boolean; metadata?: metadata; text?: string; type?: 'table'; } | { id?: string; align?: 'left' | 'center' | 'right'; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'table_cell'; } | { id?: string; children?: table_cell[]; metadata?: metadata; text?: string; type?: 'table_row'; } | { text: string; id?: string; marks?: 'bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | 'math'[]; metadata?: metadata; type?: 'text'; } | { id?: string; checked?: boolean; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'todo'; } | { tool_call_id: string; tool_name: string; id?: string; args?: object; metadata?: metadata; type?: 'tool_call'; } | { output: string | object | object[]; tool_call_id: string; tool_name: string; id?: string; is_error?: boolean; metadata?: metadata; type?: 'tool_result'; } | { text: string; id?: string; message_type?: 'message' | 'thinking'; metadata?: metadata; role?: 'user' | 'assistant'; timestamp?: string; type?: 'trace_message'; } | { text: string; id?: string; end?: number; metadata?: metadata; speaker?: person; start?: number; type?: 'utterance'; }[]; contact_ids?: string[]; deal_ids?: string[]; description?: string; emails?: string[]; employees?: number; image_url?: string; industry?: string; is_active?: boolean; metadata?: { edited_by?: string; sources?: object[]; }; name?: string; phone_numbers?: string[]; tags?: string[]; text?: string; timezone?: string; type?: 'company'; websites?: string[]; } | { id?: string; amount?: number; children?: { data: string; mimetype: string; id?: string; metadata?: metadata; type?: 'blob'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; title?: string; type?: 'callout'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'chunk'; } | { text: string; id?: string; language?: string; metadata?: metadata; type?: 'code'; } | { text: string; id?: string; created_at?: string; metadata?: metadata; type?: 'comment'; } | { id?: string; metadata?: metadata; type?: 'divider'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'equation'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'footnote'; } | { level: number; id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'heading'; } | { src: string; text: string; id?: string; metadata?: metadata; type?: 'image'; } | { text: string; url: string; id?: string; metadata?: metadata; type?: 'link'; } | { id?: string; metadata?: metadata; type?: 'line_break'; } | { id?: string; children?: list_item | to_do[]; metadata?: metadata; ordered?: boolean; text?: string; type?: 'list'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'list_item'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; page_number?: number; preview_url?: string; text?: string; type?: 'page'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'paragraph'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'quote'; } | { id?: string; children?: table_row[]; has_header?: boolean; metadata?: metadata; text?: string; type?: 'table'; } | { id?: string; align?: 'left' | 'center' | 'right'; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'table_cell'; } | { id?: string; children?: table_cell[]; metadata?: metadata; text?: string; type?: 'table_row'; } | { text: string; id?: string; marks?: 'bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | 'math'[]; metadata?: metadata; type?: 'text'; } | { id?: string; checked?: boolean; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'todo'; } | { tool_call_id: string; tool_name: string; id?: string; args?: object; metadata?: metadata; type?: 'tool_call'; } | { output: string | object | object[]; tool_call_id: string; tool_name: string; id?: string; is_error?: boolean; metadata?: metadata; type?: 'tool_result'; } | { text: string; id?: string; message_type?: 'message' | 'thinking'; metadata?: metadata; role?: 'user' | 'assistant'; timestamp?: string; type?: 'trace_message'; } | { text: string; id?: string; end?: number; metadata?: metadata; speaker?: person; start?: number; type?: 'utterance'; }[]; closed_at?: string; company_ids?: string[]; contact_ids?: string[]; currency?: string; deal_source?: string; lost_reason?: string; metadata?: { edited_by?: string; sources?: object[]; }; name?: string; pipeline?: string; probability?: number; stage?: string; tags?: string[]; text?: string; type?: 'deal'; won_reason?: string; } | { id?: string; attachment_names?: string[]; balance_amount?: number; cancelled_at?: string; children?: { data: string; mimetype: string; id?: string; metadata?: object; type?: 'blob'; } | { id?: string; children?: object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object[]; metadata?: object; text?: string; title?: string; type?: 'callout'; } | { id?: string; children?: object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object[]; metadata?: object; text?: string; type?: 'chunk'; } | { text: string; id?: string; language?: string; metadata?: object; type?: 'code'; } | { text: string; id?: string; created_at?: string; metadata?: object; type?: 'comment'; } | { id?: string; metadata?: object; type?: 'divider'; } | { id?: string; children?: object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object[]; metadata?: object; text?: string; type?: 'equation'; } | { id?: string; children?: object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object[]; metadata?: object; text?: string; type?: 'footnote'; } | { level: number; id?: string; children?: object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object[]; metadata?: object; text?: string; type?: 'heading'; } | { src: string; text: string; id?: string; metadata?: object; type?: 'image'; } | { text: string; url: string; id?: string; metadata?: object; type?: 'link'; } | { id?: string; metadata?: object; type?: 'line_break'; } | { id?: string; children?: object | object[]; metadata?: object; ordered?: boolean; text?: string; type?: 'list'; } | { id?: string; children?: object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object[]; metadata?: object; text?: string; type?: 'list_item'; } | { id?: string; children?: object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object[]; metadata?: object; page_number?: number; preview_url?: string; text?: string; type?: 'page'; } | { id?: string; children?: object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object[]; metadata?: object; text?: string; type?: 'paragraph'; } | { id?: string; children?: object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object[]; metadata?: object; text?: string; type?: 'quote'; } | { id?: string; children?: object[]; has_header?: boolean; metadata?: object; text?: string; type?: 'table'; } | { id?: string; align?: 'left' | 'center' | 'right'; children?: object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object[]; metadata?: object; text?: string; type?: 'table_cell'; } | { id?: string; children?: object[]; metadata?: object; text?: string; type?: 'table_row'; } | { text: string; id?: string; marks?: 'bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | 'math'[]; metadata?: object; type?: 'text'; } | { id?: string; checked?: boolean; children?: object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object[]; metadata?: object; text?: string; type?: 'todo'; } | { tool_call_id: string; tool_name: string; id?: string; args?: object; metadata?: object; type?: 'tool_call'; } | { output: string | object | object[]; tool_call_id: string; tool_name: string; id?: string; is_error?: boolean; metadata?: object; type?: 'tool_result'; } | { text: string; id?: string; message_type?: 'message' | 'thinking'; metadata?: object; role?: 'user' | 'assistant'; timestamp?: string; type?: 'trace_message'; } | { text: string; id?: string; end?: number; metadata?: object; speaker?: object; start?: number; type?: 'utterance'; }[]; contact_id?: string; contact_name?: string; currency?: string; due_at?: string; invoice_type?: string; metadata?: { edited_by?: string; sources?: { chunk_id: string; resource_id?: string; score?: number; source?: string; }[]; }; notes?: string; number?: string; organization_id?: string; paid_amount?: number; paid_at?: string; posted_at?: string; reference?: string; refund_amount?: number; refund_reason?: string; refunded_at?: string; status?: string; tax_amount?: number; text?: string; total_amount?: number; type?: 'invoice'; }`\n - `resource_id: string`\n - `source: string`\n - `type: string`\n - `chunks?: { chunk_id: string; summary?: string; }[]`\n - `collection?: string`\n - `document_date?: string`\n - `ingested_at?: string`\n - `last_modified_at?: string`\n - `metadata?: object`\n - `status?: string`\n - `title?: string`\n\n### Example\n\n```typescript\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell();\n\n// Automatically fetches more pages as needed.\nfor await (const memoryListResponse of client.memories.list()) {\n console.log(memoryListResponse);\n}\n```", perLanguage: { go: { method: 'client.Memories.List', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpage, err := client.Memories.List(context.TODO(), hyperspell.MemoryListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', - }, - cli: { - method: 'memories list', - example: "hyperspell memories list \\\n --api-key 'My API Key'", + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t\toption.WithUserID("My User ID"),\n\t)\n\tpage, err := client.Memories.List(context.TODO(), hyperspell.MemoryListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', }, python: { method: 'memories.list', @@ -711,12 +1116,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ typescript: { method: 'client.memories.list', example: - "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const memoryListResponse of client.memories.list()) {\n console.log(memoryListResponse.resource_id);\n}", + "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n userID: 'My User ID',\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const memoryListResponse of client.memories.list()) {\n console.log(memoryListResponse.resource_id);\n}", }, http: { example: 'curl https://api.hyperspell.com/memories/list \\\n -H "Authorization: Bearer $HYPERSPELL_API_KEY"', }, + cli: { + method: 'memories list', + example: "hyperspell memories list \\\n --api-key 'My API Key' \\\n --user-id 'My User ID'", + }, }, }, { @@ -727,18 +1136,15 @@ const EMBEDDED_METHODS: MethodEntry[] = [ description: 'This endpoint shows the indexing progress of documents, both by provider and total.', stainlessPath: '(resource) memories > (method) status', qualified: 'client.memories.status', - response: '{ providers: object; total: object; }', + response: + "{ providers: object; total: object; integrations?: { connections: { id: string; error: object; label: string; last_activity_at: string; last_synced_at: string; status: string; }[]; error: { at: string; detail: string; kind: 'auth' | 'rate_limited' | 'provider' | 'internal'; origin?: string; retry_at?: string; }; integration_id: string; last_synced_at: string; provider: string; status: string; }[]; }", markdown: - "## status\n\n`client.memories.status(): { providers: object; total: object; }`\n\n**get** `/memories/status`\n\nThis endpoint shows the indexing progress of documents, both by provider and total.\n\n### Returns\n\n- `{ providers: object; total: object; }`\n\n - `providers: object`\n - `total: object`\n\n### Example\n\n```typescript\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell();\n\nconst response = await client.memories.status();\n\nconsole.log(response);\n```", + "## status\n\n`client.memories.status(): { providers: object; total: object; integrations?: object[]; }`\n\n**get** `/memories/status`\n\nThis endpoint shows the indexing progress of documents, both by provider and total.\n\n### Returns\n\n- `{ providers: object; total: object; integrations?: { connections: { id: string; error: object; label: string; last_activity_at: string; last_synced_at: string; status: string; }[]; error: { at: string; detail: string; kind: 'auth' | 'rate_limited' | 'provider' | 'internal'; origin?: string; retry_at?: string; }; integration_id: string; last_synced_at: string; provider: string; status: string; }[]; }`\n\n - `providers: object`\n - `total: object`\n - `integrations?: { connections: { id: string; error: { at: string; detail: string; kind: 'auth' | 'rate_limited' | 'provider' | 'internal'; origin?: string; retry_at?: string; }; label: string; last_activity_at: string; last_synced_at: string; status: string; }[]; error: { at: string; detail: string; kind: 'auth' | 'rate_limited' | 'provider' | 'internal'; origin?: string; retry_at?: string; }; integration_id: string; last_synced_at: string; provider: string; status: string; }[]`\n\n### Example\n\n```typescript\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell();\n\nconst response = await client.memories.status();\n\nconsole.log(response);\n```", perLanguage: { go: { method: 'client.Memories.Status', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Memories.Status(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Providers)\n}\n', - }, - cli: { - method: 'memories status', - example: "hyperspell memories status \\\n --api-key 'My API Key'", + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t\toption.WithUserID("My User ID"),\n\t)\n\tresponse, err := client.Memories.Status(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Providers)\n}\n', }, python: { method: 'memories.status', @@ -748,12 +1154,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ typescript: { method: 'client.memories.status', example: - "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.memories.status();\n\nconsole.log(response.providers);", + "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n userID: 'My User ID',\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.memories.status();\n\nconsole.log(response.providers);", }, http: { example: 'curl https://api.hyperspell.com/memories/status \\\n -H "Authorization: Bearer $HYPERSPELL_API_KEY"', }, + cli: { + method: 'memories status', + example: "hyperspell memories status \\\n --api-key 'My API Key' \\\n --user-id 'My User ID'", + }, }, }, { @@ -761,25 +1171,19 @@ const EMBEDDED_METHODS: MethodEntry[] = [ endpoint: '/memories/get/{source}/{resource_id}', httpMethod: 'get', summary: 'Get memory', - description: - 'Retrieves a document by provider and resource_id, as a document-shaped\nresponse carrying the full hyperdoc tree (ENG-2479 Phase 4).', + description: 'Retrieve a document by provider and resource ID, including its full\nhyperdoc tree.', stainlessPath: '(resource) memories > (method) get', qualified: 'client.memories.get', - params: ['source: string;', 'resource_id: string;'], + params: ['source: string;', 'resource_id: string;', 'include_chunks?: boolean;'], response: - "{ document: object | object | object | object | object | object | object | object | object | object | object | object; resource_id: string; source: string; type: string; collection?: string; document_date?: string; ingested_at?: string; last_modified_at?: string; metadata?: object; status?: 'pending' | 'processing' | 'completed' | 'failed' | 'pending_review' | 'skipped'; title?: string; }", + "{ document: object | object | object | object | object | object | object | object | object | object | object | object | { id?: string; attachment_names?: string[]; balance_amount?: number; cancelled_at?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; contact_id?: string; contact_name?: string; currency?: string; due_at?: string; invoice_type?: string; metadata?: metadata; notes?: string; number?: string; organization_id?: string; paid_amount?: number; paid_at?: string; posted_at?: string; reference?: string; refund_amount?: number; refund_reason?: string; refunded_at?: string; status?: string; tax_amount?: number; text?: string; total_amount?: number; type?: 'invoice'; }; resource_id: string; source: string; type: string; chunks?: { chunk_id: string; summary?: string; }[]; collection?: string; document_date?: string; ingested_at?: string; last_modified_at?: string; metadata?: object; status?: string; title?: string; }", markdown: - "## get\n\n`client.memories.get(source: string, resource_id: string): { document: document | website | task | person | message | event | file | conversation | trace | transcript | company | deal; resource_id: string; source: string; type: string; collection?: string; document_date?: string; ingested_at?: string; last_modified_at?: string; metadata?: object; status?: 'pending' | 'processing' | 'completed' | 'failed' | 'pending_review' | 'skipped'; title?: string; }`\n\n**get** `/memories/get/{source}/{resource_id}`\n\nRetrieves a document by provider and resource_id, as a document-shaped\nresponse carrying the full hyperdoc tree (ENG-2479 Phase 4).\n\n### Parameters\n\n- `source: string`\n\n- `resource_id: string`\n\n### Returns\n\n- `{ document: { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; title?: string; type?: 'document'; } | { url: string; id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; description?: string; favicon?: string; image_url?: string; language?: string; metadata?: metadata; text?: string; title?: string; type?: 'website'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; comments?: message[]; due_at?: string; metadata?: metadata; priority?: 'urgent' | 'high' | 'medium' | 'low'; status?: 'completed' | 'not_started' | 'in_progress' | 'cancelled'; text?: string; type?: 'task'; } | { id?: string; address?: string; alt_names?: string[]; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; company?: string; company_ids?: string[]; date_of_birth?: string; deal_ids?: string[]; email?: string; emails?: string[]; image_url?: string; job_title?: string; link_urls?: string[]; metadata?: metadata; name?: string; phone_numbers?: string[]; tags?: string[]; text?: string; type?: 'person'; username?: string; } | { date: string; sender: person; id?: string; channel?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; external_id?: string; is_self?: boolean; mentioned_users?: person[]; metadata?: metadata; num_replies?: number; replies?: message[]; text?: string; thread_id?: string; title?: string; type?: 'message'; updated_at?: string; upvotes?: number; } | { id?: string; attendees?: person[]; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; end_at?: string; location?: string; meeting_url?: string; metadata?: metadata; start_at?: string; text?: string; title?: string; type?: 'event'; } | { content_type: string; filename: string; id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; path?: string[]; text?: string; title?: string; type?: 'file'; } | { id?: string; channel?: string; children?: message[]; metadata?: metadata; text?: string; title?: string; type?: 'conversation'; } | { id?: string; children?: trace_message | tool_call | tool_result[]; metadata?: metadata; text?: string; title?: string; type?: 'trace'; } | { id?: string; children?: utterance[]; ended_at?: string; metadata?: metadata; participants?: person[]; started_at?: string; text?: string; title?: string; type?: 'transcript'; } | { id?: string; address?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; contact_ids?: string[]; deal_ids?: string[]; description?: string; emails?: string[]; employees?: number; image_url?: string; industry?: string; is_active?: boolean; metadata?: metadata; name?: string; phone_numbers?: string[]; tags?: string[]; text?: string; timezone?: string; type?: 'company'; websites?: string[]; } | { id?: string; amount?: number; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; closed_at?: string; company_ids?: string[]; contact_ids?: string[]; currency?: string; deal_source?: string; lost_reason?: string; metadata?: metadata; name?: string; pipeline?: string; probability?: number; stage?: string; tags?: string[]; text?: string; type?: 'deal'; won_reason?: string; }; resource_id: string; source: string; type: string; collection?: string; document_date?: string; ingested_at?: string; last_modified_at?: string; metadata?: object; status?: 'pending' | 'processing' | 'completed' | 'failed' | 'pending_review' | 'skipped'; title?: string; }`\n A document-shaped API response carrying the hyperdoc tree (ENG-2479/D12).\n\n - `document: { id?: string; children?: { data: string; mimetype: string; id?: string; metadata?: metadata; type?: 'blob'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; title?: string; type?: 'callout'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'chunk'; } | { text: string; id?: string; language?: string; metadata?: metadata; type?: 'code'; } | { text: string; id?: string; created_at?: string; metadata?: metadata; type?: 'comment'; } | { id?: string; metadata?: metadata; type?: 'divider'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'equation'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'footnote'; } | { level: number; id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'heading'; } | { src: string; text: string; id?: string; metadata?: metadata; type?: 'image'; } | { text: string; url: string; id?: string; metadata?: metadata; type?: 'link'; } | { id?: string; metadata?: metadata; type?: 'line_break'; } | { id?: string; children?: list_item | to_do[]; metadata?: metadata; ordered?: boolean; text?: string; type?: 'list'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'list_item'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'paragraph'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'quote'; } | { id?: string; children?: table_row[]; has_header?: boolean; metadata?: metadata; text?: string; type?: 'table'; } | { id?: string; align?: 'left' | 'center' | 'right'; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'table_cell'; } | { id?: string; children?: table_cell[]; metadata?: metadata; text?: string; type?: 'table_row'; } | { text: string; id?: string; marks?: 'bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | 'math'[]; metadata?: metadata; type?: 'text'; } | { id?: string; checked?: boolean; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'todo'; } | { tool_call_id: string; tool_name: string; id?: string; args?: object; metadata?: metadata; type?: 'tool_call'; } | { output: string | object | object[]; tool_call_id: string; tool_name: string; id?: string; is_error?: boolean; metadata?: metadata; type?: 'tool_result'; } | { text: string; id?: string; message_type?: 'message' | 'thinking'; metadata?: metadata; role?: 'user' | 'assistant'; timestamp?: string; type?: 'trace_message'; } | { text: string; id?: string; end?: number; metadata?: metadata; speaker?: person; start?: number; type?: 'utterance'; }[]; metadata?: { edited_by?: string; sources?: object[]; }; text?: string; title?: string; type?: 'document'; } | { url: string; id?: string; children?: { data: string; mimetype: string; id?: string; metadata?: metadata; type?: 'blob'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; title?: string; type?: 'callout'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'chunk'; } | { text: string; id?: string; language?: string; metadata?: metadata; type?: 'code'; } | { text: string; id?: string; created_at?: string; metadata?: metadata; type?: 'comment'; } | { id?: string; metadata?: metadata; type?: 'divider'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'equation'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'footnote'; } | { level: number; id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'heading'; } | { src: string; text: string; id?: string; metadata?: metadata; type?: 'image'; } | { text: string; url: string; id?: string; metadata?: metadata; type?: 'link'; } | { id?: string; metadata?: metadata; type?: 'line_break'; } | { id?: string; children?: list_item | to_do[]; metadata?: metadata; ordered?: boolean; text?: string; type?: 'list'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'list_item'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'paragraph'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'quote'; } | { id?: string; children?: table_row[]; has_header?: boolean; metadata?: metadata; text?: string; type?: 'table'; } | { id?: string; align?: 'left' | 'center' | 'right'; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'table_cell'; } | { id?: string; children?: table_cell[]; metadata?: metadata; text?: string; type?: 'table_row'; } | { text: string; id?: string; marks?: 'bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | 'math'[]; metadata?: metadata; type?: 'text'; } | { id?: string; checked?: boolean; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'todo'; } | { tool_call_id: string; tool_name: string; id?: string; args?: object; metadata?: metadata; type?: 'tool_call'; } | { output: string | object | object[]; tool_call_id: string; tool_name: string; id?: string; is_error?: boolean; metadata?: metadata; type?: 'tool_result'; } | { text: string; id?: string; message_type?: 'message' | 'thinking'; metadata?: metadata; role?: 'user' | 'assistant'; timestamp?: string; type?: 'trace_message'; } | { text: string; id?: string; end?: number; metadata?: metadata; speaker?: person; start?: number; type?: 'utterance'; }[]; description?: string; favicon?: string; image_url?: string; language?: string; metadata?: { edited_by?: string; sources?: object[]; }; text?: string; title?: string; type?: 'website'; } | { id?: string; children?: { data: string; mimetype: string; id?: string; metadata?: metadata; type?: 'blob'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; title?: string; type?: 'callout'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'chunk'; } | { text: string; id?: string; language?: string; metadata?: metadata; type?: 'code'; } | { text: string; id?: string; created_at?: string; metadata?: metadata; type?: 'comment'; } | { id?: string; metadata?: metadata; type?: 'divider'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'equation'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'footnote'; } | { level: number; id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'heading'; } | { src: string; text: string; id?: string; metadata?: metadata; type?: 'image'; } | { text: string; url: string; id?: string; metadata?: metadata; type?: 'link'; } | { id?: string; metadata?: metadata; type?: 'line_break'; } | { id?: string; children?: list_item | to_do[]; metadata?: metadata; ordered?: boolean; text?: string; type?: 'list'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'list_item'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'paragraph'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'quote'; } | { id?: string; children?: table_row[]; has_header?: boolean; metadata?: metadata; text?: string; type?: 'table'; } | { id?: string; align?: 'left' | 'center' | 'right'; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'table_cell'; } | { id?: string; children?: table_cell[]; metadata?: metadata; text?: string; type?: 'table_row'; } | { text: string; id?: string; marks?: 'bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | 'math'[]; metadata?: metadata; type?: 'text'; } | { id?: string; checked?: boolean; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'todo'; } | { tool_call_id: string; tool_name: string; id?: string; args?: object; metadata?: metadata; type?: 'tool_call'; } | { output: string | object | object[]; tool_call_id: string; tool_name: string; id?: string; is_error?: boolean; metadata?: metadata; type?: 'tool_result'; } | { text: string; id?: string; message_type?: 'message' | 'thinking'; metadata?: metadata; role?: 'user' | 'assistant'; timestamp?: string; type?: 'trace_message'; } | { text: string; id?: string; end?: number; metadata?: metadata; speaker?: person; start?: number; type?: 'utterance'; }[]; comments?: { date: string; sender: person; id?: string; channel?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; external_id?: string; is_self?: boolean; mentioned_users?: person[]; metadata?: metadata; num_replies?: number; replies?: message[]; text?: string; thread_id?: string; title?: string; type?: 'message'; updated_at?: string; upvotes?: number; }[]; due_at?: string; metadata?: { edited_by?: string; sources?: object[]; }; priority?: 'urgent' | 'high' | 'medium' | 'low'; status?: 'completed' | 'not_started' | 'in_progress' | 'cancelled'; text?: string; type?: 'task'; } | { id?: string; address?: string; alt_names?: string[]; children?: { data: string; mimetype: string; id?: string; metadata?: metadata; type?: 'blob'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; title?: string; type?: 'callout'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'chunk'; } | { text: string; id?: string; language?: string; metadata?: metadata; type?: 'code'; } | { text: string; id?: string; created_at?: string; metadata?: metadata; type?: 'comment'; } | { id?: string; metadata?: metadata; type?: 'divider'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'equation'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'footnote'; } | { level: number; id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'heading'; } | { src: string; text: string; id?: string; metadata?: metadata; type?: 'image'; } | { text: string; url: string; id?: string; metadata?: metadata; type?: 'link'; } | { id?: string; metadata?: metadata; type?: 'line_break'; } | { id?: string; children?: list_item | to_do[]; metadata?: metadata; ordered?: boolean; text?: string; type?: 'list'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'list_item'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'paragraph'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'quote'; } | { id?: string; children?: table_row[]; has_header?: boolean; metadata?: metadata; text?: string; type?: 'table'; } | { id?: string; align?: 'left' | 'center' | 'right'; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'table_cell'; } | { id?: string; children?: table_cell[]; metadata?: metadata; text?: string; type?: 'table_row'; } | { text: string; id?: string; marks?: 'bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | 'math'[]; metadata?: metadata; type?: 'text'; } | { id?: string; checked?: boolean; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'todo'; } | { tool_call_id: string; tool_name: string; id?: string; args?: object; metadata?: metadata; type?: 'tool_call'; } | { output: string | object | object[]; tool_call_id: string; tool_name: string; id?: string; is_error?: boolean; metadata?: metadata; type?: 'tool_result'; } | { text: string; id?: string; message_type?: 'message' | 'thinking'; metadata?: metadata; role?: 'user' | 'assistant'; timestamp?: string; type?: 'trace_message'; } | { text: string; id?: string; end?: number; metadata?: metadata; speaker?: person; start?: number; type?: 'utterance'; }[]; company?: string; company_ids?: string[]; date_of_birth?: string; deal_ids?: string[]; email?: string; emails?: string[]; image_url?: string; job_title?: string; link_urls?: string[]; metadata?: { edited_by?: string; sources?: object[]; }; name?: string; phone_numbers?: string[]; tags?: string[]; text?: string; type?: 'person'; username?: string; } | { date: string; sender: { id?: string; address?: string; alt_names?: string[]; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; company?: string; company_ids?: string[]; date_of_birth?: string; deal_ids?: string[]; email?: string; emails?: string[]; image_url?: string; job_title?: string; link_urls?: string[]; metadata?: metadata; name?: string; phone_numbers?: string[]; tags?: string[]; text?: string; type?: 'person'; username?: string; }; id?: string; channel?: string; children?: { data: string; mimetype: string; id?: string; metadata?: metadata; type?: 'blob'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; title?: string; type?: 'callout'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'chunk'; } | { text: string; id?: string; language?: string; metadata?: metadata; type?: 'code'; } | { text: string; id?: string; created_at?: string; metadata?: metadata; type?: 'comment'; } | { id?: string; metadata?: metadata; type?: 'divider'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'equation'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'footnote'; } | { level: number; id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'heading'; } | { src: string; text: string; id?: string; metadata?: metadata; type?: 'image'; } | { text: string; url: string; id?: string; metadata?: metadata; type?: 'link'; } | { id?: string; metadata?: metadata; type?: 'line_break'; } | { id?: string; children?: list_item | to_do[]; metadata?: metadata; ordered?: boolean; text?: string; type?: 'list'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'list_item'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'paragraph'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'quote'; } | { id?: string; children?: table_row[]; has_header?: boolean; metadata?: metadata; text?: string; type?: 'table'; } | { id?: string; align?: 'left' | 'center' | 'right'; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'table_cell'; } | { id?: string; children?: table_cell[]; metadata?: metadata; text?: string; type?: 'table_row'; } | { text: string; id?: string; marks?: 'bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | 'math'[]; metadata?: metadata; type?: 'text'; } | { id?: string; checked?: boolean; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'todo'; } | { tool_call_id: string; tool_name: string; id?: string; args?: object; metadata?: metadata; type?: 'tool_call'; } | { output: string | object | object[]; tool_call_id: string; tool_name: string; id?: string; is_error?: boolean; metadata?: metadata; type?: 'tool_result'; } | { text: string; id?: string; message_type?: 'message' | 'thinking'; metadata?: metadata; role?: 'user' | 'assistant'; timestamp?: string; type?: 'trace_message'; } | { text: string; id?: string; end?: number; metadata?: metadata; speaker?: person; start?: number; type?: 'utterance'; }[]; external_id?: string; is_self?: boolean; mentioned_users?: { id?: string; address?: string; alt_names?: string[]; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; company?: string; company_ids?: string[]; date_of_birth?: string; deal_ids?: string[]; email?: string; emails?: string[]; image_url?: string; job_title?: string; link_urls?: string[]; metadata?: metadata; name?: string; phone_numbers?: string[]; tags?: string[]; text?: string; type?: 'person'; username?: string; }[]; metadata?: { edited_by?: string; sources?: object[]; }; num_replies?: number; replies?: { date: string; sender: person; id?: string; channel?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; external_id?: string; is_self?: boolean; mentioned_users?: person[]; metadata?: metadata; num_replies?: number; replies?: message[]; text?: string; thread_id?: string; title?: string; type?: 'message'; updated_at?: string; upvotes?: number; }[]; text?: string; thread_id?: string; title?: string; type?: 'message'; updated_at?: string; upvotes?: number; } | { id?: string; attendees?: { id?: string; address?: string; alt_names?: string[]; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; company?: string; company_ids?: string[]; date_of_birth?: string; deal_ids?: string[]; email?: string; emails?: string[]; image_url?: string; job_title?: string; link_urls?: string[]; metadata?: metadata; name?: string; phone_numbers?: string[]; tags?: string[]; text?: string; type?: 'person'; username?: string; }[]; children?: { data: string; mimetype: string; id?: string; metadata?: metadata; type?: 'blob'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; title?: string; type?: 'callout'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'chunk'; } | { text: string; id?: string; language?: string; metadata?: metadata; type?: 'code'; } | { text: string; id?: string; created_at?: string; metadata?: metadata; type?: 'comment'; } | { id?: string; metadata?: metadata; type?: 'divider'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'equation'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'footnote'; } | { level: number; id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'heading'; } | { src: string; text: string; id?: string; metadata?: metadata; type?: 'image'; } | { text: string; url: string; id?: string; metadata?: metadata; type?: 'link'; } | { id?: string; metadata?: metadata; type?: 'line_break'; } | { id?: string; children?: list_item | to_do[]; metadata?: metadata; ordered?: boolean; text?: string; type?: 'list'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'list_item'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'paragraph'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'quote'; } | { id?: string; children?: table_row[]; has_header?: boolean; metadata?: metadata; text?: string; type?: 'table'; } | { id?: string; align?: 'left' | 'center' | 'right'; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'table_cell'; } | { id?: string; children?: table_cell[]; metadata?: metadata; text?: string; type?: 'table_row'; } | { text: string; id?: string; marks?: 'bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | 'math'[]; metadata?: metadata; type?: 'text'; } | { id?: string; checked?: boolean; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'todo'; } | { tool_call_id: string; tool_name: string; id?: string; args?: object; metadata?: metadata; type?: 'tool_call'; } | { output: string | object | object[]; tool_call_id: string; tool_name: string; id?: string; is_error?: boolean; metadata?: metadata; type?: 'tool_result'; } | { text: string; id?: string; message_type?: 'message' | 'thinking'; metadata?: metadata; role?: 'user' | 'assistant'; timestamp?: string; type?: 'trace_message'; } | { text: string; id?: string; end?: number; metadata?: metadata; speaker?: person; start?: number; type?: 'utterance'; }[]; end_at?: string; location?: string; meeting_url?: string; metadata?: { edited_by?: string; sources?: object[]; }; start_at?: string; text?: string; title?: string; type?: 'event'; } | { content_type: string; filename: string; id?: string; children?: { data: string; mimetype: string; id?: string; metadata?: metadata; type?: 'blob'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; title?: string; type?: 'callout'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'chunk'; } | { text: string; id?: string; language?: string; metadata?: metadata; type?: 'code'; } | { text: string; id?: string; created_at?: string; metadata?: metadata; type?: 'comment'; } | { id?: string; metadata?: metadata; type?: 'divider'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'equation'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'footnote'; } | { level: number; id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'heading'; } | { src: string; text: string; id?: string; metadata?: metadata; type?: 'image'; } | { text: string; url: string; id?: string; metadata?: metadata; type?: 'link'; } | { id?: string; metadata?: metadata; type?: 'line_break'; } | { id?: string; children?: list_item | to_do[]; metadata?: metadata; ordered?: boolean; text?: string; type?: 'list'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'list_item'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'paragraph'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'quote'; } | { id?: string; children?: table_row[]; has_header?: boolean; metadata?: metadata; text?: string; type?: 'table'; } | { id?: string; align?: 'left' | 'center' | 'right'; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'table_cell'; } | { id?: string; children?: table_cell[]; metadata?: metadata; text?: string; type?: 'table_row'; } | { text: string; id?: string; marks?: 'bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | 'math'[]; metadata?: metadata; type?: 'text'; } | { id?: string; checked?: boolean; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'todo'; } | { tool_call_id: string; tool_name: string; id?: string; args?: object; metadata?: metadata; type?: 'tool_call'; } | { output: string | object | object[]; tool_call_id: string; tool_name: string; id?: string; is_error?: boolean; metadata?: metadata; type?: 'tool_result'; } | { text: string; id?: string; message_type?: 'message' | 'thinking'; metadata?: metadata; role?: 'user' | 'assistant'; timestamp?: string; type?: 'trace_message'; } | { text: string; id?: string; end?: number; metadata?: metadata; speaker?: person; start?: number; type?: 'utterance'; }[]; metadata?: { edited_by?: string; sources?: object[]; }; path?: string[]; text?: string; title?: string; type?: 'file'; } | { id?: string; channel?: string; children?: { date: string; sender: person; id?: string; channel?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; external_id?: string; is_self?: boolean; mentioned_users?: person[]; metadata?: metadata; num_replies?: number; replies?: message[]; text?: string; thread_id?: string; title?: string; type?: 'message'; updated_at?: string; upvotes?: number; }[]; metadata?: { edited_by?: string; sources?: object[]; }; text?: string; title?: string; type?: 'conversation'; } | { id?: string; children?: { text: string; id?: string; message_type?: 'message' | 'thinking'; metadata?: metadata; role?: 'user' | 'assistant'; timestamp?: string; type?: 'trace_message'; } | { tool_call_id: string; tool_name: string; id?: string; args?: object; metadata?: metadata; type?: 'tool_call'; } | { output: string | object | object[]; tool_call_id: string; tool_name: string; id?: string; is_error?: boolean; metadata?: metadata; type?: 'tool_result'; }[]; metadata?: { edited_by?: string; sources?: object[]; }; text?: string; title?: string; type?: 'trace'; } | { id?: string; children?: { text: string; id?: string; end?: number; metadata?: metadata; speaker?: person; start?: number; type?: 'utterance'; }[]; ended_at?: string; metadata?: { edited_by?: string; sources?: object[]; }; participants?: { id?: string; address?: string; alt_names?: string[]; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; company?: string; company_ids?: string[]; date_of_birth?: string; deal_ids?: string[]; email?: string; emails?: string[]; image_url?: string; job_title?: string; link_urls?: string[]; metadata?: metadata; name?: string; phone_numbers?: string[]; tags?: string[]; text?: string; type?: 'person'; username?: string; }[]; started_at?: string; text?: string; title?: string; type?: 'transcript'; } | { id?: string; address?: string; children?: { data: string; mimetype: string; id?: string; metadata?: metadata; type?: 'blob'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; title?: string; type?: 'callout'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'chunk'; } | { text: string; id?: string; language?: string; metadata?: metadata; type?: 'code'; } | { text: string; id?: string; created_at?: string; metadata?: metadata; type?: 'comment'; } | { id?: string; metadata?: metadata; type?: 'divider'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'equation'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'footnote'; } | { level: number; id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'heading'; } | { src: string; text: string; id?: string; metadata?: metadata; type?: 'image'; } | { text: string; url: string; id?: string; metadata?: metadata; type?: 'link'; } | { id?: string; metadata?: metadata; type?: 'line_break'; } | { id?: string; children?: list_item | to_do[]; metadata?: metadata; ordered?: boolean; text?: string; type?: 'list'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'list_item'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'paragraph'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'quote'; } | { id?: string; children?: table_row[]; has_header?: boolean; metadata?: metadata; text?: string; type?: 'table'; } | { id?: string; align?: 'left' | 'center' | 'right'; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'table_cell'; } | { id?: string; children?: table_cell[]; metadata?: metadata; text?: string; type?: 'table_row'; } | { text: string; id?: string; marks?: 'bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | 'math'[]; metadata?: metadata; type?: 'text'; } | { id?: string; checked?: boolean; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'todo'; } | { tool_call_id: string; tool_name: string; id?: string; args?: object; metadata?: metadata; type?: 'tool_call'; } | { output: string | object | object[]; tool_call_id: string; tool_name: string; id?: string; is_error?: boolean; metadata?: metadata; type?: 'tool_result'; } | { text: string; id?: string; message_type?: 'message' | 'thinking'; metadata?: metadata; role?: 'user' | 'assistant'; timestamp?: string; type?: 'trace_message'; } | { text: string; id?: string; end?: number; metadata?: metadata; speaker?: person; start?: number; type?: 'utterance'; }[]; contact_ids?: string[]; deal_ids?: string[]; description?: string; emails?: string[]; employees?: number; image_url?: string; industry?: string; is_active?: boolean; metadata?: { edited_by?: string; sources?: object[]; }; name?: string; phone_numbers?: string[]; tags?: string[]; text?: string; timezone?: string; type?: 'company'; websites?: string[]; } | { id?: string; amount?: number; children?: { data: string; mimetype: string; id?: string; metadata?: metadata; type?: 'blob'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; title?: string; type?: 'callout'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'chunk'; } | { text: string; id?: string; language?: string; metadata?: metadata; type?: 'code'; } | { text: string; id?: string; created_at?: string; metadata?: metadata; type?: 'comment'; } | { id?: string; metadata?: metadata; type?: 'divider'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'equation'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'footnote'; } | { level: number; id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'heading'; } | { src: string; text: string; id?: string; metadata?: metadata; type?: 'image'; } | { text: string; url: string; id?: string; metadata?: metadata; type?: 'link'; } | { id?: string; metadata?: metadata; type?: 'line_break'; } | { id?: string; children?: list_item | to_do[]; metadata?: metadata; ordered?: boolean; text?: string; type?: 'list'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'list_item'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'paragraph'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'quote'; } | { id?: string; children?: table_row[]; has_header?: boolean; metadata?: metadata; text?: string; type?: 'table'; } | { id?: string; align?: 'left' | 'center' | 'right'; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'table_cell'; } | { id?: string; children?: table_cell[]; metadata?: metadata; text?: string; type?: 'table_row'; } | { text: string; id?: string; marks?: 'bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | 'math'[]; metadata?: metadata; type?: 'text'; } | { id?: string; checked?: boolean; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'todo'; } | { tool_call_id: string; tool_name: string; id?: string; args?: object; metadata?: metadata; type?: 'tool_call'; } | { output: string | object | object[]; tool_call_id: string; tool_name: string; id?: string; is_error?: boolean; metadata?: metadata; type?: 'tool_result'; } | { text: string; id?: string; message_type?: 'message' | 'thinking'; metadata?: metadata; role?: 'user' | 'assistant'; timestamp?: string; type?: 'trace_message'; } | { text: string; id?: string; end?: number; metadata?: metadata; speaker?: person; start?: number; type?: 'utterance'; }[]; closed_at?: string; company_ids?: string[]; contact_ids?: string[]; currency?: string; deal_source?: string; lost_reason?: string; metadata?: { edited_by?: string; sources?: object[]; }; name?: string; pipeline?: string; probability?: number; stage?: string; tags?: string[]; text?: string; type?: 'deal'; won_reason?: string; }`\n - `resource_id: string`\n - `source: string`\n - `type: string`\n - `collection?: string`\n - `document_date?: string`\n - `ingested_at?: string`\n - `last_modified_at?: string`\n - `metadata?: object`\n - `status?: 'pending' | 'processing' | 'completed' | 'failed' | 'pending_review' | 'skipped'`\n - `title?: string`\n\n### Example\n\n```typescript\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell();\n\nconst memory = await client.memories.get('resource_id', { source: 'reddit' });\n\nconsole.log(memory);\n```", + "## get\n\n`client.memories.get(source: string, resource_id: string, include_chunks?: boolean): { document: document | website | task | person | message | event | file | conversation | trace | transcript | company | deal | object; resource_id: string; source: string; type: string; chunks?: object[]; collection?: string; document_date?: string; ingested_at?: string; last_modified_at?: string; metadata?: object; status?: string; title?: string; }`\n\n**get** `/memories/get/{source}/{resource_id}`\n\nRetrieve a document by provider and resource ID, including its full\nhyperdoc tree.\n\n### Parameters\n\n- `source: string`\n\n- `resource_id: string`\n\n- `include_chunks?: boolean`\n When true, include the document's extracted memories (chunks with summaries) in the `chunks` field, in document order.\n\n### Returns\n\n- `{ document: { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; title?: string; type?: 'document'; } | { url: string; id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; description?: string; favicon?: string; image_url?: string; language?: string; metadata?: metadata; text?: string; title?: string; type?: 'website'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; comments?: message[]; due_at?: string; metadata?: metadata; priority?: 'urgent' | 'high' | 'medium' | 'low'; status?: 'completed' | 'not_started' | 'in_progress' | 'cancelled'; text?: string; type?: 'task'; } | { id?: string; address?: string; alt_names?: string[]; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; company?: string; company_ids?: string[]; date_of_birth?: string; deal_ids?: string[]; email?: string; emails?: string[]; image_url?: string; is_app_user?: boolean; is_bot?: boolean; job_title?: string; link_urls?: string[]; metadata?: metadata; name?: string; phone_numbers?: string[]; tags?: string[]; text?: string; type?: 'person'; username?: string; } | { date: string; sender: person; id?: string; channel?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; external_id?: string; is_self?: boolean; mentioned_users?: person[]; metadata?: metadata; num_replies?: number; replies?: message[]; text?: string; thread_id?: string; title?: string; type?: 'message'; updated_at?: string; upvotes?: number; } | { id?: string; attendees?: person[]; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; end_at?: string; location?: string; meeting_url?: string; metadata?: metadata; start_at?: string; text?: string; title?: string; type?: 'event'; } | { content_type: string; filename: string; id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; content_truncated?: boolean; metadata?: metadata; path?: string[]; text?: string; title?: string; type?: 'file'; } | { id?: string; channel?: string; children?: message[]; metadata?: metadata; participants?: person[]; text?: string; title?: string; type?: 'conversation'; } | { id?: string; children?: trace_message | tool_call | tool_result[]; metadata?: metadata; text?: string; title?: string; type?: 'trace'; } | { id?: string; children?: utterance[]; ended_at?: string; metadata?: metadata; participants?: person[]; started_at?: string; text?: string; title?: string; type?: 'transcript'; } | { id?: string; address?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; contact_ids?: string[]; deal_ids?: string[]; description?: string; emails?: string[]; employees?: number; image_url?: string; industry?: string; is_active?: boolean; metadata?: metadata; name?: string; phone_numbers?: string[]; tags?: string[]; text?: string; timezone?: string; type?: 'company'; websites?: string[]; } | { id?: string; amount?: number; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; closed_at?: string; company_ids?: string[]; contact_ids?: string[]; currency?: string; deal_source?: string; lost_reason?: string; metadata?: metadata; name?: string; pipeline?: string; probability?: number; stage?: string; tags?: string[]; text?: string; type?: 'deal'; won_reason?: string; } | { id?: string; attachment_names?: string[]; balance_amount?: number; cancelled_at?: string; children?: object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object[]; contact_id?: string; contact_name?: string; currency?: string; due_at?: string; invoice_type?: string; metadata?: object; notes?: string; number?: string; organization_id?: string; paid_amount?: number; paid_at?: string; posted_at?: string; reference?: string; refund_amount?: number; refund_reason?: string; refunded_at?: string; status?: string; tax_amount?: number; text?: string; total_amount?: number; type?: 'invoice'; }; resource_id: string; source: string; type: string; chunks?: { chunk_id: string; summary?: string; }[]; collection?: string; document_date?: string; ingested_at?: string; last_modified_at?: string; metadata?: object; status?: string; title?: string; }`\n A document-shaped API response containing the hyperdoc tree.\n\n - `document: { id?: string; children?: { data: string; mimetype: string; id?: string; metadata?: metadata; type?: 'blob'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; title?: string; type?: 'callout'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'chunk'; } | { text: string; id?: string; language?: string; metadata?: metadata; type?: 'code'; } | { text: string; id?: string; created_at?: string; metadata?: metadata; type?: 'comment'; } | { id?: string; metadata?: metadata; type?: 'divider'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'equation'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'footnote'; } | { level: number; id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'heading'; } | { src: string; text: string; id?: string; metadata?: metadata; type?: 'image'; } | { text: string; url: string; id?: string; metadata?: metadata; type?: 'link'; } | { id?: string; metadata?: metadata; type?: 'line_break'; } | { id?: string; children?: list_item | to_do[]; metadata?: metadata; ordered?: boolean; text?: string; type?: 'list'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'list_item'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; page_number?: number; preview_url?: string; text?: string; type?: 'page'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'paragraph'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'quote'; } | { id?: string; children?: table_row[]; has_header?: boolean; metadata?: metadata; text?: string; type?: 'table'; } | { id?: string; align?: 'left' | 'center' | 'right'; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'table_cell'; } | { id?: string; children?: table_cell[]; metadata?: metadata; text?: string; type?: 'table_row'; } | { text: string; id?: string; marks?: 'bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | 'math'[]; metadata?: metadata; type?: 'text'; } | { id?: string; checked?: boolean; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'todo'; } | { tool_call_id: string; tool_name: string; id?: string; args?: object; metadata?: metadata; type?: 'tool_call'; } | { output: string | object | object[]; tool_call_id: string; tool_name: string; id?: string; is_error?: boolean; metadata?: metadata; type?: 'tool_result'; } | { text: string; id?: string; message_type?: 'message' | 'thinking'; metadata?: metadata; role?: 'user' | 'assistant'; timestamp?: string; type?: 'trace_message'; } | { text: string; id?: string; end?: number; metadata?: metadata; speaker?: person; start?: number; type?: 'utterance'; }[]; metadata?: { edited_by?: string; sources?: object[]; }; text?: string; title?: string; type?: 'document'; } | { url: string; id?: string; children?: { data: string; mimetype: string; id?: string; metadata?: metadata; type?: 'blob'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; title?: string; type?: 'callout'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'chunk'; } | { text: string; id?: string; language?: string; metadata?: metadata; type?: 'code'; } | { text: string; id?: string; created_at?: string; metadata?: metadata; type?: 'comment'; } | { id?: string; metadata?: metadata; type?: 'divider'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'equation'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'footnote'; } | { level: number; id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'heading'; } | { src: string; text: string; id?: string; metadata?: metadata; type?: 'image'; } | { text: string; url: string; id?: string; metadata?: metadata; type?: 'link'; } | { id?: string; metadata?: metadata; type?: 'line_break'; } | { id?: string; children?: list_item | to_do[]; metadata?: metadata; ordered?: boolean; text?: string; type?: 'list'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'list_item'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; page_number?: number; preview_url?: string; text?: string; type?: 'page'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'paragraph'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'quote'; } | { id?: string; children?: table_row[]; has_header?: boolean; metadata?: metadata; text?: string; type?: 'table'; } | { id?: string; align?: 'left' | 'center' | 'right'; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'table_cell'; } | { id?: string; children?: table_cell[]; metadata?: metadata; text?: string; type?: 'table_row'; } | { text: string; id?: string; marks?: 'bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | 'math'[]; metadata?: metadata; type?: 'text'; } | { id?: string; checked?: boolean; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'todo'; } | { tool_call_id: string; tool_name: string; id?: string; args?: object; metadata?: metadata; type?: 'tool_call'; } | { output: string | object | object[]; tool_call_id: string; tool_name: string; id?: string; is_error?: boolean; metadata?: metadata; type?: 'tool_result'; } | { text: string; id?: string; message_type?: 'message' | 'thinking'; metadata?: metadata; role?: 'user' | 'assistant'; timestamp?: string; type?: 'trace_message'; } | { text: string; id?: string; end?: number; metadata?: metadata; speaker?: person; start?: number; type?: 'utterance'; }[]; description?: string; favicon?: string; image_url?: string; language?: string; metadata?: { edited_by?: string; sources?: object[]; }; text?: string; title?: string; type?: 'website'; } | { id?: string; children?: { data: string; mimetype: string; id?: string; metadata?: metadata; type?: 'blob'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; title?: string; type?: 'callout'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'chunk'; } | { text: string; id?: string; language?: string; metadata?: metadata; type?: 'code'; } | { text: string; id?: string; created_at?: string; metadata?: metadata; type?: 'comment'; } | { id?: string; metadata?: metadata; type?: 'divider'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'equation'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'footnote'; } | { level: number; id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'heading'; } | { src: string; text: string; id?: string; metadata?: metadata; type?: 'image'; } | { text: string; url: string; id?: string; metadata?: metadata; type?: 'link'; } | { id?: string; metadata?: metadata; type?: 'line_break'; } | { id?: string; children?: list_item | to_do[]; metadata?: metadata; ordered?: boolean; text?: string; type?: 'list'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'list_item'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; page_number?: number; preview_url?: string; text?: string; type?: 'page'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'paragraph'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'quote'; } | { id?: string; children?: table_row[]; has_header?: boolean; metadata?: metadata; text?: string; type?: 'table'; } | { id?: string; align?: 'left' | 'center' | 'right'; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'table_cell'; } | { id?: string; children?: table_cell[]; metadata?: metadata; text?: string; type?: 'table_row'; } | { text: string; id?: string; marks?: 'bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | 'math'[]; metadata?: metadata; type?: 'text'; } | { id?: string; checked?: boolean; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'todo'; } | { tool_call_id: string; tool_name: string; id?: string; args?: object; metadata?: metadata; type?: 'tool_call'; } | { output: string | object | object[]; tool_call_id: string; tool_name: string; id?: string; is_error?: boolean; metadata?: metadata; type?: 'tool_result'; } | { text: string; id?: string; message_type?: 'message' | 'thinking'; metadata?: metadata; role?: 'user' | 'assistant'; timestamp?: string; type?: 'trace_message'; } | { text: string; id?: string; end?: number; metadata?: metadata; speaker?: person; start?: number; type?: 'utterance'; }[]; comments?: { date: string; sender: person; id?: string; channel?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; external_id?: string; is_self?: boolean; mentioned_users?: person[]; metadata?: metadata; num_replies?: number; replies?: message[]; text?: string; thread_id?: string; title?: string; type?: 'message'; updated_at?: string; upvotes?: number; }[]; due_at?: string; metadata?: { edited_by?: string; sources?: object[]; }; priority?: 'urgent' | 'high' | 'medium' | 'low'; status?: 'completed' | 'not_started' | 'in_progress' | 'cancelled'; text?: string; type?: 'task'; } | { id?: string; address?: string; alt_names?: string[]; children?: { data: string; mimetype: string; id?: string; metadata?: metadata; type?: 'blob'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; title?: string; type?: 'callout'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'chunk'; } | { text: string; id?: string; language?: string; metadata?: metadata; type?: 'code'; } | { text: string; id?: string; created_at?: string; metadata?: metadata; type?: 'comment'; } | { id?: string; metadata?: metadata; type?: 'divider'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'equation'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'footnote'; } | { level: number; id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'heading'; } | { src: string; text: string; id?: string; metadata?: metadata; type?: 'image'; } | { text: string; url: string; id?: string; metadata?: metadata; type?: 'link'; } | { id?: string; metadata?: metadata; type?: 'line_break'; } | { id?: string; children?: list_item | to_do[]; metadata?: metadata; ordered?: boolean; text?: string; type?: 'list'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'list_item'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; page_number?: number; preview_url?: string; text?: string; type?: 'page'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'paragraph'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'quote'; } | { id?: string; children?: table_row[]; has_header?: boolean; metadata?: metadata; text?: string; type?: 'table'; } | { id?: string; align?: 'left' | 'center' | 'right'; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'table_cell'; } | { id?: string; children?: table_cell[]; metadata?: metadata; text?: string; type?: 'table_row'; } | { text: string; id?: string; marks?: 'bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | 'math'[]; metadata?: metadata; type?: 'text'; } | { id?: string; checked?: boolean; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'todo'; } | { tool_call_id: string; tool_name: string; id?: string; args?: object; metadata?: metadata; type?: 'tool_call'; } | { output: string | object | object[]; tool_call_id: string; tool_name: string; id?: string; is_error?: boolean; metadata?: metadata; type?: 'tool_result'; } | { text: string; id?: string; message_type?: 'message' | 'thinking'; metadata?: metadata; role?: 'user' | 'assistant'; timestamp?: string; type?: 'trace_message'; } | { text: string; id?: string; end?: number; metadata?: metadata; speaker?: person; start?: number; type?: 'utterance'; }[]; company?: string; company_ids?: string[]; date_of_birth?: string; deal_ids?: string[]; email?: string; emails?: string[]; image_url?: string; is_app_user?: boolean; is_bot?: boolean; job_title?: string; link_urls?: string[]; metadata?: { edited_by?: string; sources?: object[]; }; name?: string; phone_numbers?: string[]; tags?: string[]; text?: string; type?: 'person'; username?: string; } | { date: string; sender: { id?: string; address?: string; alt_names?: string[]; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; company?: string; company_ids?: string[]; date_of_birth?: string; deal_ids?: string[]; email?: string; emails?: string[]; image_url?: string; is_app_user?: boolean; is_bot?: boolean; job_title?: string; link_urls?: string[]; metadata?: metadata; name?: string; phone_numbers?: string[]; tags?: string[]; text?: string; type?: 'person'; username?: string; }; id?: string; channel?: string; children?: { data: string; mimetype: string; id?: string; metadata?: metadata; type?: 'blob'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; title?: string; type?: 'callout'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'chunk'; } | { text: string; id?: string; language?: string; metadata?: metadata; type?: 'code'; } | { text: string; id?: string; created_at?: string; metadata?: metadata; type?: 'comment'; } | { id?: string; metadata?: metadata; type?: 'divider'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'equation'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'footnote'; } | { level: number; id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'heading'; } | { src: string; text: string; id?: string; metadata?: metadata; type?: 'image'; } | { text: string; url: string; id?: string; metadata?: metadata; type?: 'link'; } | { id?: string; metadata?: metadata; type?: 'line_break'; } | { id?: string; children?: list_item | to_do[]; metadata?: metadata; ordered?: boolean; text?: string; type?: 'list'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'list_item'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; page_number?: number; preview_url?: string; text?: string; type?: 'page'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'paragraph'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'quote'; } | { id?: string; children?: table_row[]; has_header?: boolean; metadata?: metadata; text?: string; type?: 'table'; } | { id?: string; align?: 'left' | 'center' | 'right'; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'table_cell'; } | { id?: string; children?: table_cell[]; metadata?: metadata; text?: string; type?: 'table_row'; } | { text: string; id?: string; marks?: 'bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | 'math'[]; metadata?: metadata; type?: 'text'; } | { id?: string; checked?: boolean; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'todo'; } | { tool_call_id: string; tool_name: string; id?: string; args?: object; metadata?: metadata; type?: 'tool_call'; } | { output: string | object | object[]; tool_call_id: string; tool_name: string; id?: string; is_error?: boolean; metadata?: metadata; type?: 'tool_result'; } | { text: string; id?: string; message_type?: 'message' | 'thinking'; metadata?: metadata; role?: 'user' | 'assistant'; timestamp?: string; type?: 'trace_message'; } | { text: string; id?: string; end?: number; metadata?: metadata; speaker?: person; start?: number; type?: 'utterance'; }[]; external_id?: string; is_self?: boolean; mentioned_users?: { id?: string; address?: string; alt_names?: string[]; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; company?: string; company_ids?: string[]; date_of_birth?: string; deal_ids?: string[]; email?: string; emails?: string[]; image_url?: string; is_app_user?: boolean; is_bot?: boolean; job_title?: string; link_urls?: string[]; metadata?: metadata; name?: string; phone_numbers?: string[]; tags?: string[]; text?: string; type?: 'person'; username?: string; }[]; metadata?: { edited_by?: string; sources?: object[]; }; num_replies?: number; replies?: { date: string; sender: person; id?: string; channel?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; external_id?: string; is_self?: boolean; mentioned_users?: person[]; metadata?: metadata; num_replies?: number; replies?: message[]; text?: string; thread_id?: string; title?: string; type?: 'message'; updated_at?: string; upvotes?: number; }[]; text?: string; thread_id?: string; title?: string; type?: 'message'; updated_at?: string; upvotes?: number; } | { id?: string; attendees?: { id?: string; address?: string; alt_names?: string[]; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; company?: string; company_ids?: string[]; date_of_birth?: string; deal_ids?: string[]; email?: string; emails?: string[]; image_url?: string; is_app_user?: boolean; is_bot?: boolean; job_title?: string; link_urls?: string[]; metadata?: metadata; name?: string; phone_numbers?: string[]; tags?: string[]; text?: string; type?: 'person'; username?: string; }[]; children?: { data: string; mimetype: string; id?: string; metadata?: metadata; type?: 'blob'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; title?: string; type?: 'callout'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'chunk'; } | { text: string; id?: string; language?: string; metadata?: metadata; type?: 'code'; } | { text: string; id?: string; created_at?: string; metadata?: metadata; type?: 'comment'; } | { id?: string; metadata?: metadata; type?: 'divider'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'equation'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'footnote'; } | { level: number; id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'heading'; } | { src: string; text: string; id?: string; metadata?: metadata; type?: 'image'; } | { text: string; url: string; id?: string; metadata?: metadata; type?: 'link'; } | { id?: string; metadata?: metadata; type?: 'line_break'; } | { id?: string; children?: list_item | to_do[]; metadata?: metadata; ordered?: boolean; text?: string; type?: 'list'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'list_item'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; page_number?: number; preview_url?: string; text?: string; type?: 'page'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'paragraph'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'quote'; } | { id?: string; children?: table_row[]; has_header?: boolean; metadata?: metadata; text?: string; type?: 'table'; } | { id?: string; align?: 'left' | 'center' | 'right'; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'table_cell'; } | { id?: string; children?: table_cell[]; metadata?: metadata; text?: string; type?: 'table_row'; } | { text: string; id?: string; marks?: 'bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | 'math'[]; metadata?: metadata; type?: 'text'; } | { id?: string; checked?: boolean; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'todo'; } | { tool_call_id: string; tool_name: string; id?: string; args?: object; metadata?: metadata; type?: 'tool_call'; } | { output: string | object | object[]; tool_call_id: string; tool_name: string; id?: string; is_error?: boolean; metadata?: metadata; type?: 'tool_result'; } | { text: string; id?: string; message_type?: 'message' | 'thinking'; metadata?: metadata; role?: 'user' | 'assistant'; timestamp?: string; type?: 'trace_message'; } | { text: string; id?: string; end?: number; metadata?: metadata; speaker?: person; start?: number; type?: 'utterance'; }[]; end_at?: string; location?: string; meeting_url?: string; metadata?: { edited_by?: string; sources?: object[]; }; start_at?: string; text?: string; title?: string; type?: 'event'; } | { content_type: string; filename: string; id?: string; children?: { data: string; mimetype: string; id?: string; metadata?: metadata; type?: 'blob'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; title?: string; type?: 'callout'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'chunk'; } | { text: string; id?: string; language?: string; metadata?: metadata; type?: 'code'; } | { text: string; id?: string; created_at?: string; metadata?: metadata; type?: 'comment'; } | { id?: string; metadata?: metadata; type?: 'divider'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'equation'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'footnote'; } | { level: number; id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'heading'; } | { src: string; text: string; id?: string; metadata?: metadata; type?: 'image'; } | { text: string; url: string; id?: string; metadata?: metadata; type?: 'link'; } | { id?: string; metadata?: metadata; type?: 'line_break'; } | { id?: string; children?: list_item | to_do[]; metadata?: metadata; ordered?: boolean; text?: string; type?: 'list'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'list_item'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; page_number?: number; preview_url?: string; text?: string; type?: 'page'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'paragraph'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'quote'; } | { id?: string; children?: table_row[]; has_header?: boolean; metadata?: metadata; text?: string; type?: 'table'; } | { id?: string; align?: 'left' | 'center' | 'right'; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'table_cell'; } | { id?: string; children?: table_cell[]; metadata?: metadata; text?: string; type?: 'table_row'; } | { text: string; id?: string; marks?: 'bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | 'math'[]; metadata?: metadata; type?: 'text'; } | { id?: string; checked?: boolean; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'todo'; } | { tool_call_id: string; tool_name: string; id?: string; args?: object; metadata?: metadata; type?: 'tool_call'; } | { output: string | object | object[]; tool_call_id: string; tool_name: string; id?: string; is_error?: boolean; metadata?: metadata; type?: 'tool_result'; } | { text: string; id?: string; message_type?: 'message' | 'thinking'; metadata?: metadata; role?: 'user' | 'assistant'; timestamp?: string; type?: 'trace_message'; } | { text: string; id?: string; end?: number; metadata?: metadata; speaker?: person; start?: number; type?: 'utterance'; }[]; content_truncated?: boolean; metadata?: { edited_by?: string; sources?: object[]; }; path?: string[]; text?: string; title?: string; type?: 'file'; } | { id?: string; channel?: string; children?: { date: string; sender: person; id?: string; channel?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; external_id?: string; is_self?: boolean; mentioned_users?: person[]; metadata?: metadata; num_replies?: number; replies?: message[]; text?: string; thread_id?: string; title?: string; type?: 'message'; updated_at?: string; upvotes?: number; }[]; metadata?: { edited_by?: string; sources?: object[]; }; participants?: { id?: string; address?: string; alt_names?: string[]; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; company?: string; company_ids?: string[]; date_of_birth?: string; deal_ids?: string[]; email?: string; emails?: string[]; image_url?: string; is_app_user?: boolean; is_bot?: boolean; job_title?: string; link_urls?: string[]; metadata?: metadata; name?: string; phone_numbers?: string[]; tags?: string[]; text?: string; type?: 'person'; username?: string; }[]; text?: string; title?: string; type?: 'conversation'; } | { id?: string; children?: { text: string; id?: string; message_type?: 'message' | 'thinking'; metadata?: metadata; role?: 'user' | 'assistant'; timestamp?: string; type?: 'trace_message'; } | { tool_call_id: string; tool_name: string; id?: string; args?: object; metadata?: metadata; type?: 'tool_call'; } | { output: string | object | object[]; tool_call_id: string; tool_name: string; id?: string; is_error?: boolean; metadata?: metadata; type?: 'tool_result'; }[]; metadata?: { edited_by?: string; sources?: object[]; }; text?: string; title?: string; type?: 'trace'; } | { id?: string; children?: { text: string; id?: string; end?: number; metadata?: metadata; speaker?: person; start?: number; type?: 'utterance'; }[]; ended_at?: string; metadata?: { edited_by?: string; sources?: object[]; }; participants?: { id?: string; address?: string; alt_names?: string[]; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; company?: string; company_ids?: string[]; date_of_birth?: string; deal_ids?: string[]; email?: string; emails?: string[]; image_url?: string; is_app_user?: boolean; is_bot?: boolean; job_title?: string; link_urls?: string[]; metadata?: metadata; name?: string; phone_numbers?: string[]; tags?: string[]; text?: string; type?: 'person'; username?: string; }[]; started_at?: string; text?: string; title?: string; type?: 'transcript'; } | { id?: string; address?: string; children?: { data: string; mimetype: string; id?: string; metadata?: metadata; type?: 'blob'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; title?: string; type?: 'callout'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'chunk'; } | { text: string; id?: string; language?: string; metadata?: metadata; type?: 'code'; } | { text: string; id?: string; created_at?: string; metadata?: metadata; type?: 'comment'; } | { id?: string; metadata?: metadata; type?: 'divider'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'equation'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'footnote'; } | { level: number; id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'heading'; } | { src: string; text: string; id?: string; metadata?: metadata; type?: 'image'; } | { text: string; url: string; id?: string; metadata?: metadata; type?: 'link'; } | { id?: string; metadata?: metadata; type?: 'line_break'; } | { id?: string; children?: list_item | to_do[]; metadata?: metadata; ordered?: boolean; text?: string; type?: 'list'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'list_item'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; page_number?: number; preview_url?: string; text?: string; type?: 'page'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'paragraph'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'quote'; } | { id?: string; children?: table_row[]; has_header?: boolean; metadata?: metadata; text?: string; type?: 'table'; } | { id?: string; align?: 'left' | 'center' | 'right'; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'table_cell'; } | { id?: string; children?: table_cell[]; metadata?: metadata; text?: string; type?: 'table_row'; } | { text: string; id?: string; marks?: 'bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | 'math'[]; metadata?: metadata; type?: 'text'; } | { id?: string; checked?: boolean; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'todo'; } | { tool_call_id: string; tool_name: string; id?: string; args?: object; metadata?: metadata; type?: 'tool_call'; } | { output: string | object | object[]; tool_call_id: string; tool_name: string; id?: string; is_error?: boolean; metadata?: metadata; type?: 'tool_result'; } | { text: string; id?: string; message_type?: 'message' | 'thinking'; metadata?: metadata; role?: 'user' | 'assistant'; timestamp?: string; type?: 'trace_message'; } | { text: string; id?: string; end?: number; metadata?: metadata; speaker?: person; start?: number; type?: 'utterance'; }[]; contact_ids?: string[]; deal_ids?: string[]; description?: string; emails?: string[]; employees?: number; image_url?: string; industry?: string; is_active?: boolean; metadata?: { edited_by?: string; sources?: object[]; }; name?: string; phone_numbers?: string[]; tags?: string[]; text?: string; timezone?: string; type?: 'company'; websites?: string[]; } | { id?: string; amount?: number; children?: { data: string; mimetype: string; id?: string; metadata?: metadata; type?: 'blob'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; title?: string; type?: 'callout'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'chunk'; } | { text: string; id?: string; language?: string; metadata?: metadata; type?: 'code'; } | { text: string; id?: string; created_at?: string; metadata?: metadata; type?: 'comment'; } | { id?: string; metadata?: metadata; type?: 'divider'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'equation'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'footnote'; } | { level: number; id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'heading'; } | { src: string; text: string; id?: string; metadata?: metadata; type?: 'image'; } | { text: string; url: string; id?: string; metadata?: metadata; type?: 'link'; } | { id?: string; metadata?: metadata; type?: 'line_break'; } | { id?: string; children?: list_item | to_do[]; metadata?: metadata; ordered?: boolean; text?: string; type?: 'list'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'list_item'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; page_number?: number; preview_url?: string; text?: string; type?: 'page'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'paragraph'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'quote'; } | { id?: string; children?: table_row[]; has_header?: boolean; metadata?: metadata; text?: string; type?: 'table'; } | { id?: string; align?: 'left' | 'center' | 'right'; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'table_cell'; } | { id?: string; children?: table_cell[]; metadata?: metadata; text?: string; type?: 'table_row'; } | { text: string; id?: string; marks?: 'bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | 'math'[]; metadata?: metadata; type?: 'text'; } | { id?: string; checked?: boolean; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; type?: 'todo'; } | { tool_call_id: string; tool_name: string; id?: string; args?: object; metadata?: metadata; type?: 'tool_call'; } | { output: string | object | object[]; tool_call_id: string; tool_name: string; id?: string; is_error?: boolean; metadata?: metadata; type?: 'tool_result'; } | { text: string; id?: string; message_type?: 'message' | 'thinking'; metadata?: metadata; role?: 'user' | 'assistant'; timestamp?: string; type?: 'trace_message'; } | { text: string; id?: string; end?: number; metadata?: metadata; speaker?: person; start?: number; type?: 'utterance'; }[]; closed_at?: string; company_ids?: string[]; contact_ids?: string[]; currency?: string; deal_source?: string; lost_reason?: string; metadata?: { edited_by?: string; sources?: object[]; }; name?: string; pipeline?: string; probability?: number; stage?: string; tags?: string[]; text?: string; type?: 'deal'; won_reason?: string; } | { id?: string; attachment_names?: string[]; balance_amount?: number; cancelled_at?: string; children?: { data: string; mimetype: string; id?: string; metadata?: object; type?: 'blob'; } | { id?: string; children?: object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object[]; metadata?: object; text?: string; title?: string; type?: 'callout'; } | { id?: string; children?: object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object[]; metadata?: object; text?: string; type?: 'chunk'; } | { text: string; id?: string; language?: string; metadata?: object; type?: 'code'; } | { text: string; id?: string; created_at?: string; metadata?: object; type?: 'comment'; } | { id?: string; metadata?: object; type?: 'divider'; } | { id?: string; children?: object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object[]; metadata?: object; text?: string; type?: 'equation'; } | { id?: string; children?: object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object[]; metadata?: object; text?: string; type?: 'footnote'; } | { level: number; id?: string; children?: object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object[]; metadata?: object; text?: string; type?: 'heading'; } | { src: string; text: string; id?: string; metadata?: object; type?: 'image'; } | { text: string; url: string; id?: string; metadata?: object; type?: 'link'; } | { id?: string; metadata?: object; type?: 'line_break'; } | { id?: string; children?: object | object[]; metadata?: object; ordered?: boolean; text?: string; type?: 'list'; } | { id?: string; children?: object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object[]; metadata?: object; text?: string; type?: 'list_item'; } | { id?: string; children?: object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object[]; metadata?: object; page_number?: number; preview_url?: string; text?: string; type?: 'page'; } | { id?: string; children?: object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object[]; metadata?: object; text?: string; type?: 'paragraph'; } | { id?: string; children?: object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object[]; metadata?: object; text?: string; type?: 'quote'; } | { id?: string; children?: object[]; has_header?: boolean; metadata?: object; text?: string; type?: 'table'; } | { id?: string; align?: 'left' | 'center' | 'right'; children?: object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object[]; metadata?: object; text?: string; type?: 'table_cell'; } | { id?: string; children?: object[]; metadata?: object; text?: string; type?: 'table_row'; } | { text: string; id?: string; marks?: 'bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | 'math'[]; metadata?: object; type?: 'text'; } | { id?: string; checked?: boolean; children?: object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object[]; metadata?: object; text?: string; type?: 'todo'; } | { tool_call_id: string; tool_name: string; id?: string; args?: object; metadata?: object; type?: 'tool_call'; } | { output: string | object | object[]; tool_call_id: string; tool_name: string; id?: string; is_error?: boolean; metadata?: object; type?: 'tool_result'; } | { text: string; id?: string; message_type?: 'message' | 'thinking'; metadata?: object; role?: 'user' | 'assistant'; timestamp?: string; type?: 'trace_message'; } | { text: string; id?: string; end?: number; metadata?: object; speaker?: object; start?: number; type?: 'utterance'; }[]; contact_id?: string; contact_name?: string; currency?: string; due_at?: string; invoice_type?: string; metadata?: { edited_by?: string; sources?: { chunk_id: string; resource_id?: string; score?: number; source?: string; }[]; }; notes?: string; number?: string; organization_id?: string; paid_amount?: number; paid_at?: string; posted_at?: string; reference?: string; refund_amount?: number; refund_reason?: string; refunded_at?: string; status?: string; tax_amount?: number; text?: string; total_amount?: number; type?: 'invoice'; }`\n - `resource_id: string`\n - `source: string`\n - `type: string`\n - `chunks?: { chunk_id: string; summary?: string; }[]`\n - `collection?: string`\n - `document_date?: string`\n - `ingested_at?: string`\n - `last_modified_at?: string`\n - `metadata?: object`\n - `status?: string`\n - `title?: string`\n\n### Example\n\n```typescript\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell();\n\nconst memory = await client.memories.get('resource_id', { source: 'reddit' });\n\nconsole.log(memory);\n```", perLanguage: { go: { method: 'client.Memories.Get', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tmemory, err := client.Memories.Get(\n\t\tcontext.TODO(),\n\t\t"resource_id",\n\t\thyperspell.MemoryGetParams{\n\t\t\tSource: hyperspell.MemoryGetParamsSourceReddit,\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", memory.ResourceID)\n}\n', - }, - cli: { - method: 'memories get', - example: - "hyperspell memories get \\\n --api-key 'My API Key' \\\n --source reddit \\\n --resource-id resource_id", + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t\toption.WithUserID("My User ID"),\n\t)\n\tmemory, err := client.Memories.Get(\n\t\tcontext.TODO(),\n\t\t"resource_id",\n\t\thyperspell.MemoryGetParams{\n\t\t\tSource: hyperspell.MemoryGetParamsSourceReddit,\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", memory.ResourceID)\n}\n', }, python: { method: 'memories.get', @@ -789,12 +1193,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [ typescript: { method: 'client.memories.get', example: - "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst memory = await client.memories.get('resource_id', { source: 'reddit' });\n\nconsole.log(memory.resource_id);", + "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n userID: 'My User ID',\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst memory = await client.memories.get('resource_id', { source: 'reddit' });\n\nconsole.log(memory.resource_id);", }, http: { example: 'curl https://api.hyperspell.com/memories/get/$SOURCE/$RESOURCE_ID \\\n -H "Authorization: Bearer $HYPERSPELL_API_KEY"', }, + cli: { + method: 'memories get', + example: + "hyperspell memories get \\\n --api-key 'My API Key' \\\n --user-id 'My User ID' \\\n --source reddit \\\n --resource-id resource_id", + }, }, }, { @@ -810,24 +1219,19 @@ const EMBEDDED_METHODS: MethodEntry[] = [ 'answer?: boolean;', "effort?: 'minimal' | 'low' | 'medium' | 'high' | 'very_high';", 'max_results?: number;', - "options?: { after?: string; answer_model?: string; before?: string; box?: { weight?: number; }; filter?: object; google_calendar?: { calendar_id?: string; weight?: number; }; google_drive?: { weight?: number; }; google_mail?: { label_ids?: string[]; weight?: number; }; max_results?: number; memory_types?: 'procedure' | 'memory' | 'mood'[]; notion?: { notion_page_ids?: string[]; weight?: number; }; recency_half_life_days?: number; resource_ids?: string[]; slack?: { channels?: string[]; exclude_archived?: boolean; include_dms?: boolean; include_group_dms?: boolean; include_private?: boolean; weight?: number; }; vault?: { weight?: number; }; web_crawler?: { max_depth?: number; url?: string; weight?: number; }; };", + "options?: { after?: string; answer_model?: string; before?: string; filter?: object; google_drive?: { weight?: number; }; google_mail?: { label_ids?: string[]; weight?: number; }; max_results?: number; memory_types?: 'procedure' | 'memory' | 'mood'[]; notion?: { notion_page_ids?: string[]; weight?: number; }; recency_half_life_days?: number; resource_ids?: string[]; slack?: { channels?: string[]; exclude_archived?: boolean; include_dms?: boolean; include_group_dms?: boolean; include_private?: boolean; weight?: number; }; timezone?: string; vault?: { weight?: number; }; web_crawler?: { max_depth?: number; url?: string; weight?: number; }; };", 'provenance?: boolean;', 'sources?: string[];', ], response: - "{ answer?: string; documents?: { document: document | website | task | person | message | event | file | conversation | trace | transcript | company | deal; resource_id: string; source: string; type: string; collection?: string; document_date?: string; highlights?: object[]; ingested_at?: string; last_modified_at?: string; metadata?: object; score?: number; status?: 'pending' | 'processing' | 'completed' | 'failed' | 'pending_review' | 'skipped'; summary?: string; title?: string; }[]; errors?: object[]; provenance?: { entities?: provenance_entity[]; failed_sources?: string[]; sources?: provenance_source[]; steps?: provenance_step[]; }; query?: string; query_id?: string; score?: number; }", + '{ answer?: string; disclaimer?: string; documents?: { document: document | website | task | person | message | event | file | conversation | trace | transcript | company | deal | object; resource_id: string; source: string; type: string; chunks?: object[]; collection?: string; document_date?: string; highlights?: object[]; ingested_at?: string; last_modified_at?: string; metadata?: object; score?: number; status?: string; summary?: string; title?: string; }[]; errors?: object[]; provenance?: { entities?: provenance_entity[]; failed_sources?: string[]; sources?: provenance_source[]; steps?: provenance_step[]; }; query?: string; query_id?: string; score?: number; }', markdown: - "## search\n\n`client.memories.search(query: string, answer?: boolean, effort?: 'minimal' | 'low' | 'medium' | 'high' | 'very_high', max_results?: number, options?: { after?: string; answer_model?: string; before?: string; box?: { weight?: number; }; filter?: object; google_calendar?: { calendar_id?: string; weight?: number; }; google_drive?: { weight?: number; }; google_mail?: { label_ids?: string[]; weight?: number; }; max_results?: number; memory_types?: 'procedure' | 'memory' | 'mood'[]; notion?: { notion_page_ids?: string[]; weight?: number; }; recency_half_life_days?: number; resource_ids?: string[]; slack?: { channels?: string[]; exclude_archived?: boolean; include_dms?: boolean; include_group_dms?: boolean; include_private?: boolean; weight?: number; }; vault?: { weight?: number; }; web_crawler?: { max_depth?: number; url?: string; weight?: number; }; }, provenance?: boolean, sources?: string[]): { answer?: string; documents?: scored_document_response[]; errors?: object[]; provenance?: provenance; query?: string; query_id?: string; score?: number; }`\n\n**post** `/memories/query`\n\nRetrieves documents matching the query.\n\n### Parameters\n\n- `query: string`\n Query to run.\n\n- `answer?: boolean`\n If true, the query will be answered along with matching source documents.\n\n- `effort?: 'minimal' | 'low' | 'medium' | 'high' | 'very_high'`\n How much compute to spend on retrieval. Mirrors the dial popularized by frontier-model APIs (OpenAI reasoning_effort, etc.). 'minimal' = verbatim single-shot retrieval (fastest). 'low' = LLM rewrites the query for better retrieval and extracts date filters. 'medium' = rewrite + agentic refinement loop (the answer LLM may request additional retrieval rounds, up to 3). 'high' = rewrite + extended refinement (up to 6 rounds). Higher = better recall, more latency, more cost.\n\n- `max_results?: number`\n Maximum number of results to return.\n\n- `options?: { after?: string; answer_model?: string; before?: string; box?: { weight?: number; }; filter?: object; google_calendar?: { calendar_id?: string; weight?: number; }; google_drive?: { weight?: number; }; google_mail?: { label_ids?: string[]; weight?: number; }; max_results?: number; memory_types?: 'procedure' | 'memory' | 'mood'[]; notion?: { notion_page_ids?: string[]; weight?: number; }; recency_half_life_days?: number; resource_ids?: string[]; slack?: { channels?: string[]; exclude_archived?: boolean; include_dms?: boolean; include_group_dms?: boolean; include_private?: boolean; weight?: number; }; vault?: { weight?: number; }; web_crawler?: { max_depth?: number; url?: string; weight?: number; }; }`\n Search options for the query.\n - `after?: string`\n Only query documents created on or after this date.\n - `answer_model?: string`\n Model to use for answer generation when answer=True\n - `before?: string`\n Only query documents created before this date.\n - `box?: { weight?: number; }`\n Search options for Box\n - `filter?: object`\n Metadata filters using MongoDB-style operators. Example: {'status': 'published', 'priority': {'$gt': 3}}\n - `google_calendar?: { calendar_id?: string; weight?: number; }`\n Search options for Google Calendar\n - `google_drive?: { weight?: number; }`\n Search options for Google Drive\n - `google_mail?: { label_ids?: string[]; weight?: number; }`\n Search options for Gmail\n - `max_results?: number`\n Maximum number of results to return.\n - `memory_types?: 'procedure' | 'memory' | 'mood'[]`\n Filter by memory type. Defaults to generic memories only. Pass multiple types to include procedures, etc.\n - `notion?: { notion_page_ids?: string[]; weight?: number; }`\n Search options for Notion\n - `recency_half_life_days?: number`\n When set, multiplies each result's score by an exponential-decay factor based on the document's most recent activity timestamp (source-reported last_modified, falling back to document_date). A document one half-life old gets its score halved. Resources with no recency timestamp are passed through unchanged. Leave unset to disable.\n - `resource_ids?: string[]`\n Only return results from these specific resource IDs. Useful for scoping searches to specific documents (e.g., a specific email thread or uploaded file).\n - `slack?: { channels?: string[]; exclude_archived?: boolean; include_dms?: boolean; include_group_dms?: boolean; include_private?: boolean; weight?: number; }`\n Search options for Slack\n - `vault?: { weight?: number; }`\n Search options for vault\n - `web_crawler?: { max_depth?: number; url?: string; weight?: number; }`\n Search options for Web Crawler\n\n- `provenance?: boolean`\n If true (effort='very_high' only), attach a provenance record to the response: the source documents and entities the answer was grounded in, the agent's search trajectory, and any sources that failed. Adds one indexed lookup; intended for auditability / compliance use cases.\n\n- `sources?: string[]`\n Only query documents from these sources.\n\n### Returns\n\n- `{ answer?: string; documents?: { document: document | website | task | person | message | event | file | conversation | trace | transcript | company | deal; resource_id: string; source: string; type: string; collection?: string; document_date?: string; highlights?: object[]; ingested_at?: string; last_modified_at?: string; metadata?: object; score?: number; status?: 'pending' | 'processing' | 'completed' | 'failed' | 'pending_review' | 'skipped'; summary?: string; title?: string; }[]; errors?: object[]; provenance?: { entities?: provenance_entity[]; failed_sources?: string[]; sources?: provenance_source[]; steps?: provenance_step[]; }; query?: string; query_id?: string; score?: number; }`\n\n - `answer?: string`\n - `documents?: { document: { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; title?: string; type?: 'document'; } | { url: string; id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; description?: string; favicon?: string; image_url?: string; language?: string; metadata?: metadata; text?: string; title?: string; type?: 'website'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; comments?: message[]; due_at?: string; metadata?: metadata; priority?: 'urgent' | 'high' | 'medium' | 'low'; status?: 'completed' | 'not_started' | 'in_progress' | 'cancelled'; text?: string; type?: 'task'; } | { id?: string; address?: string; alt_names?: string[]; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; company?: string; company_ids?: string[]; date_of_birth?: string; deal_ids?: string[]; email?: string; emails?: string[]; image_url?: string; job_title?: string; link_urls?: string[]; metadata?: metadata; name?: string; phone_numbers?: string[]; tags?: string[]; text?: string; type?: 'person'; username?: string; } | { date: string; sender: person; id?: string; channel?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; external_id?: string; is_self?: boolean; mentioned_users?: person[]; metadata?: metadata; num_replies?: number; replies?: message[]; text?: string; thread_id?: string; title?: string; type?: 'message'; updated_at?: string; upvotes?: number; } | { id?: string; attendees?: person[]; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; end_at?: string; location?: string; meeting_url?: string; metadata?: metadata; start_at?: string; text?: string; title?: string; type?: 'event'; } | { content_type: string; filename: string; id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; path?: string[]; text?: string; title?: string; type?: 'file'; } | { id?: string; channel?: string; children?: message[]; metadata?: metadata; text?: string; title?: string; type?: 'conversation'; } | { id?: string; children?: trace_message | tool_call | tool_result[]; metadata?: metadata; text?: string; title?: string; type?: 'trace'; } | { id?: string; children?: utterance[]; ended_at?: string; metadata?: metadata; participants?: person[]; started_at?: string; text?: string; title?: string; type?: 'transcript'; } | { id?: string; address?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; contact_ids?: string[]; deal_ids?: string[]; description?: string; emails?: string[]; employees?: number; image_url?: string; industry?: string; is_active?: boolean; metadata?: metadata; name?: string; phone_numbers?: string[]; tags?: string[]; text?: string; timezone?: string; type?: 'company'; websites?: string[]; } | { id?: string; amount?: number; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; closed_at?: string; company_ids?: string[]; contact_ids?: string[]; currency?: string; deal_source?: string; lost_reason?: string; metadata?: metadata; name?: string; pipeline?: string; probability?: number; stage?: string; tags?: string[]; text?: string; type?: 'deal'; won_reason?: string; }; resource_id: string; source: string; type: string; collection?: string; document_date?: string; highlights?: object[]; ingested_at?: string; last_modified_at?: string; metadata?: object; score?: number; status?: 'pending' | 'processing' | 'completed' | 'failed' | 'pending_review' | 'skipped'; summary?: string; title?: string; }[]`\n - `errors?: object[]`\n - `provenance?: { entities?: { id: string; name: string; type: string; }[]; failed_sources?: string[]; sources?: { resource_id: string; source: string; score?: number; title?: string; }[]; steps?: { iteration: number; status: string; tool: string; query?: string; result_count?: number; source?: string; }[]; }`\n - `query?: string`\n - `query_id?: string`\n - `score?: number`\n\n### Example\n\n```typescript\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell();\n\nconst queryResult = await client.memories.search({ query: 'What does Hyperspell do?' });\n\nconsole.log(queryResult);\n```", + "## search\n\n`client.memories.search(query: string, answer?: boolean, effort?: 'minimal' | 'low' | 'medium' | 'high' | 'very_high', max_results?: number, options?: { after?: string; answer_model?: string; before?: string; filter?: object; google_drive?: { weight?: number; }; google_mail?: { label_ids?: string[]; weight?: number; }; max_results?: number; memory_types?: 'procedure' | 'memory' | 'mood'[]; notion?: { notion_page_ids?: string[]; weight?: number; }; recency_half_life_days?: number; resource_ids?: string[]; slack?: { channels?: string[]; exclude_archived?: boolean; include_dms?: boolean; include_group_dms?: boolean; include_private?: boolean; weight?: number; }; timezone?: string; vault?: { weight?: number; }; web_crawler?: { max_depth?: number; url?: string; weight?: number; }; }, provenance?: boolean, sources?: string[]): { answer?: string; disclaimer?: string; documents?: scored_document_response[]; errors?: object[]; provenance?: provenance; query?: string; query_id?: string; score?: number; }`\n\n**post** `/memories/query`\n\nRetrieves documents matching the query.\n\n### Parameters\n\n- `query: string`\n Query to run.\n\n- `answer?: boolean`\n If true, the query will be answered along with matching source documents.\n\n- `effort?: 'minimal' | 'low' | 'medium' | 'high' | 'very_high'`\n Controls retrieval thoroughness. 'minimal' performs direct retrieval. 'low' improves the query and extracts date filters. 'medium' adds up to 3 refinement rounds; 'high' allows up to 6. Higher levels can improve recall but add latency and cost.\n\n- `max_results?: number`\n Maximum number of results to return.\n\n- `options?: { after?: string; answer_model?: string; before?: string; filter?: object; google_drive?: { weight?: number; }; google_mail?: { label_ids?: string[]; weight?: number; }; max_results?: number; memory_types?: 'procedure' | 'memory' | 'mood'[]; notion?: { notion_page_ids?: string[]; weight?: number; }; recency_half_life_days?: number; resource_ids?: string[]; slack?: { channels?: string[]; exclude_archived?: boolean; include_dms?: boolean; include_group_dms?: boolean; include_private?: boolean; weight?: number; }; timezone?: string; vault?: { weight?: number; }; web_crawler?: { max_depth?: number; url?: string; weight?: number; }; }`\n Search options for the query.\n - `after?: string`\n Only query documents created on or after this date.\n - `answer_model?: string`\n Model to use for answer generation when answer=True\n - `before?: string`\n Only query documents created before this date.\n - `filter?: object`\n Metadata filters using MongoDB-style operators. Example: {'status': 'published', 'priority': {'$gt': 3}}\n - `google_drive?: { weight?: number; }`\n Search options for Google Drive\n - `google_mail?: { label_ids?: string[]; weight?: number; }`\n Search options for Gmail\n - `max_results?: number`\n Maximum number of results to return.\n - `memory_types?: 'procedure' | 'memory' | 'mood'[]`\n Filter by memory type. Defaults to generic memories only. Pass multiple types to include procedures, etc.\n - `notion?: { notion_page_ids?: string[]; weight?: number; }`\n Search options for Notion\n - `recency_half_life_days?: number`\n When set, multiplies each result's score by an exponential-decay factor based on the document's most recent activity timestamp (source-reported last_modified, falling back to document_date). A document one half-life old gets its score halved. Resources with no recency timestamp are passed through unchanged. Leave unset to disable.\n - `resource_ids?: string[]`\n Only return results from these specific resource IDs. Useful for scoping searches to specific documents (e.g., a specific email thread or uploaded file).\n - `slack?: { channels?: string[]; exclude_archived?: boolean; include_dms?: boolean; include_group_dms?: boolean; include_private?: boolean; weight?: number; }`\n Search options for Slack\n - `timezone?: string`\n IANA timezone used to interpret date-only bounds and relative calendar phrases. Defaults to UTC.\n - `vault?: { weight?: number; }`\n Search options for vault\n - `web_crawler?: { max_depth?: number; url?: string; weight?: number; }`\n Search options for Web Crawler\n\n- `provenance?: boolean`\n If true (effort='very_high' only), attach a provenance record to the response: the source documents and entities the answer was grounded in, the agent's search trajectory, and any sources that failed. Intended for auditability and compliance use cases.\n\n- `sources?: string[]`\n Only query documents from these sources. Names are case-insensitive and accept either separator, so `Google Drive`'s provider may be given as `google_drive`, `google-drive`, or `GOOGLE_DRIVE`.\n\n### Returns\n\n- `{ answer?: string; disclaimer?: string; documents?: { document: document | website | task | person | message | event | file | conversation | trace | transcript | company | deal | object; resource_id: string; source: string; type: string; chunks?: object[]; collection?: string; document_date?: string; highlights?: object[]; ingested_at?: string; last_modified_at?: string; metadata?: object; score?: number; status?: string; summary?: string; title?: string; }[]; errors?: object[]; provenance?: { entities?: provenance_entity[]; failed_sources?: string[]; sources?: provenance_source[]; steps?: provenance_step[]; }; query?: string; query_id?: string; score?: number; }`\n\n - `answer?: string`\n - `disclaimer?: string`\n - `documents?: { document: { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; title?: string; type?: 'document'; } | { url: string; id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; description?: string; favicon?: string; image_url?: string; language?: string; metadata?: metadata; text?: string; title?: string; type?: 'website'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; comments?: message[]; due_at?: string; metadata?: metadata; priority?: 'urgent' | 'high' | 'medium' | 'low'; status?: 'completed' | 'not_started' | 'in_progress' | 'cancelled'; text?: string; type?: 'task'; } | { id?: string; address?: string; alt_names?: string[]; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; company?: string; company_ids?: string[]; date_of_birth?: string; deal_ids?: string[]; email?: string; emails?: string[]; image_url?: string; is_app_user?: boolean; is_bot?: boolean; job_title?: string; link_urls?: string[]; metadata?: metadata; name?: string; phone_numbers?: string[]; tags?: string[]; text?: string; type?: 'person'; username?: string; } | { date: string; sender: person; id?: string; channel?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; external_id?: string; is_self?: boolean; mentioned_users?: person[]; metadata?: metadata; num_replies?: number; replies?: message[]; text?: string; thread_id?: string; title?: string; type?: 'message'; updated_at?: string; upvotes?: number; } | { id?: string; attendees?: person[]; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; end_at?: string; location?: string; meeting_url?: string; metadata?: metadata; start_at?: string; text?: string; title?: string; type?: 'event'; } | { content_type: string; filename: string; id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; content_truncated?: boolean; metadata?: metadata; path?: string[]; text?: string; title?: string; type?: 'file'; } | { id?: string; channel?: string; children?: message[]; metadata?: metadata; participants?: person[]; text?: string; title?: string; type?: 'conversation'; } | { id?: string; children?: trace_message | tool_call | tool_result[]; metadata?: metadata; text?: string; title?: string; type?: 'trace'; } | { id?: string; children?: utterance[]; ended_at?: string; metadata?: metadata; participants?: person[]; started_at?: string; text?: string; title?: string; type?: 'transcript'; } | { id?: string; address?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; contact_ids?: string[]; deal_ids?: string[]; description?: string; emails?: string[]; employees?: number; image_url?: string; industry?: string; is_active?: boolean; metadata?: metadata; name?: string; phone_numbers?: string[]; tags?: string[]; text?: string; timezone?: string; type?: 'company'; websites?: string[]; } | { id?: string; amount?: number; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; closed_at?: string; company_ids?: string[]; contact_ids?: string[]; currency?: string; deal_source?: string; lost_reason?: string; metadata?: metadata; name?: string; pipeline?: string; probability?: number; stage?: string; tags?: string[]; text?: string; type?: 'deal'; won_reason?: string; } | { id?: string; attachment_names?: string[]; balance_amount?: number; cancelled_at?: string; children?: object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object[]; contact_id?: string; contact_name?: string; currency?: string; due_at?: string; invoice_type?: string; metadata?: object; notes?: string; number?: string; organization_id?: string; paid_amount?: number; paid_at?: string; posted_at?: string; reference?: string; refund_amount?: number; refund_reason?: string; refunded_at?: string; status?: string; tax_amount?: number; text?: string; total_amount?: number; type?: 'invoice'; }; resource_id: string; source: string; type: string; chunks?: { chunk_id: string; summary?: string; }[]; collection?: string; document_date?: string; highlights?: object[]; ingested_at?: string; last_modified_at?: string; metadata?: object; score?: number; status?: string; summary?: string; title?: string; }[]`\n - `errors?: object[]`\n - `provenance?: { entities?: { id: string; name: string; type: string; }[]; failed_sources?: string[]; sources?: { resource_id: string; source: string; chunk_id?: string; content_sha256?: string; owner?: string; score?: number; span?: object[]; title?: string; }[]; steps?: { iteration: number; status: string; tool: string; query?: string; result_count?: number; source?: string; }[]; }`\n - `query?: string`\n - `query_id?: string`\n - `score?: number`\n\n### Example\n\n```typescript\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell();\n\nconst queryResult = await client.memories.search({ query: 'What does Hyperspell do?' });\n\nconsole.log(queryResult);\n```", perLanguage: { go: { method: 'client.Memories.Search', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tqueryResult, err := client.Memories.Search(context.TODO(), hyperspell.MemorySearchParams{\n\t\tQuery: "What does Hyperspell do?",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", queryResult.QueryID)\n}\n', - }, - cli: { - method: 'memories search', - example: - "hyperspell memories search \\\n --api-key 'My API Key' \\\n --query 'What does Hyperspell do?'", + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t\toption.WithUserID("My User ID"),\n\t)\n\tqueryResult, err := client.Memories.Search(context.TODO(), hyperspell.MemorySearchParams{\n\t\tQuery: "What does Hyperspell do?",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", queryResult.QueryID)\n}\n', }, python: { method: 'memories.search', @@ -837,12 +1241,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [ typescript: { method: 'client.memories.search', example: - "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst queryResult = await client.memories.search({ query: 'What does Hyperspell do?' });\n\nconsole.log(queryResult.query_id);", + "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n userID: 'My User ID',\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst queryResult = await client.memories.search({ query: 'What does Hyperspell do?' });\n\nconsole.log(queryResult.query_id);", }, http: { example: 'curl https://api.hyperspell.com/memories/query \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $HYPERSPELL_API_KEY" \\\n -d \'{\n "query": "What does Hyperspell do?",\n "answer": true,\n "options": {\n "filter": {}\n },\n "sources": [\n "vault"\n ]\n }\'', }, + cli: { + method: 'memories search', + example: + "hyperspell memories search \\\n --api-key 'My API Key' \\\n --user-id 'My User ID' \\\n --query 'What does Hyperspell do?'", + }, }, }, { @@ -850,25 +1259,19 @@ const EMBEDDED_METHODS: MethodEntry[] = [ endpoint: '/memories/delete/{source}/{resource_id}', httpMethod: 'delete', summary: 'Delete memory', - description: - "Delete a memory and its associated chunks from the index.\n\nThis removes the memory completely from the vector index and database.\nThe operation deletes:\n1. All chunks associated with the resource (including embeddings)\n2. The documents row AND any legacy resources rows sharing the identity —\n leaving either one behind would resurrect the memory through the\n double-read path (ENG-2477).\n\nArgs:\n source: The document provider (e.g., gmail, notion, vault)\n resource_id: The unique identifier of the resource to delete\n api_token: Authentication token\n\nReturns:\n MemoryDeletionResponse with deletion details\n\nRaises:\n DocumentNotFound: If the resource doesn't exist or user doesn't have access", + description: 'Delete a memory accessible to the authenticated credential.', stainlessPath: '(resource) memories > (method) delete', qualified: 'client.memories.delete', params: ['source: string;', 'resource_id: string;'], response: '{ chunks_deleted: number; message: string; resource_id: string; source: string; success: boolean; }', markdown: - "## delete\n\n`client.memories.delete(source: string, resource_id: string): { chunks_deleted: number; message: string; resource_id: string; source: string; success: boolean; }`\n\n**delete** `/memories/delete/{source}/{resource_id}`\n\nDelete a memory and its associated chunks from the index.\n\nThis removes the memory completely from the vector index and database.\nThe operation deletes:\n1. All chunks associated with the resource (including embeddings)\n2. The documents row AND any legacy resources rows sharing the identity —\n leaving either one behind would resurrect the memory through the\n double-read path (ENG-2477).\n\nArgs:\n source: The document provider (e.g., gmail, notion, vault)\n resource_id: The unique identifier of the resource to delete\n api_token: Authentication token\n\nReturns:\n MemoryDeletionResponse with deletion details\n\nRaises:\n DocumentNotFound: If the resource doesn't exist or user doesn't have access\n\n### Parameters\n\n- `source: string`\n\n- `resource_id: string`\n\n### Returns\n\n- `{ chunks_deleted: number; message: string; resource_id: string; source: string; success: boolean; }`\n\n - `chunks_deleted: number`\n - `message: string`\n - `resource_id: string`\n - `source: string`\n - `success: boolean`\n\n### Example\n\n```typescript\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell();\n\nconst memory = await client.memories.delete('resource_id', { source: 'reddit' });\n\nconsole.log(memory);\n```", + "## delete\n\n`client.memories.delete(source: string, resource_id: string): { chunks_deleted: number; message: string; resource_id: string; source: string; success: boolean; }`\n\n**delete** `/memories/delete/{source}/{resource_id}`\n\nDelete a memory accessible to the authenticated credential.\n\n### Parameters\n\n- `source: string`\n\n- `resource_id: string`\n\n### Returns\n\n- `{ chunks_deleted: number; message: string; resource_id: string; source: string; success: boolean; }`\n\n - `chunks_deleted: number`\n - `message: string`\n - `resource_id: string`\n - `source: string`\n - `success: boolean`\n\n### Example\n\n```typescript\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell();\n\nconst memory = await client.memories.delete('resource_id', { source: 'reddit' });\n\nconsole.log(memory);\n```", perLanguage: { go: { method: 'client.Memories.Delete', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tmemory, err := client.Memories.Delete(\n\t\tcontext.TODO(),\n\t\t"resource_id",\n\t\thyperspell.MemoryDeleteParams{\n\t\t\tSource: hyperspell.MemoryDeleteParamsSourceReddit,\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", memory.ResourceID)\n}\n', - }, - cli: { - method: 'memories delete', - example: - "hyperspell memories delete \\\n --api-key 'My API Key' \\\n --source reddit \\\n --resource-id resource_id", + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t\toption.WithUserID("My User ID"),\n\t)\n\tmemory, err := client.Memories.Delete(\n\t\tcontext.TODO(),\n\t\t"resource_id",\n\t\thyperspell.MemoryDeleteParams{\n\t\t\tSource: hyperspell.MemoryDeleteParamsSourceReddit,\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", memory.ResourceID)\n}\n', }, python: { method: 'memories.delete', @@ -878,12 +1281,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [ typescript: { method: 'client.memories.delete', example: - "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst memory = await client.memories.delete('resource_id', { source: 'reddit' });\n\nconsole.log(memory.resource_id);", + "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n userID: 'My User ID',\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst memory = await client.memories.delete('resource_id', { source: 'reddit' });\n\nconsole.log(memory.resource_id);", }, http: { example: 'curl https://api.hyperspell.com/memories/delete/$SOURCE/$RESOURCE_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $HYPERSPELL_API_KEY"', }, + cli: { + method: 'memories delete', + example: + "hyperspell memories delete \\\n --api-key 'My API Key' \\\n --user-id 'My User ID' \\\n --source reddit \\\n --resource-id resource_id", + }, }, }, { @@ -892,22 +1300,18 @@ const EMBEDDED_METHODS: MethodEntry[] = [ httpMethod: 'get', summary: 'List prior queries', description: - 'Paginate through all prior queries for the app, newest first.\n\nUser tokens only see their own queries; admin tokens see every query in the\napp and can narrow to a single user with the `user_id` filter.', + "Paginate through all prior queries for the app, newest first.\n\nRequests scoped to a user only see that user's queries. App-wide requests\nsee every query in the app and can filter by ``user_id``.", stainlessPath: '(resource) evaluate > (method) list_queries', qualified: 'client.evaluate.listQueries', params: ['cursor?: string;', 'size?: number;', 'user_id?: string;'], response: '{ query: string; query_id: string; time: string; user_id?: string; }', markdown: - "## list_queries\n\n`client.evaluate.listQueries(cursor?: string, size?: number, user_id?: string): { query: string; query_id: string; time: string; user_id?: string; }`\n\n**get** `/evaluate/queries`\n\nPaginate through all prior queries for the app, newest first.\n\nUser tokens only see their own queries; admin tokens see every query in the\napp and can narrow to a single user with the `user_id` filter.\n\n### Parameters\n\n- `cursor?: string`\n\n- `size?: number`\n\n- `user_id?: string`\n Filter queries by the user that issued them.\n\n### Returns\n\n- `{ query: string; query_id: string; time: string; user_id?: string; }`\n\n - `query: string`\n - `query_id: string`\n - `time: string`\n - `user_id?: string`\n\n### Example\n\n```typescript\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell();\n\n// Automatically fetches more pages as needed.\nfor await (const evaluateListQueriesResponse of client.evaluate.listQueries()) {\n console.log(evaluateListQueriesResponse);\n}\n```", + "## list_queries\n\n`client.evaluate.listQueries(cursor?: string, size?: number, user_id?: string): { query: string; query_id: string; time: string; user_id?: string; }`\n\n**get** `/evaluate/queries`\n\nPaginate through all prior queries for the app, newest first.\n\nRequests scoped to a user only see that user's queries. App-wide requests\nsee every query in the app and can filter by ``user_id``.\n\n### Parameters\n\n- `cursor?: string`\n\n- `size?: number`\n\n- `user_id?: string`\n Filter queries by the user that issued them.\n\n### Returns\n\n- `{ query: string; query_id: string; time: string; user_id?: string; }`\n\n - `query: string`\n - `query_id: string`\n - `time: string`\n - `user_id?: string`\n\n### Example\n\n```typescript\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell();\n\n// Automatically fetches more pages as needed.\nfor await (const evaluateListQueriesResponse of client.evaluate.listQueries()) {\n console.log(evaluateListQueriesResponse);\n}\n```", perLanguage: { go: { method: 'client.Evaluate.ListQueries', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpage, err := client.Evaluate.ListQueries(context.TODO(), hyperspell.EvaluateListQueriesParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', - }, - cli: { - method: 'evaluate list_queries', - example: "hyperspell evaluate list-queries \\\n --api-key 'My API Key'", + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t\toption.WithUserID("My User ID"),\n\t)\n\tpage, err := client.Evaluate.ListQueries(context.TODO(), hyperspell.EvaluateListQueriesParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', }, python: { method: 'evaluate.list_queries', @@ -917,12 +1321,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ typescript: { method: 'client.evaluate.listQueries', example: - "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const evaluateListQueriesResponse of client.evaluate.listQueries()) {\n console.log(evaluateListQueriesResponse.query_id);\n}", + "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n userID: 'My User ID',\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const evaluateListQueriesResponse of client.evaluate.listQueries()) {\n console.log(evaluateListQueriesResponse.query_id);\n}", }, http: { example: 'curl https://api.hyperspell.com/evaluate/queries \\\n -H "Authorization: Bearer $HYPERSPELL_API_KEY"', }, + cli: { + method: 'evaluate list_queries', + example: "hyperspell evaluate list-queries \\\n --api-key 'My API Key' \\\n --user-id 'My User ID'", + }, }, }, { @@ -935,18 +1343,14 @@ const EMBEDDED_METHODS: MethodEntry[] = [ qualified: 'client.evaluate.getQuery', params: ['query_id: string;'], response: - "{ answer?: string; documents?: { document: document | website | task | person | message | event | file | conversation | trace | transcript | company | deal; resource_id: string; source: string; type: string; collection?: string; document_date?: string; highlights?: object[]; ingested_at?: string; last_modified_at?: string; metadata?: object; score?: number; status?: 'pending' | 'processing' | 'completed' | 'failed' | 'pending_review' | 'skipped'; summary?: string; title?: string; }[]; errors?: object[]; provenance?: { entities?: provenance_entity[]; failed_sources?: string[]; sources?: provenance_source[]; steps?: provenance_step[]; }; query?: string; query_id?: string; score?: number; }", + '{ answer?: string; disclaimer?: string; documents?: { document: document | website | task | person | message | event | file | conversation | trace | transcript | company | deal | object; resource_id: string; source: string; type: string; chunks?: object[]; collection?: string; document_date?: string; highlights?: object[]; ingested_at?: string; last_modified_at?: string; metadata?: object; score?: number; status?: string; summary?: string; title?: string; }[]; errors?: object[]; provenance?: { entities?: provenance_entity[]; failed_sources?: string[]; sources?: provenance_source[]; steps?: provenance_step[]; }; query?: string; query_id?: string; score?: number; }', markdown: - "## get_query\n\n`client.evaluate.getQuery(query_id: string): { answer?: string; documents?: scored_document_response[]; errors?: object[]; provenance?: provenance; query?: string; query_id?: string; score?: number; }`\n\n**get** `/evaluate/query/{query_id}`\n\nRetrieve the result of a previous query.\n\n### Parameters\n\n- `query_id: string`\n\n### Returns\n\n- `{ answer?: string; documents?: { document: document | website | task | person | message | event | file | conversation | trace | transcript | company | deal; resource_id: string; source: string; type: string; collection?: string; document_date?: string; highlights?: object[]; ingested_at?: string; last_modified_at?: string; metadata?: object; score?: number; status?: 'pending' | 'processing' | 'completed' | 'failed' | 'pending_review' | 'skipped'; summary?: string; title?: string; }[]; errors?: object[]; provenance?: { entities?: provenance_entity[]; failed_sources?: string[]; sources?: provenance_source[]; steps?: provenance_step[]; }; query?: string; query_id?: string; score?: number; }`\n\n - `answer?: string`\n - `documents?: { document: { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; title?: string; type?: 'document'; } | { url: string; id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; description?: string; favicon?: string; image_url?: string; language?: string; metadata?: metadata; text?: string; title?: string; type?: 'website'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; comments?: message[]; due_at?: string; metadata?: metadata; priority?: 'urgent' | 'high' | 'medium' | 'low'; status?: 'completed' | 'not_started' | 'in_progress' | 'cancelled'; text?: string; type?: 'task'; } | { id?: string; address?: string; alt_names?: string[]; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; company?: string; company_ids?: string[]; date_of_birth?: string; deal_ids?: string[]; email?: string; emails?: string[]; image_url?: string; job_title?: string; link_urls?: string[]; metadata?: metadata; name?: string; phone_numbers?: string[]; tags?: string[]; text?: string; type?: 'person'; username?: string; } | { date: string; sender: person; id?: string; channel?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; external_id?: string; is_self?: boolean; mentioned_users?: person[]; metadata?: metadata; num_replies?: number; replies?: message[]; text?: string; thread_id?: string; title?: string; type?: 'message'; updated_at?: string; upvotes?: number; } | { id?: string; attendees?: person[]; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; end_at?: string; location?: string; meeting_url?: string; metadata?: metadata; start_at?: string; text?: string; title?: string; type?: 'event'; } | { content_type: string; filename: string; id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; path?: string[]; text?: string; title?: string; type?: 'file'; } | { id?: string; channel?: string; children?: message[]; metadata?: metadata; text?: string; title?: string; type?: 'conversation'; } | { id?: string; children?: trace_message | tool_call | tool_result[]; metadata?: metadata; text?: string; title?: string; type?: 'trace'; } | { id?: string; children?: utterance[]; ended_at?: string; metadata?: metadata; participants?: person[]; started_at?: string; text?: string; title?: string; type?: 'transcript'; } | { id?: string; address?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; contact_ids?: string[]; deal_ids?: string[]; description?: string; emails?: string[]; employees?: number; image_url?: string; industry?: string; is_active?: boolean; metadata?: metadata; name?: string; phone_numbers?: string[]; tags?: string[]; text?: string; timezone?: string; type?: 'company'; websites?: string[]; } | { id?: string; amount?: number; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; closed_at?: string; company_ids?: string[]; contact_ids?: string[]; currency?: string; deal_source?: string; lost_reason?: string; metadata?: metadata; name?: string; pipeline?: string; probability?: number; stage?: string; tags?: string[]; text?: string; type?: 'deal'; won_reason?: string; }; resource_id: string; source: string; type: string; collection?: string; document_date?: string; highlights?: object[]; ingested_at?: string; last_modified_at?: string; metadata?: object; score?: number; status?: 'pending' | 'processing' | 'completed' | 'failed' | 'pending_review' | 'skipped'; summary?: string; title?: string; }[]`\n - `errors?: object[]`\n - `provenance?: { entities?: { id: string; name: string; type: string; }[]; failed_sources?: string[]; sources?: { resource_id: string; source: string; score?: number; title?: string; }[]; steps?: { iteration: number; status: string; tool: string; query?: string; result_count?: number; source?: string; }[]; }`\n - `query?: string`\n - `query_id?: string`\n - `score?: number`\n\n### Example\n\n```typescript\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell();\n\nconst queryResult = await client.evaluate.getQuery('query_id');\n\nconsole.log(queryResult);\n```", + "## get_query\n\n`client.evaluate.getQuery(query_id: string): { answer?: string; disclaimer?: string; documents?: scored_document_response[]; errors?: object[]; provenance?: provenance; query?: string; query_id?: string; score?: number; }`\n\n**get** `/evaluate/query/{query_id}`\n\nRetrieve the result of a previous query.\n\n### Parameters\n\n- `query_id: string`\n\n### Returns\n\n- `{ answer?: string; disclaimer?: string; documents?: { document: document | website | task | person | message | event | file | conversation | trace | transcript | company | deal | object; resource_id: string; source: string; type: string; chunks?: object[]; collection?: string; document_date?: string; highlights?: object[]; ingested_at?: string; last_modified_at?: string; metadata?: object; score?: number; status?: string; summary?: string; title?: string; }[]; errors?: object[]; provenance?: { entities?: provenance_entity[]; failed_sources?: string[]; sources?: provenance_source[]; steps?: provenance_step[]; }; query?: string; query_id?: string; score?: number; }`\n\n - `answer?: string`\n - `disclaimer?: string`\n - `documents?: { document: { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; metadata?: metadata; text?: string; title?: string; type?: 'document'; } | { url: string; id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; description?: string; favicon?: string; image_url?: string; language?: string; metadata?: metadata; text?: string; title?: string; type?: 'website'; } | { id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; comments?: message[]; due_at?: string; metadata?: metadata; priority?: 'urgent' | 'high' | 'medium' | 'low'; status?: 'completed' | 'not_started' | 'in_progress' | 'cancelled'; text?: string; type?: 'task'; } | { id?: string; address?: string; alt_names?: string[]; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; company?: string; company_ids?: string[]; date_of_birth?: string; deal_ids?: string[]; email?: string; emails?: string[]; image_url?: string; is_app_user?: boolean; is_bot?: boolean; job_title?: string; link_urls?: string[]; metadata?: metadata; name?: string; phone_numbers?: string[]; tags?: string[]; text?: string; type?: 'person'; username?: string; } | { date: string; sender: person; id?: string; channel?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; external_id?: string; is_self?: boolean; mentioned_users?: person[]; metadata?: metadata; num_replies?: number; replies?: message[]; text?: string; thread_id?: string; title?: string; type?: 'message'; updated_at?: string; upvotes?: number; } | { id?: string; attendees?: person[]; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; end_at?: string; location?: string; meeting_url?: string; metadata?: metadata; start_at?: string; text?: string; title?: string; type?: 'event'; } | { content_type: string; filename: string; id?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; content_truncated?: boolean; metadata?: metadata; path?: string[]; text?: string; title?: string; type?: 'file'; } | { id?: string; channel?: string; children?: message[]; metadata?: metadata; participants?: person[]; text?: string; title?: string; type?: 'conversation'; } | { id?: string; children?: trace_message | tool_call | tool_result[]; metadata?: metadata; text?: string; title?: string; type?: 'trace'; } | { id?: string; children?: utterance[]; ended_at?: string; metadata?: metadata; participants?: person[]; started_at?: string; text?: string; title?: string; type?: 'transcript'; } | { id?: string; address?: string; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; contact_ids?: string[]; deal_ids?: string[]; description?: string; emails?: string[]; employees?: number; image_url?: string; industry?: string; is_active?: boolean; metadata?: metadata; name?: string; phone_numbers?: string[]; tags?: string[]; text?: string; timezone?: string; type?: 'company'; websites?: string[]; } | { id?: string; amount?: number; children?: blob | callout | chunk | code | comment | divider | equation | footnote | heading | image | link | line_break | list | list_item | page | paragraph | quote | table | table_cell | table_row | text | to_do | tool_call | tool_result | trace_message | utterance[]; closed_at?: string; company_ids?: string[]; contact_ids?: string[]; currency?: string; deal_source?: string; lost_reason?: string; metadata?: metadata; name?: string; pipeline?: string; probability?: number; stage?: string; tags?: string[]; text?: string; type?: 'deal'; won_reason?: string; } | { id?: string; attachment_names?: string[]; balance_amount?: number; cancelled_at?: string; children?: object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object[]; contact_id?: string; contact_name?: string; currency?: string; due_at?: string; invoice_type?: string; metadata?: object; notes?: string; number?: string; organization_id?: string; paid_amount?: number; paid_at?: string; posted_at?: string; reference?: string; refund_amount?: number; refund_reason?: string; refunded_at?: string; status?: string; tax_amount?: number; text?: string; total_amount?: number; type?: 'invoice'; }; resource_id: string; source: string; type: string; chunks?: { chunk_id: string; summary?: string; }[]; collection?: string; document_date?: string; highlights?: object[]; ingested_at?: string; last_modified_at?: string; metadata?: object; score?: number; status?: string; summary?: string; title?: string; }[]`\n - `errors?: object[]`\n - `provenance?: { entities?: { id: string; name: string; type: string; }[]; failed_sources?: string[]; sources?: { resource_id: string; source: string; chunk_id?: string; content_sha256?: string; owner?: string; score?: number; span?: object[]; title?: string; }[]; steps?: { iteration: number; status: string; tool: string; query?: string; result_count?: number; source?: string; }[]; }`\n - `query?: string`\n - `query_id?: string`\n - `score?: number`\n\n### Example\n\n```typescript\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell();\n\nconst queryResult = await client.evaluate.getQuery('query_id');\n\nconsole.log(queryResult);\n```", perLanguage: { go: { method: 'client.Evaluate.GetQuery', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tqueryResult, err := client.Evaluate.GetQuery(context.TODO(), "query_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", queryResult.QueryID)\n}\n', - }, - cli: { - method: 'evaluate get_query', - example: "hyperspell evaluate get-query \\\n --api-key 'My API Key' \\\n --query-id query_id", + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t\toption.WithUserID("My User ID"),\n\t)\n\tqueryResult, err := client.Evaluate.GetQuery(context.TODO(), "query_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", queryResult.QueryID)\n}\n', }, python: { method: 'evaluate.get_query', @@ -956,12 +1360,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [ typescript: { method: 'client.evaluate.getQuery', example: - "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst queryResult = await client.evaluate.getQuery('query_id');\n\nconsole.log(queryResult.query_id);", + "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n userID: 'My User ID',\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst queryResult = await client.evaluate.getQuery('query_id');\n\nconsole.log(queryResult.query_id);", }, http: { example: 'curl https://api.hyperspell.com/evaluate/query/$QUERY_ID \\\n -H "Authorization: Bearer $HYPERSPELL_API_KEY"', }, + cli: { + method: 'evaluate get_query', + example: + "hyperspell evaluate get-query \\\n --api-key 'My API Key' \\\n --user-id 'My User ID' \\\n --query-id query_id", + }, }, }, { @@ -980,11 +1389,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [ go: { method: 'client.Evaluate.ScoreQuery', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Evaluate.ScoreQuery(\n\t\tcontext.TODO(),\n\t\t"query_id",\n\t\thyperspell.EvaluateScoreQueryParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Message)\n}\n', - }, - cli: { - method: 'evaluate score_query', - example: "hyperspell evaluate score-query \\\n --api-key 'My API Key' \\\n --query-id query_id", + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t\toption.WithUserID("My User ID"),\n\t)\n\tresponse, err := client.Evaluate.ScoreQuery(\n\t\tcontext.TODO(),\n\t\t"query_id",\n\t\thyperspell.EvaluateScoreQueryParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Message)\n}\n', }, python: { method: 'evaluate.score_query', @@ -994,12 +1399,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [ typescript: { method: 'client.evaluate.scoreQuery', example: - "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.evaluate.scoreQuery('query_id');\n\nconsole.log(response.message);", + "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n userID: 'My User ID',\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.evaluate.scoreQuery('query_id');\n\nconsole.log(response.message);", }, http: { example: "curl https://api.hyperspell.com/evaluate/query/$QUERY_ID \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: Bearer $HYPERSPELL_API_KEY\" \\\n -d '{}'", }, + cli: { + method: 'evaluate score_query', + example: + "hyperspell evaluate score-query \\\n --api-key 'My API Key' \\\n --user-id 'My User ID' \\\n --query-id query_id", + }, }, }, { @@ -1018,12 +1428,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [ go: { method: 'client.Evaluate.ScoreHighlight', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Evaluate.ScoreHighlight(\n\t\tcontext.TODO(),\n\t\t"highlight_id",\n\t\thyperspell.EvaluateScoreHighlightParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Message)\n}\n', - }, - cli: { - method: 'evaluate score_highlight', - example: - "hyperspell evaluate score-highlight \\\n --api-key 'My API Key' \\\n --highlight-id highlight_id", + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t\toption.WithUserID("My User ID"),\n\t)\n\tresponse, err := client.Evaluate.ScoreHighlight(\n\t\tcontext.TODO(),\n\t\t"highlight_id",\n\t\thyperspell.EvaluateScoreHighlightParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Message)\n}\n', }, python: { method: 'evaluate.score_highlight', @@ -1033,12 +1438,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [ typescript: { method: 'client.evaluate.scoreHighlight', example: - "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.evaluate.scoreHighlight('highlight_id');\n\nconsole.log(response.message);", + "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n userID: 'My User ID',\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.evaluate.scoreHighlight('highlight_id');\n\nconsole.log(response.message);", }, http: { example: "curl https://api.hyperspell.com/evaluate/highlight/$HIGHLIGHT_ID \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: Bearer $HYPERSPELL_API_KEY\" \\\n -d '{}'", }, + cli: { + method: 'evaluate score_highlight', + example: + "hyperspell evaluate score-highlight \\\n --api-key 'My API Key' \\\n --user-id 'My User ID' \\\n --highlight-id highlight_id", + }, }, }, { @@ -1050,7 +1460,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [ stainlessPath: '(resource) actions > (method) send_message', qualified: 'client.actions.sendMessage', params: [ - 'provider: string;', + "provider: 'slack';", 'text: string;', 'channel?: string;', 'connection?: string;', @@ -1058,31 +1468,31 @@ const EMBEDDED_METHODS: MethodEntry[] = [ ], response: '{ success: boolean; error?: string; provider_response?: object; }', markdown: - "## send_message\n\n`client.actions.sendMessage(provider: string, text: string, channel?: string, connection?: string, parent?: string): { success: boolean; error?: string; provider_response?: object; }`\n\n**post** `/actions/send_message`\n\nSend a message to a channel or conversation on a connected integration.\n\n### Parameters\n\n- `provider: string`\n Integration provider (e.g., slack)\n\n- `text: string`\n Message text\n\n- `channel?: string`\n Channel ID (required for Slack)\n\n- `connection?: string`\n Connection ID. If omitted, auto-resolved from provider + user.\n\n- `parent?: string`\n Parent message ID for threading (thread_ts for Slack)\n\n### Returns\n\n- `{ success: boolean; error?: string; provider_response?: object; }`\n Result from executing an integration action.\n\n - `success: boolean`\n - `error?: string`\n - `provider_response?: object`\n\n### Example\n\n```typescript\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell();\n\nconst response = await client.actions.sendMessage({ provider: 'reddit', text: 'text' });\n\nconsole.log(response);\n```", + "## send_message\n\n`client.actions.sendMessage(provider: 'slack', text: string, channel?: string, connection?: string, parent?: string): { success: boolean; error?: string; provider_response?: object; }`\n\n**post** `/actions/send_message`\n\nSend a message to a channel or conversation on a connected integration.\n\n### Parameters\n\n- `provider: 'slack'`\n Integration provider.\n\n- `text: string`\n Message text\n\n- `channel?: string`\n Channel ID (required for Slack)\n\n- `connection?: string`\n Connection ID. If omitted, auto-resolved from provider + user.\n\n- `parent?: string`\n Parent message ID for threading (thread_ts for Slack)\n\n### Returns\n\n- `{ success: boolean; error?: string; provider_response?: object; }`\n Result from executing an integration action.\n\n - `success: boolean`\n - `error?: string`\n - `provider_response?: object`\n\n### Example\n\n```typescript\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell();\n\nconst response = await client.actions.sendMessage({ provider: 'slack', text: 'text' });\n\nconsole.log(response);\n```", perLanguage: { go: { method: 'client.Actions.SendMessage', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Actions.SendMessage(context.TODO(), hyperspell.ActionSendMessageParams{\n\t\tProvider: hyperspell.ActionSendMessageParamsProviderReddit,\n\t\tText: "text",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.ProviderResponse)\n}\n', - }, - cli: { - method: 'actions send_message', - example: - "hyperspell actions send-message \\\n --api-key 'My API Key' \\\n --provider reddit \\\n --text text", + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t\toption.WithUserID("My User ID"),\n\t)\n\tresponse, err := client.Actions.SendMessage(context.TODO(), hyperspell.ActionSendMessageParams{\n\t\tProvider: "slack",\n\t\tText: "text",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.ProviderResponse)\n}\n', }, python: { method: 'actions.send_message', example: - 'import os\nfrom hyperspell import Hyperspell\n\nclient = Hyperspell(\n api_key=os.environ.get("HYPERSPELL_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.actions.send_message(\n provider="reddit",\n text="text",\n)\nprint(response.provider_response)', + 'import os\nfrom hyperspell import Hyperspell\n\nclient = Hyperspell(\n api_key=os.environ.get("HYPERSPELL_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.actions.send_message(\n provider="slack",\n text="text",\n)\nprint(response.provider_response)', }, typescript: { method: 'client.actions.sendMessage', example: - "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.actions.sendMessage({ provider: 'reddit', text: 'text' });\n\nconsole.log(response.provider_response);", + "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n userID: 'My User ID',\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.actions.sendMessage({ provider: 'slack', text: 'text' });\n\nconsole.log(response.provider_response);", }, http: { example: - 'curl https://api.hyperspell.com/actions/send_message \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $HYPERSPELL_API_KEY" \\\n -d \'{\n "provider": "reddit",\n "text": "text"\n }\'', + 'curl https://api.hyperspell.com/actions/send_message \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $HYPERSPELL_API_KEY" \\\n -d \'{\n "provider": "slack",\n "text": "text"\n }\'', + }, + cli: { + method: 'actions send_message', + example: + "hyperspell actions send-message \\\n --api-key 'My API Key' \\\n --user-id 'My User ID' \\\n --provider slack \\\n --text text", }, }, }, @@ -1097,37 +1507,37 @@ const EMBEDDED_METHODS: MethodEntry[] = [ params: [ 'channel: string;', 'name: string;', - 'provider: string;', + "provider: 'slack';", 'timestamp: string;', 'connection?: string;', ], response: '{ success: boolean; error?: string; provider_response?: object; }', markdown: - "## add_reaction\n\n`client.actions.addReaction(channel: string, name: string, provider: string, timestamp: string, connection?: string): { success: boolean; error?: string; provider_response?: object; }`\n\n**post** `/actions/add_reaction`\n\nAdd an emoji reaction to a message on a connected integration.\n\n### Parameters\n\n- `channel: string`\n Channel ID containing the message\n\n- `name: string`\n Emoji name without colons (e.g., thumbsup)\n\n- `provider: string`\n Integration provider (e.g., slack)\n\n- `timestamp: string`\n Message timestamp to react to\n\n- `connection?: string`\n Connection ID. If omitted, auto-resolved from provider + user.\n\n### Returns\n\n- `{ success: boolean; error?: string; provider_response?: object; }`\n Result from executing an integration action.\n\n - `success: boolean`\n - `error?: string`\n - `provider_response?: object`\n\n### Example\n\n```typescript\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell();\n\nconst response = await client.actions.addReaction({\n channel: 'channel',\n name: 'name',\n provider: 'reddit',\n timestamp: 'timestamp',\n});\n\nconsole.log(response);\n```", + "## add_reaction\n\n`client.actions.addReaction(channel: string, name: string, provider: 'slack', timestamp: string, connection?: string): { success: boolean; error?: string; provider_response?: object; }`\n\n**post** `/actions/add_reaction`\n\nAdd an emoji reaction to a message on a connected integration.\n\n### Parameters\n\n- `channel: string`\n Channel ID containing the message\n\n- `name: string`\n Emoji name without colons (e.g., thumbsup)\n\n- `provider: 'slack'`\n Integration provider.\n\n- `timestamp: string`\n Message timestamp to react to\n\n- `connection?: string`\n Connection ID. If omitted, auto-resolved from provider + user.\n\n### Returns\n\n- `{ success: boolean; error?: string; provider_response?: object; }`\n Result from executing an integration action.\n\n - `success: boolean`\n - `error?: string`\n - `provider_response?: object`\n\n### Example\n\n```typescript\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell();\n\nconst response = await client.actions.addReaction({\n channel: 'channel',\n name: 'name',\n provider: 'slack',\n timestamp: 'timestamp',\n});\n\nconsole.log(response);\n```", perLanguage: { go: { method: 'client.Actions.AddReaction', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Actions.AddReaction(context.TODO(), hyperspell.ActionAddReactionParams{\n\t\tChannel: "channel",\n\t\tName: "name",\n\t\tProvider: hyperspell.ActionAddReactionParamsProviderReddit,\n\t\tTimestamp: "timestamp",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.ProviderResponse)\n}\n', - }, - cli: { - method: 'actions add_reaction', - example: - "hyperspell actions add-reaction \\\n --api-key 'My API Key' \\\n --channel channel \\\n --name name \\\n --provider reddit \\\n --timestamp timestamp", + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t\toption.WithUserID("My User ID"),\n\t)\n\tresponse, err := client.Actions.AddReaction(context.TODO(), hyperspell.ActionAddReactionParams{\n\t\tChannel: "channel",\n\t\tName: "name",\n\t\tProvider: "slack",\n\t\tTimestamp: "timestamp",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.ProviderResponse)\n}\n', }, python: { method: 'actions.add_reaction', example: - 'import os\nfrom hyperspell import Hyperspell\n\nclient = Hyperspell(\n api_key=os.environ.get("HYPERSPELL_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.actions.add_reaction(\n channel="channel",\n name="name",\n provider="reddit",\n timestamp="timestamp",\n)\nprint(response.provider_response)', + 'import os\nfrom hyperspell import Hyperspell\n\nclient = Hyperspell(\n api_key=os.environ.get("HYPERSPELL_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.actions.add_reaction(\n channel="channel",\n name="name",\n provider="slack",\n timestamp="timestamp",\n)\nprint(response.provider_response)', }, typescript: { method: 'client.actions.addReaction', example: - "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.actions.addReaction({\n channel: 'channel',\n name: 'name',\n provider: 'reddit',\n timestamp: 'timestamp',\n});\n\nconsole.log(response.provider_response);", + "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n userID: 'My User ID',\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.actions.addReaction({\n channel: 'channel',\n name: 'name',\n provider: 'slack',\n timestamp: 'timestamp',\n});\n\nconsole.log(response.provider_response);", }, http: { example: - 'curl https://api.hyperspell.com/actions/add_reaction \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $HYPERSPELL_API_KEY" \\\n -d \'{\n "channel": "channel",\n "name": "name",\n "provider": "reddit",\n "timestamp": "timestamp"\n }\'', + 'curl https://api.hyperspell.com/actions/add_reaction \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $HYPERSPELL_API_KEY" \\\n -d \'{\n "channel": "channel",\n "name": "name",\n "provider": "slack",\n "timestamp": "timestamp"\n }\'', + }, + cli: { + method: 'actions add_reaction', + example: + "hyperspell actions add-reaction \\\n --api-key 'My API Key' \\\n --user-id 'My User ID' \\\n --channel channel \\\n --name name \\\n --provider slack \\\n --timestamp timestamp", }, }, }, @@ -1149,19 +1559,14 @@ const EMBEDDED_METHODS: MethodEntry[] = [ 'session_id?: string;', 'title?: string;', ], - response: - "{ resource_id: string; source: string; status: 'pending' | 'processing' | 'completed' | 'failed' | 'pending_review' | 'skipped'; }", + response: '{ resource_id: string; source: string; status: string; }', markdown: - "## add\n\n`client.sessions.add(history: string, date?: string, extract?: 'procedure' | 'memory' | 'mood'[], format?: 'vercel' | 'hyperdoc' | 'openclaw', metadata?: object, session_id?: string, title?: string): { resource_id: string; source: string; status: 'pending' | 'processing' | 'completed' | 'failed' | 'pending_review' | 'skipped'; }`\n\n**post** `/trace/add`\n\nAdd an agent trace/transcript to the index.\n\nAccepts traces as a string in Hyperdoc format (native), Vercel AI SDK format,\nor OpenClaw JSONL format. The format is auto-detected if not specified.\n\n**Hyperdoc format** (JSON array, snake_case with type discriminators):\n```json\n{\"history\": \"[{\\\"type\\\": \\\"trace_message\\\", \\\"role\\\": \\\"user\\\", \\\"text\\\": \\\"Hello\\\"}]\"}\n```\n\n**Vercel AI SDK format** (JSON array, camelCase):\n```json\n{\"history\": \"[{\\\"role\\\": \\\"user\\\", \\\"content\\\": \\\"Hello\\\"}]\"}\n```\n\n**OpenClaw JSONL format** (newline-delimited JSON):\n```json\n{\"history\": \"{\\\"type\\\":\\\"session\\\",\\\"id\\\":\\\"abc\\\"}\\n{\\\"type\\\":\\\"message\\\",\\\"message\\\":{\\\"role\\\":\\\"user\\\",...}}\"}\n```\n\n### Parameters\n\n- `history: string`\n The trace history as a string. Can be a JSON array of Hyperdoc steps, a JSON array of Vercel AI SDK steps, or OpenClaw JSONL.\n\n- `date?: string`\n Date of the trace\n\n- `extract?: 'procedure' | 'memory' | 'mood'[]`\n What kind of memories to extract from the trace\n\n- `format?: 'vercel' | 'hyperdoc' | 'openclaw'`\n Trace format: 'vercel', 'hyperdoc', or 'openclaw'. Auto-detected if not set.\n\n- `metadata?: object`\n Custom metadata for filtering. Keys must be alphanumeric with underscores, max 64 chars.\n\n- `session_id?: string`\n Resource identifier for the trace.\n\n- `title?: string`\n Title of the trace\n\n### Returns\n\n- `{ resource_id: string; source: string; status: 'pending' | 'processing' | 'completed' | 'failed' | 'pending_review' | 'skipped'; }`\n\n - `resource_id: string`\n - `source: string`\n - `status: 'pending' | 'processing' | 'completed' | 'failed' | 'pending_review' | 'skipped'`\n\n### Example\n\n```typescript\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell();\n\nconst memoryStatus = await client.sessions.add({ history: 'history' });\n\nconsole.log(memoryStatus);\n```", + '## add\n\n`client.sessions.add(history: string, date?: string, extract?: \'procedure\' | \'memory\' | \'mood\'[], format?: \'vercel\' | \'hyperdoc\' | \'openclaw\', metadata?: object, session_id?: string, title?: string): { resource_id: string; source: string; status: string; }`\n\n**post** `/trace/add`\n\nAdd an agent trace/transcript to the index.\n\nAccepts traces as a string in Hyperdoc format (native), Vercel AI SDK format,\nor OpenClaw JSONL format. The format is auto-detected if not specified.\n\n**Hyperdoc format** (JSON array, snake_case with type discriminators):\n```json\n{"history": "[{\\"type\\": \\"trace_message\\", \\"role\\": \\"user\\", \\"text\\": \\"Hello\\"}]"}\n```\n\n**Vercel AI SDK format** (JSON array, camelCase):\n```json\n{"history": "[{\\"role\\": \\"user\\", \\"content\\": \\"Hello\\"}]"}\n```\n\n**OpenClaw JSONL format** (newline-delimited JSON):\n```json\n{"history": "{\\"type\\":\\"session\\",\\"id\\":\\"abc\\"}\\n{\\"type\\":\\"message\\",\\"message\\":{\\"role\\":\\"user\\",...}}"}\n```\n\n### Parameters\n\n- `history: string`\n The trace history as a string. Can be a JSON array of Hyperdoc steps, a JSON array of Vercel AI SDK steps, or OpenClaw JSONL.\n\n- `date?: string`\n Date of the trace\n\n- `extract?: \'procedure\' | \'memory\' | \'mood\'[]`\n What kind of memories to extract from the trace\n\n- `format?: \'vercel\' | \'hyperdoc\' | \'openclaw\'`\n Trace format: \'vercel\', \'hyperdoc\', or \'openclaw\'. Auto-detected if not set.\n\n- `metadata?: object`\n Custom metadata for filtering. Keys must be alphanumeric with underscores, max 64 chars.\n\n- `session_id?: string`\n Resource identifier for the trace.\n\n- `title?: string`\n Title of the trace\n\n### Returns\n\n- `{ resource_id: string; source: string; status: string; }`\n\n - `resource_id: string`\n - `source: string`\n - `status: string`\n\n### Example\n\n```typescript\nimport Hyperspell from \'@hyperspell/hyperspell\';\n\nconst client = new Hyperspell();\n\nconst memoryStatus = await client.sessions.add({ history: \'history\' });\n\nconsole.log(memoryStatus);\n```', perLanguage: { go: { method: 'client.Sessions.Add', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tmemoryStatus, err := client.Sessions.Add(context.TODO(), hyperspell.SessionAddParams{\n\t\tHistory: "history",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", memoryStatus.ResourceID)\n}\n', - }, - cli: { - method: 'sessions add', - example: "hyperspell sessions add \\\n --api-key 'My API Key' \\\n --history history", + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t\toption.WithUserID("My User ID"),\n\t)\n\tmemoryStatus, err := client.Sessions.Add(context.TODO(), hyperspell.SessionAddParams{\n\t\tHistory: "history",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", memoryStatus.ResourceID)\n}\n', }, python: { method: 'sessions.add', @@ -1171,12 +1576,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [ typescript: { method: 'client.sessions.add', example: - "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst memoryStatus = await client.sessions.add({ history: 'history' });\n\nconsole.log(memoryStatus.resource_id);", + "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n userID: 'My User ID',\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst memoryStatus = await client.sessions.add({ history: 'history' });\n\nconsole.log(memoryStatus.resource_id);", }, http: { example: 'curl https://api.hyperspell.com/trace/add \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $HYPERSPELL_API_KEY" \\\n -d \'{\n "history": "history"\n }\'', }, + cli: { + method: 'sessions add', + example: + "hyperspell sessions add \\\n --api-key 'My API Key' \\\n --user-id 'My User ID' \\\n --history history", + }, }, }, { @@ -1196,11 +1606,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [ go: { method: 'client.Vaults.List', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tpage, err := client.Vaults.List(context.TODO(), hyperspell.VaultListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', - }, - cli: { - method: 'vaults list', - example: "hyperspell vaults list \\\n --api-key 'My API Key'", + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t\toption.WithUserID("My User ID"),\n\t)\n\tpage, err := client.Vaults.List(context.TODO(), hyperspell.VaultListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', }, python: { method: 'vaults.list', @@ -1210,12 +1616,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ typescript: { method: 'client.vaults.list', example: - "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const vaultListResponse of client.vaults.list()) {\n console.log(vaultListResponse.collection);\n}", + "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n userID: 'My User ID',\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const vaultListResponse of client.vaults.list()) {\n console.log(vaultListResponse.collection);\n}", }, http: { example: 'curl https://api.hyperspell.com/vault/list \\\n -H "Authorization: Bearer $HYPERSPELL_API_KEY"', }, + cli: { + method: 'vaults list', + example: "hyperspell vaults list \\\n --api-key 'My API Key' \\\n --user-id 'My User ID'", + }, }, }, { @@ -1230,16 +1640,12 @@ const EMBEDDED_METHODS: MethodEntry[] = [ params: ['user_id: string;', 'expires_in?: string;', 'origin?: string;'], response: '{ token: string; expires_at: string; }', markdown: - "## user_token\n\n`client.auth.userToken(user_id: string, expires_in?: string, origin?: string): { token: string; expires_at: string; }`\n\n**post** `/auth/user_token`\n\nUse this endpoint to create a user token for a specific user.\nThis token can be safely passed to your user-facing front-end.\n\n### Parameters\n\n- `user_id: string`\n\n- `expires_in?: string`\n Token lifetime, e.g., '30m', '2h', '1d'. Defaults to 24 hours if not provided.\n\n- `origin?: string`\n Origin of the request, used for CSRF protection. If set, the token will only be valid for requests originating from this origin.\n\n### Returns\n\n- `{ token: string; expires_at: string; }`\n\n - `token: string`\n - `expires_at: string`\n\n### Example\n\n```typescript\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell();\n\nconst token = await client.auth.userToken({ user_id: 'user_id' });\n\nconsole.log(token);\n```", + "## user_token\n\n`client.auth.userToken(user_id: string, expires_in?: string, origin?: string): { token: string; expires_at: string; }`\n\n**post** `/auth/user_token`\n\nUse this endpoint to create a user token for a specific user.\nThis token can be safely passed to your user-facing front-end.\n\n### Parameters\n\n- `user_id: string`\n\n- `expires_in?: string`\n Token lifetime, e.g., '30m', '2h', '1d'. Defaults to 24 hours if not provided. Maximum 30 days.\n\n- `origin?: string`\n Origin of the request, used for CSRF protection. If set, the token will only be valid for requests originating from this origin.\n\n### Returns\n\n- `{ token: string; expires_at: string; }`\n\n - `token: string`\n - `expires_at: string`\n\n### Example\n\n```typescript\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell();\n\nconst token = await client.auth.userToken({ user_id: 'user_id' });\n\nconsole.log(token);\n```", perLanguage: { go: { method: 'client.Auth.UserToken', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\ttoken, err := client.Auth.UserToken(context.TODO(), hyperspell.AuthUserTokenParams{\n\t\tUserID: "user_id",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", token.Token)\n}\n', - }, - cli: { - method: 'auth user_token', - example: "hyperspell auth user-token \\\n --api-key 'My API Key' \\\n --user-id user_id", + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t\toption.WithUserID("My User ID"),\n\t)\n\ttoken, err := client.Auth.UserToken(context.TODO(), hyperspell.AuthUserTokenParams{\n\t\tUserID: "user_id",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", token.Token)\n}\n', }, python: { method: 'auth.user_token', @@ -1249,12 +1655,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ typescript: { method: 'client.auth.userToken', example: - "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst token = await client.auth.userToken({ user_id: 'user_id' });\n\nconsole.log(token.token);", + "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n userID: 'My User ID',\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst token = await client.auth.userToken({ user_id: 'user_id' });\n\nconsole.log(token.token);", }, http: { example: 'curl https://api.hyperspell.com/auth/user_token \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $HYPERSPELL_API_KEY" \\\n -d \'{\n "user_id": "user_id",\n "expires_in": "30m"\n }\'', }, + cli: { + method: 'auth user_token', + example: "hyperspell auth user-token \\\n --api-key 'My API Key' \\\n --user-id user_id", + }, }, }, { @@ -1273,11 +1683,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [ go: { method: 'client.Auth.Me', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Auth.Me(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.ID)\n}\n', - }, - cli: { - method: 'auth me', - example: "hyperspell auth me \\\n --api-key 'My API Key'", + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t\toption.WithUserID("My User ID"),\n\t)\n\tresponse, err := client.Auth.Me(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.ID)\n}\n', }, python: { method: 'auth.me', @@ -1287,12 +1693,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ typescript: { method: 'client.auth.me', example: - "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.auth.me();\n\nconsole.log(response.id);", + "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n userID: 'My User ID',\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.auth.me();\n\nconsole.log(response.id);", }, http: { example: 'curl https://api.hyperspell.com/auth/me \\\n -H "Authorization: Bearer $HYPERSPELL_API_KEY"', }, + cli: { + method: 'auth me', + example: "hyperspell auth me \\\n --api-key 'My API Key' \\\n --user-id 'My User ID'", + }, }, }, { @@ -1300,36 +1710,37 @@ const EMBEDDED_METHODS: MethodEntry[] = [ endpoint: '/auth/delete', httpMethod: 'delete', summary: 'Delete user', - description: 'Endpoint to delete user.', + description: + "Delete the calling user's data (GDPR erasure).\n\nDeletion is processed asynchronously. The endpoint returns ``202 Accepted``\nwith an identifier for the deletion request.", stainlessPath: '(resource) auth > (method) delete_user', qualified: 'client.auth.deleteUser', - response: '{ message: string; success: boolean; }', + response: '{ message: string; success: boolean; workflow_id: string; }', markdown: - "## delete_user\n\n`client.auth.deleteUser(): { message: string; success: boolean; }`\n\n**delete** `/auth/delete`\n\nEndpoint to delete user.\n\n### Returns\n\n- `{ message: string; success: boolean; }`\n\n - `message: string`\n - `success: boolean`\n\n### Example\n\n```typescript\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell();\n\nconst response = await client.auth.deleteUser();\n\nconsole.log(response);\n```", + "## delete_user\n\n`client.auth.deleteUser(): { message: string; success: boolean; workflow_id: string; }`\n\n**delete** `/auth/delete`\n\nDelete the calling user's data (GDPR erasure).\n\nDeletion is processed asynchronously. The endpoint returns ``202 Accepted``\nwith an identifier for the deletion request.\n\n### Returns\n\n- `{ message: string; success: boolean; workflow_id: string; }`\n\n - `message: string`\n - `success: boolean`\n - `workflow_id: string`\n\n### Example\n\n```typescript\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell();\n\nconst response = await client.auth.deleteUser();\n\nconsole.log(response);\n```", perLanguage: { go: { method: 'client.Auth.DeleteUser', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Auth.DeleteUser(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Message)\n}\n', - }, - cli: { - method: 'auth delete_user', - example: "hyperspell auth delete-user \\\n --api-key 'My API Key'", + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t\toption.WithUserID("My User ID"),\n\t)\n\tresponse, err := client.Auth.DeleteUser(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.WorkflowID)\n}\n', }, python: { method: 'auth.delete_user', example: - 'import os\nfrom hyperspell import Hyperspell\n\nclient = Hyperspell(\n api_key=os.environ.get("HYPERSPELL_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.auth.delete_user()\nprint(response.message)', + 'import os\nfrom hyperspell import Hyperspell\n\nclient = Hyperspell(\n api_key=os.environ.get("HYPERSPELL_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.auth.delete_user()\nprint(response.workflow_id)', }, typescript: { method: 'client.auth.deleteUser', example: - "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.auth.deleteUser();\n\nconsole.log(response.message);", + "import Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n userID: 'My User ID',\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.auth.deleteUser();\n\nconsole.log(response.workflow_id);", }, http: { example: 'curl https://api.hyperspell.com/auth/delete \\\n -X DELETE \\\n -H "Authorization: Bearer $HYPERSPELL_API_KEY"', }, + cli: { + method: 'auth delete_user', + example: "hyperspell auth delete-user \\\n --api-key 'My API Key' \\\n --user-id 'My User ID'", + }, }, }, ]; @@ -1338,22 +1749,22 @@ const EMBEDDED_READMES: { language: string; content: string }[] = [ { language: 'go', content: - '# Hyperspell Go API Library\n\nGo Reference\n\nThe Hyperspell Go library provides convenient access to the [Hyperspell REST API](https://docs.hyperspell.com/)\nfrom applications written in Go.\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Hyperspell MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=%40hyperspell%2Fhyperspell-mcp&config=eyJjb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3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40hyperspell%2Fhyperspell-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40hyperspell%2Fhyperspell-mcp%22%5D%2C%22env%22%3A%7B%22HYPERSPELL_API_KEY%22%3A%22My%20API%20Key%22%2C%22HYPERSPELL_USER_ID%22%3A%22My%20User%20ID%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Installation\n\n\n\n```go\nimport (\n\t"github.com/hyperspell/hyperspell-go" // imported as SDK_PackageName\n)\n```\n\n\n\nOr to pin the version:\n\n\n\n```sh\ngo get -u \'github.com/hyperspell/hyperspell-go@v0.0.1\'\n```\n\n\n\n## Requirements\n\nThis library requires Go 1.22+.\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n```go\npackage main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"), // defaults to os.LookupEnv("HYPERSPELL_API_KEY")\n\t)\n\tmemoryStatus, err := client.Memories.Add(context.TODO(), hyperspell.MemoryAddParams{\n\t\tText: "...",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", memoryStatus.ResourceID)\n}\n\n```\n\n### Request fields\n\nAll request parameters are wrapped in a generic `Field` type,\nwhich we use to distinguish zero values from null or omitted fields.\n\nThis prevents accidentally sending a zero value if you forget a required parameter,\nand enables explicitly sending `null`, `false`, `\'\'`, or `0` on optional parameters.\nAny field not specified is not sent.\n\nTo construct fields with values, use the helpers `String()`, `Int()`, `Float()`, or most commonly, the generic `F[T]()`.\nTo send a null, use `Null[T]()`, and to send a nonconforming value, use `Raw[T](any)`. For example:\n\n```go\nparams := FooParams{\n\tName: SDK_PackageName.F("hello"),\n\n\t// Explicitly send `"description": null`\n\tDescription: SDK_PackageName.Null[string](),\n\n\tPoint: SDK_PackageName.F(SDK_PackageName.Point{\n\t\tX: SDK_PackageName.Int(0),\n\t\tY: SDK_PackageName.Int(1),\n\n\t\t// In cases where the API specifies a given type,\n\t\t// but you want to send something else, use `Raw`:\n\t\tZ: SDK_PackageName.Raw[int64](0.01), // sends a float\n\t}),\n}\n```\n\n### Response objects\n\nAll fields in response structs are value types (not pointers or wrappers).\n\nIf a given field is `null`, not present, or invalid, the corresponding field\nwill simply be its zero value.\n\nAll response structs also include a special `JSON` field, containing more detailed\ninformation about each property, which you can use like so:\n\n```go\nif res.Name == "" {\n\t// true if `"name"` is either not present or explicitly null\n\tres.JSON.Name.IsNull()\n\n\t// true if the `"name"` key was not present in the response JSON at all\n\tres.JSON.Name.IsMissing()\n\n\t// When the API returns data that cannot be coerced to the expected type:\n\tif res.JSON.Name.IsInvalid() {\n\t\traw := res.JSON.Name.Raw()\n\n\t\tlegacyName := struct{\n\t\t\tFirst string `json:"first"`\n\t\t\tLast string `json:"last"`\n\t\t}{}\n\t\tjson.Unmarshal([]byte(raw), &legacyName)\n\t\tname = legacyName.First + " " + legacyName.Last\n\t}\n}\n```\n\nThese `.JSON` structs also include an `Extras` map containing\nany properties in the json response that were not specified\nin the struct. This can be useful for API features not yet\npresent in the SDK.\n\n```go\nbody := res.JSON.ExtraFields["my_unexpected_field"].Raw()\n```\n\n### RequestOptions\n\nThis library uses the functional options pattern. Functions defined in the\n`SDK_PackageOptionName` package return a `RequestOption`, which is a closure that mutates a\n`RequestConfig`. These options can be supplied to the client or at individual\nrequests. For example:\n\n```go\nclient := SDK_PackageName.SDK_ClientInitializerName(\n\t// Adds a header to every request made by the client\n\tSDK_PackageOptionName.WithHeader("X-Some-Header", "custom_header_info"),\n)\n\nclient.Memories.Add(context.TODO(), ...,\n\t// Override the header\n\tSDK_PackageOptionName.WithHeader("X-Some-Header", "some_other_custom_header_info"),\n\t// Add an undocumented field to the request body, using sjson syntax\n\tSDK_PackageOptionName.WithJSONSet("some.json.path", map[string]string{"my": "object"}),\n)\n```\n\nSee the [full list of request options](https://pkg.go.dev/github.com/hyperspell/hyperspell-go/SDK_PackageOptionName).\n\n### Pagination\n\nThis library provides some conveniences for working with paginated list endpoints.\n\nYou can use `.ListAutoPaging()` methods to iterate through items across all pages:\n\n```go\niter := client.Memories.ListAutoPaging(context.TODO(), hyperspell.MemoryListParams{})\n// Automatically fetches more pages as needed.\nfor iter.Next() {\n\tmemoryListResponse := iter.Current()\n\tfmt.Printf("%+v\\n", memoryListResponse)\n}\nif err := iter.Err(); err != nil {\n\tpanic(err.Error())\n}\n```\n\nOr you can use simple `.List()` methods to fetch a single page and receive a standard response object\nwith additional helper methods like `.GetNextPage()`, e.g.:\n\n```go\npage, err := client.Memories.List(context.TODO(), hyperspell.MemoryListParams{})\nfor page != nil {\n\tfor _, memory := range page.Items {\n\t\tfmt.Printf("%+v\\n", memory)\n\t}\n\tpage, err = page.GetNextPage()\n}\nif err != nil {\n\tpanic(err.Error())\n}\n```\n\n### Errors\n\nWhen the API returns a non-success status code, we return an error with type\n`*SDK_PackageName.Error`. This contains the `StatusCode`, `*http.Request`, and\n`*http.Response` values of the request, as well as the JSON of the error body\n(much like other response objects in the SDK).\n\nTo handle errors, we recommend that you use the `errors.As` pattern:\n\n```go\n_, err := client.Memories.Add(context.TODO(), hyperspell.MemoryAddParams{\n\tText: "...",\n})\nif err != nil {\n\tvar apierr *hyperspell.Error\n\tif errors.As(err, &apierr) {\n\t\tprintln(string(apierr.DumpRequest(true))) // Prints the serialized HTTP request\n\t\tprintln(string(apierr.DumpResponse(true))) // Prints the serialized HTTP response\n\t}\n\tpanic(err.Error()) // GET "/memories/add": 400 Bad Request { ... }\n}\n```\n\nWhen other errors occur, they are returned unwrapped; for example,\nif HTTP transport fails, you might receive `*url.Error` wrapping `*net.OpError`.\n\n### Timeouts\n\nRequests do not time out by default; use context to configure a timeout for a request lifecycle.\n\nNote that if a request is [retried](#retries), the context timeout does not start over.\nTo set a per-retry timeout, use `SDK_PackageOptionName.WithRequestTimeout()`.\n\n```go\n// This sets the timeout for the request, including all the retries.\nctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)\ndefer cancel()\nclient.Memories.Add(\n\tctx,\n\thyperspell.MemoryAddParams{\n\t\tText: "...",\n\t},\n\t// This sets the per-retry timeout\n\toption.WithRequestTimeout(20*time.Second),\n)\n```\n\n### File uploads\n\nRequest parameters that correspond to file uploads in multipart requests are typed as\n`param.Field[io.Reader]`. The contents of the `io.Reader` will by default be sent as a multipart form\npart with the file name of "anonymous_file" and content-type of "application/octet-stream".\n\nThe file name and content-type can be customized by implementing `Name() string` or `ContentType()\nstring` on the run-time type of `io.Reader`. Note that `os.File` implements `Name() string`, so a\nfile returned by `os.Open` will be sent with the file name on disk.\n\nWe also provide a helper `SDK_PackageName.FileParam(reader io.Reader, filename string, contentType string)`\nwhich can be used to wrap any `io.Reader` with the appropriate file name and content type.\n\n```go\n// A file from the file system\nfile, err := os.Open("/path/to/file")\nhyperspell.MemoryUploadParams{\n\tFile: file,\n}\n\n// A file from a string\nhyperspell.MemoryUploadParams{\n\tFile: strings.NewReader("my file contents"),\n}\n\n// With a custom filename and contentType\nhyperspell.MemoryUploadParams{\n\tFile: hyperspell.NewFile(strings.NewReader(`{"hello": "foo"}`), "file.go", "application/json"),\n}\n```\n\n### Retries\n\nCertain errors will be automatically retried 2 times by default, with a short exponential backoff.\nWe retry by default all connection errors, 408 Request Timeout, 409 Conflict, 429 Rate Limit,\nand >=500 Internal errors.\n\nYou can use the `WithMaxRetries` option to configure or disable this:\n\n```go\n// Configure the default for all requests:\nclient := hyperspell.NewClient(\n\toption.WithMaxRetries(0), // default is 2\n)\n\n// Override per-request:\nclient.Memories.Add(\n\tcontext.TODO(),\n\thyperspell.MemoryAddParams{\n\t\tText: "...",\n\t},\n\toption.WithMaxRetries(5),\n)\n```\n\n\n### Accessing raw response data (e.g. response headers)\n\nYou can access the raw HTTP response data by using the `option.WithResponseInto()` request option. This is useful when\nyou need to examine response headers, status codes, or other details.\n\n```go\n// Create a variable to store the HTTP response\nvar response *http.Response\nmemoryStatus, err := client.Memories.Add(\n\tcontext.TODO(),\n\thyperspell.MemoryAddParams{\n\t\tText: "...",\n\t},\n\toption.WithResponseInto(&response),\n)\nif err != nil {\n\t// handle error\n}\nfmt.Printf("%+v\\n", memoryStatus)\n\nfmt.Printf("Status Code: %d\\n", response.StatusCode)\nfmt.Printf("Headers: %+#v\\n", response.Header)\n```\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API. If you need to access undocumented\nendpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can use `client.Get`, `client.Post`, and other HTTP verbs.\n`RequestOptions` on the client, such as retries, will be respected when making these requests.\n\n```go\nvar (\n // params can be an io.Reader, a []byte, an encoding/json serializable object,\n // or a "…Params" struct defined in this library.\n params map[string]interface{}\n\n // result can be an []byte, *http.Response, a encoding/json deserializable object,\n // or a model defined in this library.\n result *http.Response\n)\nerr := client.Post(context.Background(), "/unspecified", params, &result)\nif err != nil {\n …\n}\n```\n\n#### Undocumented request params\n\nTo make requests using undocumented parameters, you may use either the `SDK_PackageOptionName.WithQuerySet()`\nor the `SDK_PackageOptionName.WithJSONSet()` methods.\n\n```go\nparams := FooNewParams{\n ID: SDK_PackageName.F("id_xxxx"),\n Data: SDK_PackageName.F(FooNewParamsData{\n FirstName: SDK_PackageName.F("John"),\n }),\n}\nclient.Foo.New(context.Background(), params, SDK_PackageOptionName.WithJSONSet("data.last_name", "Doe"))\n```\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you may either access the raw JSON of the response as a string\nwith `result.JSON.RawJSON()`, or get the raw JSON of a particular field on the result with\n`result.JSON.Foo.Raw()`.\n\nAny fields that are not present on the response struct will be saved and can be accessed by `result.JSON.ExtraFields()` which returns the extra fields as a `map[string]Field`.\n\n### Middleware\n\nWe provide `SDK_PackageOptionName.WithMiddleware` which applies the given\nmiddleware to requests.\n\n```go\nfunc Logger(req *http.Request, next SDK_PackageOptionName.MiddlewareNext) (res *http.Response, err error) {\n\t// Before the request\n\tstart := time.Now()\n\tLogReq(req)\n\n\t// Forward the request to the next handler\n\tres, err = next(req)\n\n\t// Handle stuff after the request\n\tend := time.Now()\n\tLogRes(res, err, start - end)\n\n return res, err\n}\n\nclient := SDK_PackageName.SDK_ClientInitializerName(\n\tSDK_PackageOptionName.WithMiddleware(Logger),\n)\n```\n\nWhen multiple middlewares are provided as variadic arguments, the middlewares\nare applied left to right. If `SDK_PackageOptionName.WithMiddleware` is given\nmultiple times, for example first in the client then the method, the\nmiddleware in the client will run first and the middleware given in the method\nwill run next.\n\nYou may also replace the default `http.Client` with\n`SDK_PackageOptionName.WithHTTPClient(client)`. Only one http client is\naccepted (this overwrites any previous client) and receives requests after any\nmiddleware has been applied.\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n2. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/hyperspell/hyperspell-go/issues) with questions, bugs, or suggestions.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n', + '# Hyperspell Go API Library\n\nGo Reference\n\nThe Hyperspell Go library provides convenient access to the [Hyperspell REST API](https://docs.hyperspell.com/)\nfrom applications written in Go.\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Hyperspell MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=%40hyperspell%2Fhyperspell-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBoeXBlcnNwZWxsL2h5cGVyc3BlbGwtbWNwIl0sImVudiI6eyJIWVBFUlNQRUxMX0FQSV9LRVkiOiJNeSBBUEkgS2V5IiwiSFlQRVJTUEVMTF9VU0VSX0lEIjoiTXkgVXNlciBJRCJ9fQ)\n[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40hyperspell%2Fhyperspell-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40hyperspell%2Fhyperspell-mcp%22%5D%2C%22env%22%3A%7B%22HYPERSPELL_API_KEY%22%3A%22My%20API%20Key%22%2C%22HYPERSPELL_USER_ID%22%3A%22My%20User%20ID%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Installation\n\n\n\n```go\nimport (\n\t"github.com/hyperspell/hyperspell-go" // imported as SDK_PackageName\n)\n```\n\n\n\nOr to pin the version:\n\n\n\n```sh\ngo get -u \'github.com/hyperspell/hyperspell-go@v0.0.1\'\n```\n\n\n\n## Requirements\n\nThis library requires Go 1.22+.\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n```go\npackage main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/hyperspell/hyperspell-go"\n\t"github.com/hyperspell/hyperspell-go/option"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey("My API Key"), // defaults to os.LookupEnv("HYPERSPELL_API_KEY")\n\t\toption.WithUserID("My User ID"),\n\t)\n\tmemoryStatus, err := client.Memories.Add(context.TODO(), hyperspell.MemoryAddParams{\n\t\tText: "...",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", memoryStatus.ResourceID)\n}\n\n```\n\n### Request fields\n\nAll request parameters are wrapped in a generic `Field` type,\nwhich we use to distinguish zero values from null or omitted fields.\n\nThis prevents accidentally sending a zero value if you forget a required parameter,\nand enables explicitly sending `null`, `false`, `\'\'`, or `0` on optional parameters.\nAny field not specified is not sent.\n\nTo construct fields with values, use the helpers `String()`, `Int()`, `Float()`, or most commonly, the generic `F[T]()`.\nTo send a null, use `Null[T]()`, and to send a nonconforming value, use `Raw[T](any)`. For example:\n\n```go\nparams := FooParams{\n\tName: SDK_PackageName.F("hello"),\n\n\t// Explicitly send `"description": null`\n\tDescription: SDK_PackageName.Null[string](),\n\n\tPoint: SDK_PackageName.F(SDK_PackageName.Point{\n\t\tX: SDK_PackageName.Int(0),\n\t\tY: SDK_PackageName.Int(1),\n\n\t\t// In cases where the API specifies a given type,\n\t\t// but you want to send something else, use `Raw`:\n\t\tZ: SDK_PackageName.Raw[int64](0.01), // sends a float\n\t}),\n}\n```\n\n### Response objects\n\nAll fields in response structs are value types (not pointers or wrappers).\n\nIf a given field is `null`, not present, or invalid, the corresponding field\nwill simply be its zero value.\n\nAll response structs also include a special `JSON` field, containing more detailed\ninformation about each property, which you can use like so:\n\n```go\nif res.Name == "" {\n\t// true if `"name"` is either not present or explicitly null\n\tres.JSON.Name.IsNull()\n\n\t// true if the `"name"` key was not present in the response JSON at all\n\tres.JSON.Name.IsMissing()\n\n\t// When the API returns data that cannot be coerced to the expected type:\n\tif res.JSON.Name.IsInvalid() {\n\t\traw := res.JSON.Name.Raw()\n\n\t\tlegacyName := struct{\n\t\t\tFirst string `json:"first"`\n\t\t\tLast string `json:"last"`\n\t\t}{}\n\t\tjson.Unmarshal([]byte(raw), &legacyName)\n\t\tname = legacyName.First + " " + legacyName.Last\n\t}\n}\n```\n\nThese `.JSON` structs also include an `Extras` map containing\nany properties in the json response that were not specified\nin the struct. This can be useful for API features not yet\npresent in the SDK.\n\n```go\nbody := res.JSON.ExtraFields["my_unexpected_field"].Raw()\n```\n\n### RequestOptions\n\nThis library uses the functional options pattern. Functions defined in the\n`SDK_PackageOptionName` package return a `RequestOption`, which is a closure that mutates a\n`RequestConfig`. These options can be supplied to the client or at individual\nrequests. For example:\n\n```go\nclient := SDK_PackageName.SDK_ClientInitializerName(\n\t// Adds a header to every request made by the client\n\tSDK_PackageOptionName.WithHeader("X-Some-Header", "custom_header_info"),\n)\n\nclient.Memories.Add(context.TODO(), ...,\n\t// Override the header\n\tSDK_PackageOptionName.WithHeader("X-Some-Header", "some_other_custom_header_info"),\n\t// Add an undocumented field to the request body, using sjson syntax\n\tSDK_PackageOptionName.WithJSONSet("some.json.path", map[string]string{"my": "object"}),\n)\n```\n\nSee the [full list of request options](https://pkg.go.dev/github.com/hyperspell/hyperspell-go/SDK_PackageOptionName).\n\n### Pagination\n\nThis library provides some conveniences for working with paginated list endpoints.\n\nYou can use `.ListAutoPaging()` methods to iterate through items across all pages:\n\n```go\niter := client.ContextDocuments.ListAutoPaging(context.TODO(), hyperspell.ContextDocumentListParams{})\n// Automatically fetches more pages as needed.\nfor iter.Next() {\n\tcontextDocumentListResponse := iter.Current()\n\tfmt.Printf("%+v\\n", contextDocumentListResponse)\n}\nif err := iter.Err(); err != nil {\n\tpanic(err.Error())\n}\n```\n\nOr you can use simple `.List()` methods to fetch a single page and receive a standard response object\nwith additional helper methods like `.GetNextPage()`, e.g.:\n\n```go\npage, err := client.ContextDocuments.List(context.TODO(), hyperspell.ContextDocumentListParams{})\nfor page != nil {\n\tfor _, contextDocument := range page.Documents {\n\t\tfmt.Printf("%+v\\n", contextDocument)\n\t}\n\tpage, err = page.GetNextPage()\n}\nif err != nil {\n\tpanic(err.Error())\n}\n```\n\n### Errors\n\nWhen the API returns a non-success status code, we return an error with type\n`*SDK_PackageName.Error`. This contains the `StatusCode`, `*http.Request`, and\n`*http.Response` values of the request, as well as the JSON of the error body\n(much like other response objects in the SDK).\n\nTo handle errors, we recommend that you use the `errors.As` pattern:\n\n```go\n_, err := client.Memories.Add(context.TODO(), hyperspell.MemoryAddParams{\n\tText: "...",\n})\nif err != nil {\n\tvar apierr *hyperspell.Error\n\tif errors.As(err, &apierr) {\n\t\tprintln(string(apierr.DumpRequest(true))) // Prints the serialized HTTP request\n\t\tprintln(string(apierr.DumpResponse(true))) // Prints the serialized HTTP response\n\t}\n\tpanic(err.Error()) // GET "/memories/add": 400 Bad Request { ... }\n}\n```\n\nWhen other errors occur, they are returned unwrapped; for example,\nif HTTP transport fails, you might receive `*url.Error` wrapping `*net.OpError`.\n\n### Timeouts\n\nRequests do not time out by default; use context to configure a timeout for a request lifecycle.\n\nNote that if a request is [retried](#retries), the context timeout does not start over.\nTo set a per-retry timeout, use `SDK_PackageOptionName.WithRequestTimeout()`.\n\n```go\n// This sets the timeout for the request, including all the retries.\nctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)\ndefer cancel()\nclient.Memories.Add(\n\tctx,\n\thyperspell.MemoryAddParams{\n\t\tText: "...",\n\t},\n\t// This sets the per-retry timeout\n\toption.WithRequestTimeout(20*time.Second),\n)\n```\n\n### File uploads\n\nRequest parameters that correspond to file uploads in multipart requests are typed as\n`param.Field[io.Reader]`. The contents of the `io.Reader` will by default be sent as a multipart form\npart with the file name of "anonymous_file" and content-type of "application/octet-stream".\n\nThe file name and content-type can be customized by implementing `Name() string` or `ContentType()\nstring` on the run-time type of `io.Reader`. Note that `os.File` implements `Name() string`, so a\nfile returned by `os.Open` will be sent with the file name on disk.\n\nWe also provide a helper `SDK_PackageName.FileParam(reader io.Reader, filename string, contentType string)`\nwhich can be used to wrap any `io.Reader` with the appropriate file name and content type.\n\n```go\n// A file from the file system\nfile, err := os.Open("/path/to/file")\nhyperspell.MemoryUploadParams{\n\tFile: file,\n}\n\n// A file from a string\nhyperspell.MemoryUploadParams{\n\tFile: strings.NewReader("my file contents"),\n}\n\n// With a custom filename and contentType\nhyperspell.MemoryUploadParams{\n\tFile: hyperspell.NewFile(strings.NewReader(`{"hello": "foo"}`), "file.go", "application/json"),\n}\n```\n\n### Retries\n\nCertain errors will be automatically retried 2 times by default, with a short exponential backoff.\nWe retry by default all connection errors, 408 Request Timeout, 409 Conflict, 429 Rate Limit,\nand >=500 Internal errors.\n\nYou can use the `WithMaxRetries` option to configure or disable this:\n\n```go\n// Configure the default for all requests:\nclient := hyperspell.NewClient(\n\toption.WithMaxRetries(0), // default is 2\n)\n\n// Override per-request:\nclient.Memories.Add(\n\tcontext.TODO(),\n\thyperspell.MemoryAddParams{\n\t\tText: "...",\n\t},\n\toption.WithMaxRetries(5),\n)\n```\n\n\n### Accessing raw response data (e.g. response headers)\n\nYou can access the raw HTTP response data by using the `option.WithResponseInto()` request option. This is useful when\nyou need to examine response headers, status codes, or other details.\n\n```go\n// Create a variable to store the HTTP response\nvar response *http.Response\nmemoryStatus, err := client.Memories.Add(\n\tcontext.TODO(),\n\thyperspell.MemoryAddParams{\n\t\tText: "...",\n\t},\n\toption.WithResponseInto(&response),\n)\nif err != nil {\n\t// handle error\n}\nfmt.Printf("%+v\\n", memoryStatus)\n\nfmt.Printf("Status Code: %d\\n", response.StatusCode)\nfmt.Printf("Headers: %+#v\\n", response.Header)\n```\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API. If you need to access undocumented\nendpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can use `client.Get`, `client.Post`, and other HTTP verbs.\n`RequestOptions` on the client, such as retries, will be respected when making these requests.\n\n```go\nvar (\n // params can be an io.Reader, a []byte, an encoding/json serializable object,\n // or a "…Params" struct defined in this library.\n params map[string]interface{}\n\n // result can be an []byte, *http.Response, a encoding/json deserializable object,\n // or a model defined in this library.\n result *http.Response\n)\nerr := client.Post(context.Background(), "/unspecified", params, &result)\nif err != nil {\n …\n}\n```\n\n#### Undocumented request params\n\nTo make requests using undocumented parameters, you may use either the `SDK_PackageOptionName.WithQuerySet()`\nor the `SDK_PackageOptionName.WithJSONSet()` methods.\n\n```go\nparams := FooNewParams{\n ID: SDK_PackageName.F("id_xxxx"),\n Data: SDK_PackageName.F(FooNewParamsData{\n FirstName: SDK_PackageName.F("John"),\n }),\n}\nclient.Foo.New(context.Background(), params, SDK_PackageOptionName.WithJSONSet("data.last_name", "Doe"))\n```\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you may either access the raw JSON of the response as a string\nwith `result.JSON.RawJSON()`, or get the raw JSON of a particular field on the result with\n`result.JSON.Foo.Raw()`.\n\nAny fields that are not present on the response struct will be saved and can be accessed by `result.JSON.ExtraFields()` which returns the extra fields as a `map[string]Field`.\n\n### Middleware\n\nWe provide `SDK_PackageOptionName.WithMiddleware` which applies the given\nmiddleware to requests.\n\n```go\nfunc Logger(req *http.Request, next SDK_PackageOptionName.MiddlewareNext) (res *http.Response, err error) {\n\t// Before the request\n\tstart := time.Now()\n\tLogReq(req)\n\n\t// Forward the request to the next handler\n\tres, err = next(req)\n\n\t// Handle stuff after the request\n\tend := time.Now()\n\tLogRes(res, err, start - end)\n\n return res, err\n}\n\nclient := SDK_PackageName.SDK_ClientInitializerName(\n\tSDK_PackageOptionName.WithMiddleware(Logger),\n)\n```\n\nWhen multiple middlewares are provided as variadic arguments, the middlewares\nare applied left to right. If `SDK_PackageOptionName.WithMiddleware` is given\nmultiple times, for example first in the client then the method, the\nmiddleware in the client will run first and the middleware given in the method\nwill run next.\n\nYou may also replace the default `http.Client` with\n`SDK_PackageOptionName.WithHTTPClient(client)`. Only one http client is\naccepted (this overwrites any previous client) and receives requests after any\nmiddleware has been applied.\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n2. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/hyperspell/hyperspell-go/issues) with questions, bugs, or suggestions.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n', }, { - language: 'cli', + language: 'python', content: - "# Hyperspell CLI\n\nThe official CLI for the [Hyperspell REST API](https://docs.hyperspell.com/).\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n\n\n## Installation\n\n### Installing with Homebrew\n\n~~~sh\nbrew install hyperspell/tools/hyperspell\n~~~\n\n### Installing with Go\n\nTo test or install the CLI locally, you need [Go](https://go.dev/doc/install) version 1.22 or later installed.\n\n~~~sh\ngo install 'github.com/hyperspell/hyperspell-cli/cmd/hyperspell@latest'\n~~~\n\nOnce you have run `go install`, the binary is placed in your Go bin directory:\n\n- **Default location**: `$HOME/go/bin` (or `$GOPATH/bin` if GOPATH is set)\n- **Check your path**: Run `go env GOPATH` to see the base directory\n\nIf commands aren't found after installation, add the Go bin directory to your PATH:\n\n~~~sh\n# Add to your shell profile (.zshrc, .bashrc, etc.)\nexport PATH=\"$PATH:$(go env GOPATH)/bin\"\n~~~\n\n\n\n### Running Locally\n\nAfter cloning the git repository for this project, you can use the\n`scripts/run` script to run the tool locally:\n\n~~~sh\n./scripts/run args...\n~~~\n\n## Usage\n\nThe CLI follows a resource-based command structure:\n\n~~~sh\nhyperspell [resource] [flags...]\n~~~\n\n~~~sh\nhyperspell memories add \\\n --api-key 'My API Key' \\\n --text ...\n~~~\n\nFor details about specific commands, use the `--help` flag.\n\n### Environment variables\n\n| Environment variable | Description | Required |\n| -------------------- | ---------------------------------------------------------------------------- | -------- |\n| `HYPERSPELL_API_KEY` | Either an API Key or User Token to authenticate a specific user of your app. | yes |\n\n### Global flags\n\n- `--api-key` - Either an API Key or User Token to authenticate a specific user of your app. (can also be set with `HYPERSPELL_API_KEY` env var)\n- `--user-id` - The id of the user making this request. Optional.\n- `--help` - Show command line usage\n- `--debug` - Enable debug logging (includes HTTP request/response details)\n- `--version`, `-v` - Show the CLI version\n- `--base-url` - Use a custom API backend URL\n- `--format` - Change the output format (`auto`, `explore`, `json`, `jsonl`, `pretty`, `raw`, `yaml`)\n- `--format-error` - Change the output format for errors (`auto`, `explore`, `json`, `jsonl`, `pretty`, `raw`, `yaml`)\n- `--transform` - Transform the data output using [GJSON syntax](https://github.com/tidwall/gjson/blob/master/SYNTAX.md)\n- `--transform-error` - Transform the error output using [GJSON syntax](https://github.com/tidwall/gjson/blob/master/SYNTAX.md)\n\n### Passing files as arguments\n\nTo pass files to your API, you can use the `@myfile.ext` syntax:\n\n~~~bash\nhyperspell --arg @abe.jpg\n~~~\n\nFiles can also be passed inside JSON or YAML blobs:\n\n~~~bash\nhyperspell --arg '{image: \"@abe.jpg\"}'\n# Equivalent:\nhyperspell < --username '\\@abe'\n~~~\n\n#### Explicit encoding\n\nFor JSON endpoints, the CLI tool does filetype sniffing to determine whether the\nfile contents should be sent as a string literal (for plain text files) or as a\nbase64-encoded string literal (for binary files). If you need to explicitly send\nthe file as either plain text or base64-encoded data, you can use\n`@file://myfile.txt` (for string encoding) or `@data://myfile.dat` (for\nbase64-encoding). Note that absolute paths will begin with `@file://` or\n`@data://`, followed by a third `/` (for example, `@file:///tmp/file.txt`).\n\n~~~bash\nhyperspell --arg @data://file.txt\n~~~\n\n## Linking different Go SDK versions\n\nYou can link the CLI against a different version of the Hyperspell Go SDK\nfor development purposes using the `./scripts/link` script.\n\nTo link to a specific version from a repository (version can be a branch,\ngit tag, or commit hash):\n\n~~~bash\n./scripts/link github.com/org/repo@version\n~~~\n\nTo link to a local copy of the SDK:\n\n~~~bash\n./scripts/link ../path/to/hyperspell-go\n~~~\n\nIf you run the link script without any arguments, it will default to `../hyperspell-go`.\n", + '# Hyperspell Python API library\n\n\n[![PyPI version](https://img.shields.io/pypi/v/hyperspell.svg?label=pypi%20(stable))](https://pypi.org/project/hyperspell/)\n\nThe Hyperspell Python library provides convenient access to the Hyperspell REST API from any Python 3.9+\napplication. The library includes type definitions for all request params and response fields,\nand offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).\n\n\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Hyperspell MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=%40hyperspell%2Fhyperspell-mcp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YtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40hyperspell%2Fhyperspell-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40hyperspell%2Fhyperspell-mcp%22%5D%2C%22env%22%3A%7B%22HYPERSPELL_API_KEY%22%3A%22My%20API%20Key%22%2C%22HYPERSPELL_USER_ID%22%3A%22My%20User%20ID%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Documentation\n\nThe REST API documentation can be found on [docs.hyperspell.com](https://docs.hyperspell.com/). The full API of this library can be found in [api.md](api.md).\n\n## Installation\n\n```sh\n# install from PyPI\npip install hyperspell\n```\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n```python\nimport os\nfrom hyperspell import Hyperspell\n\nclient = Hyperspell(\n user_id="My User ID",\n api_key=os.environ.get("HYPERSPELL_API_KEY"), # This is the default and can be omitted\n)\n\nmemory_status = client.memories.add(\n text="...",\n)\nprint(memory_status.resource_id)\n```\n\nWhile you can provide an `api_key` keyword argument,\nwe recommend using [python-dotenv](https://pypi.org/project/python-dotenv/)\nto add `HYPERSPELL_API_KEY="My API Key"` to your `.env` file\nso that your API Key is not stored in source control.\n\n## Async usage\n\nSimply import `AsyncHyperspell` instead of `Hyperspell` and use `await` with each API call:\n\n```python\nimport os\nimport asyncio\nfrom hyperspell import AsyncHyperspell\n\nclient = AsyncHyperspell(\n user_id="My User ID",\n api_key=os.environ.get("HYPERSPELL_API_KEY"), # This is the default and can be omitted\n)\n\nasync def main() -> None:\n memory_status = await client.memories.add(\n text="...",\n )\n print(memory_status.resource_id)\n\nasyncio.run(main())\n```\n\nFunctionality between the synchronous and asynchronous clients is otherwise identical.\n\n### With aiohttp\n\nBy default, the async client uses `httpx` for HTTP requests. However, for improved concurrency performance you may also use `aiohttp` as the HTTP backend.\n\nYou can enable this by installing `aiohttp`:\n\n```sh\n# install from PyPI\npip install hyperspell[aiohttp]\n```\n\nThen you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:\n\n```python\nimport os\nimport asyncio\nfrom hyperspell import DefaultAioHttpClient\nfrom hyperspell import AsyncHyperspell\n\nasync def main() -> None:\n async with AsyncHyperspell(\n user_id="My User ID",\n api_key=os.environ.get("HYPERSPELL_API_KEY"), # This is the default and can be omitted\n http_client=DefaultAioHttpClient(),\n) as client:\n memory_status = await client.memories.add(\n text="...",\n )\n print(memory_status.resource_id)\n\nasyncio.run(main())\n```\n\n\n\n## Using types\n\nNested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev) which also provide helper methods for things like:\n\n- Serializing back into JSON, `model.to_json()`\n- Converting to a dictionary, `model.to_dict()`\n\nTyped requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`.\n\n## Pagination\n\nList methods in the Hyperspell API are paginated.\n\nThis library provides auto-paginating iterators with each list response, so you do not have to request successive pages manually:\n\n```python\nfrom hyperspell import Hyperspell\n\nclient = Hyperspell(\n user_id="My User ID",\n)\n\nall_context_documents = []\n# Automatically fetches more pages as needed.\nfor context_document in client.context_documents.list():\n # Do something with context_document here\n all_context_documents.append(context_document)\nprint(all_context_documents)\n```\n\nOr, asynchronously:\n\n```python\nimport asyncio\nfrom hyperspell import AsyncHyperspell\n\nclient = AsyncHyperspell(\n user_id="My User ID",\n)\n\nasync def main() -> None:\n all_context_documents = []\n # Iterate through items across all pages, issuing requests as needed.\n async for context_document in client.context_documents.list():\n all_context_documents.append(context_document)\n print(all_context_documents)\n\nasyncio.run(main())\n```\n\nAlternatively, you can use the `.has_next_page()`, `.next_page_info()`, or `.get_next_page()` methods for more granular control working with pages:\n\n```python\nfirst_page = await client.context_documents.list()\nif first_page.has_next_page():\n print(f"will fetch next page using these details: {first_page.next_page_info()}")\n next_page = await first_page.get_next_page()\n print(f"number of items we just fetched: {len(next_page.documents)}")\n\n# Remove `await` for non-async usage.\n```\n\nOr just work directly with the returned data:\n\n```python\nfirst_page = await client.context_documents.list()\n\nprint(f"next page cursor: {first_page.next_cursor}") # => "next page cursor: ..."\nfor context_document in first_page.documents:\n print(context_document.document_id)\n\n# Remove `await` for non-async usage.\n```\n\n## Nested params\n\nNested parameters are dictionaries, typed using `TypedDict`, for example:\n\n```python\nfrom hyperspell import Hyperspell\n\nclient = Hyperspell(\n user_id="My User ID",\n)\n\nconfig = client.context_documents.config.update(\n structure={},\n)\nprint(config.structure)\n```\n\n## File uploads\n\nRequest parameters that correspond to file uploads can be passed as `bytes`, or a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance or a tuple of `(filename, contents, media type)`.\n\n```python\nfrom pathlib import Path\nfrom hyperspell import Hyperspell\n\nclient = Hyperspell(\n user_id="My User ID",\n)\n\nclient.memories.upload(\n file=Path("/path/to/file"),\n)\n```\n\nThe async client uses the exact same interface. If you pass a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance, the file contents will be read asynchronously automatically.\n\n## Handling errors\n\nWhen the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `hyperspell.APIConnectionError` is raised.\n\nWhen the API returns a non-success status code (that is, 4xx or 5xx\nresponse), a subclass of `hyperspell.APIStatusError` is raised, containing `status_code` and `response` properties.\n\nAll errors inherit from `hyperspell.APIError`.\n\n```python\nimport hyperspell\nfrom hyperspell import Hyperspell\n\nclient = Hyperspell(\n user_id="My User ID",\n)\n\ntry:\n client.memories.add(\n text="...",\n )\nexcept hyperspell.APIConnectionError as e:\n print("The server could not be reached")\n print(e.__cause__) # an underlying Exception, likely raised within httpx.\nexcept hyperspell.RateLimitError as e:\n print("A 429 status code was received; we should back off a bit.")\nexcept hyperspell.APIStatusError as e:\n print("Another non-200-range status code was received")\n print(e.status_code)\n print(e.response)\n```\n\nError codes are as follows:\n\n| Status Code | Error Type |\n| ----------- | -------------------------- |\n| 400 | `BadRequestError` |\n| 401 | `AuthenticationError` |\n| 403 | `PermissionDeniedError` |\n| 404 | `NotFoundError` |\n| 422 | `UnprocessableEntityError` |\n| 429 | `RateLimitError` |\n| >=500 | `InternalServerError` |\n| N/A | `APIConnectionError` |\n\n### Retries\n\nCertain errors are automatically retried 2 times by default, with a short exponential backoff.\nConnection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,\n429 Rate Limit, and >=500 Internal errors are all retried by default.\n\nYou can use the `max_retries` option to configure or disable retry settings:\n\n```python\nfrom hyperspell import Hyperspell\n\n# Configure the default for all requests:\nclient = Hyperspell(\n user_id="My User ID",\n # default is 2\n max_retries=0,\n)\n\n# Or, configure per-request:\nclient.with_options(max_retries = 5).memories.add(\n text="...",\n)\n```\n\n### Timeouts\n\nBy default requests time out after 1 minute. You can configure this with a `timeout` option,\nwhich accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object:\n\n```python\nfrom hyperspell import Hyperspell\n\n# Configure the default for all requests:\nclient = Hyperspell(\n user_id="My User ID",\n # 20 seconds (default is 1 minute)\n timeout=20.0,\n)\n\n# More granular control:\nclient = Hyperspell(\n user_id="My User ID",\n timeout=httpx.Timeout(60.0, read=5.0, write=10.0, connect=2.0),\n)\n\n# Override per-request:\nclient.with_options(timeout = 5.0).memories.add(\n text="...",\n)\n```\n\nOn timeout, an `APITimeoutError` is thrown.\n\nNote that requests that time out are [retried twice by default](#retries).\n\n\n\n## Advanced\n\n### Logging\n\nWe use the standard library [`logging`](https://docs.python.org/3/library/logging.html) module.\n\nYou can enable logging by setting the environment variable `HYPERSPELL_LOG` to `info`.\n\n```shell\n$ export HYPERSPELL_LOG=info\n```\n\nOr to `debug` for more verbose logging.\n\n### How to tell whether `None` means `null` or missing\n\nIn an API response, a field may be explicitly `null`, or missing entirely; in either case, its value is `None` in this library. You can differentiate the two cases with `.model_fields_set`:\n\n```py\nif response.my_field is None:\n if \'my_field\' not in response.model_fields_set:\n print(\'Got json like {}, without a "my_field" key present at all.\')\n else:\n print(\'Got json like {"my_field": null}.\')\n```\n\n### Accessing raw response data (e.g. headers)\n\nThe "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,\n\n```py\nfrom hyperspell import Hyperspell\n\nclient = Hyperspell(\n user_id="My User ID",\n)\nresponse = client.memories.with_raw_response.add(\n text="...",\n)\nprint(response.headers.get(\'X-My-Header\'))\n\nmemory = response.parse() # get the object that `memories.add()` would have returned\nprint(memory.resource_id)\n```\n\nThese methods return an [`APIResponse`](https://github.com/hyperspell/python-sdk/tree/main/src/hyperspell/_response.py) object.\n\nThe async client returns an [`AsyncAPIResponse`](https://github.com/hyperspell/python-sdk/tree/main/src/hyperspell/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.\n\n#### `.with_streaming_response`\n\nThe above interface eagerly reads the full response body when you make the request, which may not always be what you want.\n\nTo stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.\n\n```python\nwith client.memories.with_streaming_response.add(\n text="...",\n) as response :\n print(response.headers.get(\'X-My-Header\'))\n\n for line in response.iter_lines():\n print(line)\n```\n\nThe context manager is required so that the response will reliably be closed.\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API.\n\nIf you need to access undocumented endpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can make requests using `client.get`, `client.post`, and other\nhttp verbs. Options on the client will be respected (such as retries) when making this request.\n\n```py\nimport httpx\n\nresponse = client.post(\n "/foo",\n cast_to=httpx.Response,\n body={"my_param": True},\n)\n\nprint(response.headers.get("x-foo"))\n```\n\n#### Undocumented request params\n\nIf you want to explicitly send an extra param, you can do so with the `extra_query`, `extra_body`, and `extra_headers` request\noptions.\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you can access the extra fields like `response.unknown_prop`. You\ncan also get all the extra fields on the Pydantic model as a dict with\n[`response.model_extra`](https://docs.pydantic.dev/latest/api/base_model/#pydantic.BaseModel.model_extra).\n\n### Configuring the HTTP client\n\nYou can directly override the [httpx client](https://www.python-httpx.org/api/#client) to customize it for your use case, including:\n\n- Support for [proxies](https://www.python-httpx.org/advanced/proxies/)\n- Custom [transports](https://www.python-httpx.org/advanced/transports/)\n- Additional [advanced](https://www.python-httpx.org/advanced/clients/) functionality\n\n```python\nimport httpx\nfrom hyperspell import Hyperspell, DefaultHttpxClient\n\nclient = Hyperspell(\n user_id="My User ID",\n # Or use the `HYPERSPELL_BASE_URL` env var\n base_url="http://my.test.server.example.com:8083",\n http_client=DefaultHttpxClient(proxy="http://my.test.proxy.example.com", transport=httpx.HTTPTransport(local_address="0.0.0.0")),\n)\n```\n\nYou can also customize the client on a per-request basis by using `with_options()`:\n\n```python\nclient.with_options(http_client=DefaultHttpxClient(...))\n```\n\n### Managing HTTP resources\n\nBy default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.\n\n```py\nfrom hyperspell import Hyperspell\n\nwith Hyperspell(\n user_id="My User ID",\n) as client:\n # make requests here\n ...\n\n# HTTP client is now closed\n```\n\n## Versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes that only affect static types, without breaking runtime behavior.\n2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n3. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/hyperspell/python-sdk/issues) with questions, bugs, or suggestions.\n\n### Determining the installed version\n\nIf you\'ve upgraded to the latest version but aren\'t seeing any new features you were expecting then your python environment is likely still using an older version.\n\nYou can determine the version that is being used at runtime with:\n\n```py\nimport hyperspell\nprint(hyperspell.__version__)\n```\n\n## Requirements\n\nPython 3.9 or higher.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n', }, { - language: 'python', + language: 'typescript', content: - '# Hyperspell Python API library\n\n\n[![PyPI version](https://img.shields.io/pypi/v/hyperspell.svg?label=pypi%20(stable))](https://pypi.org/project/hyperspell/)\n\nThe Hyperspell Python library provides convenient access to the Hyperspell REST API from any Python 3.9+\napplication. The library includes type definitions for all request params and response fields,\nand offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).\n\n\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Hyperspell MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=%40hyperspell%2Fhyperspell-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBoeXBlcnNwZWxsL2h5cGVyc3BlbGwtbWNwIl0sImVudiI6eyJIWVBFUlNQRUxMX0FQSV9LRVkiOiJNeSBBUEkgS2V5IiwiSFlQRVJTUEVMTF9VU0VSX0lEIjoiTXkgVXNlciBJRCJ9fQ)\n[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40hyperspell%2Fhyperspell-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40hyperspell%2Fhyperspell-mcp%22%5D%2C%22env%22%3A%7B%22HYPERSPELL_API_KEY%22%3A%22My%20API%20Key%22%2C%22HYPERSPELL_USER_ID%22%3A%22My%20User%20ID%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Documentation\n\nThe REST API documentation can be found on [docs.hyperspell.com](https://docs.hyperspell.com/). The full API of this library can be found in [api.md](api.md).\n\n## Installation\n\n```sh\n# install from PyPI\npip install hyperspell\n```\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n```python\nimport os\nfrom hyperspell import Hyperspell\n\nclient = Hyperspell(\n api_key=os.environ.get("HYPERSPELL_API_KEY"), # This is the default and can be omitted\n)\n\nmemory_status = client.memories.add(\n text="...",\n)\nprint(memory_status.resource_id)\n```\n\nWhile you can provide an `api_key` keyword argument,\nwe recommend using [python-dotenv](https://pypi.org/project/python-dotenv/)\nto add `HYPERSPELL_API_KEY="My API Key"` to your `.env` file\nso that your API Key is not stored in source control.\n\n## Async usage\n\nSimply import `AsyncHyperspell` instead of `Hyperspell` and use `await` with each API call:\n\n```python\nimport os\nimport asyncio\nfrom hyperspell import AsyncHyperspell\n\nclient = AsyncHyperspell(\n api_key=os.environ.get("HYPERSPELL_API_KEY"), # This is the default and can be omitted\n)\n\nasync def main() -> None:\n memory_status = await client.memories.add(\n text="...",\n )\n print(memory_status.resource_id)\n\nasyncio.run(main())\n```\n\nFunctionality between the synchronous and asynchronous clients is otherwise identical.\n\n### With aiohttp\n\nBy default, the async client uses `httpx` for HTTP requests. However, for improved concurrency performance you may also use `aiohttp` as the HTTP backend.\n\nYou can enable this by installing `aiohttp`:\n\n```sh\n# install from PyPI\npip install hyperspell[aiohttp]\n```\n\nThen you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:\n\n```python\nimport os\nimport asyncio\nfrom hyperspell import DefaultAioHttpClient\nfrom hyperspell import AsyncHyperspell\n\nasync def main() -> None:\n async with AsyncHyperspell(\n api_key=os.environ.get("HYPERSPELL_API_KEY"), # This is the default and can be omitted\n http_client=DefaultAioHttpClient(),\n) as client:\n memory_status = await client.memories.add(\n text="...",\n )\n print(memory_status.resource_id)\n\nasyncio.run(main())\n```\n\n\n\n## Using types\n\nNested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev) which also provide helper methods for things like:\n\n- Serializing back into JSON, `model.to_json()`\n- Converting to a dictionary, `model.to_dict()`\n\nTyped requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`.\n\n## Pagination\n\nList methods in the Hyperspell API are paginated.\n\nThis library provides auto-paginating iterators with each list response, so you do not have to request successive pages manually:\n\n```python\nfrom hyperspell import Hyperspell\n\nclient = Hyperspell()\n\nall_memories = []\n# Automatically fetches more pages as needed.\nfor memory in client.memories.list():\n # Do something with memory here\n all_memories.append(memory)\nprint(all_memories)\n```\n\nOr, asynchronously:\n\n```python\nimport asyncio\nfrom hyperspell import AsyncHyperspell\n\nclient = AsyncHyperspell()\n\nasync def main() -> None:\n all_memories = []\n # Iterate through items across all pages, issuing requests as needed.\n async for memory in client.memories.list():\n all_memories.append(memory)\n print(all_memories)\n\nasyncio.run(main())\n```\n\nAlternatively, you can use the `.has_next_page()`, `.next_page_info()`, or `.get_next_page()` methods for more granular control working with pages:\n\n```python\nfirst_page = await client.memories.list()\nif first_page.has_next_page():\n print(f"will fetch next page using these details: {first_page.next_page_info()}")\n next_page = await first_page.get_next_page()\n print(f"number of items we just fetched: {len(next_page.items)}")\n\n# Remove `await` for non-async usage.\n```\n\nOr just work directly with the returned data:\n\n```python\nfirst_page = await client.memories.list()\n\nprint(f"next page cursor: {first_page.next_cursor}") # => "next page cursor: ..."\nfor memory in first_page.items:\n print(memory.resource_id)\n\n# Remove `await` for non-async usage.\n```\n\n## Nested params\n\nNested parameters are dictionaries, typed using `TypedDict`, for example:\n\n```python\nfrom hyperspell import Hyperspell\n\nclient = Hyperspell()\n\nquery_result = client.memories.search(\n query="What does Hyperspell do?",\n options={\n "filter": {}\n },\n)\nprint(query_result.options)\n```\n\n## File uploads\n\nRequest parameters that correspond to file uploads can be passed as `bytes`, or a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance or a tuple of `(filename, contents, media type)`.\n\n```python\nfrom pathlib import Path\nfrom hyperspell import Hyperspell\n\nclient = Hyperspell()\n\nclient.memories.upload(\n file=Path("/path/to/file"),\n)\n```\n\nThe async client uses the exact same interface. If you pass a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance, the file contents will be read asynchronously automatically.\n\n## Handling errors\n\nWhen the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `hyperspell.APIConnectionError` is raised.\n\nWhen the API returns a non-success status code (that is, 4xx or 5xx\nresponse), a subclass of `hyperspell.APIStatusError` is raised, containing `status_code` and `response` properties.\n\nAll errors inherit from `hyperspell.APIError`.\n\n```python\nimport hyperspell\nfrom hyperspell import Hyperspell\n\nclient = Hyperspell()\n\ntry:\n client.memories.add(\n text="...",\n )\nexcept hyperspell.APIConnectionError as e:\n print("The server could not be reached")\n print(e.__cause__) # an underlying Exception, likely raised within httpx.\nexcept hyperspell.RateLimitError as e:\n print("A 429 status code was received; we should back off a bit.")\nexcept hyperspell.APIStatusError as e:\n print("Another non-200-range status code was received")\n print(e.status_code)\n print(e.response)\n```\n\nError codes are as follows:\n\n| Status Code | Error Type |\n| ----------- | -------------------------- |\n| 400 | `BadRequestError` |\n| 401 | `AuthenticationError` |\n| 403 | `PermissionDeniedError` |\n| 404 | `NotFoundError` |\n| 422 | `UnprocessableEntityError` |\n| 429 | `RateLimitError` |\n| >=500 | `InternalServerError` |\n| N/A | `APIConnectionError` |\n\n### Retries\n\nCertain errors are automatically retried 2 times by default, with a short exponential backoff.\nConnection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,\n429 Rate Limit, and >=500 Internal errors are all retried by default.\n\nYou can use the `max_retries` option to configure or disable retry settings:\n\n```python\nfrom hyperspell import Hyperspell\n\n# Configure the default for all requests:\nclient = Hyperspell(\n # default is 2\n max_retries=0,\n)\n\n# Or, configure per-request:\nclient.with_options(max_retries = 5).memories.add(\n text="...",\n)\n```\n\n### Timeouts\n\nBy default requests time out after 1 minute. You can configure this with a `timeout` option,\nwhich accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object:\n\n```python\nfrom hyperspell import Hyperspell\n\n# Configure the default for all requests:\nclient = Hyperspell(\n # 20 seconds (default is 1 minute)\n timeout=20.0,\n)\n\n# More granular control:\nclient = Hyperspell(\n timeout=httpx.Timeout(60.0, read=5.0, write=10.0, connect=2.0),\n)\n\n# Override per-request:\nclient.with_options(timeout = 5.0).memories.add(\n text="...",\n)\n```\n\nOn timeout, an `APITimeoutError` is thrown.\n\nNote that requests that time out are [retried twice by default](#retries).\n\n\n\n## Advanced\n\n### Logging\n\nWe use the standard library [`logging`](https://docs.python.org/3/library/logging.html) module.\n\nYou can enable logging by setting the environment variable `HYPERSPELL_LOG` to `info`.\n\n```shell\n$ export HYPERSPELL_LOG=info\n```\n\nOr to `debug` for more verbose logging.\n\n### How to tell whether `None` means `null` or missing\n\nIn an API response, a field may be explicitly `null`, or missing entirely; in either case, its value is `None` in this library. You can differentiate the two cases with `.model_fields_set`:\n\n```py\nif response.my_field is None:\n if \'my_field\' not in response.model_fields_set:\n print(\'Got json like {}, without a "my_field" key present at all.\')\n else:\n print(\'Got json like {"my_field": null}.\')\n```\n\n### Accessing raw response data (e.g. headers)\n\nThe "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,\n\n```py\nfrom hyperspell import Hyperspell\n\nclient = Hyperspell()\nresponse = client.memories.with_raw_response.add(\n text="...",\n)\nprint(response.headers.get(\'X-My-Header\'))\n\nmemory = response.parse() # get the object that `memories.add()` would have returned\nprint(memory.resource_id)\n```\n\nThese methods return an [`APIResponse`](https://github.com/hyperspell/python-sdk/tree/main/src/hyperspell/_response.py) object.\n\nThe async client returns an [`AsyncAPIResponse`](https://github.com/hyperspell/python-sdk/tree/main/src/hyperspell/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.\n\n#### `.with_streaming_response`\n\nThe above interface eagerly reads the full response body when you make the request, which may not always be what you want.\n\nTo stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.\n\n```python\nwith client.memories.with_streaming_response.add(\n text="...",\n) as response :\n print(response.headers.get(\'X-My-Header\'))\n\n for line in response.iter_lines():\n print(line)\n```\n\nThe context manager is required so that the response will reliably be closed.\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API.\n\nIf you need to access undocumented endpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can make requests using `client.get`, `client.post`, and other\nhttp verbs. Options on the client will be respected (such as retries) when making this request.\n\n```py\nimport httpx\n\nresponse = client.post(\n "/foo",\n cast_to=httpx.Response,\n body={"my_param": True},\n)\n\nprint(response.headers.get("x-foo"))\n```\n\n#### Undocumented request params\n\nIf you want to explicitly send an extra param, you can do so with the `extra_query`, `extra_body`, and `extra_headers` request\noptions.\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you can access the extra fields like `response.unknown_prop`. You\ncan also get all the extra fields on the Pydantic model as a dict with\n[`response.model_extra`](https://docs.pydantic.dev/latest/api/base_model/#pydantic.BaseModel.model_extra).\n\n### Configuring the HTTP client\n\nYou can directly override the [httpx client](https://www.python-httpx.org/api/#client) to customize it for your use case, including:\n\n- Support for [proxies](https://www.python-httpx.org/advanced/proxies/)\n- Custom [transports](https://www.python-httpx.org/advanced/transports/)\n- Additional [advanced](https://www.python-httpx.org/advanced/clients/) functionality\n\n```python\nimport httpx\nfrom hyperspell import Hyperspell, DefaultHttpxClient\n\nclient = Hyperspell(\n # Or use the `HYPERSPELL_BASE_URL` env var\n base_url="http://my.test.server.example.com:8083",\n http_client=DefaultHttpxClient(proxy="http://my.test.proxy.example.com", transport=httpx.HTTPTransport(local_address="0.0.0.0")),\n)\n```\n\nYou can also customize the client on a per-request basis by using `with_options()`:\n\n```python\nclient.with_options(http_client=DefaultHttpxClient(...))\n```\n\n### Managing HTTP resources\n\nBy default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.\n\n```py\nfrom hyperspell import Hyperspell\n\nwith Hyperspell() as client:\n # make requests here\n ...\n\n# HTTP client is now closed\n```\n\n## Versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes that only affect static types, without breaking runtime behavior.\n2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n3. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/hyperspell/python-sdk/issues) with questions, bugs, or suggestions.\n\n### Determining the installed version\n\nIf you\'ve upgraded to the latest version but aren\'t seeing any new features you were expecting then your python environment is likely still using an older version.\n\nYou can determine the version that is being used at runtime with:\n\n```py\nimport hyperspell\nprint(hyperspell.__version__)\n```\n\n## Requirements\n\nPython 3.9 or higher.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n', + "# Hyperspell TypeScript API Library\n\n[![NPM version](https://img.shields.io/npm/v/@hyperspell/hyperspell.svg?label=npm%20(stable))](https://npmjs.org/package/@hyperspell/hyperspell) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/@hyperspell/hyperspell)\n\nThis library provides convenient access to the Hyperspell REST API from server-side TypeScript or JavaScript.\n\n\n\nThe REST API documentation can be found on [docs.hyperspell.com](https://docs.hyperspell.com/). The full API of this library can be found in [api.md](api.md).\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Hyperspell MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=%40hyperspell%2Fhyperspell-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBoeXBlcnNwZWxsL2h5cGVyc3BlbGwtbWNwIl0sImVudiI6eyJIWVBFUlNQRUxMX0F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40hyperspell%2Fhyperspell-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40hyperspell%2Fhyperspell-mcp%22%5D%2C%22env%22%3A%7B%22HYPERSPELL_API_KEY%22%3A%22My%20API%20Key%22%2C%22HYPERSPELL_USER_ID%22%3A%22My%20User%20ID%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Installation\n\n```sh\nnpm install @hyperspell/hyperspell\n```\n\n\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n\n```js\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n userID: 'My User ID',\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst memoryStatus = await client.memories.add({ text: '...' });\n\nconsole.log(memoryStatus.resource_id);\n```\n\n\n\n### Request & Response types\n\nThis library includes TypeScript definitions for all request params and response fields. You may import and use them like so:\n\n\n```ts\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n userID: 'My User ID',\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst params: Hyperspell.MemoryAddParams = { text: '...' };\nconst memoryStatus: Hyperspell.MemoryStatus = await client.memories.add(params);\n```\n\nDocumentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.\n\n## File uploads\n\nRequest parameters that correspond to file uploads can be passed in many different forms:\n- `File` (or an object with the same structure)\n- a `fetch` `Response` (or an object with the same structure)\n- an `fs.ReadStream`\n- the return value of our `toFile` helper\n\n```ts\nimport fs from 'fs';\nimport Hyperspell, { toFile } from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell();\n\n// If you have access to Node `fs` we recommend using `fs.createReadStream()`:\nawait client.memories.upload({ file: fs.createReadStream('/path/to/file') });\n\n// Or if you have the web `File` API you can pass a `File` instance:\nawait client.memories.upload({ file: new File(['my bytes'], 'file') });\n\n// You can also pass a `fetch` `Response`:\nawait client.memories.upload({ file: await fetch('https://somesite/file') });\n\n// Finally, if none of the above are convenient, you can use our `toFile` helper:\nawait client.memories.upload({ file: await toFile(Buffer.from('my bytes'), 'file') });\nawait client.memories.upload({ file: await toFile(new Uint8Array([0, 1, 2]), 'file') });\n```\n\n\n\n## Handling errors\n\nWhen the library is unable to connect to the API,\nor if the API returns a non-success status code (i.e., 4xx or 5xx response),\na subclass of `APIError` will be thrown:\n\n\n```ts\nconst memoryStatus = await client.memories.add({ text: '...' }).catch(async (err) => {\n if (err instanceof Hyperspell.APIError) {\n console.log(err.status); // 400\n console.log(err.name); // BadRequestError\n console.log(err.headers); // {server: 'nginx', ...}\n } else {\n throw err;\n }\n});\n```\n\nError codes are as follows:\n\n| Status Code | Error Type |\n| ----------- | -------------------------- |\n| 400 | `BadRequestError` |\n| 401 | `AuthenticationError` |\n| 403 | `PermissionDeniedError` |\n| 404 | `NotFoundError` |\n| 422 | `UnprocessableEntityError` |\n| 429 | `RateLimitError` |\n| >=500 | `InternalServerError` |\n| N/A | `APIConnectionError` |\n\n### Retries\n\nCertain errors will be automatically retried 2 times by default, with a short exponential backoff.\nConnection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,\n429 Rate Limit, and >=500 Internal errors will all be retried by default.\n\nYou can use the `maxRetries` option to configure or disable this:\n\n\n```js\n// Configure the default for all requests:\nconst client = new Hyperspell({\n userID: 'My User ID',\n maxRetries: 0, // default is 2\n});\n\n// Or, configure per-request:\nawait client.memories.add({ text: '...' }, {\n maxRetries: 5,\n});\n```\n\n### Timeouts\n\nRequests time out after 1 minute by default. You can configure this with a `timeout` option:\n\n\n```ts\n// Configure the default for all requests:\nconst client = new Hyperspell({\n userID: 'My User ID',\n timeout: 20 * 1000, // 20 seconds (default is 1 minute)\n});\n\n// Override per-request:\nawait client.memories.add({ text: '...' }, {\n timeout: 5 * 1000,\n});\n```\n\nOn timeout, an `APIConnectionTimeoutError` is thrown.\n\nNote that requests which time out will be [retried twice by default](#retries).\n\n## Auto-pagination\n\nList methods in the Hyperspell API are paginated.\nYou can use the `for await … of` syntax to iterate through items across all pages:\n\n```ts\nasync function fetchAllContextDocumentListResponses(params) {\n const allContextDocumentListResponses = [];\n // Automatically fetches more pages as needed.\n for await (const contextDocumentListResponse of client.contextDocuments.list()) {\n allContextDocumentListResponses.push(contextDocumentListResponse);\n }\n return allContextDocumentListResponses;\n}\n```\n\nAlternatively, you can request a single page at a time:\n\n```ts\nlet page = await client.contextDocuments.list();\nfor (const contextDocumentListResponse of page.documents) {\n console.log(contextDocumentListResponse);\n}\n\n// Convenience methods are provided for manually paginating:\nwhile (page.hasNextPage()) {\n page = await page.getNextPage();\n // ...\n}\n```\n\n\n\n## Advanced Usage\n\n### Accessing raw Response data (e.g., headers)\n\nThe \"raw\" `Response` returned by `fetch()` can be accessed through the `.asResponse()` method on the `APIPromise` type that all methods return.\nThis method returns as soon as the headers for a successful response are received and does not consume the response body, so you are free to write custom parsing or streaming logic.\n\nYou can also use the `.withResponse()` method to get the raw `Response` along with the parsed data.\nUnlike `.asResponse()` this method consumes the body, returning once it is parsed.\n\n\n```ts\nconst client = new Hyperspell();\n\nconst response = await client.memories.add({ text: '...' }).asResponse();\nconsole.log(response.headers.get('X-My-Header'));\nconsole.log(response.statusText); // access the underlying Response object\n\nconst { data: memoryStatus, response: raw } = await client.memories\n .add({ text: '...' })\n .withResponse();\nconsole.log(raw.headers.get('X-My-Header'));\nconsole.log(memoryStatus.resource_id);\n```\n\n### Logging\n\n> [!IMPORTANT]\n> All log messages are intended for debugging only. The format and content of log messages\n> may change between releases.\n\n#### Log levels\n\nThe log level can be configured in two ways:\n\n1. Via the `HYPERSPELL_LOG` environment variable\n2. Using the `logLevel` client option (overrides the environment variable if set)\n\n```ts\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n logLevel: 'debug', // Show all log messages\n});\n```\n\nAvailable log levels, from most to least verbose:\n\n- `'debug'` - Show debug messages, info, warnings, and errors\n- `'info'` - Show info messages, warnings, and errors\n- `'warn'` - Show warnings and errors (default)\n- `'error'` - Show only errors\n- `'off'` - Disable all logging\n\nAt the `'debug'` level, all HTTP requests and responses are logged, including headers and bodies.\nSome authentication-related headers are redacted, but sensitive data in request and response bodies\nmay still be visible.\n\n#### Custom logger\n\nBy default, this library logs to `globalThis.console`. You can also provide a custom logger.\nMost logging libraries are supported, including [pino](https://www.npmjs.com/package/pino), [winston](https://www.npmjs.com/package/winston), [bunyan](https://www.npmjs.com/package/bunyan), [consola](https://www.npmjs.com/package/consola), [signale](https://www.npmjs.com/package/signale), and [@std/log](https://jsr.io/@std/log). If your logger doesn't work, please open an issue.\n\nWhen providing a custom logger, the `logLevel` option still controls which messages are emitted, messages\nbelow the configured level will not be sent to your logger.\n\n```ts\nimport Hyperspell from '@hyperspell/hyperspell';\nimport pino from 'pino';\n\nconst logger = pino();\n\nconst client = new Hyperspell({\n logger: logger.child({ name: 'Hyperspell' }),\n logLevel: 'debug', // Send all messages to pino, allowing it to filter\n});\n```\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API. If you need to access undocumented\nendpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can use `client.get`, `client.post`, and other HTTP verbs.\nOptions on the client, such as retries, will be respected when making these requests.\n\n```ts\nawait client.post('/some/path', {\n body: { some_prop: 'foo' },\n query: { some_query_arg: 'bar' },\n});\n```\n\n#### Undocumented request params\n\nTo make requests using undocumented parameters, you may use `// @ts-expect-error` on the undocumented\nparameter. This library doesn't validate at runtime that the request matches the type, so any extra values you\nsend will be sent as-is.\n\n```ts\nclient.memories.add({\n // ...\n // @ts-expect-error baz is not yet public\n baz: 'undocumented option',\n});\n```\n\nFor requests with the `GET` verb, any extra params will be in the query, all other requests will send the\nextra param in the body.\n\nIf you want to explicitly send an extra argument, you can do so with the `query`, `body`, and `headers` request\noptions.\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you may access the response object with `// @ts-expect-error` on\nthe response object, or cast the response object to the requisite type. Like the request params, we do not\nvalidate or strip extra properties from the response from the API.\n\n### Customizing the fetch client\n\nBy default, this library expects a global `fetch` function is defined.\n\nIf you want to use a different `fetch` function, you can either polyfill the global:\n\n```ts\nimport fetch from 'my-fetch';\n\nglobalThis.fetch = fetch;\n```\n\nOr pass it to the client:\n\n```ts\nimport Hyperspell from '@hyperspell/hyperspell';\nimport fetch from 'my-fetch';\n\nconst client = new Hyperspell({ fetch });\n```\n\n### Fetch options\n\nIf you want to set custom `fetch` options without overriding the `fetch` function, you can provide a `fetchOptions` object when instantiating the client or making a request. (Request-specific options override client options.)\n\n```ts\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n fetchOptions: {\n // `RequestInit` options\n },\n});\n```\n\n#### Configuring proxies\n\nTo modify proxy behavior, you can provide custom `fetchOptions` that add runtime-specific proxy\noptions to requests:\n\n **Node** [[docs](https://github.com/nodejs/undici/blob/main/docs/docs/api/ProxyAgent.md#example---proxyagent-with-fetch)]\n\n```ts\nimport Hyperspell from '@hyperspell/hyperspell';\nimport * as undici from 'undici';\n\nconst proxyAgent = new undici.ProxyAgent('http://localhost:8888');\nconst client = new Hyperspell({\n fetchOptions: {\n dispatcher: proxyAgent,\n },\n});\n```\n\n **Bun** [[docs](https://bun.sh/guides/http/proxy)]\n\n```ts\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n fetchOptions: {\n proxy: 'http://localhost:8888',\n },\n});\n```\n\n **Deno** [[docs](https://docs.deno.com/api/deno/~/Deno.createHttpClient)]\n\n```ts\nimport Hyperspell from 'npm:@hyperspell/hyperspell';\n\nconst httpClient = Deno.createHttpClient({ proxy: { url: 'http://localhost:8888' } });\nconst client = new Hyperspell({\n fetchOptions: {\n client: httpClient,\n },\n});\n```\n\n## Frequently Asked Questions\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes that only affect static types, without breaking runtime behavior.\n2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n3. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/hyperspell/node-sdk/issues) with questions, bugs, or suggestions.\n\n## Requirements\n\nTypeScript >= 4.9 is supported.\n\nThe following runtimes are supported:\n\n- Web browsers (Up-to-date Chrome, Firefox, Safari, Edge, and more)\n- Node.js 20 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions.\n- Deno v1.28.0 or higher.\n- Bun 1.0 or later.\n- Cloudflare Workers.\n- Vercel Edge Runtime.\n- Jest 28 or greater with the `\"node\"` environment (`\"jsdom\"` is not supported at this time).\n- Nitro v2.6 or greater.\n\nNote that React Native is not supported at this time.\n\nIf you are interested in other runtime environments, please open or upvote an issue on GitHub.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n", }, { - language: 'typescript', + language: 'cli', content: - "# Hyperspell TypeScript API Library\n\n[![NPM version](https://img.shields.io/npm/v/@hyperspell/hyperspell.svg?label=npm%20(stable))](https://npmjs.org/package/@hyperspell/hyperspell) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/@hyperspell/hyperspell)\n\nThis library provides convenient access to the Hyperspell REST API from server-side TypeScript or JavaScript.\n\n\n\nThe REST API documentation can be found on [docs.hyperspell.com](https://docs.hyperspell.com/). The full API of this library can be found in [api.md](api.md).\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Hyperspell MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=%40hyperspell%2Fhyperspell-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBoeXBlcnNwZ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OC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40hyperspell%2Fhyperspell-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40hyperspell%2Fhyperspell-mcp%22%5D%2C%22env%22%3A%7B%22HYPERSPELL_API_KEY%22%3A%22My%20API%20Key%22%2C%22HYPERSPELL_USER_ID%22%3A%22My%20User%20ID%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Installation\n\n```sh\nnpm install @hyperspell/hyperspell\n```\n\n\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n\n```js\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst memoryStatus = await client.memories.add({ text: '...' });\n\nconsole.log(memoryStatus.resource_id);\n```\n\n\n\n### Request & Response types\n\nThis library includes TypeScript definitions for all request params and response fields. You may import and use them like so:\n\n\n```ts\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst params: Hyperspell.MemoryAddParams = { text: '...' };\nconst memoryStatus: Hyperspell.MemoryStatus = await client.memories.add(params);\n```\n\nDocumentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.\n\n## File uploads\n\nRequest parameters that correspond to file uploads can be passed in many different forms:\n- `File` (or an object with the same structure)\n- a `fetch` `Response` (or an object with the same structure)\n- an `fs.ReadStream`\n- the return value of our `toFile` helper\n\n```ts\nimport fs from 'fs';\nimport Hyperspell, { toFile } from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell();\n\n// If you have access to Node `fs` we recommend using `fs.createReadStream()`:\nawait client.memories.upload({ file: fs.createReadStream('/path/to/file') });\n\n// Or if you have the web `File` API you can pass a `File` instance:\nawait client.memories.upload({ file: new File(['my bytes'], 'file') });\n\n// You can also pass a `fetch` `Response`:\nawait client.memories.upload({ file: await fetch('https://somesite/file') });\n\n// Finally, if none of the above are convenient, you can use our `toFile` helper:\nawait client.memories.upload({ file: await toFile(Buffer.from('my bytes'), 'file') });\nawait client.memories.upload({ file: await toFile(new Uint8Array([0, 1, 2]), 'file') });\n```\n\n\n\n## Handling errors\n\nWhen the library is unable to connect to the API,\nor if the API returns a non-success status code (i.e., 4xx or 5xx response),\na subclass of `APIError` will be thrown:\n\n\n```ts\nconst memoryStatus = await client.memories.add({ text: '...' }).catch(async (err) => {\n if (err instanceof Hyperspell.APIError) {\n console.log(err.status); // 400\n console.log(err.name); // BadRequestError\n console.log(err.headers); // {server: 'nginx', ...}\n } else {\n throw err;\n }\n});\n```\n\nError codes are as follows:\n\n| Status Code | Error Type |\n| ----------- | -------------------------- |\n| 400 | `BadRequestError` |\n| 401 | `AuthenticationError` |\n| 403 | `PermissionDeniedError` |\n| 404 | `NotFoundError` |\n| 422 | `UnprocessableEntityError` |\n| 429 | `RateLimitError` |\n| >=500 | `InternalServerError` |\n| N/A | `APIConnectionError` |\n\n### Retries\n\nCertain errors will be automatically retried 2 times by default, with a short exponential backoff.\nConnection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,\n429 Rate Limit, and >=500 Internal errors will all be retried by default.\n\nYou can use the `maxRetries` option to configure or disable this:\n\n\n```js\n// Configure the default for all requests:\nconst client = new Hyperspell({\n maxRetries: 0, // default is 2\n});\n\n// Or, configure per-request:\nawait client.memories.add({ text: '...' }, {\n maxRetries: 5,\n});\n```\n\n### Timeouts\n\nRequests time out after 1 minute by default. You can configure this with a `timeout` option:\n\n\n```ts\n// Configure the default for all requests:\nconst client = new Hyperspell({\n timeout: 20 * 1000, // 20 seconds (default is 1 minute)\n});\n\n// Override per-request:\nawait client.memories.add({ text: '...' }, {\n timeout: 5 * 1000,\n});\n```\n\nOn timeout, an `APIConnectionTimeoutError` is thrown.\n\nNote that requests which time out will be [retried twice by default](#retries).\n\n## Auto-pagination\n\nList methods in the Hyperspell API are paginated.\nYou can use the `for await … of` syntax to iterate through items across all pages:\n\n```ts\nasync function fetchAllMemoryListResponses(params) {\n const allMemoryListResponses = [];\n // Automatically fetches more pages as needed.\n for await (const memoryListResponse of client.memories.list()) {\n allMemoryListResponses.push(memoryListResponse);\n }\n return allMemoryListResponses;\n}\n```\n\nAlternatively, you can request a single page at a time:\n\n```ts\nlet page = await client.memories.list();\nfor (const memoryListResponse of page.items) {\n console.log(memoryListResponse);\n}\n\n// Convenience methods are provided for manually paginating:\nwhile (page.hasNextPage()) {\n page = await page.getNextPage();\n // ...\n}\n```\n\n\n\n## Advanced Usage\n\n### Accessing raw Response data (e.g., headers)\n\nThe \"raw\" `Response` returned by `fetch()` can be accessed through the `.asResponse()` method on the `APIPromise` type that all methods return.\nThis method returns as soon as the headers for a successful response are received and does not consume the response body, so you are free to write custom parsing or streaming logic.\n\nYou can also use the `.withResponse()` method to get the raw `Response` along with the parsed data.\nUnlike `.asResponse()` this method consumes the body, returning once it is parsed.\n\n\n```ts\nconst client = new Hyperspell();\n\nconst response = await client.memories.add({ text: '...' }).asResponse();\nconsole.log(response.headers.get('X-My-Header'));\nconsole.log(response.statusText); // access the underlying Response object\n\nconst { data: memoryStatus, response: raw } = await client.memories\n .add({ text: '...' })\n .withResponse();\nconsole.log(raw.headers.get('X-My-Header'));\nconsole.log(memoryStatus.resource_id);\n```\n\n### Logging\n\n> [!IMPORTANT]\n> All log messages are intended for debugging only. The format and content of log messages\n> may change between releases.\n\n#### Log levels\n\nThe log level can be configured in two ways:\n\n1. Via the `HYPERSPELL_LOG` environment variable\n2. Using the `logLevel` client option (overrides the environment variable if set)\n\n```ts\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n logLevel: 'debug', // Show all log messages\n});\n```\n\nAvailable log levels, from most to least verbose:\n\n- `'debug'` - Show debug messages, info, warnings, and errors\n- `'info'` - Show info messages, warnings, and errors\n- `'warn'` - Show warnings and errors (default)\n- `'error'` - Show only errors\n- `'off'` - Disable all logging\n\nAt the `'debug'` level, all HTTP requests and responses are logged, including headers and bodies.\nSome authentication-related headers are redacted, but sensitive data in request and response bodies\nmay still be visible.\n\n#### Custom logger\n\nBy default, this library logs to `globalThis.console`. You can also provide a custom logger.\nMost logging libraries are supported, including [pino](https://www.npmjs.com/package/pino), [winston](https://www.npmjs.com/package/winston), [bunyan](https://www.npmjs.com/package/bunyan), [consola](https://www.npmjs.com/package/consola), [signale](https://www.npmjs.com/package/signale), and [@std/log](https://jsr.io/@std/log). If your logger doesn't work, please open an issue.\n\nWhen providing a custom logger, the `logLevel` option still controls which messages are emitted, messages\nbelow the configured level will not be sent to your logger.\n\n```ts\nimport Hyperspell from '@hyperspell/hyperspell';\nimport pino from 'pino';\n\nconst logger = pino();\n\nconst client = new Hyperspell({\n logger: logger.child({ name: 'Hyperspell' }),\n logLevel: 'debug', // Send all messages to pino, allowing it to filter\n});\n```\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API. If you need to access undocumented\nendpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can use `client.get`, `client.post`, and other HTTP verbs.\nOptions on the client, such as retries, will be respected when making these requests.\n\n```ts\nawait client.post('/some/path', {\n body: { some_prop: 'foo' },\n query: { some_query_arg: 'bar' },\n});\n```\n\n#### Undocumented request params\n\nTo make requests using undocumented parameters, you may use `// @ts-expect-error` on the undocumented\nparameter. This library doesn't validate at runtime that the request matches the type, so any extra values you\nsend will be sent as-is.\n\n```ts\nclient.memories.add({\n // ...\n // @ts-expect-error baz is not yet public\n baz: 'undocumented option',\n});\n```\n\nFor requests with the `GET` verb, any extra params will be in the query, all other requests will send the\nextra param in the body.\n\nIf you want to explicitly send an extra argument, you can do so with the `query`, `body`, and `headers` request\noptions.\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you may access the response object with `// @ts-expect-error` on\nthe response object, or cast the response object to the requisite type. Like the request params, we do not\nvalidate or strip extra properties from the response from the API.\n\n### Customizing the fetch client\n\nBy default, this library expects a global `fetch` function is defined.\n\nIf you want to use a different `fetch` function, you can either polyfill the global:\n\n```ts\nimport fetch from 'my-fetch';\n\nglobalThis.fetch = fetch;\n```\n\nOr pass it to the client:\n\n```ts\nimport Hyperspell from '@hyperspell/hyperspell';\nimport fetch from 'my-fetch';\n\nconst client = new Hyperspell({ fetch });\n```\n\n### Fetch options\n\nIf you want to set custom `fetch` options without overriding the `fetch` function, you can provide a `fetchOptions` object when instantiating the client or making a request. (Request-specific options override client options.)\n\n```ts\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n fetchOptions: {\n // `RequestInit` options\n },\n});\n```\n\n#### Configuring proxies\n\nTo modify proxy behavior, you can provide custom `fetchOptions` that add runtime-specific proxy\noptions to requests:\n\n **Node** [[docs](https://github.com/nodejs/undici/blob/main/docs/docs/api/ProxyAgent.md#example---proxyagent-with-fetch)]\n\n```ts\nimport Hyperspell from '@hyperspell/hyperspell';\nimport * as undici from 'undici';\n\nconst proxyAgent = new undici.ProxyAgent('http://localhost:8888');\nconst client = new Hyperspell({\n fetchOptions: {\n dispatcher: proxyAgent,\n },\n});\n```\n\n **Bun** [[docs](https://bun.sh/guides/http/proxy)]\n\n```ts\nimport Hyperspell from '@hyperspell/hyperspell';\n\nconst client = new Hyperspell({\n fetchOptions: {\n proxy: 'http://localhost:8888',\n },\n});\n```\n\n **Deno** [[docs](https://docs.deno.com/api/deno/~/Deno.createHttpClient)]\n\n```ts\nimport Hyperspell from 'npm:@hyperspell/hyperspell';\n\nconst httpClient = Deno.createHttpClient({ proxy: { url: 'http://localhost:8888' } });\nconst client = new Hyperspell({\n fetchOptions: {\n client: httpClient,\n },\n});\n```\n\n## Frequently Asked Questions\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes that only affect static types, without breaking runtime behavior.\n2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n3. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/hyperspell/node-sdk/issues) with questions, bugs, or suggestions.\n\n## Requirements\n\nTypeScript >= 4.9 is supported.\n\nThe following runtimes are supported:\n\n- Web browsers (Up-to-date Chrome, Firefox, Safari, Edge, and more)\n- Node.js 20 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions.\n- Deno v1.28.0 or higher.\n- Bun 1.0 or later.\n- Cloudflare Workers.\n- Vercel Edge Runtime.\n- Jest 28 or greater with the `\"node\"` environment (`\"jsdom\"` is not supported at this time).\n- Nitro v2.6 or greater.\n\nNote that React Native is not supported at this time.\n\nIf you are interested in other runtime environments, please open or upvote an issue on GitHub.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n", + "# Hyperspell CLI\n\nThe official CLI for the [Hyperspell REST API](https://docs.hyperspell.com/).\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n\n\n## Installation\n\n### Installing with Homebrew\n\n~~~sh\nbrew install hyperspell/tools/hyperspell\n~~~\n\n### Installing with Go\n\nTo test or install the CLI locally, you need [Go](https://go.dev/doc/install) version 1.22 or later installed.\n\n~~~sh\ngo install 'github.com/hyperspell/hyperspell-cli/cmd/hyperspell@latest'\n~~~\n\nOnce you have run `go install`, the binary is placed in your Go bin directory:\n\n- **Default location**: `$HOME/go/bin` (or `$GOPATH/bin` if GOPATH is set)\n- **Check your path**: Run `go env GOPATH` to see the base directory\n\nIf commands aren't found after installation, add the Go bin directory to your PATH:\n\n~~~sh\n# Add to your shell profile (.zshrc, .bashrc, etc.)\nexport PATH=\"$PATH:$(go env GOPATH)/bin\"\n~~~\n\n\n\n### Running Locally\n\nAfter cloning the git repository for this project, you can use the\n`scripts/run` script to run the tool locally:\n\n~~~sh\n./scripts/run args...\n~~~\n\n## Usage\n\nThe CLI follows a resource-based command structure:\n\n~~~sh\nhyperspell [resource] [flags...]\n~~~\n\n~~~sh\nhyperspell memories add \\\n --api-key 'My API Key' \\\n --user-id 'My User ID' \\\n --text ...\n~~~\n\nFor details about specific commands, use the `--help` flag.\n\n### Environment variables\n\n| Environment variable | Description | Required |\n| -------------------- | ---------------------------------------------------------------------------- | -------- |\n| `HYPERSPELL_API_KEY` | Either an API Key or User Token to authenticate a specific user of your app. | yes |\n\n### Global flags\n\n- `--api-key` - Either an API Key or User Token to authenticate a specific user of your app. (can also be set with `HYPERSPELL_API_KEY` env var)\n- `--user-id` - The id of the user making this request. Optional.\n- `--help` - Show command line usage\n- `--debug` - Enable debug logging (includes HTTP request/response details)\n- `--version`, `-v` - Show the CLI version\n- `--base-url` - Use a custom API backend URL\n- `--format` - Change the output format (`auto`, `explore`, `json`, `jsonl`, `pretty`, `raw`, `yaml`)\n- `--format-error` - Change the output format for errors (`auto`, `explore`, `json`, `jsonl`, `pretty`, `raw`, `yaml`)\n- `--transform` - Transform the data output using [GJSON syntax](https://github.com/tidwall/gjson/blob/master/SYNTAX.md)\n- `--transform-error` - Transform the error output using [GJSON syntax](https://github.com/tidwall/gjson/blob/master/SYNTAX.md)\n\n### Passing files as arguments\n\nTo pass files to your API, you can use the `@myfile.ext` syntax:\n\n~~~bash\nhyperspell --arg @abe.jpg\n~~~\n\nFiles can also be passed inside JSON or YAML blobs:\n\n~~~bash\nhyperspell --arg '{image: \"@abe.jpg\"}'\n# Equivalent:\nhyperspell < --username '\\@abe'\n~~~\n\n#### Explicit encoding\n\nFor JSON endpoints, the CLI tool does filetype sniffing to determine whether the\nfile contents should be sent as a string literal (for plain text files) or as a\nbase64-encoded string literal (for binary files). If you need to explicitly send\nthe file as either plain text or base64-encoded data, you can use\n`@file://myfile.txt` (for string encoding) or `@data://myfile.dat` (for\nbase64-encoding). Note that absolute paths will begin with `@file://` or\n`@data://`, followed by a third `/` (for example, `@file:///tmp/file.txt`).\n\n~~~bash\nhyperspell --arg @data://file.txt\n~~~\n\n## Linking different Go SDK versions\n\nYou can link the CLI against a different version of the Hyperspell Go SDK\nfor development purposes using the `./scripts/link` script.\n\nTo link to a specific version from a repository (version can be a branch,\ngit tag, or commit hash):\n\n~~~bash\n./scripts/link github.com/org/repo@version\n~~~\n\nTo link to a local copy of the SDK:\n\n~~~bash\n./scripts/link ../path/to/hyperspell-go\n~~~\n\nIf you run the link script without any arguments, it will default to `../hyperspell-go`.\n", }, ]; diff --git a/packages/mcp-server/src/methods.ts b/packages/mcp-server/src/methods.ts index 3f2bedbd..b71dbfcc 100644 --- a/packages/mcp-server/src/methods.ts +++ b/packages/mcp-server/src/methods.ts @@ -58,12 +58,6 @@ export const sdkMethods: SdkMethod[] = [ httpMethod: 'get', httpPath: '/integrations/{integration_id}/connect', }, - { - clientCallName: 'client.integrations.googleCalendar.list', - fullyQualifiedName: 'integrations.googleCalendar.list', - httpMethod: 'get', - httpPath: '/integrations/google_calendar/list', - }, { clientCallName: 'client.integrations.webCrawler.index', fullyQualifiedName: 'integrations.webCrawler.index', @@ -71,10 +65,76 @@ export const sdkMethods: SdkMethod[] = [ httpPath: '/integrations/web_crawler/index', }, { - clientCallName: 'client.integrations.slack.list', - fullyQualifiedName: 'integrations.slack.list', + clientCallName: 'client.contextDocuments.generate', + fullyQualifiedName: 'contextDocuments.generate', + httpMethod: 'post', + httpPath: '/context-documents/generate', + }, + { + clientCallName: 'client.contextDocuments.list', + fullyQualifiedName: 'contextDocuments.list', + httpMethod: 'get', + httpPath: '/context-documents', + }, + { + clientCallName: 'client.contextDocuments.get', + fullyQualifiedName: 'contextDocuments.get', + httpMethod: 'get', + httpPath: '/context-documents/{document_id}', + }, + { + clientCallName: 'client.contextDocuments.trees.generate', + fullyQualifiedName: 'contextDocuments.trees.generate', + httpMethod: 'post', + httpPath: '/context-documents/tree', + }, + { + clientCallName: 'client.contextDocuments.trees.getLatest', + fullyQualifiedName: 'contextDocuments.trees.getLatest', + httpMethod: 'get', + httpPath: '/context-documents/tree/latest', + }, + { + clientCallName: 'client.contextDocuments.trees.get', + fullyQualifiedName: 'contextDocuments.trees.get', httpMethod: 'get', - httpPath: '/integrations/slack/list', + httpPath: '/context-documents/tree/by-id/{tree_id}', + }, + { + clientCallName: 'client.contextDocuments.trees.progress', + fullyQualifiedName: 'contextDocuments.trees.progress', + httpMethod: 'get', + httpPath: '/context-documents/tree/{tree_id}/progress', + }, + { + clientCallName: 'client.contextDocuments.digests.generate', + fullyQualifiedName: 'contextDocuments.digests.generate', + httpMethod: 'post', + httpPath: '/context-documents/digest', + }, + { + clientCallName: 'client.contextDocuments.digests.list', + fullyQualifiedName: 'contextDocuments.digests.list', + httpMethod: 'get', + httpPath: '/context-documents/digest/list', + }, + { + clientCallName: 'client.contextDocuments.config.get', + fullyQualifiedName: 'contextDocuments.config.get', + httpMethod: 'get', + httpPath: '/context-documents/config', + }, + { + clientCallName: 'client.contextDocuments.config.update', + fullyQualifiedName: 'contextDocuments.config.update', + httpMethod: 'patch', + httpPath: '/context-documents/config', + }, + { + clientCallName: 'client.contextDocuments.config.reset', + fullyQualifiedName: 'contextDocuments.config.reset', + httpMethod: 'post', + httpPath: '/context-documents/config/reset', }, { clientCallName: 'client.memories.add', diff --git a/packages/mcp-server/tests/auth.test.ts b/packages/mcp-server/tests/auth.test.ts new file mode 100644 index 00000000..a411cd28 --- /dev/null +++ b/packages/mcp-server/tests/auth.test.ts @@ -0,0 +1,32 @@ +import { IncomingMessage } from 'node:http'; +import { parseClientAuthHeaders } from '../src/auth'; + +describe('parseClientAuthHeaders', () => { + it('forwards X-As-User to the SDK client', () => { + const req = { + headers: { + 'x-hyperspell-api-key': 'test-key', + 'x-as-user': 'user@example.com', + }, + } as IncomingMessage; + + expect(parseClientAuthHeaders(req)).toEqual({ + apiKey: 'test-key', + userID: 'user@example.com', + }); + }); + + it('uses the first value from repeated headers', () => { + const req = { + headers: { + 'x-hyperspell-api-key': ['first-key', 'second-key'], + 'x-as-user': ['first@example.com', 'second@example.com'], + }, + } as IncomingMessage; + + expect(parseClientAuthHeaders(req)).toEqual({ + apiKey: 'first-key', + userID: 'first@example.com', + }); + }); +}); diff --git a/scripts/mock b/scripts/mock index 1df910b9..e40bdc55 100755 --- a/scripts/mock +++ b/scripts/mock @@ -11,7 +11,7 @@ elif [ -n "$STAINLESS_OPENAPI_SPEC_URL" ]; then URL="$STAINLESS_OPENAPI_SPEC_URL" else # Embedded OpenAPI spec (base64-encoded, gzipped) - EMBEDDED_SPEC="H4sIAAAAAAAAA+y97XIbyZEo+ioVOCdCpA2Akjz2xuGs9xwOSc3QpiQuKXl270ABFroLQC0bVe2ubkJYXUXcX/sAG/cJ/ST3ZmZVdzX6AyAIakAbfyQCqO/KzMrv/NLRsVA8lp3jzu/6r/ovO92OVGPdOf7SSWUaic5x56dFLBITiyhiJ1cXnW7HZLMZTxbln6Rh6VSwmZjpZMEivhAJG+uEnVwwHseGcRUyPhEqNX32YZrobDLFDidXF1220BkLuGI8DGkEKUyXBVopEaQs5ClnRmdJIAxLNZMqFJ+h84xJxRLBo14qZ6KLcxjBk2Caj8LmMp0ynSVM8TRLeMQiriYZnwj210wkCybURCrR73Q7qUhm5v34RiT3MoCNT9M0NsdHR9N8l/1Az45GkZ4cpdp0up1Aq5QHKZyW4rPyYXW6nSyJmofpdDtixiW2EFGk/0/5987XbudeJEZq1TnuvOz/7nX/FXxnRAJfd45/+bI0Po9lf2mMbicUJkhknNIwV4kOswA/fP3U7cQ8nRpY/JE7riMehvBFrA3uKuUTmKrz1v7e+eRf/0kYMm6vvDLXSRjCrTOejGSa8GTBQh1kM6FSuEO4erxHgAZp8PZHgnG1YKn4nHYZnk13oAIeRSxNuKKxu0ykAfQRxXBzGUXQOU50IIwRIQLCjIeC8XsuIz6KBMDiQOGVSzVhWgUC12D7wHewCj2LI5EiOOhYJBz2chF2jjs8DIfukIbwAU+o20nEXzNh0h90uIDzAoAQCo+Ox3EkAxzh6D8MHMmXjgmmYsbhr/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0VKpwiPoecuECmMtVYPjdI4JLVCbAzVWINhD9LeG6JXXVnMvX7udnz58uPoLj2SI4HEOScprOB6RQh3Lda2sy+O1VUPAgdsWX7dAWLdTQT3UejLNlVONxpNprtne2072tpO97WRvO9nbTva2k73tZG872dtONraddDvRUu2eavbOy7V8LWkcb5LiNYU/k3QkeHOxQLRS3InWxNBoivizwNzQIRczrYZQsGFFvZEzbMn+Ylv6HGWm7pSeqyJRKHgKVYesORHMBAr+VDXDvsREniALDE3rKB+xEbtZGTrsH3N+UOWTLh9v+cibNKb6rtWh+v2dv7CmwISaNRSqyJ/kZBpZmdL/+CvHdOPjtn4wt/eKbVo0PX/lljzg8Hvy3LXLape6mg7wa7dDb8+DBS9pn6xGsUtaZnenha6mVTnByiRBq44/CVbSt5SeERjJr/LuTucCNirVpChnu3QPOuWUHqK9DGBROafE8D24BmwzEH3AlXi+xK3VCX+l5W46XqnmbtMJeI1WXTqelX9U/t2XrxyBYCJM8yO3QRr7OgVmbl6+OEObehiWy4+nukaNybF6pt/VacKcJZR090WP0piusc3rjIEpKeNRIni4YOKzNCm5G6yFkRUndPD9hZ65atXO2yff5CgiR+HNCXA+Qn3FMfdzw3linfZQxIkIYPddjLdIyz0zsIUXxaekMqngIT0lrmOedWUrQYRLG4Fva88PbuzBFsszntb46UMVq+Up2JmwVbfdQ+Z+6pLaNsASjCNSn6MdE127cayE/i/DGjcM+LEc2A7EpG9L1AVTULjmReG6rtizN0PoLRKHsUz3oVX1TkUUkwU74eoOls2jiU5kOp1BPUcwR+m5YQudeXa20YLGTbiaiF2omVb7Gi6R0LZ8QxvVUAPu27BZBg4WgvEonnKVzUQiAzJsZApoJHBgpstm/DP7w3dwY4nps7/wKBNFX9p+l9EOu8zuK498W50qBglNiRr7tBfKcXGoD2/w0H0S0pkteoFPEEo3maVTULd0/qSnip1pxAHEn87rl69/33v5+97rlx9evj7+3avjly//L1gTspad49/lxK/T7/d9H50Fc68TXZPn93WhxnrdyKGWSCEgYp456YVhGJmR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A==" SPEC_TMPFILE="$(mktemp)" trap 'rm -f "$SPEC_TMPFILE"' EXIT echo "$EMBEDDED_SPEC" | base64 --decode | gunzip > "$SPEC_TMPFILE" diff --git a/src/client.ts b/src/client.ts index 4c19147b..534483e6 100644 --- a/src/client.ts +++ b/src/client.ts @@ -15,7 +15,13 @@ import { stringifyQuery } from './internal/utils/query'; import { VERSION } from './version'; import * as Errors from './core/error'; import * as Pagination from './core/pagination'; -import { AbstractPage, type CursorPageParams, CursorPageResponse } from './core/pagination'; +import { + AbstractPage, + type ContextDocumentsCursorPageParams, + ContextDocumentsCursorPageResponse, + type CursorPageParams, + CursorPageResponse, +} from './core/pagination'; import * as Uploads from './core/uploads'; import * as API from './resources/index'; import { APIPromise } from './core/api-promise'; @@ -68,6 +74,15 @@ import { } from './resources/memories'; import { SessionAddParams, Sessions } from './resources/sessions'; import { VaultListParams, VaultListResponse, VaultListResponsesCursorPage, Vaults } from './resources/vaults'; +import { + ContextDocumentGenerateParams, + ContextDocumentGenerateResponse, + ContextDocumentGetResponse, + ContextDocumentListParams, + ContextDocumentListResponse, + ContextDocumentListResponsesContextDocumentsCursorPage, + ContextDocuments, +} from './resources/context-documents/context-documents'; import { IntegrationConnectParams, IntegrationConnectResponse, @@ -287,20 +302,12 @@ export class Hyperspell { } protected async authHeaders(opts: FinalRequestOptions): Promise { - return buildHeaders([await this.apiKeyAuth(opts), await this.asUserAuth(opts)]); - } - - protected async apiKeyAuth(opts: FinalRequestOptions): Promise { return buildHeaders([{ Authorization: `Bearer ${this.apiKey}` }]); } - protected async asUserAuth(opts: FinalRequestOptions): Promise { - if (this.userID == null) { - return undefined; - } - return buildHeaders([{ 'X-As-User': this.userID }]); - } - + /** + * Basic re-implementation of `qs.stringify` for primitive types. + */ protected stringifyQuery(query: object | Record): string { return stringifyQuery(query); } @@ -747,6 +754,7 @@ export class Hyperspell { 'X-Stainless-Retry-Count': String(retryCount), ...(options.timeout ? { 'X-Stainless-Timeout': String(Math.trunc(options.timeout / 1000)) } : {}), ...getPlatformHeaders(), + 'X-As-User': this.userID, }, await this.authHeaders(options), this._options.defaultHeaders, @@ -832,6 +840,7 @@ export class Hyperspell { connections: API.Connections = new API.Connections(this); folders: API.Folders = new API.Folders(this); integrations: API.Integrations = new API.Integrations(this); + contextDocuments: API.ContextDocuments = new API.ContextDocuments(this); memories: API.Memories = new API.Memories(this); evaluate: API.Evaluate = new API.Evaluate(this); actions: API.Actions = new API.Actions(this); @@ -843,6 +852,7 @@ export class Hyperspell { Hyperspell.Connections = Connections; Hyperspell.Folders = Folders; Hyperspell.Integrations = Integrations; +Hyperspell.ContextDocuments = ContextDocuments; Hyperspell.Memories = Memories; Hyperspell.Evaluate = Evaluate; Hyperspell.Actions = Actions; @@ -856,6 +866,12 @@ export declare namespace Hyperspell { export import CursorPage = Pagination.CursorPage; export { type CursorPageParams as CursorPageParams, type CursorPageResponse as CursorPageResponse }; + export import ContextDocumentsCursorPage = Pagination.ContextDocumentsCursorPage; + export { + type ContextDocumentsCursorPageParams as ContextDocumentsCursorPageParams, + type ContextDocumentsCursorPageResponse as ContextDocumentsCursorPageResponse, + }; + export { Connections as Connections, type ConnectionListResponse as ConnectionListResponse, @@ -880,6 +896,16 @@ export declare namespace Hyperspell { type IntegrationConnectParams as IntegrationConnectParams, }; + export { + ContextDocuments as ContextDocuments, + type ContextDocumentListResponse as ContextDocumentListResponse, + type ContextDocumentGenerateResponse as ContextDocumentGenerateResponse, + type ContextDocumentGetResponse as ContextDocumentGetResponse, + type ContextDocumentListResponsesContextDocumentsCursorPage as ContextDocumentListResponsesContextDocumentsCursorPage, + type ContextDocumentGenerateParams as ContextDocumentGenerateParams, + type ContextDocumentListParams as ContextDocumentListParams, + }; + export { Memories as Memories, type MemoryStatus as MemoryStatus, @@ -957,6 +983,7 @@ export declare namespace Hyperspell { export type ListItem = API.ListItem; export type Message = API.Message; export type Metadata = API.Metadata; + export type Page = API.Page; export type Paragraph = API.Paragraph; export type Person = API.Person; export type Provenance = API.Provenance; diff --git a/src/core/pagination.ts b/src/core/pagination.ts index bc487ee9..31b43a14 100644 --- a/src/core/pagination.ts +++ b/src/core/pagination.ts @@ -155,3 +155,55 @@ export class CursorPage extends AbstractPage implements CursorPageRe }; } } + +export interface ContextDocumentsCursorPageResponse { + documents: Array; + + next_cursor: string; +} + +export interface ContextDocumentsCursorPageParams { + cursor?: string; + + limit?: number; +} + +export class ContextDocumentsCursorPage + extends AbstractPage + implements ContextDocumentsCursorPageResponse +{ + documents: Array; + + next_cursor: string; + + constructor( + client: Hyperspell, + response: Response, + body: ContextDocumentsCursorPageResponse, + options: FinalRequestOptions, + ) { + super(client, response, body, options); + + this.documents = body.documents || []; + this.next_cursor = body.next_cursor || ''; + } + + getPaginatedItems(): Item[] { + return this.documents ?? []; + } + + nextPageRequestOptions(): PageRequestOptions | null { + const cursor = this.next_cursor; + if (!cursor) { + return null; + } + + return { + ...this.options, + query: { + ...maybeObj(this.options.query), + cursor, + }, + }; + } +} diff --git a/src/internal/qs/LICENSE.md b/src/internal/qs/LICENSE.md deleted file mode 100644 index 3fda1573..00000000 --- a/src/internal/qs/LICENSE.md +++ /dev/null @@ -1,13 +0,0 @@ -BSD 3-Clause License - -Copyright (c) 2014, Nathan LaFreniere and other [contributors](https://github.com/puruvj/neoqs/graphs/contributors) All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/src/internal/qs/README.md b/src/internal/qs/README.md deleted file mode 100644 index 67ae04ec..00000000 --- a/src/internal/qs/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# qs - -This is a vendored version of [neoqs](https://github.com/PuruVJ/neoqs) which is a TypeScript rewrite of [qs](https://github.com/ljharb/qs), a query string library. diff --git a/src/internal/qs/formats.ts b/src/internal/qs/formats.ts deleted file mode 100644 index e76a742f..00000000 --- a/src/internal/qs/formats.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { Format } from './types'; - -export const default_format: Format = 'RFC3986'; -export const default_formatter = (v: PropertyKey) => String(v); -export const formatters: Record string> = { - RFC1738: (v: PropertyKey) => String(v).replace(/%20/g, '+'), - RFC3986: default_formatter, -}; -export const RFC1738 = 'RFC1738'; -export const RFC3986 = 'RFC3986'; diff --git a/src/internal/qs/index.ts b/src/internal/qs/index.ts deleted file mode 100644 index c3a3620d..00000000 --- a/src/internal/qs/index.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { default_format, formatters, RFC1738, RFC3986 } from './formats'; - -const formats = { - formatters, - RFC1738, - RFC3986, - default: default_format, -}; - -export { stringify } from './stringify'; -export { formats }; - -export type { DefaultDecoder, DefaultEncoder, Format, ParseOptions, StringifyOptions } from './types'; diff --git a/src/internal/qs/stringify.ts b/src/internal/qs/stringify.ts deleted file mode 100644 index 7e71387f..00000000 --- a/src/internal/qs/stringify.ts +++ /dev/null @@ -1,385 +0,0 @@ -import { encode, is_buffer, maybe_map, has } from './utils'; -import { default_format, default_formatter, formatters } from './formats'; -import type { NonNullableProperties, StringifyOptions } from './types'; -import { isArray } from '../utils/values'; - -const array_prefix_generators = { - brackets(prefix: PropertyKey) { - return String(prefix) + '[]'; - }, - comma: 'comma', - indices(prefix: PropertyKey, key: string) { - return String(prefix) + '[' + key + ']'; - }, - repeat(prefix: PropertyKey) { - return String(prefix); - }, -}; - -const push_to_array = function (arr: any[], value_or_array: any) { - Array.prototype.push.apply(arr, isArray(value_or_array) ? value_or_array : [value_or_array]); -}; - -let toISOString; - -const defaults = { - addQueryPrefix: false, - allowDots: false, - allowEmptyArrays: false, - arrayFormat: 'indices', - charset: 'utf-8', - charsetSentinel: false, - delimiter: '&', - encode: true, - encodeDotInKeys: false, - encoder: encode, - encodeValuesOnly: false, - format: default_format, - formatter: default_formatter, - /** @deprecated */ - indices: false, - serializeDate(date) { - return (toISOString ??= Function.prototype.call.bind(Date.prototype.toISOString))(date); - }, - skipNulls: false, - strictNullHandling: false, -} as NonNullableProperties; - -function is_non_nullish_primitive(v: unknown): v is string | number | boolean | symbol | bigint { - return ( - typeof v === 'string' || - typeof v === 'number' || - typeof v === 'boolean' || - typeof v === 'symbol' || - typeof v === 'bigint' - ); -} - -const sentinel = {}; - -function inner_stringify( - object: any, - prefix: PropertyKey, - generateArrayPrefix: StringifyOptions['arrayFormat'] | ((prefix: string, key: string) => string), - commaRoundTrip: boolean, - allowEmptyArrays: boolean, - strictNullHandling: boolean, - skipNulls: boolean, - encodeDotInKeys: boolean, - encoder: StringifyOptions['encoder'], - filter: StringifyOptions['filter'], - sort: StringifyOptions['sort'], - allowDots: StringifyOptions['allowDots'], - serializeDate: StringifyOptions['serializeDate'], - format: StringifyOptions['format'], - formatter: StringifyOptions['formatter'], - encodeValuesOnly: boolean, - charset: StringifyOptions['charset'], - sideChannel: WeakMap, -) { - let obj = object; - - let tmp_sc = sideChannel; - let step = 0; - let find_flag = false; - while ((tmp_sc = tmp_sc.get(sentinel)) !== void undefined && !find_flag) { - // Where object last appeared in the ref tree - const pos = tmp_sc.get(object); - step += 1; - if (typeof pos !== 'undefined') { - if (pos === step) { - throw new RangeError('Cyclic object value'); - } else { - find_flag = true; // Break while - } - } - if (typeof tmp_sc.get(sentinel) === 'undefined') { - step = 0; - } - } - - if (typeof filter === 'function') { - obj = filter(prefix, obj); - } else if (obj instanceof Date) { - obj = serializeDate?.(obj); - } else if (generateArrayPrefix === 'comma' && isArray(obj)) { - obj = maybe_map(obj, function (value) { - if (value instanceof Date) { - return serializeDate?.(value); - } - return value; - }); - } - - if (obj === null) { - if (strictNullHandling) { - return encoder && !encodeValuesOnly ? - // @ts-expect-error - encoder(prefix, defaults.encoder, charset, 'key', format) - : prefix; - } - - obj = ''; - } - - if (is_non_nullish_primitive(obj) || is_buffer(obj)) { - if (encoder) { - const key_value = - encodeValuesOnly ? prefix - // @ts-expect-error - : encoder(prefix, defaults.encoder, charset, 'key', format); - return [ - formatter?.(key_value) + - '=' + - // @ts-expect-error - formatter?.(encoder(obj, defaults.encoder, charset, 'value', format)), - ]; - } - return [formatter?.(prefix) + '=' + formatter?.(String(obj))]; - } - - const values: string[] = []; - - if (typeof obj === 'undefined') { - return values; - } - - let obj_keys; - if (generateArrayPrefix === 'comma' && isArray(obj)) { - // we need to join elements in - if (encodeValuesOnly && encoder) { - // @ts-expect-error values only - obj = maybe_map(obj, encoder); - } - obj_keys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }]; - } else if (isArray(filter)) { - obj_keys = filter; - } else { - const keys = Object.keys(obj); - obj_keys = sort ? keys.sort(sort) : keys; - } - - const encoded_prefix = encodeDotInKeys ? String(prefix).replace(/\./g, '%2E') : String(prefix); - - const adjusted_prefix = - commaRoundTrip && isArray(obj) && obj.length === 1 ? encoded_prefix + '[]' : encoded_prefix; - - if (allowEmptyArrays && isArray(obj) && obj.length === 0) { - return adjusted_prefix + '[]'; - } - - for (let j = 0; j < obj_keys.length; ++j) { - const key = obj_keys[j]; - const value = - // @ts-ignore - typeof key === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key as any]; - - if (skipNulls && value === null) { - continue; - } - - // @ts-ignore - const encoded_key = allowDots && encodeDotInKeys ? (key as any).replace(/\./g, '%2E') : key; - const key_prefix = - isArray(obj) ? - typeof generateArrayPrefix === 'function' ? - generateArrayPrefix(adjusted_prefix, encoded_key) - : adjusted_prefix - : adjusted_prefix + (allowDots ? '.' + encoded_key : '[' + encoded_key + ']'); - - sideChannel.set(object, step); - const valueSideChannel = new WeakMap(); - valueSideChannel.set(sentinel, sideChannel); - push_to_array( - values, - inner_stringify( - value, - key_prefix, - generateArrayPrefix, - commaRoundTrip, - allowEmptyArrays, - strictNullHandling, - skipNulls, - encodeDotInKeys, - // @ts-ignore - generateArrayPrefix === 'comma' && encodeValuesOnly && isArray(obj) ? null : encoder, - filter, - sort, - allowDots, - serializeDate, - format, - formatter, - encodeValuesOnly, - charset, - valueSideChannel, - ), - ); - } - - return values; -} - -function normalize_stringify_options( - opts: StringifyOptions = defaults, -): NonNullableProperties> & { indices?: boolean } { - if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') { - throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided'); - } - - if (typeof opts.encodeDotInKeys !== 'undefined' && typeof opts.encodeDotInKeys !== 'boolean') { - throw new TypeError('`encodeDotInKeys` option can only be `true` or `false`, when provided'); - } - - if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') { - throw new TypeError('Encoder has to be a function.'); - } - - const charset = opts.charset || defaults.charset; - if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') { - throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined'); - } - - let format = default_format; - if (typeof opts.format !== 'undefined') { - if (!has(formatters, opts.format)) { - throw new TypeError('Unknown format option provided.'); - } - format = opts.format; - } - const formatter = formatters[format]; - - let filter = defaults.filter; - if (typeof opts.filter === 'function' || isArray(opts.filter)) { - filter = opts.filter; - } - - let arrayFormat: StringifyOptions['arrayFormat']; - if (opts.arrayFormat && opts.arrayFormat in array_prefix_generators) { - arrayFormat = opts.arrayFormat; - } else if ('indices' in opts) { - arrayFormat = opts.indices ? 'indices' : 'repeat'; - } else { - arrayFormat = defaults.arrayFormat; - } - - if ('commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') { - throw new TypeError('`commaRoundTrip` must be a boolean, or absent'); - } - - const allowDots = - typeof opts.allowDots === 'undefined' ? - !!opts.encodeDotInKeys === true ? - true - : defaults.allowDots - : !!opts.allowDots; - - return { - addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix, - // @ts-ignore - allowDots: allowDots, - allowEmptyArrays: - typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays, - arrayFormat: arrayFormat, - charset: charset, - charsetSentinel: - typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel, - commaRoundTrip: !!opts.commaRoundTrip, - delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter, - encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode, - encodeDotInKeys: - typeof opts.encodeDotInKeys === 'boolean' ? opts.encodeDotInKeys : defaults.encodeDotInKeys, - encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder, - encodeValuesOnly: - typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly, - filter: filter, - format: format, - formatter: formatter, - serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate, - skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls, - // @ts-ignore - sort: typeof opts.sort === 'function' ? opts.sort : null, - strictNullHandling: - typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling, - }; -} - -export function stringify(object: any, opts: StringifyOptions = {}) { - let obj = object; - const options = normalize_stringify_options(opts); - - let obj_keys: PropertyKey[] | undefined; - let filter; - - if (typeof options.filter === 'function') { - filter = options.filter; - obj = filter('', obj); - } else if (isArray(options.filter)) { - filter = options.filter; - obj_keys = filter; - } - - const keys: string[] = []; - - if (typeof obj !== 'object' || obj === null) { - return ''; - } - - const generateArrayPrefix = array_prefix_generators[options.arrayFormat]; - const commaRoundTrip = generateArrayPrefix === 'comma' && options.commaRoundTrip; - - if (!obj_keys) { - obj_keys = Object.keys(obj); - } - - if (options.sort) { - obj_keys.sort(options.sort); - } - - const sideChannel = new WeakMap(); - for (let i = 0; i < obj_keys.length; ++i) { - const key = obj_keys[i]!; - - if (options.skipNulls && obj[key] === null) { - continue; - } - push_to_array( - keys, - inner_stringify( - obj[key], - key, - // @ts-expect-error - generateArrayPrefix, - commaRoundTrip, - options.allowEmptyArrays, - options.strictNullHandling, - options.skipNulls, - options.encodeDotInKeys, - options.encode ? options.encoder : null, - options.filter, - options.sort, - options.allowDots, - options.serializeDate, - options.format, - options.formatter, - options.encodeValuesOnly, - options.charset, - sideChannel, - ), - ); - } - - const joined = keys.join(options.delimiter); - let prefix = options.addQueryPrefix === true ? '?' : ''; - - if (options.charsetSentinel) { - if (options.charset === 'iso-8859-1') { - // encodeURIComponent('✓'), the "numeric entity" representation of a checkmark - prefix += 'utf8=%26%2310003%3B&'; - } else { - // encodeURIComponent('✓') - prefix += 'utf8=%E2%9C%93&'; - } - } - - return joined.length > 0 ? prefix + joined : ''; -} diff --git a/src/internal/qs/types.ts b/src/internal/qs/types.ts deleted file mode 100644 index 7c28dbb4..00000000 --- a/src/internal/qs/types.ts +++ /dev/null @@ -1,71 +0,0 @@ -export type Format = 'RFC1738' | 'RFC3986'; - -export type DefaultEncoder = (str: any, defaultEncoder?: any, charset?: string) => string; -export type DefaultDecoder = (str: string, decoder?: any, charset?: string) => string; - -export type BooleanOptional = boolean | undefined; - -export type StringifyBaseOptions = { - delimiter?: string; - allowDots?: boolean; - encodeDotInKeys?: boolean; - strictNullHandling?: boolean; - skipNulls?: boolean; - encode?: boolean; - encoder?: ( - str: any, - defaultEncoder: DefaultEncoder, - charset: string, - type: 'key' | 'value', - format?: Format, - ) => string; - filter?: Array | ((prefix: PropertyKey, value: any) => any); - arrayFormat?: 'indices' | 'brackets' | 'repeat' | 'comma'; - indices?: boolean; - sort?: ((a: PropertyKey, b: PropertyKey) => number) | null; - serializeDate?: (d: Date) => string; - format?: 'RFC1738' | 'RFC3986'; - formatter?: (str: PropertyKey) => string; - encodeValuesOnly?: boolean; - addQueryPrefix?: boolean; - charset?: 'utf-8' | 'iso-8859-1'; - charsetSentinel?: boolean; - allowEmptyArrays?: boolean; - commaRoundTrip?: boolean; -}; - -export type StringifyOptions = StringifyBaseOptions; - -export type ParseBaseOptions = { - comma?: boolean; - delimiter?: string | RegExp; - depth?: number | false; - decoder?: (str: string, defaultDecoder: DefaultDecoder, charset: string, type: 'key' | 'value') => any; - arrayLimit?: number; - parseArrays?: boolean; - plainObjects?: boolean; - allowPrototypes?: boolean; - allowSparse?: boolean; - parameterLimit?: number; - strictDepth?: boolean; - strictNullHandling?: boolean; - ignoreQueryPrefix?: boolean; - charset?: 'utf-8' | 'iso-8859-1'; - charsetSentinel?: boolean; - interpretNumericEntities?: boolean; - allowEmptyArrays?: boolean; - duplicates?: 'combine' | 'first' | 'last'; - allowDots?: boolean; - decodeDotInKeys?: boolean; -}; - -export type ParseOptions = ParseBaseOptions; - -export type ParsedQs = { - [key: string]: undefined | string | string[] | ParsedQs | ParsedQs[]; -}; - -// Type to remove null or undefined union from each property -export type NonNullableProperties = { - [K in keyof T]-?: Exclude; -}; diff --git a/src/internal/qs/utils.ts b/src/internal/qs/utils.ts deleted file mode 100644 index 4cd56579..00000000 --- a/src/internal/qs/utils.ts +++ /dev/null @@ -1,265 +0,0 @@ -import { RFC1738 } from './formats'; -import type { DefaultEncoder, Format } from './types'; -import { isArray } from '../utils/values'; - -export let has = (obj: object, key: PropertyKey): boolean => ( - (has = (Object as any).hasOwn ?? Function.prototype.call.bind(Object.prototype.hasOwnProperty)), - has(obj, key) -); - -const hex_table = /* @__PURE__ */ (() => { - const array = []; - for (let i = 0; i < 256; ++i) { - array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase()); - } - - return array; -})(); - -function compact_queue>(queue: Array<{ obj: T; prop: string }>) { - while (queue.length > 1) { - const item = queue.pop(); - if (!item) continue; - - const obj = item.obj[item.prop]; - - if (isArray(obj)) { - const compacted: unknown[] = []; - - for (let j = 0; j < obj.length; ++j) { - if (typeof obj[j] !== 'undefined') { - compacted.push(obj[j]); - } - } - - // @ts-ignore - item.obj[item.prop] = compacted; - } - } -} - -function array_to_object(source: any[], options: { plainObjects: boolean }) { - const obj = options && options.plainObjects ? Object.create(null) : {}; - for (let i = 0; i < source.length; ++i) { - if (typeof source[i] !== 'undefined') { - obj[i] = source[i]; - } - } - - return obj; -} - -export function merge( - target: any, - source: any, - options: { plainObjects?: boolean; allowPrototypes?: boolean } = {}, -) { - if (!source) { - return target; - } - - if (typeof source !== 'object') { - if (isArray(target)) { - target.push(source); - } else if (target && typeof target === 'object') { - if ((options && (options.plainObjects || options.allowPrototypes)) || !has(Object.prototype, source)) { - target[source] = true; - } - } else { - return [target, source]; - } - - return target; - } - - if (!target || typeof target !== 'object') { - return [target].concat(source); - } - - let mergeTarget = target; - if (isArray(target) && !isArray(source)) { - // @ts-ignore - mergeTarget = array_to_object(target, options); - } - - if (isArray(target) && isArray(source)) { - source.forEach(function (item, i) { - if (has(target, i)) { - const targetItem = target[i]; - if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') { - target[i] = merge(targetItem, item, options); - } else { - target.push(item); - } - } else { - target[i] = item; - } - }); - return target; - } - - return Object.keys(source).reduce(function (acc, key) { - const value = source[key]; - - if (has(acc, key)) { - acc[key] = merge(acc[key], value, options); - } else { - acc[key] = value; - } - return acc; - }, mergeTarget); -} - -export function assign_single_source(target: any, source: any) { - return Object.keys(source).reduce(function (acc, key) { - acc[key] = source[key]; - return acc; - }, target); -} - -export function decode(str: string, _: any, charset: string) { - const strWithoutPlus = str.replace(/\+/g, ' '); - if (charset === 'iso-8859-1') { - // unescape never throws, no try...catch needed: - return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape); - } - // utf-8 - try { - return decodeURIComponent(strWithoutPlus); - } catch (e) { - return strWithoutPlus; - } -} - -const limit = 1024; - -export const encode: ( - str: any, - defaultEncoder: DefaultEncoder, - charset: string, - type: 'key' | 'value', - format: Format, -) => string = (str, _defaultEncoder, charset, _kind, format: Format) => { - // This code was originally written by Brian White for the io.js core querystring library. - // It has been adapted here for stricter adherence to RFC 3986 - if (str.length === 0) { - return str; - } - - let string = str; - if (typeof str === 'symbol') { - string = Symbol.prototype.toString.call(str); - } else if (typeof str !== 'string') { - string = String(str); - } - - if (charset === 'iso-8859-1') { - return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) { - return '%26%23' + parseInt($0.slice(2), 16) + '%3B'; - }); - } - - let out = ''; - for (let j = 0; j < string.length; j += limit) { - const segment = string.length >= limit ? string.slice(j, j + limit) : string; - const arr = []; - - for (let i = 0; i < segment.length; ++i) { - let c = segment.charCodeAt(i); - if ( - c === 0x2d || // - - c === 0x2e || // . - c === 0x5f || // _ - c === 0x7e || // ~ - (c >= 0x30 && c <= 0x39) || // 0-9 - (c >= 0x41 && c <= 0x5a) || // a-z - (c >= 0x61 && c <= 0x7a) || // A-Z - (format === RFC1738 && (c === 0x28 || c === 0x29)) // ( ) - ) { - arr[arr.length] = segment.charAt(i); - continue; - } - - if (c < 0x80) { - arr[arr.length] = hex_table[c]; - continue; - } - - if (c < 0x800) { - arr[arr.length] = hex_table[0xc0 | (c >> 6)]! + hex_table[0x80 | (c & 0x3f)]; - continue; - } - - if (c < 0xd800 || c >= 0xe000) { - arr[arr.length] = - hex_table[0xe0 | (c >> 12)]! + hex_table[0x80 | ((c >> 6) & 0x3f)] + hex_table[0x80 | (c & 0x3f)]; - continue; - } - - i += 1; - c = 0x10000 + (((c & 0x3ff) << 10) | (segment.charCodeAt(i) & 0x3ff)); - - arr[arr.length] = - hex_table[0xf0 | (c >> 18)]! + - hex_table[0x80 | ((c >> 12) & 0x3f)] + - hex_table[0x80 | ((c >> 6) & 0x3f)] + - hex_table[0x80 | (c & 0x3f)]; - } - - out += arr.join(''); - } - - return out; -}; - -export function compact(value: any) { - const queue = [{ obj: { o: value }, prop: 'o' }]; - const refs = []; - - for (let i = 0; i < queue.length; ++i) { - const item = queue[i]; - // @ts-ignore - const obj = item.obj[item.prop]; - - const keys = Object.keys(obj); - for (let j = 0; j < keys.length; ++j) { - const key = keys[j]!; - const val = obj[key]; - if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) { - queue.push({ obj: obj, prop: key }); - refs.push(val); - } - } - } - - compact_queue(queue); - - return value; -} - -export function is_regexp(obj: any) { - return Object.prototype.toString.call(obj) === '[object RegExp]'; -} - -export function is_buffer(obj: any) { - if (!obj || typeof obj !== 'object') { - return false; - } - - return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); -} - -export function combine(a: any, b: any) { - return [].concat(a, b); -} - -export function maybe_map(val: T[], fn: (v: T) => T) { - if (isArray(val)) { - const mapped = []; - for (let i = 0; i < val.length; i += 1) { - mapped.push(fn(val[i]!)); - } - return mapped; - } - return fn(val); -} diff --git a/src/internal/utils/query.ts b/src/internal/utils/query.ts index 0139cacb..26daecd6 100644 --- a/src/internal/utils/query.ts +++ b/src/internal/utils/query.ts @@ -1,7 +1,23 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as qs from '../qs/stringify'; +import { HyperspellError } from '../../core/error'; +/** + * Basic re-implementation of `qs.stringify` for primitive types. + */ export function stringifyQuery(query: object | Record) { - return qs.stringify(query, { arrayFormat: 'comma' }); + return Object.entries(query) + .filter(([_, value]) => typeof value !== 'undefined') + .map(([key, value]) => { + if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') { + return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`; + } + if (value === null) { + return `${encodeURIComponent(key)}=`; + } + throw new HyperspellError( + `Cannot stringify type ${typeof value}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`, + ); + }) + .join('&'); } diff --git a/src/resources/actions.ts b/src/resources/actions.ts index dcacb818..75015dfd 100644 --- a/src/resources/actions.ts +++ b/src/resources/actions.ts @@ -50,32 +50,9 @@ export interface ActionSendMessageResponse { export interface ActionSendMessageParams { /** - * Integration provider (e.g., slack) + * Integration provider. */ - provider: - | 'reddit' - | 'notion' - | 'slack' - | 'google_calendar' - | 'google_mail' - | 'box' - | 'dropbox' - | 'github' - | 'google_drive' - | 'vault' - | 'web_crawler' - | 'trace' - | 'microsoft_teams' - | 'gmail_actions' - | 'granola' - | 'fathom' - | 'fireflies' - | 'linear' - | 'hubspot' - | 'salesforce' - | 'coda' - | 'lightfield' - | 'gong'; + provider: 'slack'; /** * Message text @@ -110,32 +87,9 @@ export interface ActionAddReactionParams { name: string; /** - * Integration provider (e.g., slack) + * Integration provider. */ - provider: - | 'reddit' - | 'notion' - | 'slack' - | 'google_calendar' - | 'google_mail' - | 'box' - | 'dropbox' - | 'github' - | 'google_drive' - | 'vault' - | 'web_crawler' - | 'trace' - | 'microsoft_teams' - | 'gmail_actions' - | 'granola' - | 'fathom' - | 'fireflies' - | 'linear' - | 'hubspot' - | 'salesforce' - | 'coda' - | 'lightfield' - | 'gong'; + provider: 'slack'; /** * Message timestamp to react to diff --git a/src/resources/auth.ts b/src/resources/auth.ts index 7dc1bf02..8ecba454 100644 --- a/src/resources/auth.ts +++ b/src/resources/auth.ts @@ -33,7 +33,10 @@ export class Auth extends APIResource { } /** - * Endpoint to delete user. + * Delete the calling user's data (GDPR erasure). + * + * Deletion is processed asynchronously. The endpoint returns `202 Accepted` with + * an identifier for the deletion request. * * @example * ```ts @@ -55,6 +58,8 @@ export interface AuthDeleteUserResponse { message: string; success: boolean; + + workflow_id: string; } export interface AuthMeResponse { @@ -77,24 +82,36 @@ export interface AuthMeResponse { | 'slack' | 'google_calendar' | 'google_mail' + | 'imap' + | 'google_meet' | 'box' | 'dropbox' | 'github' + | 'gitlab' | 'google_drive' | 'vault' | 'web_crawler' | 'trace' + | 'microsoft_outlook' | 'microsoft_teams' - | 'gmail_actions' | 'granola' | 'fathom' | 'fireflies' + | 'figma' | 'linear' | 'hubspot' | 'salesforce' | 'coda' - | 'lightfield' + | 'confluence' + | 'jira' + | 'metabase' | 'gong' + | 'clickup' + | 'lightfield' + | 'pylon' + | 'fellow' + | 'odoo' + | 'external_mcp' >; /** @@ -106,24 +123,36 @@ export interface AuthMeResponse { | 'slack' | 'google_calendar' | 'google_mail' + | 'imap' + | 'google_meet' | 'box' | 'dropbox' | 'github' + | 'gitlab' | 'google_drive' | 'vault' | 'web_crawler' | 'trace' + | 'microsoft_outlook' | 'microsoft_teams' - | 'gmail_actions' | 'granola' | 'fathom' | 'fireflies' + | 'figma' | 'linear' | 'hubspot' | 'salesforce' | 'coda' - | 'lightfield' + | 'confluence' + | 'jira' + | 'metabase' | 'gong' + | 'clickup' + | 'lightfield' + | 'pylon' + | 'fellow' + | 'odoo' + | 'external_mcp' >; /** @@ -164,6 +193,7 @@ export interface AuthUserTokenParams { /** * Token lifetime, e.g., '30m', '2h', '1d'. Defaults to 24 hours if not provided. + * Maximum 30 days. */ expires_in?: string | null; diff --git a/src/resources/connections.ts b/src/resources/connections.ts index 748d6558..3110adc7 100644 --- a/src/resources/connections.ts +++ b/src/resources/connections.ts @@ -9,12 +9,9 @@ export class Connections extends APIResource { /** * Revoke Hyperspell's access to a provider and delete this user's stored data. * - * The external OAuth/Unified revoke and the (potentially large) data purge run in - * a background Temporal workflow; this returns `202 Accepted` immediately. A heavy - * provider — a Gmail account can carry hundreds of thousands of chunks — plus a - * slow third-party revoke would otherwise outrun the request timeout: the old - * synchronous path "timed out" for the caller while still finishing server-side, - * making the outcome invisible. Idempotent per (app, user, provider). + * Revocation and deletion are processed asynchronously, so the endpoint returns + * `202 Accepted` immediately. Repeated requests for the same app, user, and + * provider are safe. */ revoke(connectionID: string, options?: RequestOptions): APIPromise { return this._client.delete(path`/connections/${connectionID}/revoke`, options); @@ -58,28 +55,55 @@ export namespace ConnectionListResponse { | 'slack' | 'google_calendar' | 'google_mail' + | 'imap' + | 'google_meet' | 'box' | 'dropbox' | 'github' + | 'gitlab' | 'google_drive' | 'vault' | 'web_crawler' | 'trace' + | 'microsoft_outlook' | 'microsoft_teams' - | 'gmail_actions' | 'granola' | 'fathom' | 'fireflies' + | 'figma' | 'linear' | 'hubspot' | 'salesforce' | 'coda' + | 'confluence' + | 'jira' + | 'metabase' + | 'gong' + | 'clickup' | 'lightfield' - | 'gong'; + | 'pylon' + | 'fellow' + | 'odoo' + | 'external_mcp'; /** - * Count of items in user_options.channels (Teams: workspaces selected; 0 means - * nothing is being indexed for integrations that require selection). + * State of the historical backfill for providers that deliver history + * asynchronously: 'backfilling' while history is still streaming in, 'quiesced' + * once no backfill batch has arrived for a while (drained or stalled), 'completed' + * if the provider confirmed completion, and 'unknown' when the provider has not + * reported a backfill state. + */ + backfill_state?: 'backfilling' | 'quiesced' | 'completed' | 'unknown'; + + /** + * 'user' for a personal connection; 'app' for an org-wide (app-level) connection + * installed once by an app admin and shared with every user of the app. + */ + scope?: 'user' | 'app'; + + /** + * Number of items selected for this connection. For integrations that require + * selection, 0 means nothing is being indexed. */ selected_count?: number; } diff --git a/src/resources/context-documents.ts b/src/resources/context-documents.ts new file mode 100644 index 00000000..9f28b72f --- /dev/null +++ b/src/resources/context-documents.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './context-documents/index'; diff --git a/src/resources/context-documents/config.ts b/src/resources/context-documents/config.ts new file mode 100644 index 00000000..05948a97 --- /dev/null +++ b/src/resources/context-documents/config.ts @@ -0,0 +1,148 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../core/resource'; +import { APIPromise } from '../../core/api-promise'; +import { RequestOptions } from '../../internal/request-options'; + +export class Config extends APIResource { + /** + * Read the customer-editable generation config for the authenticated app. + */ + get(options?: RequestOptions): APIPromise { + return this._client.get('/context-documents/config', options); + } + + /** + * Update the supplied generation settings. + * + * Changes apply to the next generation. This endpoint does not start a generation + * or modify existing context documents. + */ + update(body: ConfigUpdateParams, options?: RequestOptions): APIPromise { + return this._client.patch('/context-documents/config', { body, ...options }); + } + + /** + * Reset customer-editable generation settings to their defaults. + * + * Existing context documents remain unchanged. `detected_domain` is retained and + * used for future generations unless a new domain override is set. + */ + reset(options?: RequestOptions): APIPromise { + return this._client.post('/context-documents/config/reset', options); + } +} + +/** + * Brain-generation settings that customers can view and edit. + */ +export interface ConfigUpdateResponse { + prompts: { [key: string]: unknown }; + + source_weights: { [key: string]: string }; + + structure: { [key: string]: unknown }; + + detected_domain?: string | null; + + domain?: string | null; +} + +/** + * Brain-generation settings that customers can view and edit. + */ +export interface ConfigGetResponse { + prompts: { [key: string]: unknown }; + + source_weights: { [key: string]: string }; + + structure: { [key: string]: unknown }; + + detected_domain?: string | null; + + domain?: string | null; +} + +/** + * Brain-generation settings that customers can view and edit. + */ +export interface ConfigResetResponse { + prompts: { [key: string]: unknown }; + + source_weights: { [key: string]: string }; + + structure: { [key: string]: unknown }; + + detected_domain?: string | null; + + domain?: string | null; +} + +export interface ConfigUpdateParams { + company_prompts?: { [key: string]: string } | null; + + detection_prompt?: string | null; + + domain?: string | null; + + personal_prompt?: string | null; + + source_weights?: { [key: string]: string } | null; + + /** + * Per-tier document definitions for custom generation. + */ + structure?: ConfigUpdateParams.Structure | null; + + workstream_prompts?: { [key: string]: string } | null; +} + +export namespace ConfigUpdateParams { + /** + * Per-tier document definitions for custom generation. + */ + export interface Structure { + company?: Array | null; + + workstream?: Array | null; + } + + export namespace Structure { + /** + * One document in a context-tree tier: what to generate and how to retrieve for + * it. + */ + export interface Company { + filename: string; + + key: string; + + prompt: string; + + search_queries: Array; + } + + /** + * One document in a context-tree tier: what to generate and how to retrieve for + * it. + */ + export interface Workstream { + filename: string; + + key: string; + + prompt: string; + + search_queries: Array; + } + } +} + +export declare namespace Config { + export { + type ConfigUpdateResponse as ConfigUpdateResponse, + type ConfigGetResponse as ConfigGetResponse, + type ConfigResetResponse as ConfigResetResponse, + type ConfigUpdateParams as ConfigUpdateParams, + }; +} diff --git a/src/resources/context-documents/context-documents.ts b/src/resources/context-documents/context-documents.ts new file mode 100644 index 00000000..28dc5593 --- /dev/null +++ b/src/resources/context-documents/context-documents.ts @@ -0,0 +1,200 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../core/resource'; +import * as ConfigAPI from './config'; +import { + Config, + ConfigGetResponse, + ConfigResetResponse, + ConfigUpdateParams, + ConfigUpdateResponse, +} from './config'; +import * as DigestsAPI from './digests'; +import { + DigestGenerateParams, + DigestGenerateResponse, + DigestListParams, + DigestListResponse, + Digests, +} from './digests'; +import * as TreesAPI from './trees'; +import { + TreeGenerateParams, + TreeGenerateResponse, + TreeGetLatestParams, + TreeGetLatestResponse, + TreeGetResponse, + TreeProgressResponse, + Trees, +} from './trees'; +import { APIPromise } from '../../core/api-promise'; +import { + ContextDocumentsCursorPage, + type ContextDocumentsCursorPageParams, + PagePromise, +} from '../../core/pagination'; +import { RequestOptions } from '../../internal/request-options'; +import { path } from '../../internal/utils/path'; + +export class ContextDocuments extends APIResource { + trees: TreesAPI.Trees = new TreesAPI.Trees(this._client); + digests: DigestsAPI.Digests = new DigestsAPI.Digests(this._client); + config: ConfigAPI.Config = new ConfigAPI.Config(this._client); + + /** + * Generate an LLM-synthesized context document from the app's synced data. + * + * Generation runs asynchronously. The endpoint returns immediately with status + * `PROCESSING`; synthesis time depends on the amount of source data. + */ + generate( + body: ContextDocumentGenerateParams, + options?: RequestOptions, + ): APIPromise { + return this._client.post('/context-documents/generate', { body, ...options }); + } + + /** + * List context documents for the authenticated app, most recent first. + */ + list( + query: ContextDocumentListParams | null | undefined = {}, + options?: RequestOptions, + ): PagePromise { + return this._client.getAPIList( + '/context-documents', + ContextDocumentsCursorPage, + { query, ...options }, + ); + } + + /** + * Get a specific context document by ID. + */ + get(documentID: string, options?: RequestOptions): APIPromise { + return this._client.get(path`/context-documents/${documentID}`, options); + } +} + +export type ContextDocumentListResponsesContextDocumentsCursorPage = + ContextDocumentsCursorPage; + +export interface ContextDocumentListResponse { + completed_at: string | null; + + created_at: string; + + document_id: string; + + model: string; + + sources: Array; + + status: string; + + token_count: number | null; + + error?: string | null; +} + +export interface ContextDocumentGenerateResponse { + created_at: string; + + document_id: string; + + status: string; +} + +export interface ContextDocumentGetResponse { + completed_at: string | null; + + content: string | null; + + created_at: string; + + document_id: string; + + error: string | null; + + metadata: { [key: string]: unknown }; + + model: string; + + prompt: string | null; + + sources: Array; + + status: string; + + token_usage: { [key: string]: unknown } | null; + + user_id: string | null; +} + +export interface ContextDocumentGenerateParams { + /** + * Model used for final synthesis. + */ + model?: string; + + /** + * Custom prompt template. Replaces the standard summary prompt. + */ + prompt?: string | null; + + /** + * Integration sources to include (e.g., ['gmail', 'slack']). Defaults to all + * connected integrations. + */ + sources?: Array | null; + + /** + * Scope generation to a specific user's data. + */ + user_id?: string | null; +} + +export interface ContextDocumentListParams extends ContextDocumentsCursorPageParams { + status?: 'processing' | 'completed' | 'failed' | null; +} + +ContextDocuments.Trees = Trees; +ContextDocuments.Digests = Digests; +ContextDocuments.Config = Config; + +export declare namespace ContextDocuments { + export { + type ContextDocumentListResponse as ContextDocumentListResponse, + type ContextDocumentGenerateResponse as ContextDocumentGenerateResponse, + type ContextDocumentGetResponse as ContextDocumentGetResponse, + type ContextDocumentListResponsesContextDocumentsCursorPage as ContextDocumentListResponsesContextDocumentsCursorPage, + type ContextDocumentGenerateParams as ContextDocumentGenerateParams, + type ContextDocumentListParams as ContextDocumentListParams, + }; + + export { + Trees as Trees, + type TreeGenerateResponse as TreeGenerateResponse, + type TreeGetResponse as TreeGetResponse, + type TreeGetLatestResponse as TreeGetLatestResponse, + type TreeProgressResponse as TreeProgressResponse, + type TreeGenerateParams as TreeGenerateParams, + type TreeGetLatestParams as TreeGetLatestParams, + }; + + export { + Digests as Digests, + type DigestListResponse as DigestListResponse, + type DigestGenerateResponse as DigestGenerateResponse, + type DigestGenerateParams as DigestGenerateParams, + type DigestListParams as DigestListParams, + }; + + export { + Config as Config, + type ConfigUpdateResponse as ConfigUpdateResponse, + type ConfigGetResponse as ConfigGetResponse, + type ConfigResetResponse as ConfigResetResponse, + type ConfigUpdateParams as ConfigUpdateParams, + }; +} diff --git a/src/resources/context-documents/digests.ts b/src/resources/context-documents/digests.ts new file mode 100644 index 00000000..09663e99 --- /dev/null +++ b/src/resources/context-documents/digests.ts @@ -0,0 +1,103 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../core/resource'; +import { APIPromise } from '../../core/api-promise'; +import { RequestOptions } from '../../internal/request-options'; + +export class Digests extends APIResource { + /** + * Generate a date-windowed "what the company did today" digest. + * + * Returns immediately with a tree ID. Poll + * `GET /context-documents/tree/{tree_id}/progress` for completion or fetch the + * result with `GET /context-documents/tree/by-id/{tree_id}`. + */ + generate(body: DigestGenerateParams, options?: RequestOptions): APIPromise { + return this._client.post('/context-documents/digest', { body, ...options }); + } + + /** + * List recent digest summaries, newest first. + * + * Filter by cadence with `period=daily` or `period=weekly`. Fetch full content + * with `GET /context-documents/tree/by-id/{tree_id}`. + */ + list( + query: DigestListParams | null | undefined = {}, + options?: RequestOptions, + ): APIPromise { + return this._client.get('/context-documents/digest/list', { query, ...options }); + } +} + +export interface DigestListResponse { + digests: Array; +} + +export namespace DigestListResponse { + /** + * A digest summary. Fetch the full content through the tree-by-ID endpoint. + */ + export interface Digest { + completed_at: string | null; + + created_at: string; + + period: string | null; + + status: string; + + tree_id: string; + + window_end: string | null; + + window_start: string | null; + } +} + +export interface DigestGenerateResponse { + created_at: string; + + status: string; + + tree_id: string; +} + +export interface DigestGenerateParams { + /** + * Digest cadence: 'daily' or 'weekly'. Sets the default window when none is given. + */ + period?: string; + + /** + * Integration sources to include (e.g., ['slack', 'github']). Defaults to all. + */ + sources?: Array | null; + + /** + * Exclusive upper bound of the digest window. Defaults to now. + */ + window_end?: string | null; + + /** + * Inclusive lower bound of the digest window. Defaults to midnight UTC today + * (paired with window_end=now) when omitted. Both bounds must be supplied + * together. + */ + window_start?: string | null; +} + +export interface DigestListParams { + limit?: number; + + period?: string | null; +} + +export declare namespace Digests { + export { + type DigestListResponse as DigestListResponse, + type DigestGenerateResponse as DigestGenerateResponse, + type DigestGenerateParams as DigestGenerateParams, + type DigestListParams as DigestListParams, + }; +} diff --git a/src/resources/context-documents/index.ts b/src/resources/context-documents/index.ts new file mode 100644 index 00000000..adf605d5 --- /dev/null +++ b/src/resources/context-documents/index.ts @@ -0,0 +1,34 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export { + Config, + type ConfigUpdateResponse, + type ConfigGetResponse, + type ConfigResetResponse, + type ConfigUpdateParams, +} from './config'; +export { + ContextDocuments, + type ContextDocumentListResponse, + type ContextDocumentGenerateResponse, + type ContextDocumentGetResponse, + type ContextDocumentGenerateParams, + type ContextDocumentListParams, + type ContextDocumentListResponsesContextDocumentsCursorPage, +} from './context-documents'; +export { + Digests, + type DigestListResponse, + type DigestGenerateResponse, + type DigestGenerateParams, + type DigestListParams, +} from './digests'; +export { + Trees, + type TreeGenerateResponse, + type TreeGetResponse, + type TreeGetLatestResponse, + type TreeProgressResponse, + type TreeGenerateParams, + type TreeGetLatestParams, +} from './trees'; diff --git a/src/resources/context-documents/trees.ts b/src/resources/context-documents/trees.ts new file mode 100644 index 00000000..1b231beb --- /dev/null +++ b/src/resources/context-documents/trees.ts @@ -0,0 +1,250 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../core/resource'; +import { APIPromise } from '../../core/api-promise'; +import { RequestOptions } from '../../internal/request-options'; +import { path } from '../../internal/utils/path'; + +export class Trees extends APIResource { + /** + * Generate a three-tier context document tree for local push delivery. + * + * Creates company, workstream, and personal context documents from the app's + * synced data. Returns immediately with a tree ID; use + * `GET /context-documents/tree/latest` to retrieve the result. + */ + generate( + body: TreeGenerateParams | null | undefined = {}, + options?: RequestOptions, + ): APIPromise { + return this._client.post('/context-documents/tree', { body, ...options }); + } + + /** + * Get the most recent context document tree for the authenticated app. + * + * By default, the endpoint returns the latest ready tree. Readiness depends on + * whether the app has `require_review` enabled: + * + * - `require_review=False` (default): return the latest completed tree. + * - `require_review=True`: return the latest published tree. + * + * `status` filters to a specific status (case-insensitive). When no ready tree + * exists yet, the endpoint returns the newest available generation state. + */ + getLatest( + query: TreeGetLatestParams | null | undefined = {}, + options?: RequestOptions, + ): APIPromise { + return this._client.get('/context-documents/tree/latest', { query, ...options }); + } + + /** + * Fetch a specific tree by its tree ID instead of selecting the latest one. + */ + get(treeID: string, options?: RequestOptions): APIPromise { + return this._client.get(path`/context-documents/tree/by-id/${treeID}`, options); + } + + /** + * Return the generation progress for a single tree. + * + * Active generations include phase and counter data. Completed generations, and + * generations without detailed progress data, return status only. + */ + progress(treeID: string, options?: RequestOptions): APIPromise { + return this._client.get(path`/context-documents/tree/${treeID}/progress`, options); + } +} + +export interface TreeGenerateResponse { + created_at: string; + + status: string; + + tree_id: string; +} + +export interface TreeGetResponse { + completed_at: string | null; + + created_at: string; + + error: string | null; + + files: Array | null; + + meta: { [key: string]: unknown }; + + status: string; + + tree_id: string; + + version: number; + + /** + * Status of a newer generation that is processing or recently failed. + * + * This can accompany the last ready tree so clients can report progress while + * continuing to use ready content. + */ + generating?: TreeGetResponse.Generating | null; +} + +export namespace TreeGetResponse { + export interface File { + content: string; + + path: string; + + team: string | null; + + tier: string; + + updated_at: string; + + error?: string | null; + + provenance?: { [key: string]: unknown } | null; + + status?: string | null; + } + + /** + * Status of a newer generation that is processing or recently failed. + * + * This can accompany the last ready tree so clients can report progress while + * continuing to use ready content. + */ + export interface Generating { + created_at: string; + + status: 'processing' | 'failed'; + + tree_id: string; + + error?: string | null; + + progress?: { [key: string]: unknown } | null; + } +} + +export interface TreeGetLatestResponse { + completed_at: string | null; + + created_at: string; + + error: string | null; + + files: Array | null; + + meta: { [key: string]: unknown }; + + status: string; + + tree_id: string; + + version: number; + + /** + * Status of a newer generation that is processing or recently failed. + * + * This can accompany the last ready tree so clients can report progress while + * continuing to use ready content. + */ + generating?: TreeGetLatestResponse.Generating | null; +} + +export namespace TreeGetLatestResponse { + export interface File { + content: string; + + path: string; + + team: string | null; + + tier: string; + + updated_at: string; + + error?: string | null; + + provenance?: { [key: string]: unknown } | null; + + status?: string | null; + } + + /** + * Status of a newer generation that is processing or recently failed. + * + * This can accompany the last ready tree so clients can report progress while + * continuing to use ready content. + */ + export interface Generating { + created_at: string; + + status: 'processing' | 'failed'; + + tree_id: string; + + error?: string | null; + + progress?: { [key: string]: unknown } | null; + } +} + +/** + * Response shape for GET /context-documents/tree/{tree_id}/progress. + */ +export interface TreeProgressResponse { + status: string; + + tree_id: string; + + completed_docs?: number | null; + + failed_docs?: number | null; + + failed_keys?: Array | null; + + /** + * Generation phase. Values: discover, search, select, synthesize, finalize, + * personal, done. Null when detailed progress is unavailable. + */ + phase?: string | null; + + total_docs?: number | null; +} + +export interface TreeGenerateParams { + /** + * Integration sources to include (e.g., ['gmail', 'slack']). Defaults to all. + */ + sources?: Array | null; + + /** + * User ID for personal tier scoping. When set, personal/context.md is generated + * from this user's data only. Company and workstream tiers still use all data. + */ + user_id?: string | null; + + /** + * Generate docs for this workstream only (skip auto-detection). + */ + workstream_name?: string | null; +} + +export interface TreeGetLatestParams { + status?: string | null; +} + +export declare namespace Trees { + export { + type TreeGenerateResponse as TreeGenerateResponse, + type TreeGetResponse as TreeGetResponse, + type TreeGetLatestResponse as TreeGetLatestResponse, + type TreeProgressResponse as TreeProgressResponse, + type TreeGenerateParams as TreeGenerateParams, + type TreeGetLatestParams as TreeGetLatestParams, + }; +} diff --git a/src/resources/evaluate.ts b/src/resources/evaluate.ts index d1b4683d..9758c9c0 100644 --- a/src/resources/evaluate.ts +++ b/src/resources/evaluate.ts @@ -11,8 +11,8 @@ export class Evaluate extends APIResource { /** * Paginate through all prior queries for the app, newest first. * - * User tokens only see their own queries; admin tokens see every query in the app - * and can narrow to a single user with the `user_id` filter. + * Requests scoped to a user only see that user's queries. App-wide requests see + * every query in the app and can filter by `user_id`. */ listQueries( query: EvaluateListQueriesParams | null | undefined = {}, diff --git a/src/resources/index.ts b/src/resources/index.ts index 53f58731..2eb3f82e 100644 --- a/src/resources/index.ts +++ b/src/resources/index.ts @@ -16,6 +16,15 @@ export { type AuthUserTokenParams, } from './auth'; export { Connections, type ConnectionListResponse, type ConnectionRevokeResponse } from './connections'; +export { + ContextDocuments, + type ContextDocumentListResponse, + type ContextDocumentGenerateResponse, + type ContextDocumentGetResponse, + type ContextDocumentGenerateParams, + type ContextDocumentListParams, + type ContextDocumentListResponsesContextDocumentsCursorPage, +} from './context-documents/context-documents'; export { Evaluate, type EvaluateListQueriesResponse, diff --git a/src/resources/integrations/google-calendar.ts b/src/resources/integrations/google-calendar.ts deleted file mode 100644 index d787927a..00000000 --- a/src/resources/integrations/google-calendar.ts +++ /dev/null @@ -1,53 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import { APIResource } from '../../core/resource'; -import { APIPromise } from '../../core/api-promise'; -import { RequestOptions } from '../../internal/request-options'; - -export class GoogleCalendar extends APIResource { - /** - * List available calendars for a user. This can be used to ie. populate a dropdown - * for the user to select a calendar. - * - * @example - * ```ts - * const calendar = - * await client.integrations.googleCalendar.list(); - * ``` - */ - list(options?: RequestOptions): APIPromise { - return this._client.get('/integrations/google_calendar/list', options); - } -} - -export interface Calendar { - items: Array; -} - -export namespace Calendar { - export interface Item { - /** - * The ID of the calendar - */ - id: string; - - /** - * The name of the calendar - */ - name: string; - - /** - * Whether the calendar is the primary calendar of the user - */ - primary: boolean; - - /** - * Default timezone of the calendar - */ - timezone: string | null; - } -} - -export declare namespace GoogleCalendar { - export { type Calendar as Calendar }; -} diff --git a/src/resources/integrations/index.ts b/src/resources/integrations/index.ts index ee806e5b..696ac3dc 100644 --- a/src/resources/integrations/index.ts +++ b/src/resources/integrations/index.ts @@ -1,11 +1,9 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { GoogleCalendar, type Calendar } from './google-calendar'; export { Integrations, type IntegrationListResponse, type IntegrationConnectResponse, type IntegrationConnectParams, } from './integrations'; -export { Slack, type SlackListResponse, type SlackListParams } from './slack'; export { WebCrawler, type WebCrawlerIndexResponse, type WebCrawlerIndexParams } from './web-crawler'; diff --git a/src/resources/integrations/integrations.ts b/src/resources/integrations/integrations.ts index cb41aeb1..ddb667ec 100644 --- a/src/resources/integrations/integrations.ts +++ b/src/resources/integrations/integrations.ts @@ -1,10 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../core/resource'; -import * as GoogleCalendarAPI from './google-calendar'; -import { Calendar, GoogleCalendar } from './google-calendar'; -import * as SlackAPI from './slack'; -import { Slack, SlackListParams, SlackListResponse } from './slack'; import * as WebCrawlerAPI from './web-crawler'; import { WebCrawler, WebCrawlerIndexParams, WebCrawlerIndexResponse } from './web-crawler'; import { APIPromise } from '../../core/api-promise'; @@ -12,17 +8,10 @@ import { RequestOptions } from '../../internal/request-options'; import { path } from '../../internal/utils/path'; export class Integrations extends APIResource { - googleCalendar: GoogleCalendarAPI.GoogleCalendar = new GoogleCalendarAPI.GoogleCalendar(this._client); webCrawler: WebCrawlerAPI.WebCrawler = new WebCrawlerAPI.WebCrawler(this._client); - slack: SlackAPI.Slack = new SlackAPI.Slack(this._client); /** * List all integrations for the user. - * - * @example - * ```ts - * const integrations = await client.integrations.list(); - * ``` */ list(options?: RequestOptions): APIPromise { return this._client.get('/integrations/list', options); @@ -30,13 +19,6 @@ export class Integrations extends APIResource { /** * Redirects to the connect URL to link an integration. - * - * @example - * ```ts - * const response = await client.integrations.connect( - * 'integration_id', - * ); - * ``` */ connect( integrationID: string, @@ -87,34 +69,88 @@ export namespace IntegrationListResponse { | 'slack' | 'google_calendar' | 'google_mail' + | 'imap' + | 'google_meet' | 'box' | 'dropbox' | 'github' + | 'gitlab' | 'google_drive' | 'vault' | 'web_crawler' | 'trace' + | 'microsoft_outlook' | 'microsoft_teams' - | 'gmail_actions' | 'granola' | 'fathom' | 'fireflies' + | 'figma' | 'linear' | 'hubspot' | 'salesforce' | 'coda' + | 'confluence' + | 'jira' + | 'metabase' + | 'gong' + | 'clickup' | 'lightfield' - | 'gong'; + | 'pylon' + | 'fellow' + | 'odoo' + | 'external_mcp'; /** * Whether this integration only supports write actions (no sync) */ actions_only?: boolean; + /** + * Whether indexing waits until the user selects at least one channel. + */ + channel_selection_required?: boolean; + + /** + * Whether this app already has a scope='app' (service-account/bot) connection for + * this integration. Informational only: a shared connection no longer blocks + * personal OAuth — shared and personal connections can coexist. + */ + connected_via_service_account?: boolean; + + /** + * Whether a new personal connection waits for the user to select at least one + * folder before indexing begins. Shared service-account connections are exempt. + */ + folder_selection_required?: boolean; + + /** + * Whether private channels are included by default when no explicit channel + * selection is provided. + */ + private_channels_included?: boolean; + + /** + * Whether public channels are included by default when no explicit channel + * selection is provided. + */ + public_channels_included?: boolean; + /** * Whether the user must select channels before indexing starts */ requires_channel_selection?: boolean; + + /** + * Whether the integration allows users to choose specific channels to index. + * Unless selection is required, an empty selection indexes all channels. + */ + supports_channel_selection?: boolean; + + /** + * Whether the integration supports listing folders and configuring per-folder sync + * policies. + */ + supports_folder_selection?: boolean; } } @@ -128,9 +164,7 @@ export interface IntegrationConnectParams { redirect_url?: string | null; } -Integrations.GoogleCalendar = GoogleCalendar; Integrations.WebCrawler = WebCrawler; -Integrations.Slack = Slack; export declare namespace Integrations { export { @@ -139,17 +173,9 @@ export declare namespace Integrations { type IntegrationConnectParams as IntegrationConnectParams, }; - export { GoogleCalendar as GoogleCalendar, type Calendar as Calendar }; - export { WebCrawler as WebCrawler, type WebCrawlerIndexResponse as WebCrawlerIndexResponse, type WebCrawlerIndexParams as WebCrawlerIndexParams, }; - - export { - Slack as Slack, - type SlackListResponse as SlackListResponse, - type SlackListParams as SlackListParams, - }; } diff --git a/src/resources/integrations/slack.ts b/src/resources/integrations/slack.ts deleted file mode 100644 index 6a6da06b..00000000 --- a/src/resources/integrations/slack.ts +++ /dev/null @@ -1,58 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import { APIResource } from '../../core/resource'; -import { APIPromise } from '../../core/api-promise'; -import { RequestOptions } from '../../internal/request-options'; - -export class Slack extends APIResource { - /** - * List Slack conversations accessible to the user via the live Nango connection. - * - * Returns minimal channel metadata suitable for selection UIs. If required scopes - * are missing, Slack's error is propagated with details. - * - * Supports filtering by channels, including/excluding private channels, DMs, group - * DMs, and archived channels based on the provided search options. - * - * @example - * ```ts - * const slacks = await client.integrations.slack.list(); - * ``` - */ - list(query: SlackListParams | null | undefined = {}, options?: RequestOptions): APIPromise { - return this._client.get('/integrations/slack/list', { query, ...options }); - } -} - -export type SlackListResponse = unknown; - -export interface SlackListParams { - /** - * List of Slack channels to include (by id, name, or #name). - */ - channels?: Array; - - /** - * If set, pass 'exclude_archived' to Slack. If None, omit the param. - */ - exclude_archived?: boolean | null; - - /** - * Include direct messages (im) when listing conversations. - */ - include_dms?: boolean; - - /** - * Include group DMs (mpim) when listing conversations. - */ - include_group_dms?: boolean; - - /** - * Include private channels when constructing Slack 'types'. - */ - include_private?: boolean; -} - -export declare namespace Slack { - export { type SlackListResponse as SlackListResponse, type SlackListParams as SlackListParams }; -} diff --git a/src/resources/integrations/web-crawler.ts b/src/resources/integrations/web-crawler.ts index 79f7748e..26b07852 100644 --- a/src/resources/integrations/web-crawler.ts +++ b/src/resources/integrations/web-crawler.ts @@ -7,13 +7,6 @@ import { RequestOptions } from '../../internal/request-options'; export class WebCrawler extends APIResource { /** * Recursively crawl a website to make it available for indexed search. - * - * @example - * ```ts - * const response = await client.integrations.webCrawler.index( - * { url: 'url' }, - * ); - * ``` */ index(query: WebCrawlerIndexParams, options?: RequestOptions): APIPromise { return this._client.get('/integrations/web_crawler/index', { query, ...options }); @@ -29,26 +22,46 @@ export interface WebCrawlerIndexResponse { | 'slack' | 'google_calendar' | 'google_mail' + | 'imap' + | 'google_meet' | 'box' | 'dropbox' | 'github' + | 'gitlab' | 'google_drive' | 'vault' | 'web_crawler' | 'trace' + | 'microsoft_outlook' | 'microsoft_teams' - | 'gmail_actions' | 'granola' | 'fathom' | 'fireflies' + | 'figma' | 'linear' | 'hubspot' | 'salesforce' | 'coda' + | 'confluence' + | 'jira' + | 'metabase' + | 'gong' + | 'clickup' | 'lightfield' - | 'gong'; + | 'pylon' + | 'fellow' + | 'odoo' + | 'external_mcp'; - status: 'pending' | 'processing' | 'completed' | 'failed' | 'pending_review' | 'skipped'; + status: + | 'pending' + | 'processing' + | 'completed' + | 'failed' + | 'pending_review' + | 'skipped' + | 'filtered' + | 'cancelled'; } export interface WebCrawlerIndexParams { diff --git a/src/resources/memories.ts b/src/resources/memories.ts index cd8ff777..1aeb6aab 100644 --- a/src/resources/memories.ts +++ b/src/resources/memories.ts @@ -29,9 +29,9 @@ export class Memories extends APIResource { /** * Adds multiple documents to the index in a single request. * - * All items are validated before any database operations occur. If any item fails - * validation, the entire batch is rejected with a 422 error detailing which items - * failed and why. + * All items are validated before processing begins. If any item fails validation, + * the entire batch is rejected with a 422 error detailing which items failed and + * why. * * Maximum 100 items per request. Each item follows the same schema as the * single-item /memories/add endpoint. @@ -120,8 +120,8 @@ export class Memories extends APIResource { } /** - * Retrieves a document by provider and resource_id, as a document-shaped response - * carrying the full hyperdoc tree (ENG-2479 Phase 4). + * Retrieve a document by provider and resource ID, including its full hyperdoc + * tree. * * @example * ```ts @@ -131,8 +131,8 @@ export class Memories extends APIResource { * ``` */ get(resourceID: string, params: MemoryGetParams, options?: RequestOptions): APIPromise { - const { source } = params; - return this._client.get(path`/memories/get/${source}/${resourceID}`, options); + const { source, ...query } = params; + return this._client.get(path`/memories/get/${source}/${resourceID}`, { query, ...options }); } /** @@ -150,23 +150,7 @@ export class Memories extends APIResource { } /** - * Delete a memory and its associated chunks from the index. - * - * This removes the memory completely from the vector index and database. The - * operation deletes: - * - * 1. All chunks associated with the resource (including embeddings) - * 2. The documents row AND any legacy resources rows sharing the identity — - * leaving either one behind would resurrect the memory through the double-read - * path (ENG-2477). - * - * Args: source: The document provider (e.g., gmail, notion, vault) resource_id: - * The unique identifier of the resource to delete api_token: Authentication token - * - * Returns: MemoryDeletionResponse with deletion details - * - * Raises: DocumentNotFound: If the resource doesn't exist or user doesn't have - * access + * Delete a memory accessible to the authenticated credential. * * @example * ```ts @@ -196,35 +180,55 @@ export interface MemoryStatus { | 'slack' | 'google_calendar' | 'google_mail' + | 'imap' + | 'google_meet' | 'box' | 'dropbox' | 'github' + | 'gitlab' | 'google_drive' | 'vault' | 'web_crawler' | 'trace' + | 'microsoft_outlook' | 'microsoft_teams' - | 'gmail_actions' | 'granola' | 'fathom' | 'fireflies' + | 'figma' | 'linear' | 'hubspot' | 'salesforce' | 'coda' + | 'confluence' + | 'jira' + | 'metabase' + | 'gong' + | 'clickup' | 'lightfield' - | 'gong'; - - status: 'pending' | 'processing' | 'completed' | 'failed' | 'pending_review' | 'skipped'; + | 'pylon' + | 'fellow' + | 'odoo' + | 'external_mcp'; + + status: + | 'pending' + | 'processing' + | 'completed' + | 'failed' + | 'pending_review' + | 'skipped' + | 'filtered' + | 'cancelled'; } /** - * A document-shaped API response carrying the hyperdoc tree (ENG-2479/D12). + * A document-shaped API response containing the hyperdoc tree. */ export interface MemoryListResponse { /** * The full hyperdoc tree. Switch on `type` for the document frame and recurse - * `children` for the body — see the `` renderer. + * through `children` for the body. */ document: | Shared.Document @@ -238,7 +242,8 @@ export interface MemoryListResponse { | Shared.Trace | Shared.Transcript | Shared.Company - | Shared.Deal; + | Shared.Deal + | MemoryListResponse.Invoice; resource_id: string; @@ -248,30 +253,48 @@ export interface MemoryListResponse { | 'slack' | 'google_calendar' | 'google_mail' + | 'imap' + | 'google_meet' | 'box' | 'dropbox' | 'github' + | 'gitlab' | 'google_drive' | 'vault' | 'web_crawler' | 'trace' + | 'microsoft_outlook' | 'microsoft_teams' - | 'gmail_actions' | 'granola' | 'fathom' | 'fireflies' + | 'figma' | 'linear' | 'hubspot' | 'salesforce' | 'coda' + | 'confluence' + | 'jira' + | 'metabase' + | 'gong' + | 'clickup' | 'lightfield' - | 'gong'; + | 'pylon' + | 'fellow' + | 'odoo' + | 'external_mcp'; /** * Hyperdoc document type discriminator (document, message, file, event, ...). */ type: string; + /** + * Extracted memories (chunks with summaries) for this document, in document order. + * Present only when explicitly requested via `include_chunks`; omitted otherwise. + */ + chunks?: Array | null; + /** * The document's collection, if any. */ @@ -288,7 +311,7 @@ export interface MemoryListResponse { ingested_at?: string | null; /** - * When the source document was last modified. + * When the source document was last modified, if supplied by the source. */ last_modified_at?: string | null; @@ -300,7 +323,16 @@ export interface MemoryListResponse { /** * Indexing status of the document. */ - status?: 'pending' | 'processing' | 'completed' | 'failed' | 'pending_review' | 'skipped' | null; + status?: + | 'pending' + | 'processing' + | 'completed' + | 'failed' + | 'pending_review' + | 'skipped' + | 'filtered' + | 'cancelled' + | null; /** * Human-readable document title. @@ -308,6 +340,117 @@ export interface MemoryListResponse { title?: string | null; } +export namespace MemoryListResponse { + /** + * A customer invoice, vendor bill, or credit memo. + * + * Line items are included in `children`. + */ + export interface Invoice { + id?: string; + + attachment_names?: Array | null; + + balance_amount?: number | null; + + cancelled_at?: string | null; + + children?: Array< + | Shared.Blob + | Shared.Callout + | Shared.Chunk + | Shared.Code + | Shared.Comment + | Shared.Divider + | Shared.Equation + | Shared.Footnote + | Shared.Heading + | Shared.Image + | Shared.Link + | Shared.LineBreak + | Shared.List + | Shared.ListItem + | Shared.Page + | Shared.Paragraph + | Shared.Quote + | Shared.Table + | Shared.TableCell + | Shared.TableRow + | Shared.Text + | Shared.ToDo + | Shared.ToolCall + | Shared.ToolResult + | Shared.TraceMessage + | Shared.Utterance + >; + + contact_id?: string | null; + + contact_name?: string | null; + + currency?: string | null; + + due_at?: string | null; + + invoice_type?: string | null; + + /** + * Optional annotations carried by a hyperdoc node. + * + * Includes source provenance and human edit attribution. Unset metadata is omitted + * from serialized responses. + */ + metadata?: Shared.Metadata | null; + + notes?: string | null; + + number?: string | null; + + organization_id?: string | null; + + paid_amount?: number | null; + + paid_at?: string | null; + + posted_at?: string | null; + + reference?: string | null; + + refund_amount?: number | null; + + refund_reason?: string | null; + + refunded_at?: string | null; + + status?: string | null; + + tax_amount?: number | null; + + text?: string | null; + + total_amount?: number | null; + + type?: 'invoice'; + } + + /** + * A searchable chunk extracted from a document during ingestion. + * + * `summary` is null when no summary was generated for the chunk. + */ + export interface Chunk { + /** + * Stable identifier of the chunk. + */ + chunk_id: string; + + /** + * LLM-generated summary of the chunk, if one was produced. + */ + summary?: string | null; + } +} + export interface MemoryDeleteResponse { chunks_deleted: number; @@ -321,24 +464,36 @@ export interface MemoryDeleteResponse { | 'slack' | 'google_calendar' | 'google_mail' + | 'imap' + | 'google_meet' | 'box' | 'dropbox' | 'github' + | 'gitlab' | 'google_drive' | 'vault' | 'web_crawler' | 'trace' + | 'microsoft_outlook' | 'microsoft_teams' - | 'gmail_actions' | 'granola' | 'fathom' | 'fireflies' + | 'figma' | 'linear' | 'hubspot' | 'salesforce' | 'coda' + | 'confluence' + | 'jira' + | 'metabase' + | 'gong' + | 'clickup' | 'lightfield' - | 'gong'; + | 'pylon' + | 'fellow' + | 'odoo' + | 'external_mcp'; success: boolean; } @@ -357,16 +512,44 @@ export interface MemoryAddBulkResponse { */ items: Array; + /** + * Items not ingested because their resource_id is already owned by another user on + * this app. Empty in the common case; a non-empty list is a partial success, not + * an error. + */ + skipped?: Array; + success?: boolean; } +export namespace MemoryAddBulkResponse { + /** + * A bulk item that was neither written nor indexed, with the reason. + * + * `owned_by_another_user` means the resource ID already belongs to another user in + * the app. The bulk endpoint skips that item without modifying the existing + * document. Single-item `/memories/add` returns 409 instead. + */ + export interface Skipped { + /** + * Why the item was skipped (e.g. 'owned_by_another_user') + */ + reason: string; + + /** + * Resource ID of the skipped item + */ + resource_id: string; + } +} + /** - * A document-shaped API response carrying the hyperdoc tree (ENG-2479/D12). + * A document-shaped API response containing the hyperdoc tree. */ export interface MemoryGetResponse { /** * The full hyperdoc tree. Switch on `type` for the document frame and recurse - * `children` for the body — see the `` renderer. + * through `children` for the body. */ document: | Shared.Document @@ -380,7 +563,8 @@ export interface MemoryGetResponse { | Shared.Trace | Shared.Transcript | Shared.Company - | Shared.Deal; + | Shared.Deal + | MemoryGetResponse.Invoice; resource_id: string; @@ -390,30 +574,48 @@ export interface MemoryGetResponse { | 'slack' | 'google_calendar' | 'google_mail' + | 'imap' + | 'google_meet' | 'box' | 'dropbox' | 'github' + | 'gitlab' | 'google_drive' | 'vault' | 'web_crawler' | 'trace' + | 'microsoft_outlook' | 'microsoft_teams' - | 'gmail_actions' | 'granola' | 'fathom' | 'fireflies' + | 'figma' | 'linear' | 'hubspot' | 'salesforce' | 'coda' + | 'confluence' + | 'jira' + | 'metabase' + | 'gong' + | 'clickup' | 'lightfield' - | 'gong'; + | 'pylon' + | 'fellow' + | 'odoo' + | 'external_mcp'; /** * Hyperdoc document type discriminator (document, message, file, event, ...). */ type: string; + /** + * Extracted memories (chunks with summaries) for this document, in document order. + * Present only when explicitly requested via `include_chunks`; omitted otherwise. + */ + chunks?: Array | null; + /** * The document's collection, if any. */ @@ -430,7 +632,7 @@ export interface MemoryGetResponse { ingested_at?: string | null; /** - * When the source document was last modified. + * When the source document was last modified, if supplied by the source. */ last_modified_at?: string | null; @@ -442,7 +644,16 @@ export interface MemoryGetResponse { /** * Indexing status of the document. */ - status?: 'pending' | 'processing' | 'completed' | 'failed' | 'pending_review' | 'skipped' | null; + status?: + | 'pending' + | 'processing' + | 'completed' + | 'failed' + | 'pending_review' + | 'skipped' + | 'filtered' + | 'cancelled' + | null; /** * Human-readable document title. @@ -450,10 +661,239 @@ export interface MemoryGetResponse { title?: string | null; } +export namespace MemoryGetResponse { + /** + * A customer invoice, vendor bill, or credit memo. + * + * Line items are included in `children`. + */ + export interface Invoice { + id?: string; + + attachment_names?: Array | null; + + balance_amount?: number | null; + + cancelled_at?: string | null; + + children?: Array< + | Shared.Blob + | Shared.Callout + | Shared.Chunk + | Shared.Code + | Shared.Comment + | Shared.Divider + | Shared.Equation + | Shared.Footnote + | Shared.Heading + | Shared.Image + | Shared.Link + | Shared.LineBreak + | Shared.List + | Shared.ListItem + | Shared.Page + | Shared.Paragraph + | Shared.Quote + | Shared.Table + | Shared.TableCell + | Shared.TableRow + | Shared.Text + | Shared.ToDo + | Shared.ToolCall + | Shared.ToolResult + | Shared.TraceMessage + | Shared.Utterance + >; + + contact_id?: string | null; + + contact_name?: string | null; + + currency?: string | null; + + due_at?: string | null; + + invoice_type?: string | null; + + /** + * Optional annotations carried by a hyperdoc node. + * + * Includes source provenance and human edit attribution. Unset metadata is omitted + * from serialized responses. + */ + metadata?: Shared.Metadata | null; + + notes?: string | null; + + number?: string | null; + + organization_id?: string | null; + + paid_amount?: number | null; + + paid_at?: string | null; + + posted_at?: string | null; + + reference?: string | null; + + refund_amount?: number | null; + + refund_reason?: string | null; + + refunded_at?: string | null; + + status?: string | null; + + tax_amount?: number | null; + + text?: string | null; + + total_amount?: number | null; + + type?: 'invoice'; + } + + /** + * A searchable chunk extracted from a document during ingestion. + * + * `summary` is null when no summary was generated for the chunk. + */ + export interface Chunk { + /** + * Stable identifier of the chunk. + */ + chunk_id: string; + + /** + * LLM-generated summary of the chunk, if one was produced. + */ + summary?: string | null; + } +} + export interface MemoryStatusResponse { providers: { [key: string]: { [key: string]: number } }; total: { [key: string]: number }; + + integrations?: Array; +} + +export namespace MemoryStatusResponse { + /** + * Health summary for a configured integration. + * + * `provider` uses lowercase snake_case naming (e.g. `google_drive`). + */ + export interface Integration { + connections: Array; + + /** + * The current error for a connection. + * + * `detail` contains a sanitized summary suitable for display. + */ + error: Integration.Error | null; + + integration_id: string; + + last_synced_at: string | null; + + provider: string; + + /** + * Current health status of a connection or integration. + */ + status: + | 'broken' + | 'stalled' + | 'error' + | 'rate_limited' + | 'syncing' + | 'connected' + | 'live' + | 'never_synced' + | 'not_connected'; + } + + export namespace Integration { + /** + * The current health of one connection. + */ + export interface Connection { + id: string; + + /** + * The current error for a connection. + * + * `detail` contains a sanitized summary suitable for display. + */ + error: Connection.Error | null; + + label: string | null; + + last_activity_at: string | null; + + last_synced_at: string | null; + + /** + * Current health status of a connection or integration. + */ + status: + | 'broken' + | 'stalled' + | 'error' + | 'rate_limited' + | 'syncing' + | 'connected' + | 'live' + | 'never_synced' + | 'not_connected'; + } + + export namespace Connection { + /** + * The current error for a connection. + * + * `detail` contains a sanitized summary suitable for display. + */ + export interface Error { + at: string; + + detail: string | null; + + /** + * Classification of the most recent synchronization or indexing failure. + */ + kind: 'auth' | 'rate_limited' | 'provider' | 'internal'; + + origin?: string | null; + + retry_at?: string | null; + } + } + + /** + * The current error for a connection. + * + * `detail` contains a sanitized summary suitable for display. + */ + export interface Error { + at: string; + + detail: string | null; + + /** + * Classification of the most recent synchronization or indexing failure. + */ + kind: 'auth' | 'rate_limited' | 'provider' | 'internal'; + + origin?: string | null; + + retry_at?: string | null; + } + } } export interface MemoryAddParams { @@ -570,24 +1010,36 @@ export interface MemoryUpdateParams { | 'slack' | 'google_calendar' | 'google_mail' + | 'imap' + | 'google_meet' | 'box' | 'dropbox' | 'github' + | 'gitlab' | 'google_drive' | 'vault' | 'web_crawler' | 'trace' + | 'microsoft_outlook' | 'microsoft_teams' - | 'gmail_actions' | 'granola' | 'fathom' | 'fireflies' + | 'figma' | 'linear' | 'hubspot' | 'salesforce' | 'coda' + | 'confluence' + | 'jira' + | 'metabase' + | 'gong' + | 'clickup' | 'lightfield' - | 'gong'; + | 'pylon' + | 'fellow' + | 'odoo' + | 'external_mcp'; /** * @deprecated Body param: The collection to move the document to — deprecated, set @@ -631,6 +1083,13 @@ export interface MemoryListParams extends CursorPageParams { */ filter?: string | null; + /** + * When > 0, include up to this many extracted memories (chunks with summaries) per + * document in each item's `chunks` field, in document order. 0 (default) omits + * them. + */ + include_chunks?: number; + /** * Filter documents by source. */ @@ -640,57 +1099,99 @@ export interface MemoryListParams extends CursorPageParams { | 'slack' | 'google_calendar' | 'google_mail' + | 'imap' + | 'google_meet' | 'box' | 'dropbox' | 'github' + | 'gitlab' | 'google_drive' | 'vault' | 'web_crawler' | 'trace' + | 'microsoft_outlook' | 'microsoft_teams' - | 'gmail_actions' | 'granola' | 'fathom' | 'fireflies' + | 'figma' | 'linear' | 'hubspot' | 'salesforce' | 'coda' - | 'lightfield' + | 'confluence' + | 'jira' + | 'metabase' | 'gong' + | 'clickup' + | 'lightfield' + | 'pylon' + | 'fellow' + | 'odoo' + | 'external_mcp' | null; /** * Filter documents by status. */ - status?: 'pending' | 'processing' | 'completed' | 'failed' | 'pending_review' | 'skipped' | null; + status?: + | 'pending' + | 'processing' + | 'completed' + | 'failed' + | 'pending_review' + | 'skipped' + | 'filtered' + | 'cancelled' + | null; } export interface MemoryGetParams { + /** + * Path param + */ source: | 'reddit' | 'notion' | 'slack' | 'google_calendar' | 'google_mail' + | 'imap' + | 'google_meet' | 'box' | 'dropbox' | 'github' + | 'gitlab' | 'google_drive' | 'vault' | 'web_crawler' | 'trace' + | 'microsoft_outlook' | 'microsoft_teams' - | 'gmail_actions' | 'granola' | 'fathom' | 'fireflies' + | 'figma' | 'linear' | 'hubspot' | 'salesforce' | 'coda' + | 'confluence' + | 'jira' + | 'metabase' + | 'gong' + | 'clickup' | 'lightfield' - | 'gong'; + | 'pylon' + | 'fellow' + | 'odoo' + | 'external_mcp'; + + /** + * Query param: When true, include the document's extracted memories (chunks with + * summaries) in the `chunks` field, in document order. + */ + include_chunks?: boolean; } export interface MemorySearchParams { @@ -705,13 +1206,10 @@ export interface MemorySearchParams { answer?: boolean; /** - * How much compute to spend on retrieval. Mirrors the dial popularized by - * frontier-model APIs (OpenAI reasoning_effort, etc.). 'minimal' = verbatim - * single-shot retrieval (fastest). 'low' = LLM rewrites the query for better - * retrieval and extracts date filters. 'medium' = rewrite + agentic refinement - * loop (the answer LLM may request additional retrieval rounds, up to 3). 'high' = - * rewrite + extended refinement (up to 6 rounds). Higher = better recall, more - * latency, more cost. + * Controls retrieval thoroughness. 'minimal' performs direct retrieval. 'low' + * improves the query and extracts date filters. 'medium' adds up to 3 refinement + * rounds; 'high' allows up to 6. Higher levels can improve recall but add latency + * and cost. */ effort?: 'minimal' | 'low' | 'medium' | 'high' | 'very_high'; @@ -728,13 +1226,15 @@ export interface MemorySearchParams { /** * If true (effort='very_high' only), attach a provenance record to the response: * the source documents and entities the answer was grounded in, the agent's search - * trajectory, and any sources that failed. Adds one indexed lookup; intended for - * auditability / compliance use cases. + * trajectory, and any sources that failed. Intended for auditability and + * compliance use cases. */ provenance?: boolean; /** - * Only query documents from these sources. + * Only query documents from these sources. Names are case-insensitive and accept + * either separator, so `Google Drive`'s provider may be given as `google_drive`, + * `google-drive`, or `GOOGLE_DRIVE`. */ sources?: Array< | 'reddit' @@ -742,24 +1242,36 @@ export interface MemorySearchParams { | 'slack' | 'google_calendar' | 'google_mail' + | 'imap' + | 'google_meet' | 'box' | 'dropbox' | 'github' + | 'gitlab' | 'google_drive' | 'vault' | 'web_crawler' | 'trace' + | 'microsoft_outlook' | 'microsoft_teams' - | 'gmail_actions' | 'granola' | 'fathom' | 'fireflies' + | 'figma' | 'linear' | 'hubspot' | 'salesforce' | 'coda' - | 'lightfield' + | 'confluence' + | 'jira' + | 'metabase' | 'gong' + | 'clickup' + | 'lightfield' + | 'pylon' + | 'fellow' + | 'odoo' + | 'external_mcp' >; } @@ -784,29 +1296,23 @@ export namespace MemorySearchParams { | 'llama-4-scout' | 'deepseek-r1' | 'gpt-oss-20b' - | 'gpt-oss-120b'; + | 'gpt-oss-120b' + | 'claude-sonnet-4-6' + | 'claude-sonnet-5' + | 'claude-opus-4-7' + | 'claude-opus-4-8'; /** * Only query documents created before this date. */ before?: string | null; - /** - * Search options for Box - */ - box?: Options.Box; - /** * Metadata filters using MongoDB-style operators. Example: {'status': 'published', * 'priority': {'$gt': 3}} */ filter?: { [key: string]: unknown } | null; - /** - * Search options for Google Calendar - */ - google_calendar?: Options.GoogleCalendar; - /** * Search options for Google Drive */ @@ -826,7 +1332,7 @@ export namespace MemorySearchParams { * Filter by memory type. Defaults to generic memories only. Pass multiple types to * include procedures, etc. */ - memory_types?: Array<'procedure' | 'memory'>; + memory_types?: Array<'procedure' | 'memory' | 'mood'>; /** * Search options for Notion @@ -853,6 +1359,12 @@ export namespace MemorySearchParams { */ slack?: Options.Slack; + /** + * IANA timezone used to interpret date-only bounds and relative calendar phrases. + * Defaults to UTC. + */ + timezone?: string; + /** * Search options for vault */ @@ -865,39 +1377,6 @@ export namespace MemorySearchParams { } export namespace Options { - /** - * Search options for Box - */ - export interface Box { - /** - * Weight of results from this source. A weight greater than 1.0 means more results - * from this source will be returned, a weight less than 1.0 means fewer results - * will be returned. This will only affect results if multiple sources are queried - * at the same time. - */ - weight?: number; - } - - /** - * Search options for Google Calendar - */ - export interface GoogleCalendar { - /** - * The ID of the calendar to search. If not provided, it will use the ID of the - * default calendar. You can get the list of calendars with the - * `/integrations/google_calendar/list` endpoint. - */ - calendar_id?: string | null; - - /** - * Weight of results from this source. A weight greater than 1.0 means more results - * from this source will be returned, a weight less than 1.0 means fewer results - * will be returned. This will only affect results if multiple sources are queried - * at the same time. - */ - weight?: number; - } - /** * Search options for Google Drive */ @@ -1035,24 +1514,36 @@ export interface MemoryDeleteParams { | 'slack' | 'google_calendar' | 'google_mail' + | 'imap' + | 'google_meet' | 'box' | 'dropbox' | 'github' + | 'gitlab' | 'google_drive' | 'vault' | 'web_crawler' | 'trace' + | 'microsoft_outlook' | 'microsoft_teams' - | 'gmail_actions' | 'granola' | 'fathom' | 'fireflies' + | 'figma' | 'linear' | 'hubspot' | 'salesforce' | 'coda' + | 'confluence' + | 'jira' + | 'metabase' + | 'gong' + | 'clickup' | 'lightfield' - | 'gong'; + | 'pylon' + | 'fellow' + | 'odoo' + | 'external_mcp'; } export declare namespace Memories { diff --git a/src/resources/sessions.ts b/src/resources/sessions.ts index 70cfa3c9..4a789100 100644 --- a/src/resources/sessions.ts +++ b/src/resources/sessions.ts @@ -54,7 +54,7 @@ export interface SessionAddParams { /** * What kind of memories to extract from the trace */ - extract?: Array<'procedure' | 'memory'>; + extract?: Array<'procedure' | 'memory' | 'mood'>; /** * Trace format: 'vercel', 'hyperdoc', or 'openclaw'. Auto-detected if not set. diff --git a/src/resources/shared.ts b/src/resources/shared.ts index bffd529f..843db745 100644 --- a/src/resources/shared.ts +++ b/src/resources/shared.ts @@ -1,5 +1,7 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +import * as Shared from './shared'; + /** * Represents embedded binary data using data URI scheme. * @@ -14,15 +16,10 @@ export interface Blob { id?: string; /** - * Per-block annotations carried by any Hyperdoc node (ENG-1390). - * - * Out-of-band annotations that travel with a block but aren't part of its content: - * provenance (`sources`) and human edit attribution (`edited_by`). New annotation - * types get added here as typed fields as the need arises. + * Optional annotations carried by a hyperdoc node. * - * Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset - * `metadata` (None) is dropped from serialization entirely, and within a populated - * `Metadata` only the set keys survive. + * Includes source provenance and human edit attribution. Unset metadata is omitted + * from serialized responses. */ metadata?: Metadata | null; @@ -47,6 +44,7 @@ export interface Callout { | LineBreak | List | ListItem + | Page | Paragraph | Quote | Table @@ -61,15 +59,10 @@ export interface Callout { > | null; /** - * Per-block annotations carried by any Hyperdoc node (ENG-1390). - * - * Out-of-band annotations that travel with a block but aren't part of its content: - * provenance (`sources`) and human edit attribution (`edited_by`). New annotation - * types get added here as typed fields as the need arises. + * Optional annotations carried by a hyperdoc node. * - * Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset - * `metadata` (None) is dropped from serialization entirely, and within a populated - * `Metadata` only the set keys survive. + * Includes source provenance and human edit attribution. Unset metadata is omitted + * from serialized responses. */ metadata?: Metadata | null; @@ -98,6 +91,7 @@ export interface Chunk { | LineBreak | List | ListItem + | Page | Paragraph | Quote | Table @@ -112,15 +106,10 @@ export interface Chunk { >; /** - * Per-block annotations carried by any Hyperdoc node (ENG-1390). + * Optional annotations carried by a hyperdoc node. * - * Out-of-band annotations that travel with a block but aren't part of its content: - * provenance (`sources`) and human edit attribution (`edited_by`). New annotation - * types get added here as typed fields as the need arises. - * - * Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset - * `metadata` (None) is dropped from serialization entirely, and within a populated - * `Metadata` only the set keys survive. + * Includes source provenance and human edit attribution. Unset metadata is omitted + * from serialized responses. */ metadata?: Metadata | null; @@ -137,15 +126,10 @@ export interface Code { language?: string | null; /** - * Per-block annotations carried by any Hyperdoc node (ENG-1390). - * - * Out-of-band annotations that travel with a block but aren't part of its content: - * provenance (`sources`) and human edit attribution (`edited_by`). New annotation - * types get added here as typed fields as the need arises. + * Optional annotations carried by a hyperdoc node. * - * Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset - * `metadata` (None) is dropped from serialization entirely, and within a populated - * `Metadata` only the set keys survive. + * Includes source provenance and human edit attribution. Unset metadata is omitted + * from serialized responses. */ metadata?: Metadata | null; @@ -160,15 +144,10 @@ export interface Comment { created_at?: string | null; /** - * Per-block annotations carried by any Hyperdoc node (ENG-1390). + * Optional annotations carried by a hyperdoc node. * - * Out-of-band annotations that travel with a block but aren't part of its content: - * provenance (`sources`) and human edit attribution (`edited_by`). New annotation - * types get added here as typed fields as the need arises. - * - * Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset - * `metadata` (None) is dropped from serialization entirely, and within a populated - * `Metadata` only the set keys survive. + * Includes source provenance and human edit attribution. Unset metadata is omitted + * from serialized responses. */ metadata?: Metadata | null; @@ -176,7 +155,7 @@ export interface Comment { } /** - * A CRM company/account record (ENG-2476/D10). + * A CRM company or account record. */ export interface Company { id?: string; @@ -198,6 +177,7 @@ export interface Company { | LineBreak | List | ListItem + | Page | Paragraph | Quote | Table @@ -228,15 +208,10 @@ export interface Company { is_active?: boolean | null; /** - * Per-block annotations carried by any Hyperdoc node (ENG-1390). - * - * Out-of-band annotations that travel with a block but aren't part of its content: - * provenance (`sources`) and human edit attribution (`edited_by`). New annotation - * types get added here as typed fields as the need arises. + * Optional annotations carried by a hyperdoc node. * - * Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset - * `metadata` (None) is dropped from serialization entirely, and within a populated - * `Metadata` only the set keys survive. + * Includes source provenance and human edit attribution. Unset metadata is omitted + * from serialized responses. */ metadata?: Metadata | null; @@ -263,18 +238,15 @@ export interface Conversation { children?: Array; /** - * Per-block annotations carried by any Hyperdoc node (ENG-1390). + * Optional annotations carried by a hyperdoc node. * - * Out-of-band annotations that travel with a block but aren't part of its content: - * provenance (`sources`) and human edit attribution (`edited_by`). New annotation - * types get added here as typed fields as the need arises. - * - * Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset - * `metadata` (None) is dropped from serialization entirely, and within a populated - * `Metadata` only the set keys survive. + * Includes source provenance and human edit attribution. Unset metadata is omitted + * from serialized responses. */ metadata?: Metadata | null; + participants?: Array | null; + text?: string | null; title?: string | null; @@ -283,7 +255,7 @@ export interface Conversation { } /** - * A CRM deal/opportunity record (ENG-2476/D10). + * A CRM deal or opportunity record. */ export interface Deal { id?: string; @@ -305,6 +277,7 @@ export interface Deal { | LineBreak | List | ListItem + | Page | Paragraph | Quote | Table @@ -331,15 +304,10 @@ export interface Deal { lost_reason?: string | null; /** - * Per-block annotations carried by any Hyperdoc node (ENG-1390). + * Optional annotations carried by a hyperdoc node. * - * Out-of-band annotations that travel with a block but aren't part of its content: - * provenance (`sources`) and human edit attribution (`edited_by`). New annotation - * types get added here as typed fields as the need arises. - * - * Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset - * `metadata` (None) is dropped from serialization entirely, and within a populated - * `Metadata` only the set keys survive. + * Includes source provenance and human edit attribution. Unset metadata is omitted + * from serialized responses. */ metadata?: Metadata | null; @@ -364,15 +332,10 @@ export interface Divider { id?: string; /** - * Per-block annotations carried by any Hyperdoc node (ENG-1390). - * - * Out-of-band annotations that travel with a block but aren't part of its content: - * provenance (`sources`) and human edit attribution (`edited_by`). New annotation - * types get added here as typed fields as the need arises. + * Optional annotations carried by a hyperdoc node. * - * Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset - * `metadata` (None) is dropped from serialization entirely, and within a populated - * `Metadata` only the set keys survive. + * Includes source provenance and human edit attribution. Unset metadata is omitted + * from serialized responses. */ metadata?: Metadata | null; @@ -397,6 +360,7 @@ export interface Document { | LineBreak | List | ListItem + | Page | Paragraph | Quote | Table @@ -411,15 +375,10 @@ export interface Document { >; /** - * Per-block annotations carried by any Hyperdoc node (ENG-1390). - * - * Out-of-band annotations that travel with a block but aren't part of its content: - * provenance (`sources`) and human edit attribution (`edited_by`). New annotation - * types get added here as typed fields as the need arises. + * Optional annotations carried by a hyperdoc node. * - * Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset - * `metadata` (None) is dropped from serialization entirely, and within a populated - * `Metadata` only the set keys survive. + * Includes source provenance and human edit attribution. Unset metadata is omitted + * from serialized responses. */ metadata?: Metadata | null; @@ -448,6 +407,7 @@ export interface Equation { | LineBreak | List | ListItem + | Page | Paragraph | Quote | Table @@ -462,15 +422,10 @@ export interface Equation { > | null; /** - * Per-block annotations carried by any Hyperdoc node (ENG-1390). + * Optional annotations carried by a hyperdoc node. * - * Out-of-band annotations that travel with a block but aren't part of its content: - * provenance (`sources`) and human edit attribution (`edited_by`). New annotation - * types get added here as typed fields as the need arises. - * - * Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset - * `metadata` (None) is dropped from serialization entirely, and within a populated - * `Metadata` only the set keys survive. + * Includes source provenance and human edit attribution. Unset metadata is omitted + * from serialized responses. */ metadata?: Metadata | null; @@ -499,6 +454,7 @@ export interface Event { | LineBreak | List | ListItem + | Page | Paragraph | Quote | Table @@ -519,15 +475,10 @@ export interface Event { meeting_url?: string | null; /** - * Per-block annotations carried by any Hyperdoc node (ENG-1390). - * - * Out-of-band annotations that travel with a block but aren't part of its content: - * provenance (`sources`) and human edit attribution (`edited_by`). New annotation - * types get added here as typed fields as the need arises. + * Optional annotations carried by a hyperdoc node. * - * Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset - * `metadata` (None) is dropped from serialization entirely, and within a populated - * `Metadata` only the set keys survive. + * Includes source provenance and human edit attribution. Unset metadata is omitted + * from serialized responses. */ metadata?: Metadata | null; @@ -562,6 +513,7 @@ export interface File { | LineBreak | List | ListItem + | Page | Paragraph | Quote | Table @@ -576,15 +528,15 @@ export interface File { >; /** - * Per-block annotations carried by any Hyperdoc node (ENG-1390). - * - * Out-of-band annotations that travel with a block but aren't part of its content: - * provenance (`sources`) and human edit attribution (`edited_by`). New annotation - * types get added here as typed fields as the need arises. + * Whether the stored readable body is a capped preview of the full file. + */ + content_truncated?: boolean | null; + + /** + * Optional annotations carried by a hyperdoc node. * - * Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset - * `metadata` (None) is dropped from serialization entirely, and within a populated - * `Metadata` only the set keys survive. + * Includes source provenance and human edit attribution. Unset metadata is omitted + * from serialized responses. */ metadata?: Metadata | null; @@ -615,6 +567,7 @@ export interface Footnote { | LineBreak | List | ListItem + | Page | Paragraph | Quote | Table @@ -629,15 +582,10 @@ export interface Footnote { > | null; /** - * Per-block annotations carried by any Hyperdoc node (ENG-1390). + * Optional annotations carried by a hyperdoc node. * - * Out-of-band annotations that travel with a block but aren't part of its content: - * provenance (`sources`) and human edit attribution (`edited_by`). New annotation - * types get added here as typed fields as the need arises. - * - * Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset - * `metadata` (None) is dropped from serialization entirely, and within a populated - * `Metadata` only the set keys survive. + * Includes source provenance and human edit attribution. Unset metadata is omitted + * from serialized responses. */ metadata?: Metadata | null; @@ -666,6 +614,7 @@ export interface Heading { | LineBreak | List | ListItem + | Page | Paragraph | Quote | Table @@ -680,15 +629,10 @@ export interface Heading { > | null; /** - * Per-block annotations carried by any Hyperdoc node (ENG-1390). - * - * Out-of-band annotations that travel with a block but aren't part of its content: - * provenance (`sources`) and human edit attribution (`edited_by`). New annotation - * types get added here as typed fields as the need arises. + * Optional annotations carried by a hyperdoc node. * - * Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset - * `metadata` (None) is dropped from serialization entirely, and within a populated - * `Metadata` only the set keys survive. + * Includes source provenance and human edit attribution. Unset metadata is omitted + * from serialized responses. */ metadata?: Metadata | null; @@ -705,15 +649,10 @@ export interface Image { id?: string; /** - * Per-block annotations carried by any Hyperdoc node (ENG-1390). - * - * Out-of-band annotations that travel with a block but aren't part of its content: - * provenance (`sources`) and human edit attribution (`edited_by`). New annotation - * types get added here as typed fields as the need arises. + * Optional annotations carried by a hyperdoc node. * - * Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset - * `metadata` (None) is dropped from serialization entirely, and within a populated - * `Metadata` only the set keys survive. + * Includes source provenance and human edit attribution. Unset metadata is omitted + * from serialized responses. */ metadata?: Metadata | null; @@ -724,15 +663,10 @@ export interface LineBreak { id?: string; /** - * Per-block annotations carried by any Hyperdoc node (ENG-1390). + * Optional annotations carried by a hyperdoc node. * - * Out-of-band annotations that travel with a block but aren't part of its content: - * provenance (`sources`) and human edit attribution (`edited_by`). New annotation - * types get added here as typed fields as the need arises. - * - * Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset - * `metadata` (None) is dropped from serialization entirely, and within a populated - * `Metadata` only the set keys survive. + * Includes source provenance and human edit attribution. Unset metadata is omitted + * from serialized responses. */ metadata?: Metadata | null; @@ -747,15 +681,10 @@ export interface Link { id?: string; /** - * Per-block annotations carried by any Hyperdoc node (ENG-1390). - * - * Out-of-band annotations that travel with a block but aren't part of its content: - * provenance (`sources`) and human edit attribution (`edited_by`). New annotation - * types get added here as typed fields as the need arises. + * Optional annotations carried by a hyperdoc node. * - * Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset - * `metadata` (None) is dropped from serialization entirely, and within a populated - * `Metadata` only the set keys survive. + * Includes source provenance and human edit attribution. Unset metadata is omitted + * from serialized responses. */ metadata?: Metadata | null; @@ -768,15 +697,10 @@ export interface List { children?: Array; /** - * Per-block annotations carried by any Hyperdoc node (ENG-1390). + * Optional annotations carried by a hyperdoc node. * - * Out-of-band annotations that travel with a block but aren't part of its content: - * provenance (`sources`) and human edit attribution (`edited_by`). New annotation - * types get added here as typed fields as the need arises. - * - * Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset - * `metadata` (None) is dropped from serialization entirely, and within a populated - * `Metadata` only the set keys survive. + * Includes source provenance and human edit attribution. Unset metadata is omitted + * from serialized responses. */ metadata?: Metadata | null; @@ -805,6 +729,7 @@ export interface ListItem { | LineBreak | List | ListItem + | Page | Paragraph | Quote | Table @@ -819,15 +744,10 @@ export interface ListItem { > | null; /** - * Per-block annotations carried by any Hyperdoc node (ENG-1390). - * - * Out-of-band annotations that travel with a block but aren't part of its content: - * provenance (`sources`) and human edit attribution (`edited_by`). New annotation - * types get added here as typed fields as the need arises. + * Optional annotations carried by a hyperdoc node. * - * Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset - * `metadata` (None) is dropped from serialization entirely, and within a populated - * `Metadata` only the set keys survive. + * Includes source provenance and human edit attribution. Unset metadata is omitted + * from serialized responses. */ metadata?: Metadata | null; @@ -864,6 +784,7 @@ export interface Message { | LineBreak | List | ListItem + | Page | Paragraph | Quote | Table @@ -887,15 +808,10 @@ export interface Message { mentioned_users?: Array | null; /** - * Per-block annotations carried by any Hyperdoc node (ENG-1390). + * Optional annotations carried by a hyperdoc node. * - * Out-of-band annotations that travel with a block but aren't part of its content: - * provenance (`sources`) and human edit attribution (`edited_by`). New annotation - * types get added here as typed fields as the need arises. - * - * Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset - * `metadata` (None) is dropped from serialization entirely, and within a populated - * `Metadata` only the set keys survive. + * Includes source provenance and human edit attribution. Unset metadata is omitted + * from serialized responses. */ metadata?: Metadata | null; @@ -926,15 +842,10 @@ export interface Message { } /** - * Per-block annotations carried by any Hyperdoc node (ENG-1390). - * - * Out-of-band annotations that travel with a block but aren't part of its content: - * provenance (`sources`) and human edit attribution (`edited_by`). New annotation - * types get added here as typed fields as the need arises. + * Optional annotations carried by a hyperdoc node. * - * Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset - * `metadata` (None) is dropped from serialization entirely, and within a populated - * `Metadata` only the set keys survive. + * Includes source provenance and human edit attribution. Unset metadata is omitted + * from serialized responses. */ export interface Metadata { edited_by?: string | null; @@ -944,14 +855,10 @@ export interface Metadata { export namespace Metadata { /** - * A reference to a memory/chunk that a block's content is grounded in (ENG-1390). + * A reference to source content that supports a block. * - * Chunks are the unit persisted to the DB — extracted memories become chunks when - * indexed — so `chunk_id` is the stable pointer back to the source. `resource_id` - * and `source` locate the originating document; `score` carries optional retrieval - * relevance. Kept deliberately self-contained (plain `str` for `source` rather - * than the `DocumentProviders` enum) so the hyperdoc format stays free of - * app-layer imports. + * `chunk_id` identifies the supporting content. `resource_id` and `source` + * identify its document, and `score` optionally records relevance. */ export interface Source { chunk_id: string; @@ -964,7 +871,7 @@ export namespace Metadata { } } -export interface Paragraph { +export interface Page { id?: string; children?: Array< @@ -982,6 +889,7 @@ export interface Paragraph { | LineBreak | List | ListItem + | Page | Paragraph | Quote | Table @@ -996,15 +904,59 @@ export interface Paragraph { > | null; /** - * Per-block annotations carried by any Hyperdoc node (ENG-1390). + * Optional annotations carried by a hyperdoc node. * - * Out-of-band annotations that travel with a block but aren't part of its content: - * provenance (`sources`) and human edit attribution (`edited_by`). New annotation - * types get added here as typed fields as the need arises. + * Includes source provenance and human edit attribution. Unset metadata is omitted + * from serialized responses. + */ + metadata?: Metadata | null; + + page_number?: number | null; + + preview_url?: string | null; + + text?: string | null; + + type?: 'page'; +} + +export interface Paragraph { + id?: string; + + children?: Array< + | Blob + | Callout + | Chunk + | Code + | Comment + | Divider + | Equation + | Footnote + | Heading + | Image + | Link + | LineBreak + | List + | ListItem + | Page + | Paragraph + | Quote + | Table + | TableCell + | TableRow + | Text + | ToDo + | ToolCall + | ToolResult + | TraceMessage + | Utterance + > | null; + + /** + * Optional annotations carried by a hyperdoc node. * - * Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset - * `metadata` (None) is dropped from serialization entirely, and within a populated - * `Metadata` only the set keys survive. + * Includes source provenance and human edit attribution. Unset metadata is omitted + * from serialized responses. */ metadata?: Metadata | null; @@ -1035,6 +987,7 @@ export interface Person { | LineBreak | List | ListItem + | Page | Paragraph | Quote | Table @@ -1065,20 +1018,19 @@ export interface Person { image_url?: string | null; + is_app_user?: boolean | null; + + is_bot?: boolean | null; + job_title?: string | null; link_urls?: Array | null; /** - * Per-block annotations carried by any Hyperdoc node (ENG-1390). - * - * Out-of-band annotations that travel with a block but aren't part of its content: - * provenance (`sources`) and human edit attribution (`edited_by`). New annotation - * types get added here as typed fields as the need arises. + * Optional annotations carried by a hyperdoc node. * - * Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset - * `metadata` (None) is dropped from serialization entirely, and within a populated - * `Metadata` only the set keys survive. + * Includes source provenance and human edit attribution. Unset metadata is omitted + * from serialized responses. */ metadata?: Metadata | null; @@ -1096,11 +1048,7 @@ export interface Person { } /** - * Auditability record attached to an agentic answer. - * - * Gated behind `provenance=true` on the request: the cheap parts (sources, steps, - * failed_sources) are derived from in-memory loop state, but `entities` costs one - * indexed DB lookup, so the whole record is only built on request. + * Auditability record returned when requested for a supported query. */ export interface Provenance { entities?: Array; @@ -1124,7 +1072,9 @@ export interface ProvenanceEntity { } /** - * A source document that informed the final answer (the post-rank result set). + * A source document that informed the final answer. + * + * Includes available retrieval details such as title and relevance score. */ export interface ProvenanceSource { resource_id: string; @@ -1135,27 +1085,47 @@ export interface ProvenanceSource { | 'slack' | 'google_calendar' | 'google_mail' + | 'imap' + | 'google_meet' | 'box' | 'dropbox' | 'github' + | 'gitlab' | 'google_drive' | 'vault' | 'web_crawler' | 'trace' + | 'microsoft_outlook' | 'microsoft_teams' - | 'gmail_actions' | 'granola' | 'fathom' | 'fireflies' + | 'figma' | 'linear' | 'hubspot' | 'salesforce' | 'coda' + | 'confluence' + | 'jira' + | 'metabase' + | 'gong' + | 'clickup' | 'lightfield' - | 'gong'; + | 'pylon' + | 'fellow' + | 'odoo' + | 'external_mcp'; + + chunk_id?: string | null; + + content_sha256?: string | null; + + owner?: string | null; score?: number | null; + span?: Array | null; + title?: string | null; } @@ -1183,8 +1153,14 @@ export interface QueryResult { answer?: string | null; /** - * The matching documents, each carrying its hyperdoc tree plus query-path - * score/highlights/summary (ENG-2479 Phase 4). + * Privacy notice set when cross-user alpha mode ran. Callers must display it + * alongside the synthesized answer. + */ + disclaimer?: string | null; + + /** + * The matching documents, each carrying its hyperdoc tree plus query-path score, + * highlights, and summary. */ documents?: Array; @@ -1195,11 +1171,7 @@ export interface QueryResult { errors?: Array<{ [key: string]: string }> | null; /** - * Auditability record attached to an agentic answer. - * - * Gated behind `provenance=true` on the request: the cheap parts (sources, steps, - * failed_sources) are derived from in-memory loop state, but `entities` costs one - * indexed DB lookup, so the whole record is only built on request. + * Auditability record returned when requested for a supported query. */ provenance?: Provenance | null; @@ -1238,6 +1210,7 @@ export interface Quote { | LineBreak | List | ListItem + | Page | Paragraph | Quote | Table @@ -1252,15 +1225,10 @@ export interface Quote { > | null; /** - * Per-block annotations carried by any Hyperdoc node (ENG-1390). + * Optional annotations carried by a hyperdoc node. * - * Out-of-band annotations that travel with a block but aren't part of its content: - * provenance (`sources`) and human edit attribution (`edited_by`). New annotation - * types get added here as typed fields as the need arises. - * - * Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset - * `metadata` (None) is dropped from serialization entirely, and within a populated - * `Metadata` only the set keys survive. + * Includes source provenance and human edit attribution. Unset metadata is omitted + * from serialized responses. */ metadata?: Metadata | null; @@ -1270,14 +1238,13 @@ export interface Quote { } /** - * A `DocumentResponse` plus the query-path fields a `ScoredDocument` carries - * (ENG-2479): relevance score, matched highlights, and the concatenated summary of - * those highlights. + * A document response with its relevance score, matched highlights, and a summary + * of those highlights. */ export interface ScoredDocumentResponse { /** * The full hyperdoc tree. Switch on `type` for the document frame and recurse - * `children` for the body — see the `` renderer. + * through `children` for the body. */ document: | Document @@ -1291,7 +1258,8 @@ export interface ScoredDocumentResponse { | Trace | Transcript | Company - | Deal; + | Deal + | ScoredDocumentResponse.Invoice; resource_id: string; @@ -1301,30 +1269,48 @@ export interface ScoredDocumentResponse { | 'slack' | 'google_calendar' | 'google_mail' + | 'imap' + | 'google_meet' | 'box' | 'dropbox' | 'github' + | 'gitlab' | 'google_drive' | 'vault' | 'web_crawler' | 'trace' + | 'microsoft_outlook' | 'microsoft_teams' - | 'gmail_actions' | 'granola' | 'fathom' | 'fireflies' + | 'figma' | 'linear' | 'hubspot' | 'salesforce' | 'coda' + | 'confluence' + | 'jira' + | 'metabase' + | 'gong' + | 'clickup' | 'lightfield' - | 'gong'; + | 'pylon' + | 'fellow' + | 'odoo' + | 'external_mcp'; /** * Hyperdoc document type discriminator (document, message, file, event, ...). */ type: string; + /** + * Extracted memories (chunks with summaries) for this document, in document order. + * Present only when explicitly requested via `include_chunks`; omitted otherwise. + */ + chunks?: Array | null; + /** * The document's collection, if any. */ @@ -1346,7 +1332,7 @@ export interface ScoredDocumentResponse { ingested_at?: string | null; /** - * When the source document was last modified. + * When the source document was last modified, if supplied by the source. */ last_modified_at?: string | null; @@ -1363,7 +1349,16 @@ export interface ScoredDocumentResponse { /** * Indexing status of the document. */ - status?: 'pending' | 'processing' | 'completed' | 'failed' | 'pending_review' | 'skipped' | null; + status?: + | 'pending' + | 'processing' + | 'completed' + | 'failed' + | 'pending_review' + | 'skipped' + | 'filtered' + | 'cancelled' + | null; /** * Concatenated text of the matched highlights. @@ -1376,6 +1371,117 @@ export interface ScoredDocumentResponse { title?: string | null; } +export namespace ScoredDocumentResponse { + /** + * A customer invoice, vendor bill, or credit memo. + * + * Line items are included in `children`. + */ + export interface Invoice { + id?: string; + + attachment_names?: Array | null; + + balance_amount?: number | null; + + cancelled_at?: string | null; + + children?: Array< + | Shared.Blob + | Shared.Callout + | Shared.Chunk + | Shared.Code + | Shared.Comment + | Shared.Divider + | Shared.Equation + | Shared.Footnote + | Shared.Heading + | Shared.Image + | Shared.Link + | Shared.LineBreak + | Shared.List + | Shared.ListItem + | Shared.Page + | Shared.Paragraph + | Shared.Quote + | Shared.Table + | Shared.TableCell + | Shared.TableRow + | Shared.Text + | Shared.ToDo + | Shared.ToolCall + | Shared.ToolResult + | Shared.TraceMessage + | Shared.Utterance + >; + + contact_id?: string | null; + + contact_name?: string | null; + + currency?: string | null; + + due_at?: string | null; + + invoice_type?: string | null; + + /** + * Optional annotations carried by a hyperdoc node. + * + * Includes source provenance and human edit attribution. Unset metadata is omitted + * from serialized responses. + */ + metadata?: Shared.Metadata | null; + + notes?: string | null; + + number?: string | null; + + organization_id?: string | null; + + paid_amount?: number | null; + + paid_at?: string | null; + + posted_at?: string | null; + + reference?: string | null; + + refund_amount?: number | null; + + refund_reason?: string | null; + + refunded_at?: string | null; + + status?: string | null; + + tax_amount?: number | null; + + text?: string | null; + + total_amount?: number | null; + + type?: 'invoice'; + } + + /** + * A searchable chunk extracted from a document during ingestion. + * + * `summary` is null when no summary was generated for the chunk. + */ + export interface Chunk { + /** + * Stable identifier of the chunk. + */ + chunk_id: string; + + /** + * LLM-generated summary of the chunk, if one was produced. + */ + summary?: string | null; + } +} + export interface Table { id?: string; @@ -1387,15 +1493,10 @@ export interface Table { has_header?: boolean; /** - * Per-block annotations carried by any Hyperdoc node (ENG-1390). - * - * Out-of-band annotations that travel with a block but aren't part of its content: - * provenance (`sources`) and human edit attribution (`edited_by`). New annotation - * types get added here as typed fields as the need arises. + * Optional annotations carried by a hyperdoc node. * - * Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset - * `metadata` (None) is dropped from serialization entirely, and within a populated - * `Metadata` only the set keys survive. + * Includes source provenance and human edit attribution. Unset metadata is omitted + * from serialized responses. */ metadata?: Metadata | null; @@ -1424,6 +1525,7 @@ export interface TableCell { | LineBreak | List | ListItem + | Page | Paragraph | Quote | Table @@ -1438,15 +1540,10 @@ export interface TableCell { > | null; /** - * Per-block annotations carried by any Hyperdoc node (ENG-1390). + * Optional annotations carried by a hyperdoc node. * - * Out-of-band annotations that travel with a block but aren't part of its content: - * provenance (`sources`) and human edit attribution (`edited_by`). New annotation - * types get added here as typed fields as the need arises. - * - * Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset - * `metadata` (None) is dropped from serialization entirely, and within a populated - * `Metadata` only the set keys survive. + * Includes source provenance and human edit attribution. Unset metadata is omitted + * from serialized responses. */ metadata?: Metadata | null; @@ -1461,15 +1558,10 @@ export interface TableRow { children?: Array; /** - * Per-block annotations carried by any Hyperdoc node (ENG-1390). - * - * Out-of-band annotations that travel with a block but aren't part of its content: - * provenance (`sources`) and human edit attribution (`edited_by`). New annotation - * types get added here as typed fields as the need arises. + * Optional annotations carried by a hyperdoc node. * - * Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset - * `metadata` (None) is dropped from serialization entirely, and within a populated - * `Metadata` only the set keys survive. + * Includes source provenance and human edit attribution. Unset metadata is omitted + * from serialized responses. */ metadata?: Metadata | null; @@ -1496,6 +1588,7 @@ export interface Task { | LineBreak | List | ListItem + | Page | Paragraph | Quote | Table @@ -1514,15 +1607,10 @@ export interface Task { due_at?: string | null; /** - * Per-block annotations carried by any Hyperdoc node (ENG-1390). + * Optional annotations carried by a hyperdoc node. * - * Out-of-band annotations that travel with a block but aren't part of its content: - * provenance (`sources`) and human edit attribution (`edited_by`). New annotation - * types get added here as typed fields as the need arises. - * - * Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset - * `metadata` (None) is dropped from serialization entirely, and within a populated - * `Metadata` only the set keys survive. + * Includes source provenance and human edit attribution. Unset metadata is omitted + * from serialized responses. */ metadata?: Metadata | null; @@ -1543,15 +1631,10 @@ export interface Text { marks?: Array<'bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | 'math'> | null; /** - * Per-block annotations carried by any Hyperdoc node (ENG-1390). - * - * Out-of-band annotations that travel with a block but aren't part of its content: - * provenance (`sources`) and human edit attribution (`edited_by`). New annotation - * types get added here as typed fields as the need arises. + * Optional annotations carried by a hyperdoc node. * - * Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset - * `metadata` (None) is dropped from serialization entirely, and within a populated - * `Metadata` only the set keys survive. + * Includes source provenance and human edit attribution. Unset metadata is omitted + * from serialized responses. */ metadata?: Metadata | null; @@ -1578,6 +1661,7 @@ export interface ToDo { | LineBreak | List | ListItem + | Page | Paragraph | Quote | Table @@ -1592,15 +1676,10 @@ export interface ToDo { > | null; /** - * Per-block annotations carried by any Hyperdoc node (ENG-1390). + * Optional annotations carried by a hyperdoc node. * - * Out-of-band annotations that travel with a block but aren't part of its content: - * provenance (`sources`) and human edit attribution (`edited_by`). New annotation - * types get added here as typed fields as the need arises. - * - * Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset - * `metadata` (None) is dropped from serialization entirely, and within a populated - * `Metadata` only the set keys survive. + * Includes source provenance and human edit attribution. Unset metadata is omitted + * from serialized responses. */ metadata?: Metadata | null; @@ -1622,15 +1701,10 @@ export interface ToolCall { args?: { [key: string]: unknown }; /** - * Per-block annotations carried by any Hyperdoc node (ENG-1390). - * - * Out-of-band annotations that travel with a block but aren't part of its content: - * provenance (`sources`) and human edit attribution (`edited_by`). New annotation - * types get added here as typed fields as the need arises. + * Optional annotations carried by a hyperdoc node. * - * Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset - * `metadata` (None) is dropped from serialization entirely, and within a populated - * `Metadata` only the set keys survive. + * Includes source provenance and human edit attribution. Unset metadata is omitted + * from serialized responses. */ metadata?: Metadata | null; @@ -1652,15 +1726,10 @@ export interface ToolResult { is_error?: boolean; /** - * Per-block annotations carried by any Hyperdoc node (ENG-1390). + * Optional annotations carried by a hyperdoc node. * - * Out-of-band annotations that travel with a block but aren't part of its content: - * provenance (`sources`) and human edit attribution (`edited_by`). New annotation - * types get added here as typed fields as the need arises. - * - * Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset - * `metadata` (None) is dropped from serialization entirely, and within a populated - * `Metadata` only the set keys survive. + * Includes source provenance and human edit attribution. Unset metadata is omitted + * from serialized responses. */ metadata?: Metadata | null; @@ -1679,15 +1748,10 @@ export interface Trace { children?: Array; /** - * Per-block annotations carried by any Hyperdoc node (ENG-1390). - * - * Out-of-band annotations that travel with a block but aren't part of its content: - * provenance (`sources`) and human edit attribution (`edited_by`). New annotation - * types get added here as typed fields as the need arises. + * Optional annotations carried by a hyperdoc node. * - * Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset - * `metadata` (None) is dropped from serialization entirely, and within a populated - * `Metadata` only the set keys survive. + * Includes source provenance and human edit attribution. Unset metadata is omitted + * from serialized responses. */ metadata?: Metadata | null; @@ -1709,15 +1773,10 @@ export interface TraceMessage { message_type?: 'message' | 'thinking'; /** - * Per-block annotations carried by any Hyperdoc node (ENG-1390). + * Optional annotations carried by a hyperdoc node. * - * Out-of-band annotations that travel with a block but aren't part of its content: - * provenance (`sources`) and human edit attribution (`edited_by`). New annotation - * types get added here as typed fields as the need arises. - * - * Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset - * `metadata` (None) is dropped from serialization entirely, and within a populated - * `Metadata` only the set keys survive. + * Includes source provenance and human edit attribution. Unset metadata is omitted + * from serialized responses. */ metadata?: Metadata | null; @@ -1729,8 +1788,7 @@ export interface TraceMessage { } /** - * A time-anchored, speaker-attributed transcript — meetings, calls (ENG-2476/D10; - * mirrors the Trace+TraceStep precedent). + * A time-anchored, speaker-attributed transcript for a meeting or call. * * Utterance timestamps are relative offsets from `started_at`, which is the * absolute wall-clock anchor. @@ -1743,15 +1801,10 @@ export interface Transcript { ended_at?: string | null; /** - * Per-block annotations carried by any Hyperdoc node (ENG-1390). - * - * Out-of-band annotations that travel with a block but aren't part of its content: - * provenance (`sources`) and human edit attribution (`edited_by`). New annotation - * types get added here as typed fields as the need arises. + * Optional annotations carried by a hyperdoc node. * - * Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset - * `metadata` (None) is dropped from serialization entirely, and within a populated - * `Metadata` only the set keys survive. + * Includes source provenance and human edit attribution. Unset metadata is omitted + * from serialized responses. */ metadata?: Metadata | null; @@ -1767,11 +1820,9 @@ export interface Transcript { } /** - * A speaker-attributed segment of a transcript (ENG-2476/D10). + * A speaker-attributed segment of a transcript. * - * "Utterance" is the standard name for this across transcription providers - * (AssemblyAI, Deepgram, Rev). Timestamps are relative offsets in seconds — - * provider-native; absolute times derive from `Transcript.started_at`. + * Start and end times are offsets in seconds from the beginning of the transcript. */ export interface Utterance { text: string; @@ -1781,15 +1832,10 @@ export interface Utterance { end?: number | null; /** - * Per-block annotations carried by any Hyperdoc node (ENG-1390). + * Optional annotations carried by a hyperdoc node. * - * Out-of-band annotations that travel with a block but aren't part of its content: - * provenance (`sources`) and human edit attribution (`edited_by`). New annotation - * types get added here as typed fields as the need arises. - * - * Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset - * `metadata` (None) is dropped from serialization entirely, and within a populated - * `Metadata` only the set keys survive. + * Includes source provenance and human edit attribution. Unset metadata is omitted + * from serialized responses. */ metadata?: Metadata | null; @@ -1820,6 +1866,7 @@ export interface Website { | LineBreak | List | ListItem + | Page | Paragraph | Quote | Table @@ -1842,15 +1889,10 @@ export interface Website { language?: string | null; /** - * Per-block annotations carried by any Hyperdoc node (ENG-1390). - * - * Out-of-band annotations that travel with a block but aren't part of its content: - * provenance (`sources`) and human edit attribution (`edited_by`). New annotation - * types get added here as typed fields as the need arises. + * Optional annotations carried by a hyperdoc node. * - * Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset - * `metadata` (None) is dropped from serialization entirely, and within a populated - * `Metadata` only the set keys survive. + * Includes source provenance and human edit attribution. Unset metadata is omitted + * from serialized responses. */ metadata?: Metadata | null; diff --git a/tests/api-resources/actions.test.ts b/tests/api-resources/actions.test.ts index 0eacbc9b..e3a55c72 100644 --- a/tests/api-resources/actions.test.ts +++ b/tests/api-resources/actions.test.ts @@ -10,7 +10,7 @@ const client = new Hyperspell({ describe('resource actions', () => { test('sendMessage: only required params', async () => { - const responsePromise = client.actions.sendMessage({ provider: 'reddit', text: 'text' }); + const responsePromise = client.actions.sendMessage({ provider: 'slack', text: 'text' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -22,7 +22,7 @@ describe('resource actions', () => { test('sendMessage: required and optional params', async () => { const response = await client.actions.sendMessage({ - provider: 'reddit', + provider: 'slack', text: 'text', channel: 'channel', connection: 'connection', @@ -34,7 +34,7 @@ describe('resource actions', () => { const responsePromise = client.actions.addReaction({ channel: 'channel', name: 'name', - provider: 'reddit', + provider: 'slack', timestamp: 'timestamp', }); const rawResponse = await responsePromise.asResponse(); @@ -50,7 +50,7 @@ describe('resource actions', () => { const response = await client.actions.addReaction({ channel: 'channel', name: 'name', - provider: 'reddit', + provider: 'slack', timestamp: 'timestamp', connection: 'connection', }); diff --git a/tests/api-resources/context-documents/config.test.ts b/tests/api-resources/context-documents/config.test.ts new file mode 100644 index 00000000..656c1935 --- /dev/null +++ b/tests/api-resources/context-documents/config.test.ts @@ -0,0 +1,44 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Hyperspell from '@hyperspell/hyperspell'; + +const client = new Hyperspell({ + apiKey: 'My API Key', + userID: 'My User ID', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource config', () => { + test('get', async () => { + const responsePromise = client.contextDocuments.config.get(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('update', async () => { + const responsePromise = client.contextDocuments.config.update({}); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('reset', async () => { + const responsePromise = client.contextDocuments.config.reset(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); +}); diff --git a/tests/api-resources/context-documents/context-documents.test.ts b/tests/api-resources/context-documents/context-documents.test.ts new file mode 100644 index 00000000..d22d25c2 --- /dev/null +++ b/tests/api-resources/context-documents/context-documents.test.ts @@ -0,0 +1,58 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Hyperspell from '@hyperspell/hyperspell'; + +const client = new Hyperspell({ + apiKey: 'My API Key', + userID: 'My User ID', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource contextDocuments', () => { + test('generate', async () => { + const responsePromise = client.contextDocuments.generate({}); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('list', async () => { + const responsePromise = client.contextDocuments.list(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('list: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.contextDocuments.list( + { + cursor: 'cursor', + limit: 0, + status: 'processing', + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Hyperspell.NotFoundError); + }); + + test('get', async () => { + const responsePromise = client.contextDocuments.get('document_id'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); +}); diff --git a/tests/api-resources/integrations/slack.test.ts b/tests/api-resources/context-documents/digests.test.ts similarity index 60% rename from tests/api-resources/integrations/slack.test.ts rename to tests/api-resources/context-documents/digests.test.ts index 7367e5fc..4969492e 100644 --- a/tests/api-resources/integrations/slack.test.ts +++ b/tests/api-resources/context-documents/digests.test.ts @@ -8,9 +8,20 @@ const client = new Hyperspell({ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); -describe('resource slack', () => { +describe('resource digests', () => { + test('generate', async () => { + const responsePromise = client.contextDocuments.digests.generate({}); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + test('list', async () => { - const responsePromise = client.integrations.slack.list(); + const responsePromise = client.contextDocuments.digests.list(); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -23,14 +34,8 @@ describe('resource slack', () => { test('list: request options and params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - client.integrations.slack.list( - { - channels: ['string'], - exclude_archived: true, - include_dms: true, - include_group_dms: true, - include_private: true, - }, + client.contextDocuments.digests.list( + { limit: 0, period: 'period' }, { path: '/_stainless_unknown_path' }, ), ).rejects.toThrow(Hyperspell.NotFoundError); diff --git a/tests/api-resources/context-documents/trees.test.ts b/tests/api-resources/context-documents/trees.test.ts new file mode 100644 index 00000000..e5adf76d --- /dev/null +++ b/tests/api-resources/context-documents/trees.test.ts @@ -0,0 +1,76 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Hyperspell from '@hyperspell/hyperspell'; + +const client = new Hyperspell({ + apiKey: 'My API Key', + userID: 'My User ID', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource trees', () => { + test('generate', async () => { + const responsePromise = client.contextDocuments.trees.generate(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('generate: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.contextDocuments.trees.generate( + { + sources: ['string'], + user_id: 'user_id', + workstream_name: 'workstream_name', + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Hyperspell.NotFoundError); + }); + + test('getLatest', async () => { + const responsePromise = client.contextDocuments.trees.getLatest(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('getLatest: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.contextDocuments.trees.getLatest({ status: 'status' }, { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Hyperspell.NotFoundError); + }); + + test('get', async () => { + const responsePromise = client.contextDocuments.trees.get('tree_id'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('progress', async () => { + const responsePromise = client.contextDocuments.trees.progress('tree_id'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); +}); diff --git a/tests/api-resources/integrations/google-calendar.test.ts b/tests/api-resources/integrations/google-calendar.test.ts deleted file mode 100644 index b9aa076e..00000000 --- a/tests/api-resources/integrations/google-calendar.test.ts +++ /dev/null @@ -1,22 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import Hyperspell from '@hyperspell/hyperspell'; - -const client = new Hyperspell({ - apiKey: 'My API Key', - userID: 'My User ID', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource googleCalendar', () => { - test('list', async () => { - const responsePromise = client.integrations.googleCalendar.list(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); -}); diff --git a/tests/api-resources/memories.test.ts b/tests/api-resources/memories.test.ts index 6b221029..ecf7df01 100644 --- a/tests/api-resources/memories.test.ts +++ b/tests/api-resources/memories.test.ts @@ -127,6 +127,7 @@ describe('resource memories', () => { collection: 'collection', cursor: 'cursor', filter: 'filter', + include_chunks: 0, size: 0, source: 'reddit', status: 'pending', @@ -159,7 +160,7 @@ describe('resource memories', () => { }); test('get: required and optional params', async () => { - const response = await client.memories.get('resource_id', { source: 'reddit' }); + const response = await client.memories.get('resource_id', { source: 'reddit', include_chunks: true }); }); test('search: only required params', async () => { @@ -183,9 +184,7 @@ describe('resource memories', () => { after: '2019-12-27T18:11:19.117Z', answer_model: 'llama-3.1', before: '2019-12-27T18:11:19.117Z', - box: { weight: 0 }, filter: {}, - google_calendar: { calendar_id: 'calendar_id', weight: 0 }, google_drive: { weight: 0 }, google_mail: { label_ids: ['string'], weight: 0 }, max_results: 1, @@ -201,6 +200,7 @@ describe('resource memories', () => { include_private: true, weight: 0, }, + timezone: 'timezone', vault: { weight: 0 }, web_crawler: { max_depth: 0, diff --git a/tests/qs/empty-keys-cases.ts b/tests/qs/empty-keys-cases.ts deleted file mode 100644 index ea2c1b0a..00000000 --- a/tests/qs/empty-keys-cases.ts +++ /dev/null @@ -1,271 +0,0 @@ -export const empty_test_cases = [ - { - input: '&', - with_empty_keys: {}, - stringify_output: { - brackets: '', - indices: '', - repeat: '', - }, - no_empty_keys: {}, - }, - { - input: '&&', - with_empty_keys: {}, - stringify_output: { - brackets: '', - indices: '', - repeat: '', - }, - no_empty_keys: {}, - }, - { - input: '&=', - with_empty_keys: { '': '' }, - stringify_output: { - brackets: '=', - indices: '=', - repeat: '=', - }, - no_empty_keys: {}, - }, - { - input: '&=&', - with_empty_keys: { '': '' }, - stringify_output: { - brackets: '=', - indices: '=', - repeat: '=', - }, - no_empty_keys: {}, - }, - { - input: '&=&=', - with_empty_keys: { '': ['', ''] }, - stringify_output: { - brackets: '[]=&[]=', - indices: '[0]=&[1]=', - repeat: '=&=', - }, - no_empty_keys: {}, - }, - { - input: '&=&=&', - with_empty_keys: { '': ['', ''] }, - stringify_output: { - brackets: '[]=&[]=', - indices: '[0]=&[1]=', - repeat: '=&=', - }, - no_empty_keys: {}, - }, - { - input: '=', - with_empty_keys: { '': '' }, - no_empty_keys: {}, - stringify_output: { - brackets: '=', - indices: '=', - repeat: '=', - }, - }, - { - input: '=&', - with_empty_keys: { '': '' }, - stringify_output: { - brackets: '=', - indices: '=', - repeat: '=', - }, - no_empty_keys: {}, - }, - { - input: '=&&&', - with_empty_keys: { '': '' }, - stringify_output: { - brackets: '=', - indices: '=', - repeat: '=', - }, - no_empty_keys: {}, - }, - { - input: '=&=&=&', - with_empty_keys: { '': ['', '', ''] }, - stringify_output: { - brackets: '[]=&[]=&[]=', - indices: '[0]=&[1]=&[2]=', - repeat: '=&=&=', - }, - no_empty_keys: {}, - }, - { - input: '=&a[]=b&a[1]=c', - with_empty_keys: { '': '', a: ['b', 'c'] }, - stringify_output: { - brackets: '=&a[]=b&a[]=c', - indices: '=&a[0]=b&a[1]=c', - repeat: '=&a=b&a=c', - }, - no_empty_keys: { a: ['b', 'c'] }, - }, - { - input: '=a', - with_empty_keys: { '': 'a' }, - no_empty_keys: {}, - stringify_output: { - brackets: '=a', - indices: '=a', - repeat: '=a', - }, - }, - { - input: 'a==a', - with_empty_keys: { a: '=a' }, - no_empty_keys: { a: '=a' }, - stringify_output: { - brackets: 'a==a', - indices: 'a==a', - repeat: 'a==a', - }, - }, - { - input: '=&a[]=b', - with_empty_keys: { '': '', a: ['b'] }, - stringify_output: { - brackets: '=&a[]=b', - indices: '=&a[0]=b', - repeat: '=&a=b', - }, - no_empty_keys: { a: ['b'] }, - }, - { - input: '=&a[]=b&a[]=c&a[2]=d', - with_empty_keys: { '': '', a: ['b', 'c', 'd'] }, - stringify_output: { - brackets: '=&a[]=b&a[]=c&a[]=d', - indices: '=&a[0]=b&a[1]=c&a[2]=d', - repeat: '=&a=b&a=c&a=d', - }, - no_empty_keys: { a: ['b', 'c', 'd'] }, - }, - { - input: '=a&=b', - with_empty_keys: { '': ['a', 'b'] }, - stringify_output: { - brackets: '[]=a&[]=b', - indices: '[0]=a&[1]=b', - repeat: '=a&=b', - }, - no_empty_keys: {}, - }, - { - input: '=a&foo=b', - with_empty_keys: { '': 'a', foo: 'b' }, - no_empty_keys: { foo: 'b' }, - stringify_output: { - brackets: '=a&foo=b', - indices: '=a&foo=b', - repeat: '=a&foo=b', - }, - }, - { - input: 'a[]=b&a=c&=', - with_empty_keys: { '': '', a: ['b', 'c'] }, - stringify_output: { - brackets: '=&a[]=b&a[]=c', - indices: '=&a[0]=b&a[1]=c', - repeat: '=&a=b&a=c', - }, - no_empty_keys: { a: ['b', 'c'] }, - }, - { - input: 'a[]=b&a=c&=', - with_empty_keys: { '': '', a: ['b', 'c'] }, - stringify_output: { - brackets: '=&a[]=b&a[]=c', - indices: '=&a[0]=b&a[1]=c', - repeat: '=&a=b&a=c', - }, - no_empty_keys: { a: ['b', 'c'] }, - }, - { - input: 'a[0]=b&a=c&=', - with_empty_keys: { '': '', a: ['b', 'c'] }, - stringify_output: { - brackets: '=&a[]=b&a[]=c', - indices: '=&a[0]=b&a[1]=c', - repeat: '=&a=b&a=c', - }, - no_empty_keys: { a: ['b', 'c'] }, - }, - { - input: 'a=b&a[]=c&=', - with_empty_keys: { '': '', a: ['b', 'c'] }, - stringify_output: { - brackets: '=&a[]=b&a[]=c', - indices: '=&a[0]=b&a[1]=c', - repeat: '=&a=b&a=c', - }, - no_empty_keys: { a: ['b', 'c'] }, - }, - { - input: 'a=b&a[0]=c&=', - with_empty_keys: { '': '', a: ['b', 'c'] }, - stringify_output: { - brackets: '=&a[]=b&a[]=c', - indices: '=&a[0]=b&a[1]=c', - repeat: '=&a=b&a=c', - }, - no_empty_keys: { a: ['b', 'c'] }, - }, - { - input: '[]=a&[]=b& []=1', - with_empty_keys: { '': ['a', 'b'], ' ': ['1'] }, - stringify_output: { - brackets: '[]=a&[]=b& []=1', - indices: '[0]=a&[1]=b& [0]=1', - repeat: '=a&=b& =1', - }, - no_empty_keys: { 0: 'a', 1: 'b', ' ': ['1'] }, - }, - { - input: '[0]=a&[1]=b&a[0]=1&a[1]=2', - with_empty_keys: { '': ['a', 'b'], a: ['1', '2'] }, - no_empty_keys: { 0: 'a', 1: 'b', a: ['1', '2'] }, - stringify_output: { - brackets: '[]=a&[]=b&a[]=1&a[]=2', - indices: '[0]=a&[1]=b&a[0]=1&a[1]=2', - repeat: '=a&=b&a=1&a=2', - }, - }, - { - input: '[deep]=a&[deep]=2', - with_empty_keys: { '': { deep: ['a', '2'] } }, - stringify_output: { - brackets: '[deep][]=a&[deep][]=2', - indices: '[deep][0]=a&[deep][1]=2', - repeat: '[deep]=a&[deep]=2', - }, - no_empty_keys: { deep: ['a', '2'] }, - }, - { - input: '%5B0%5D=a&%5B1%5D=b', - with_empty_keys: { '': ['a', 'b'] }, - stringify_output: { - brackets: '[]=a&[]=b', - indices: '[0]=a&[1]=b', - repeat: '=a&=b', - }, - no_empty_keys: { 0: 'a', 1: 'b' }, - }, -] satisfies { - input: string; - with_empty_keys: Record; - stringify_output: { - brackets: string; - indices: string; - repeat: string; - }; - no_empty_keys: Record; -}[]; diff --git a/tests/qs/stringify.test.ts b/tests/qs/stringify.test.ts deleted file mode 100644 index 47d83763..00000000 --- a/tests/qs/stringify.test.ts +++ /dev/null @@ -1,2232 +0,0 @@ -import iconv from 'iconv-lite'; -import { stringify } from '@hyperspell/hyperspell/internal/qs'; -import { encode } from '@hyperspell/hyperspell/internal/qs/utils'; -import { StringifyOptions } from '@hyperspell/hyperspell/internal/qs/types'; -import { empty_test_cases } from './empty-keys-cases'; -import assert from 'assert'; - -describe('stringify()', function () { - test('stringifies a querystring object', function () { - expect(stringify({ a: 'b' })).toBe('a=b'); - expect(stringify({ a: 1 })).toBe('a=1'); - expect(stringify({ a: 1, b: 2 })).toBe('a=1&b=2'); - expect(stringify({ a: 'A_Z' })).toBe('a=A_Z'); - expect(stringify({ a: '€' })).toBe('a=%E2%82%AC'); - expect(stringify({ a: '' })).toBe('a=%EE%80%80'); - expect(stringify({ a: 'א' })).toBe('a=%D7%90'); - expect(stringify({ a: '𐐷' })).toBe('a=%F0%90%90%B7'); - }); - - test('stringifies falsy values', function () { - expect(stringify(undefined)).toBe(''); - expect(stringify(null)).toBe(''); - expect(stringify(null, { strictNullHandling: true })).toBe(''); - expect(stringify(false)).toBe(''); - expect(stringify(0)).toBe(''); - }); - - test('stringifies symbols', function () { - expect(stringify(Symbol.iterator)).toBe(''); - expect(stringify([Symbol.iterator])).toBe('0=Symbol%28Symbol.iterator%29'); - expect(stringify({ a: Symbol.iterator })).toBe('a=Symbol%28Symbol.iterator%29'); - expect(stringify({ a: [Symbol.iterator] }, { encodeValuesOnly: true, arrayFormat: 'brackets' })).toBe( - 'a[]=Symbol%28Symbol.iterator%29', - ); - }); - - test('stringifies bigints', function () { - var three = BigInt(3); - // @ts-expect-error - var encodeWithN = function (value, defaultEncoder, charset) { - var result = defaultEncoder(value, defaultEncoder, charset); - return typeof value === 'bigint' ? result + 'n' : result; - }; - - expect(stringify(three)).toBe(''); - expect(stringify([three])).toBe('0=3'); - expect(stringify([three], { encoder: encodeWithN })).toBe('0=3n'); - expect(stringify({ a: three })).toBe('a=3'); - expect(stringify({ a: three }, { encoder: encodeWithN })).toBe('a=3n'); - expect(stringify({ a: [three] }, { encodeValuesOnly: true, arrayFormat: 'brackets' })).toBe('a[]=3'); - expect( - stringify({ a: [three] }, { encodeValuesOnly: true, encoder: encodeWithN, arrayFormat: 'brackets' }), - ).toBe('a[]=3n'); - }); - - test('encodes dot in key of object when encodeDotInKeys and allowDots is provided', function () { - expect( - stringify({ 'name.obj': { first: 'John', last: 'Doe' } }, { allowDots: false, encodeDotInKeys: false }), - ).toBe('name.obj%5Bfirst%5D=John&name.obj%5Blast%5D=Doe'); - expect( - stringify({ 'name.obj': { first: 'John', last: 'Doe' } }, { allowDots: true, encodeDotInKeys: false }), - ).toBe('name.obj.first=John&name.obj.last=Doe'); - expect( - stringify({ 'name.obj': { first: 'John', last: 'Doe' } }, { allowDots: false, encodeDotInKeys: true }), - ).toBe('name%252Eobj%5Bfirst%5D=John&name%252Eobj%5Blast%5D=Doe'); - expect( - stringify({ 'name.obj': { first: 'John', last: 'Doe' } }, { allowDots: true, encodeDotInKeys: true }), - ).toBe('name%252Eobj.first=John&name%252Eobj.last=Doe'); - - // st.equal( - // stringify( - // { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, - // { allowDots: false, encodeDotInKeys: false }, - // ), - // 'name.obj.subobject%5Bfirst.godly.name%5D=John&name.obj.subobject%5Blast%5D=Doe', - // 'with allowDots false and encodeDotInKeys false', - // ); - // st.equal( - // stringify( - // { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, - // { allowDots: true, encodeDotInKeys: false }, - // ), - // 'name.obj.subobject.first.godly.name=John&name.obj.subobject.last=Doe', - // 'with allowDots false and encodeDotInKeys false', - // ); - // st.equal( - // stringify( - // { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, - // { allowDots: false, encodeDotInKeys: true }, - // ), - // 'name%252Eobj%252Esubobject%5Bfirst.godly.name%5D=John&name%252Eobj%252Esubobject%5Blast%5D=Doe', - // 'with allowDots false and encodeDotInKeys true', - // ); - // st.equal( - // stringify( - // { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, - // { allowDots: true, encodeDotInKeys: true }, - // ), - // 'name%252Eobj%252Esubobject.first%252Egodly%252Ename=John&name%252Eobj%252Esubobject.last=Doe', - // 'with allowDots true and encodeDotInKeys true', - // ); - expect( - stringify( - { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, - { allowDots: false, encodeDotInKeys: false }, - ), - ).toBe('name.obj.subobject%5Bfirst.godly.name%5D=John&name.obj.subobject%5Blast%5D=Doe'); - expect( - stringify( - { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, - { allowDots: true, encodeDotInKeys: false }, - ), - ).toBe('name.obj.subobject.first.godly.name=John&name.obj.subobject.last=Doe'); - expect( - stringify( - { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, - { allowDots: false, encodeDotInKeys: true }, - ), - ).toBe('name%252Eobj%252Esubobject%5Bfirst.godly.name%5D=John&name%252Eobj%252Esubobject%5Blast%5D=Doe'); - expect( - stringify( - { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, - { allowDots: true, encodeDotInKeys: true }, - ), - ).toBe('name%252Eobj%252Esubobject.first%252Egodly%252Ename=John&name%252Eobj%252Esubobject.last=Doe'); - }); - - test('should encode dot in key of object, and automatically set allowDots to `true` when encodeDotInKeys is true and allowDots in undefined', function () { - // st.equal( - // stringify( - // { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, - // { encodeDotInKeys: true }, - // ), - // 'name%252Eobj%252Esubobject.first%252Egodly%252Ename=John&name%252Eobj%252Esubobject.last=Doe', - // 'with allowDots undefined and encodeDotInKeys true', - // ); - expect( - stringify( - { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, - { encodeDotInKeys: true }, - ), - ).toBe('name%252Eobj%252Esubobject.first%252Egodly%252Ename=John&name%252Eobj%252Esubobject.last=Doe'); - }); - - test('should encode dot in key of object when encodeDotInKeys and allowDots is provided, and nothing else when encodeValuesOnly is provided', function () { - // st.equal( - // stringify( - // { 'name.obj': { first: 'John', last: 'Doe' } }, - // { - // encodeDotInKeys: true, - // allowDots: true, - // encodeValuesOnly: true, - // }, - // ), - // 'name%2Eobj.first=John&name%2Eobj.last=Doe', - // ); - expect( - stringify( - { 'name.obj': { first: 'John', last: 'Doe' } }, - { - encodeDotInKeys: true, - allowDots: true, - encodeValuesOnly: true, - }, - ), - ).toBe('name%2Eobj.first=John&name%2Eobj.last=Doe'); - - // st.equal( - // stringify( - // { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, - // { allowDots: true, encodeDotInKeys: true, encodeValuesOnly: true }, - // ), - // 'name%2Eobj%2Esubobject.first%2Egodly%2Ename=John&name%2Eobj%2Esubobject.last=Doe', - // ); - expect( - stringify( - { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, - { allowDots: true, encodeDotInKeys: true, encodeValuesOnly: true }, - ), - ).toBe('name%2Eobj%2Esubobject.first%2Egodly%2Ename=John&name%2Eobj%2Esubobject.last=Doe'); - }); - - test('throws when `commaRoundTrip` is not a boolean', function () { - // st['throws']( - // function () { - // stringify({}, { commaRoundTrip: 'not a boolean' }); - // }, - // TypeError, - // 'throws when `commaRoundTrip` is not a boolean', - // ); - expect(() => { - // @ts-expect-error - stringify({}, { commaRoundTrip: 'not a boolean' }); - }).toThrow(TypeError); - }); - - test('throws when `encodeDotInKeys` is not a boolean', function () { - // st['throws'](function () { - // stringify({ a: [], b: 'zz' }, { encodeDotInKeys: 'foobar' }); - // }, TypeError); - expect(() => { - // @ts-expect-error - stringify({ a: [], b: 'zz' }, { encodeDotInKeys: 'foobar' }); - }).toThrow(TypeError); - - // st['throws'](function () { - // stringify({ a: [], b: 'zz' }, { encodeDotInKeys: 0 }); - // }, TypeError); - expect(() => { - // @ts-expect-error - stringify({ a: [], b: 'zz' }, { encodeDotInKeys: 0 }); - }).toThrow(TypeError); - - // st['throws'](function () { - // stringify({ a: [], b: 'zz' }, { encodeDotInKeys: NaN }); - // }, TypeError); - expect(() => { - // @ts-expect-error - stringify({ a: [], b: 'zz' }, { encodeDotInKeys: NaN }); - }).toThrow(TypeError); - - // st['throws'](function () { - // stringify({ a: [], b: 'zz' }, { encodeDotInKeys: null }); - // }, TypeError); - expect(() => { - // @ts-expect-error - stringify({ a: [], b: 'zz' }, { encodeDotInKeys: null }); - }).toThrow(TypeError); - }); - - test('adds query prefix', function () { - // st.equal(stringify({ a: 'b' }, { addQueryPrefix: true }), '?a=b'); - expect(stringify({ a: 'b' }, { addQueryPrefix: true })).toBe('?a=b'); - }); - - test('with query prefix, outputs blank string given an empty object', function () { - // st.equal(stringify({}, { addQueryPrefix: true }), ''); - expect(stringify({}, { addQueryPrefix: true })).toBe(''); - }); - - test('stringifies nested falsy values', function () { - // st.equal(stringify({ a: { b: { c: null } } }), 'a%5Bb%5D%5Bc%5D='); - // st.equal( - // stringify({ a: { b: { c: null } } }, { strictNullHandling: true }), - // 'a%5Bb%5D%5Bc%5D', - // ); - // st.equal(stringify({ a: { b: { c: false } } }), 'a%5Bb%5D%5Bc%5D=false'); - expect(stringify({ a: { b: { c: null } } })).toBe('a%5Bb%5D%5Bc%5D='); - expect(stringify({ a: { b: { c: null } } }, { strictNullHandling: true })).toBe('a%5Bb%5D%5Bc%5D'); - expect(stringify({ a: { b: { c: false } } })).toBe('a%5Bb%5D%5Bc%5D=false'); - }); - - test('stringifies a nested object', function () { - // st.equal(stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c'); - // st.equal(stringify({ a: { b: { c: { d: 'e' } } } }), 'a%5Bb%5D%5Bc%5D%5Bd%5D=e'); - expect(stringify({ a: { b: 'c' } })).toBe('a%5Bb%5D=c'); - expect(stringify({ a: { b: { c: { d: 'e' } } } })).toBe('a%5Bb%5D%5Bc%5D%5Bd%5D=e'); - }); - - test('`allowDots` option: stringifies a nested object with dots notation', function () { - // st.equal(stringify({ a: { b: 'c' } }, { allowDots: true }), 'a.b=c'); - // st.equal(stringify({ a: { b: { c: { d: 'e' } } } }, { allowDots: true }), 'a.b.c.d=e'); - expect(stringify({ a: { b: 'c' } }, { allowDots: true })).toBe('a.b=c'); - expect(stringify({ a: { b: { c: { d: 'e' } } } }, { allowDots: true })).toBe('a.b.c.d=e'); - }); - - test('stringifies an array value', function () { - // st.equal( - // stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'indices' }), - // 'a%5B0%5D=b&a%5B1%5D=c&a%5B2%5D=d', - // 'indices => indices', - // ); - // st.equal( - // stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'brackets' }), - // 'a%5B%5D=b&a%5B%5D=c&a%5B%5D=d', - // 'brackets => brackets', - // ); - // st.equal( - // stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'comma' }), - // 'a=b%2Cc%2Cd', - // 'comma => comma', - // ); - // st.equal( - // stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'comma', commaRoundTrip: true }), - // 'a=b%2Cc%2Cd', - // 'comma round trip => comma', - // ); - // st.equal( - // stringify({ a: ['b', 'c', 'd'] }), - // 'a%5B0%5D=b&a%5B1%5D=c&a%5B2%5D=d', - // 'default => indices', - // ); - expect(stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'indices' })).toBe( - 'a%5B0%5D=b&a%5B1%5D=c&a%5B2%5D=d', - ); - expect(stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'brackets' })).toBe( - 'a%5B%5D=b&a%5B%5D=c&a%5B%5D=d', - ); - expect(stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'comma' })).toBe('a=b%2Cc%2Cd'); - expect(stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'comma', commaRoundTrip: true })).toBe( - 'a=b%2Cc%2Cd', - ); - expect(stringify({ a: ['b', 'c', 'd'] })).toBe('a%5B0%5D=b&a%5B1%5D=c&a%5B2%5D=d'); - }); - - test('`skipNulls` option', function () { - // st.equal( - // stringify({ a: 'b', c: null }, { skipNulls: true }), - // 'a=b', - // 'omits nulls when asked', - // ); - expect(stringify({ a: 'b', c: null }, { skipNulls: true })).toBe('a=b'); - - // st.equal( - // stringify({ a: { b: 'c', d: null } }, { skipNulls: true }), - // 'a%5Bb%5D=c', - // 'omits nested nulls when asked', - // ); - expect(stringify({ a: { b: 'c', d: null } }, { skipNulls: true })).toBe('a%5Bb%5D=c'); - }); - - test('omits array indices when asked', function () { - // st.equal(stringify({ a: ['b', 'c', 'd'] }, { indices: false }), 'a=b&a=c&a=d'); - expect(stringify({ a: ['b', 'c', 'd'] }, { indices: false })).toBe('a=b&a=c&a=d'); - }); - - test('omits object key/value pair when value is empty array', function () { - // st.equal(stringify({ a: [], b: 'zz' }), 'b=zz'); - expect(stringify({ a: [], b: 'zz' })).toBe('b=zz'); - }); - - test('should not omit object key/value pair when value is empty array and when asked', function () { - // st.equal(stringify({ a: [], b: 'zz' }), 'b=zz'); - // st.equal(stringify({ a: [], b: 'zz' }, { allowEmptyArrays: false }), 'b=zz'); - // st.equal(stringify({ a: [], b: 'zz' }, { allowEmptyArrays: true }), 'a[]&b=zz'); - expect(stringify({ a: [], b: 'zz' })).toBe('b=zz'); - expect(stringify({ a: [], b: 'zz' }, { allowEmptyArrays: false })).toBe('b=zz'); - expect(stringify({ a: [], b: 'zz' }, { allowEmptyArrays: true })).toBe('a[]&b=zz'); - }); - - test('should throw when allowEmptyArrays is not of type boolean', function () { - // st['throws'](function () { - // stringify({ a: [], b: 'zz' }, { allowEmptyArrays: 'foobar' }); - // }, TypeError); - expect(() => { - // @ts-expect-error - stringify({ a: [], b: 'zz' }, { allowEmptyArrays: 'foobar' }); - }).toThrow(TypeError); - - // st['throws'](function () { - // stringify({ a: [], b: 'zz' }, { allowEmptyArrays: 0 }); - // }, TypeError); - expect(() => { - // @ts-expect-error - stringify({ a: [], b: 'zz' }, { allowEmptyArrays: 0 }); - }).toThrow(TypeError); - - // st['throws'](function () { - // stringify({ a: [], b: 'zz' }, { allowEmptyArrays: NaN }); - // }, TypeError); - expect(() => { - // @ts-expect-error - stringify({ a: [], b: 'zz' }, { allowEmptyArrays: NaN }); - }).toThrow(TypeError); - - // st['throws'](function () { - // stringify({ a: [], b: 'zz' }, { allowEmptyArrays: null }); - // }, TypeError); - expect(() => { - // @ts-expect-error - stringify({ a: [], b: 'zz' }, { allowEmptyArrays: null }); - }).toThrow(TypeError); - }); - - test('allowEmptyArrays + strictNullHandling', function () { - // st.equal( - // stringify({ testEmptyArray: [] }, { strictNullHandling: true, allowEmptyArrays: true }), - // 'testEmptyArray[]', - // ); - expect(stringify({ testEmptyArray: [] }, { strictNullHandling: true, allowEmptyArrays: true })).toBe( - 'testEmptyArray[]', - ); - }); - - describe('stringifies an array value with one item vs multiple items', function () { - test('non-array item', function () { - // s2t.equal( - // stringify({ a: 'c' }, { encodeValuesOnly: true, arrayFormat: 'indices' }), - // 'a=c', - // ); - // s2t.equal( - // stringify({ a: 'c' }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), - // 'a=c', - // ); - // s2t.equal(stringify({ a: 'c' }, { encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=c'); - // s2t.equal(stringify({ a: 'c' }, { encodeValuesOnly: true }), 'a=c'); - expect(stringify({ a: 'c' }, { encodeValuesOnly: true, arrayFormat: 'indices' })).toBe('a=c'); - expect(stringify({ a: 'c' }, { encodeValuesOnly: true, arrayFormat: 'brackets' })).toBe('a=c'); - expect(stringify({ a: 'c' }, { encodeValuesOnly: true, arrayFormat: 'comma' })).toBe('a=c'); - expect(stringify({ a: 'c' }, { encodeValuesOnly: true })).toBe('a=c'); - }); - - test('array with a single item', function () { - // s2t.equal( - // stringify({ a: ['c'] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), - // 'a[0]=c', - // ); - // s2t.equal( - // stringify({ a: ['c'] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), - // 'a[]=c', - // ); - // s2t.equal( - // stringify({ a: ['c'] }, { encodeValuesOnly: true, arrayFormat: 'comma' }), - // 'a=c', - // ); - // s2t.equal( - // stringify( - // { a: ['c'] }, - // { encodeValuesOnly: true, arrayFormat: 'comma', commaRoundTrip: true }, - // ), - // 'a[]=c', - // ); // so it parses back as an array - // s2t.equal(stringify({ a: ['c'] }, { encodeValuesOnly: true }), 'a[0]=c'); - expect(stringify({ a: ['c'] }, { encodeValuesOnly: true, arrayFormat: 'indices' })).toBe('a[0]=c'); - expect(stringify({ a: ['c'] }, { encodeValuesOnly: true, arrayFormat: 'brackets' })).toBe('a[]=c'); - expect(stringify({ a: ['c'] }, { encodeValuesOnly: true, arrayFormat: 'comma' })).toBe('a=c'); - expect( - stringify({ a: ['c'] }, { encodeValuesOnly: true, arrayFormat: 'comma', commaRoundTrip: true }), - ).toBe('a[]=c'); - expect(stringify({ a: ['c'] }, { encodeValuesOnly: true })).toBe('a[0]=c'); - }); - - test('array with multiple items', function () { - // s2t.equal( - // stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), - // 'a[0]=c&a[1]=d', - // ); - // s2t.equal( - // stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), - // 'a[]=c&a[]=d', - // ); - // s2t.equal( - // stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'comma' }), - // 'a=c,d', - // ); - // s2t.equal( - // stringify( - // { a: ['c', 'd'] }, - // { encodeValuesOnly: true, arrayFormat: 'comma', commaRoundTrip: true }, - // ), - // 'a=c,d', - // ); - // s2t.equal(stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true }), 'a[0]=c&a[1]=d'); - expect(stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'indices' })).toBe( - 'a[0]=c&a[1]=d', - ); - expect(stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'brackets' })).toBe( - 'a[]=c&a[]=d', - ); - expect(stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'comma' })).toBe('a=c,d'); - expect( - stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'comma', commaRoundTrip: true }), - ).toBe('a=c,d'); - expect(stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true })).toBe('a[0]=c&a[1]=d'); - }); - - test('array with multiple items with a comma inside', function () { - // s2t.equal( - // stringify({ a: ['c,d', 'e'] }, { encodeValuesOnly: true, arrayFormat: 'comma' }), - // 'a=c%2Cd,e', - // ); - // s2t.equal(stringify({ a: ['c,d', 'e'] }, { arrayFormat: 'comma' }), 'a=c%2Cd%2Ce'); - expect(stringify({ a: ['c,d', 'e'] }, { encodeValuesOnly: true, arrayFormat: 'comma' })).toBe( - 'a=c%2Cd,e', - ); - expect(stringify({ a: ['c,d', 'e'] }, { arrayFormat: 'comma' })).toBe('a=c%2Cd%2Ce'); - - // s2t.equal( - // stringify( - // { a: ['c,d', 'e'] }, - // { encodeValuesOnly: true, arrayFormat: 'comma', commaRoundTrip: true }, - // ), - // 'a=c%2Cd,e', - // ); - // s2t.equal( - // stringify({ a: ['c,d', 'e'] }, { arrayFormat: 'comma', commaRoundTrip: true }), - // 'a=c%2Cd%2Ce', - // ); - expect( - stringify( - { a: ['c,d', 'e'] }, - { encodeValuesOnly: true, arrayFormat: 'comma', commaRoundTrip: true }, - ), - ).toBe('a=c%2Cd,e'); - expect(stringify({ a: ['c,d', 'e'] }, { arrayFormat: 'comma', commaRoundTrip: true })).toBe( - 'a=c%2Cd%2Ce', - ); - }); - }); - - test('stringifies a nested array value', function () { - expect(stringify({ a: { b: ['c', 'd'] } }, { encodeValuesOnly: true, arrayFormat: 'indices' })).toBe( - 'a[b][0]=c&a[b][1]=d', - ); - expect(stringify({ a: { b: ['c', 'd'] } }, { encodeValuesOnly: true, arrayFormat: 'brackets' })).toBe( - 'a[b][]=c&a[b][]=d', - ); - expect(stringify({ a: { b: ['c', 'd'] } }, { encodeValuesOnly: true, arrayFormat: 'comma' })).toBe( - 'a[b]=c,d', - ); - expect(stringify({ a: { b: ['c', 'd'] } }, { encodeValuesOnly: true })).toBe('a[b][0]=c&a[b][1]=d'); - }); - - test('stringifies comma and empty array values', function () { - // st.equal( - // stringify({ a: [',', '', 'c,d%'] }, { encode: false, arrayFormat: 'indices' }), - // 'a[0]=,&a[1]=&a[2]=c,d%', - // ); - // st.equal( - // stringify({ a: [',', '', 'c,d%'] }, { encode: false, arrayFormat: 'brackets' }), - // 'a[]=,&a[]=&a[]=c,d%', - // ); - // st.equal( - // stringify({ a: [',', '', 'c,d%'] }, { encode: false, arrayFormat: 'comma' }), - // 'a=,,,c,d%', - // ); - // st.equal( - // stringify({ a: [',', '', 'c,d%'] }, { encode: false, arrayFormat: 'repeat' }), - // 'a=,&a=&a=c,d%', - // ); - expect(stringify({ a: [',', '', 'c,d%'] }, { encode: false, arrayFormat: 'indices' })).toBe( - 'a[0]=,&a[1]=&a[2]=c,d%', - ); - expect(stringify({ a: [',', '', 'c,d%'] }, { encode: false, arrayFormat: 'brackets' })).toBe( - 'a[]=,&a[]=&a[]=c,d%', - ); - expect(stringify({ a: [',', '', 'c,d%'] }, { encode: false, arrayFormat: 'comma' })).toBe('a=,,,c,d%'); - expect(stringify({ a: [',', '', 'c,d%'] }, { encode: false, arrayFormat: 'repeat' })).toBe( - 'a=,&a=&a=c,d%', - ); - - // st.equal( - // stringify( - // { a: [',', '', 'c,d%'] }, - // { encode: true, encodeValuesOnly: true, arrayFormat: 'indices' }, - // ), - // 'a[0]=%2C&a[1]=&a[2]=c%2Cd%25', - // ); - // st.equal( - // stringify( - // { a: [',', '', 'c,d%'] }, - // { encode: true, encodeValuesOnly: true, arrayFormat: 'brackets' }, - // ), - // 'a[]=%2C&a[]=&a[]=c%2Cd%25', - // ); - // st.equal( - // stringify( - // { a: [',', '', 'c,d%'] }, - // { encode: true, encodeValuesOnly: true, arrayFormat: 'comma' }, - // ), - // 'a=%2C,,c%2Cd%25', - // ); - // st.equal( - // stringify( - // { a: [',', '', 'c,d%'] }, - // { encode: true, encodeValuesOnly: true, arrayFormat: 'repeat' }, - // ), - // 'a=%2C&a=&a=c%2Cd%25', - // ); - expect( - stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: false, arrayFormat: 'indices' }), - ).toBe('a%5B0%5D=%2C&a%5B1%5D=&a%5B2%5D=c%2Cd%25'); - expect( - stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: true, arrayFormat: 'brackets' }), - ).toBe('a[]=%2C&a[]=&a[]=c%2Cd%25'); - expect( - stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: false, arrayFormat: 'comma' }), - ).toBe('a=%2C%2C%2Cc%2Cd%25'); - expect( - stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: false, arrayFormat: 'repeat' }), - ).toBe('a=%2C&a=&a=c%2Cd%25'); - - // st.equal( - // stringify( - // { a: [',', '', 'c,d%'] }, - // { encode: true, encodeValuesOnly: false, arrayFormat: 'indices' }, - // ), - // 'a%5B0%5D=%2C&a%5B1%5D=&a%5B2%5D=c%2Cd%25', - // ); - // st.equal( - // stringify( - // { a: [',', '', 'c,d%'] }, - // { encode: true, encodeValuesOnly: false, arrayFormat: 'brackets' }, - // ), - // 'a%5B%5D=%2C&a%5B%5D=&a%5B%5D=c%2Cd%25', - // ); - // st.equal( - // stringify( - // { a: [',', '', 'c,d%'] }, - // { encode: true, encodeValuesOnly: false, arrayFormat: 'comma' }, - // ), - // 'a=%2C%2C%2Cc%2Cd%25', - // ); - // st.equal( - // stringify( - // { a: [',', '', 'c,d%'] }, - // { encode: true, encodeValuesOnly: false, arrayFormat: 'repeat' }, - // ), - // 'a=%2C&a=&a=c%2Cd%25', - // ); - expect( - stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: false, arrayFormat: 'repeat' }), - ).toBe('a=%2C&a=&a=c%2Cd%25'); - expect( - stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: false, arrayFormat: 'indices' }), - ).toBe('a%5B0%5D=%2C&a%5B1%5D=&a%5B2%5D=c%2Cd%25'); - expect( - stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: true, arrayFormat: 'brackets' }), - ).toBe('a[]=%2C&a[]=&a[]=c%2Cd%25'); - expect( - stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: false, arrayFormat: 'comma' }), - ).toBe('a=%2C%2C%2Cc%2Cd%25'); - expect( - stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: false, arrayFormat: 'repeat' }), - ).toBe('a=%2C&a=&a=c%2Cd%25'); - }); - - test('stringifies comma and empty non-array values', function () { - // st.equal( - // stringify({ a: ',', b: '', c: 'c,d%' }, { encode: false, arrayFormat: 'indices' }), - // 'a=,&b=&c=c,d%', - // ); - // st.equal( - // stringify({ a: ',', b: '', c: 'c,d%' }, { encode: false, arrayFormat: 'brackets' }), - // 'a=,&b=&c=c,d%', - // ); - // st.equal( - // stringify({ a: ',', b: '', c: 'c,d%' }, { encode: false, arrayFormat: 'comma' }), - // 'a=,&b=&c=c,d%', - // ); - // st.equal( - // stringify({ a: ',', b: '', c: 'c,d%' }, { encode: false, arrayFormat: 'repeat' }), - // 'a=,&b=&c=c,d%', - // ); - expect(stringify({ a: ',', b: '', c: 'c,d%' }, { encode: false, arrayFormat: 'indices' })).toBe( - 'a=,&b=&c=c,d%', - ); - expect(stringify({ a: ',', b: '', c: 'c,d%' }, { encode: false, arrayFormat: 'brackets' })).toBe( - 'a=,&b=&c=c,d%', - ); - - // st.equal( - // stringify( - // { a: ',', b: '', c: 'c,d%' }, - // { encode: true, encodeValuesOnly: true, arrayFormat: 'indices' }, - // ), - // 'a=%2C&b=&c=c%2Cd%25', - // ); - // st.equal( - // stringify( - // { a: ',', b: '', c: 'c,d%' }, - // { encode: true, encodeValuesOnly: true, arrayFormat: 'brackets' }, - // ), - // 'a=%2C&b=&c=c%2Cd%25', - // ); - // st.equal( - // stringify( - // { a: ',', b: '', c: 'c,d%' }, - // { encode: true, encodeValuesOnly: true, arrayFormat: 'comma' }, - // ), - // 'a=%2C&b=&c=c%2Cd%25', - // ); - // st.equal( - // stringify( - // { a: ',', b: '', c: 'c,d%' }, - // { encode: true, encodeValuesOnly: true, arrayFormat: 'repeat' }, - // ), - // 'a=%2C&b=&c=c%2Cd%25', - // ); - expect( - stringify( - { a: ',', b: '', c: 'c,d%' }, - { encode: true, encodeValuesOnly: true, arrayFormat: 'indices' }, - ), - ).toBe('a=%2C&b=&c=c%2Cd%25'); - expect( - stringify( - { a: ',', b: '', c: 'c,d%' }, - { encode: true, encodeValuesOnly: true, arrayFormat: 'brackets' }, - ), - ).toBe('a=%2C&b=&c=c%2Cd%25'); - expect( - stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: true, arrayFormat: 'comma' }), - ).toBe('a=%2C&b=&c=c%2Cd%25'); - expect( - stringify( - { a: ',', b: '', c: 'c,d%' }, - { encode: true, encodeValuesOnly: true, arrayFormat: 'repeat' }, - ), - ).toBe('a=%2C&b=&c=c%2Cd%25'); - - // st.equal( - // stringify( - // { a: ',', b: '', c: 'c,d%' }, - // { encode: true, encodeValuesOnly: false, arrayFormat: 'indices' }, - // ), - // 'a=%2C&b=&c=c%2Cd%25', - // ); - // st.equal( - // stringify( - // { a: ',', b: '', c: 'c,d%' }, - // { encode: true, encodeValuesOnly: false, arrayFormat: 'brackets' }, - // ), - // 'a=%2C&b=&c=c%2Cd%25', - // ); - // st.equal( - // stringify( - // { a: ',', b: '', c: 'c,d%' }, - // { encode: true, encodeValuesOnly: false, arrayFormat: 'comma' }, - // ), - // 'a=%2C&b=&c=c%2Cd%25', - // ); - // st.equal( - // stringify( - // { a: ',', b: '', c: 'c,d%' }, - // { encode: true, encodeValuesOnly: false, arrayFormat: 'repeat' }, - // ), - // 'a=%2C&b=&c=c%2Cd%25', - // ); - expect( - stringify( - { a: ',', b: '', c: 'c,d%' }, - { encode: true, encodeValuesOnly: false, arrayFormat: 'indices' }, - ), - ).toBe('a=%2C&b=&c=c%2Cd%25'); - expect( - stringify( - { a: ',', b: '', c: 'c,d%' }, - { encode: true, encodeValuesOnly: false, arrayFormat: 'brackets' }, - ), - ).toBe('a=%2C&b=&c=c%2Cd%25'); - expect( - stringify( - { a: ',', b: '', c: 'c,d%' }, - { encode: true, encodeValuesOnly: false, arrayFormat: 'comma' }, - ), - ).toBe('a=%2C&b=&c=c%2Cd%25'); - expect( - stringify( - { a: ',', b: '', c: 'c,d%' }, - { encode: true, encodeValuesOnly: false, arrayFormat: 'repeat' }, - ), - ).toBe('a=%2C&b=&c=c%2Cd%25'); - }); - - test('stringifies a nested array value with dots notation', function () { - // st.equal( - // stringify( - // { a: { b: ['c', 'd'] } }, - // { allowDots: true, encodeValuesOnly: true, arrayFormat: 'indices' }, - // ), - // 'a.b[0]=c&a.b[1]=d', - // 'indices: stringifies with dots + indices', - // ); - // st.equal( - // stringify( - // { a: { b: ['c', 'd'] } }, - // { allowDots: true, encodeValuesOnly: true, arrayFormat: 'brackets' }, - // ), - // 'a.b[]=c&a.b[]=d', - // 'brackets: stringifies with dots + brackets', - // ); - // st.equal( - // stringify( - // { a: { b: ['c', 'd'] } }, - // { allowDots: true, encodeValuesOnly: true, arrayFormat: 'comma' }, - // ), - // 'a.b=c,d', - // 'comma: stringifies with dots + comma', - // ); - // st.equal( - // stringify({ a: { b: ['c', 'd'] } }, { allowDots: true, encodeValuesOnly: true }), - // 'a.b[0]=c&a.b[1]=d', - // 'default: stringifies with dots + indices', - // ); - expect( - stringify( - { a: { b: ['c', 'd'] } }, - { allowDots: true, encodeValuesOnly: true, arrayFormat: 'indices' }, - ), - ).toBe('a.b[0]=c&a.b[1]=d'); - expect( - stringify( - { a: { b: ['c', 'd'] } }, - { allowDots: true, encodeValuesOnly: true, arrayFormat: 'brackets' }, - ), - ).toBe('a.b[]=c&a.b[]=d'); - expect( - stringify({ a: { b: ['c', 'd'] } }, { allowDots: true, encodeValuesOnly: true, arrayFormat: 'comma' }), - ).toBe('a.b=c,d'); - expect(stringify({ a: { b: ['c', 'd'] } }, { allowDots: true, encodeValuesOnly: true })).toBe( - 'a.b[0]=c&a.b[1]=d', - ); - }); - - test('stringifies an object inside an array', function () { - // st.equal( - // stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'indices', encodeValuesOnly: true }), - // 'a[0][b]=c', - // 'indices => indices', - // ); - // st.equal( - // stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'repeat', encodeValuesOnly: true }), - // 'a[b]=c', - // 'repeat => repeat', - // ); - // st.equal( - // stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'brackets', encodeValuesOnly: true }), - // 'a[][b]=c', - // 'brackets => brackets', - // ); - // st.equal( - // stringify({ a: [{ b: 'c' }] }, { encodeValuesOnly: true }), - // 'a[0][b]=c', - // 'default => indices', - // ); - expect(stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'indices', encodeValuesOnly: true })).toBe( - 'a[0][b]=c', - ); - expect(stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'repeat', encodeValuesOnly: true })).toBe('a[b]=c'); - expect(stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'brackets', encodeValuesOnly: true })).toBe( - 'a[][b]=c', - ); - expect(stringify({ a: [{ b: 'c' }] }, { encodeValuesOnly: true })).toBe('a[0][b]=c'); - - // st.equal( - // stringify({ a: [{ b: { c: [1] } }] }, { arrayFormat: 'indices', encodeValuesOnly: true }), - // 'a[0][b][c][0]=1', - // 'indices => indices', - // ); - // st.equal( - // stringify({ a: [{ b: { c: [1] } }] }, { arrayFormat: 'repeat', encodeValuesOnly: true }), - // 'a[b][c]=1', - // 'repeat => repeat', - // ); - // st.equal( - // stringify({ a: [{ b: { c: [1] } }] }, { arrayFormat: 'brackets', encodeValuesOnly: true }), - // 'a[][b][c][]=1', - // 'brackets => brackets', - // ); - // st.equal( - // stringify({ a: [{ b: { c: [1] } }] }, { encodeValuesOnly: true }), - // 'a[0][b][c][0]=1', - // 'default => indices', - // ); - expect(stringify({ a: [{ b: { c: [1] } }] }, { arrayFormat: 'indices', encodeValuesOnly: true })).toBe( - 'a[0][b][c][0]=1', - ); - expect(stringify({ a: [{ b: { c: [1] } }] }, { arrayFormat: 'repeat', encodeValuesOnly: true })).toBe( - 'a[b][c]=1', - ); - expect(stringify({ a: [{ b: { c: [1] } }] }, { arrayFormat: 'brackets', encodeValuesOnly: true })).toBe( - 'a[][b][c][]=1', - ); - expect(stringify({ a: [{ b: { c: [1] } }] }, { encodeValuesOnly: true })).toBe('a[0][b][c][0]=1'); - }); - - test('stringifies an array with mixed objects and primitives', function () { - // st.equal( - // stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), - // 'a[0][b]=1&a[1]=2&a[2]=3', - // 'indices => indices', - // ); - // st.equal( - // stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), - // 'a[][b]=1&a[]=2&a[]=3', - // 'brackets => brackets', - // ); - // st.equal( - // stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true, arrayFormat: 'comma' }), - // '???', - // 'brackets => brackets', - // { skip: 'TODO: figure out what this should do' }, - // ); - // st.equal( - // stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true }), - // 'a[0][b]=1&a[1]=2&a[2]=3', - // 'default => indices', - // ); - expect(stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true, arrayFormat: 'indices' })).toBe( - 'a[0][b]=1&a[1]=2&a[2]=3', - ); - expect(stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true, arrayFormat: 'brackets' })).toBe( - 'a[][b]=1&a[]=2&a[]=3', - ); - // !Skipped: Figure out what this should do - // expect( - // stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true, arrayFormat: 'comma' }), - // ).toBe('???'); - expect(stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true })).toBe('a[0][b]=1&a[1]=2&a[2]=3'); - }); - - test('stringifies an object inside an array with dots notation', function () { - // st.equal( - // stringify({ a: [{ b: 'c' }] }, { allowDots: true, encode: false, arrayFormat: 'indices' }), - // 'a[0].b=c', - // 'indices => indices', - // ); - // st.equal( - // stringify( - // { a: [{ b: 'c' }] }, - // { allowDots: true, encode: false, arrayFormat: 'brackets' }, - // ), - // 'a[].b=c', - // 'brackets => brackets', - // ); - // st.equal( - // stringify({ a: [{ b: 'c' }] }, { allowDots: true, encode: false }), - // 'a[0].b=c', - // 'default => indices', - // ); - expect(stringify({ a: [{ b: 'c' }] }, { allowDots: true, encode: false, arrayFormat: 'indices' })).toBe( - 'a[0].b=c', - ); - expect(stringify({ a: [{ b: 'c' }] }, { allowDots: true, encode: false, arrayFormat: 'brackets' })).toBe( - 'a[].b=c', - ); - expect(stringify({ a: [{ b: 'c' }] }, { allowDots: true, encode: false })).toBe('a[0].b=c'); - - // st.equal( - // stringify( - // { a: [{ b: { c: [1] } }] }, - // { allowDots: true, encode: false, arrayFormat: 'indices' }, - // ), - // 'a[0].b.c[0]=1', - // 'indices => indices', - // ); - // st.equal( - // stringify( - // { a: [{ b: { c: [1] } }] }, - // { allowDots: true, encode: false, arrayFormat: 'brackets' }, - // ), - // 'a[].b.c[]=1', - // 'brackets => brackets', - // ); - // st.equal( - // stringify({ a: [{ b: { c: [1] } }] }, { allowDots: true, encode: false }), - // 'a[0].b.c[0]=1', - // 'default => indices', - // ); - expect( - stringify({ a: [{ b: { c: [1] } }] }, { allowDots: true, encode: false, arrayFormat: 'indices' }), - ).toBe('a[0].b.c[0]=1'); - expect( - stringify({ a: [{ b: { c: [1] } }] }, { allowDots: true, encode: false, arrayFormat: 'brackets' }), - ).toBe('a[].b.c[]=1'); - expect(stringify({ a: [{ b: { c: [1] } }] }, { allowDots: true, encode: false })).toBe('a[0].b.c[0]=1'); - }); - - test('does not omit object keys when indices = false', function () { - // st.equal(stringify({ a: [{ b: 'c' }] }, { indices: false }), 'a%5Bb%5D=c'); - expect(stringify({ a: [{ b: 'c' }] }, { indices: false })).toBe('a%5Bb%5D=c'); - }); - - test('uses indices notation for arrays when indices=true', function () { - // st.equal(stringify({ a: ['b', 'c'] }, { indices: true }), 'a%5B0%5D=b&a%5B1%5D=c'); - expect(stringify({ a: ['b', 'c'] }, { indices: true })).toBe('a%5B0%5D=b&a%5B1%5D=c'); - }); - - test('uses indices notation for arrays when no arrayFormat is specified', function () { - // st.equal(stringify({ a: ['b', 'c'] }), 'a%5B0%5D=b&a%5B1%5D=c'); - expect(stringify({ a: ['b', 'c'] })).toBe('a%5B0%5D=b&a%5B1%5D=c'); - }); - - test('uses indices notation for arrays when arrayFormat=indices', function () { - // st.equal(stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' }), 'a%5B0%5D=b&a%5B1%5D=c'); - expect(stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' })).toBe('a%5B0%5D=b&a%5B1%5D=c'); - }); - - test('uses repeat notation for arrays when arrayFormat=repeat', function () { - // st.equal(stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' }), 'a=b&a=c'); - expect(stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' })).toBe('a=b&a=c'); - }); - - test('uses brackets notation for arrays when arrayFormat=brackets', function () { - // st.equal(stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' }), 'a%5B%5D=b&a%5B%5D=c'); - expect(stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' })).toBe('a%5B%5D=b&a%5B%5D=c'); - }); - - test('stringifies a complicated object', function () { - // st.equal(stringify({ a: { b: 'c', d: 'e' } }), 'a%5Bb%5D=c&a%5Bd%5D=e'); - expect(stringify({ a: { b: 'c', d: 'e' } })).toBe('a%5Bb%5D=c&a%5Bd%5D=e'); - }); - - test('stringifies an empty value', function () { - // st.equal(stringify({ a: '' }), 'a='); - // st.equal(stringify({ a: null }, { strictNullHandling: true }), 'a'); - expect(stringify({ a: '' })).toBe('a='); - expect(stringify({ a: null }, { strictNullHandling: true })).toBe('a'); - - // st.equal(stringify({ a: '', b: '' }), 'a=&b='); - // st.equal(stringify({ a: null, b: '' }, { strictNullHandling: true }), 'a&b='); - expect(stringify({ a: '', b: '' })).toBe('a=&b='); - expect(stringify({ a: null, b: '' }, { strictNullHandling: true })).toBe('a&b='); - - // st.equal(stringify({ a: { b: '' } }), 'a%5Bb%5D='); - // st.equal(stringify({ a: { b: null } }, { strictNullHandling: true }), 'a%5Bb%5D'); - // st.equal(stringify({ a: { b: null } }, { strictNullHandling: false }), 'a%5Bb%5D='); - expect(stringify({ a: { b: '' } })).toBe('a%5Bb%5D='); - expect(stringify({ a: { b: null } }, { strictNullHandling: true })).toBe('a%5Bb%5D'); - expect(stringify({ a: { b: null } }, { strictNullHandling: false })).toBe('a%5Bb%5D='); - }); - - test('stringifies an empty array in different arrayFormat', function () { - // st.equal(stringify({ a: [], b: [null], c: 'c' }, { encode: false }), 'b[0]=&c=c'); - expect(stringify({ a: [], b: [null], c: 'c' }, { encode: false })).toBe('b[0]=&c=c'); - // arrayFormat default - // st.equal( - // stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'indices' }), - // 'b[0]=&c=c', - // ); - // st.equal( - // stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'brackets' }), - // 'b[]=&c=c', - // ); - // st.equal( - // stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'repeat' }), - // 'b=&c=c', - // ); - // st.equal( - // stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma' }), - // 'b=&c=c', - // ); - // st.equal( - // stringify( - // { a: [], b: [null], c: 'c' }, - // { encode: false, arrayFormat: 'comma', commaRoundTrip: true }, - // ), - // 'b[]=&c=c', - // ); - expect(stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'indices' })).toBe( - 'b[0]=&c=c', - ); - expect(stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'brackets' })).toBe( - 'b[]=&c=c', - ); - expect(stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'repeat' })).toBe('b=&c=c'); - expect(stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma' })).toBe('b=&c=c'); - expect( - stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma', commaRoundTrip: true }), - ).toBe('b[]=&c=c'); - - // with strictNullHandling - // st.equal( - // stringify( - // { a: [], b: [null], c: 'c' }, - // { encode: false, arrayFormat: 'indices', strictNullHandling: true }, - // ), - // 'b[0]&c=c', - // ); - // st.equal( - // stringify( - // { a: [], b: [null], c: 'c' }, - // { encode: false, arrayFormat: 'brackets', strictNullHandling: true }, - // ), - // 'b[]&c=c', - // ); - // st.equal( - // stringify( - // { a: [], b: [null], c: 'c' }, - // { encode: false, arrayFormat: 'repeat', strictNullHandling: true }, - // ), - // 'b&c=c', - // ); - // st.equal( - // stringify( - // { a: [], b: [null], c: 'c' }, - // { encode: false, arrayFormat: 'comma', strictNullHandling: true }, - // ), - // 'b&c=c', - // ); - // st.equal( - // stringify( - // { a: [], b: [null], c: 'c' }, - // { encode: false, arrayFormat: 'comma', strictNullHandling: true, commaRoundTrip: true }, - // ), - // 'b[]&c=c', - // ); - - expect( - stringify( - { a: [], b: [null], c: 'c' }, - { encode: false, arrayFormat: 'indices', strictNullHandling: true }, - ), - ).toBe('b[0]&c=c'); - expect( - stringify( - { a: [], b: [null], c: 'c' }, - { encode: false, arrayFormat: 'brackets', strictNullHandling: true }, - ), - ).toBe('b[]&c=c'); - expect( - stringify( - { a: [], b: [null], c: 'c' }, - { encode: false, arrayFormat: 'repeat', strictNullHandling: true }, - ), - ).toBe('b&c=c'); - expect( - stringify( - { a: [], b: [null], c: 'c' }, - { encode: false, arrayFormat: 'comma', strictNullHandling: true }, - ), - ).toBe('b&c=c'); - expect( - stringify( - { a: [], b: [null], c: 'c' }, - { encode: false, arrayFormat: 'comma', strictNullHandling: true, commaRoundTrip: true }, - ), - ).toBe('b[]&c=c'); - - // with skipNulls - // st.equal( - // stringify( - // { a: [], b: [null], c: 'c' }, - // { encode: false, arrayFormat: 'indices', skipNulls: true }, - // ), - // 'c=c', - // ); - // st.equal( - // stringify( - // { a: [], b: [null], c: 'c' }, - // { encode: false, arrayFormat: 'brackets', skipNulls: true }, - // ), - // 'c=c', - // ); - // st.equal( - // stringify( - // { a: [], b: [null], c: 'c' }, - // { encode: false, arrayFormat: 'repeat', skipNulls: true }, - // ), - // 'c=c', - // ); - // st.equal( - // stringify( - // { a: [], b: [null], c: 'c' }, - // { encode: false, arrayFormat: 'comma', skipNulls: true }, - // ), - // 'c=c', - // ); - expect( - stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'indices', skipNulls: true }), - ).toBe('c=c'); - expect( - stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'brackets', skipNulls: true }), - ).toBe('c=c'); - expect( - stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'repeat', skipNulls: true }), - ).toBe('c=c'); - expect( - stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma', skipNulls: true }), - ).toBe('c=c'); - }); - - test('stringifies a null object', function () { - var obj = Object.create(null); - obj.a = 'b'; - // st.equal(stringify(obj), 'a=b'); - expect(stringify(obj)).toBe('a=b'); - }); - - test('returns an empty string for invalid input', function () { - // st.equal(stringify(undefined), ''); - // st.equal(stringify(false), ''); - // st.equal(stringify(null), ''); - // st.equal(stringify(''), ''); - expect(stringify(undefined)).toBe(''); - expect(stringify(false)).toBe(''); - expect(stringify(null)).toBe(''); - expect(stringify('')).toBe(''); - }); - - test('stringifies an object with a null object as a child', function () { - var obj = { a: Object.create(null) }; - - obj.a.b = 'c'; - // st.equal(stringify(obj), 'a%5Bb%5D=c'); - expect(stringify(obj)).toBe('a%5Bb%5D=c'); - }); - - test('drops keys with a value of undefined', function () { - // st.equal(stringify({ a: undefined }), ''); - expect(stringify({ a: undefined })).toBe(''); - - // st.equal( - // stringify({ a: { b: undefined, c: null } }, { strictNullHandling: true }), - // 'a%5Bc%5D', - // ); - // st.equal( - // stringify({ a: { b: undefined, c: null } }, { strictNullHandling: false }), - // 'a%5Bc%5D=', - // ); - // st.equal(stringify({ a: { b: undefined, c: '' } }), 'a%5Bc%5D='); - expect(stringify({ a: { b: undefined, c: null } }, { strictNullHandling: true })).toBe('a%5Bc%5D'); - expect(stringify({ a: { b: undefined, c: null } }, { strictNullHandling: false })).toBe('a%5Bc%5D='); - expect(stringify({ a: { b: undefined, c: '' } })).toBe('a%5Bc%5D='); - }); - - test('url encodes values', function () { - // st.equal(stringify({ a: 'b c' }), 'a=b%20c'); - expect(stringify({ a: 'b c' })).toBe('a=b%20c'); - }); - - test('stringifies a date', function () { - var now = new Date(); - var str = 'a=' + encodeURIComponent(now.toISOString()); - // st.equal(stringify({ a: now }), str); - expect(stringify({ a: now })).toBe(str); - }); - - test('stringifies the weird object from qs', function () { - // st.equal( - // stringify({ 'my weird field': '~q1!2"\'w$5&7/z8)?' }), - // 'my%20weird%20field=~q1%212%22%27w%245%267%2Fz8%29%3F', - // ); - expect(stringify({ 'my weird field': '~q1!2"\'w$5&7/z8)?' })).toBe( - 'my%20weird%20field=~q1%212%22%27w%245%267%2Fz8%29%3F', - ); - }); - - // TODO: Investigate how to to intercept in vitest - // TODO(rob) - test('skips properties that are part of the object prototype', function () { - // st.intercept(Object.prototype, 'crash', { value: 'test' }); - // @ts-expect-error - Object.prototype.crash = 'test'; - - // st.equal(stringify({ a: 'b' }), 'a=b'); - // st.equal(stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c'); - expect(stringify({ a: 'b' })).toBe('a=b'); - expect(stringify({ a: { b: 'c' } })).toBe('a%5Bb%5D=c'); - }); - - test('stringifies boolean values', function () { - // st.equal(stringify({ a: true }), 'a=true'); - // st.equal(stringify({ a: { b: true } }), 'a%5Bb%5D=true'); - // st.equal(stringify({ b: false }), 'b=false'); - // st.equal(stringify({ b: { c: false } }), 'b%5Bc%5D=false'); - expect(stringify({ a: true })).toBe('a=true'); - expect(stringify({ a: { b: true } })).toBe('a%5Bb%5D=true'); - expect(stringify({ b: false })).toBe('b=false'); - expect(stringify({ b: { c: false } })).toBe('b%5Bc%5D=false'); - }); - - test('stringifies buffer values', function () { - // st.equal(stringify({ a: Buffer.from('test') }), 'a=test'); - // st.equal(stringify({ a: { b: Buffer.from('test') } }), 'a%5Bb%5D=test'); - }); - - test('stringifies an object using an alternative delimiter', function () { - // st.equal(stringify({ a: 'b', c: 'd' }, { delimiter: ';' }), 'a=b;c=d'); - expect(stringify({ a: 'b', c: 'd' }, { delimiter: ';' })).toBe('a=b;c=d'); - }); - - // We dont target environments which dont even have Buffer - // test('does not blow up when Buffer global is missing', function () { - // var restore = mockProperty(global, 'Buffer', { delete: true }); - - // var result = stringify({ a: 'b', c: 'd' }); - - // restore(); - - // st.equal(result, 'a=b&c=d'); - // st.end(); - // }); - - test('does not crash when parsing circular references', function () { - var a: any = {}; - a.b = a; - - // st['throws']( - // function () { - // stringify({ 'foo[bar]': 'baz', 'foo[baz]': a }); - // }, - // /RangeError: Cyclic object value/, - // 'cyclic values throw', - // ); - expect(() => { - stringify({ 'foo[bar]': 'baz', 'foo[baz]': a }); - }).toThrow('Cyclic object value'); - - var circular: any = { - a: 'value', - }; - circular.a = circular; - // st['throws']( - // function () { - // stringify(circular); - // }, - // /RangeError: Cyclic object value/, - // 'cyclic values throw', - // ); - expect(() => { - stringify(circular); - }).toThrow('Cyclic object value'); - - var arr = ['a']; - // st.doesNotThrow(function () { - // stringify({ x: arr, y: arr }); - // }, 'non-cyclic values do not throw'); - expect(() => { - stringify({ x: arr, y: arr }); - }).not.toThrow(); - }); - - test('non-circular duplicated references can still work', function () { - var hourOfDay = { - function: 'hour_of_day', - }; - - var p1 = { - function: 'gte', - arguments: [hourOfDay, 0], - }; - var p2 = { - function: 'lte', - arguments: [hourOfDay, 23], - }; - - // st.equal( - // stringify( - // { filters: { $and: [p1, p2] } }, - // { encodeValuesOnly: true, arrayFormat: 'indices' }, - // ), - // 'filters[$and][0][function]=gte&filters[$and][0][arguments][0][function]=hour_of_day&filters[$and][0][arguments][1]=0&filters[$and][1][function]=lte&filters[$and][1][arguments][0][function]=hour_of_day&filters[$and][1][arguments][1]=23', - // ); - // st.equal( - // stringify( - // { filters: { $and: [p1, p2] } }, - // { encodeValuesOnly: true, arrayFormat: 'brackets' }, - // ), - // 'filters[$and][][function]=gte&filters[$and][][arguments][][function]=hour_of_day&filters[$and][][arguments][]=0&filters[$and][][function]=lte&filters[$and][][arguments][][function]=hour_of_day&filters[$and][][arguments][]=23', - // ); - // st.equal( - // stringify( - // { filters: { $and: [p1, p2] } }, - // { encodeValuesOnly: true, arrayFormat: 'repeat' }, - // ), - // 'filters[$and][function]=gte&filters[$and][arguments][function]=hour_of_day&filters[$and][arguments]=0&filters[$and][function]=lte&filters[$and][arguments][function]=hour_of_day&filters[$and][arguments]=23', - // ); - expect( - stringify({ filters: { $and: [p1, p2] } }, { encodeValuesOnly: true, arrayFormat: 'indices' }), - ).toBe( - 'filters[$and][0][function]=gte&filters[$and][0][arguments][0][function]=hour_of_day&filters[$and][0][arguments][1]=0&filters[$and][1][function]=lte&filters[$and][1][arguments][0][function]=hour_of_day&filters[$and][1][arguments][1]=23', - ); - expect( - stringify({ filters: { $and: [p1, p2] } }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), - ).toBe( - 'filters[$and][][function]=gte&filters[$and][][arguments][][function]=hour_of_day&filters[$and][][arguments][]=0&filters[$and][][function]=lte&filters[$and][][arguments][][function]=hour_of_day&filters[$and][][arguments][]=23', - ); - expect( - stringify({ filters: { $and: [p1, p2] } }, { encodeValuesOnly: true, arrayFormat: 'repeat' }), - ).toBe( - 'filters[$and][function]=gte&filters[$and][arguments][function]=hour_of_day&filters[$and][arguments]=0&filters[$and][function]=lte&filters[$and][arguments][function]=hour_of_day&filters[$and][arguments]=23', - ); - }); - - test('selects properties when filter=array', function () { - // st.equal(stringify({ a: 'b' }, { filter: ['a'] }), 'a=b'); - // st.equal(stringify({ a: 1 }, { filter: [] }), ''); - expect(stringify({ a: 'b' }, { filter: ['a'] })).toBe('a=b'); - expect(stringify({ a: 1 }, { filter: [] })).toBe(''); - - // st.equal( - // stringify( - // { a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' }, - // { filter: ['a', 'b', 0, 2], arrayFormat: 'indices' }, - // ), - // 'a%5Bb%5D%5B0%5D=1&a%5Bb%5D%5B2%5D=3', - // 'indices => indices', - // ); - // st.equal( - // stringify( - // { a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' }, - // { filter: ['a', 'b', 0, 2], arrayFormat: 'brackets' }, - // ), - // 'a%5Bb%5D%5B%5D=1&a%5Bb%5D%5B%5D=3', - // 'brackets => brackets', - // ); - // st.equal( - // stringify({ a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' }, { filter: ['a', 'b', 0, 2] }), - // 'a%5Bb%5D%5B0%5D=1&a%5Bb%5D%5B2%5D=3', - // 'default => indices', - // ); - expect(stringify({ a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' }, { filter: ['a', 'b', 0, 2] })).toBe( - 'a%5Bb%5D%5B0%5D=1&a%5Bb%5D%5B2%5D=3', - ); - expect( - stringify( - { a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' }, - { filter: ['a', 'b', 0, 2], arrayFormat: 'indices' }, - ), - ).toBe('a%5Bb%5D%5B0%5D=1&a%5Bb%5D%5B2%5D=3'); - expect( - stringify( - { a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' }, - { filter: ['a', 'b', 0, 2], arrayFormat: 'brackets' }, - ), - ).toBe('a%5Bb%5D%5B%5D=1&a%5Bb%5D%5B%5D=3'); - }); - - test('supports custom representations when filter=function', function () { - var calls = 0; - var obj = { a: 'b', c: 'd', e: { f: new Date(1257894000000) } }; - var filterFunc: StringifyOptions['filter'] = function (prefix, value) { - calls += 1; - if (calls === 1) { - // st.equal(prefix, '', 'prefix is empty'); - // st.equal(value, obj); - expect(prefix).toBe(''); - expect(value).toBe(obj); - } else if (prefix === 'c') { - return void 0; - } else if (value instanceof Date) { - // st.equal(prefix, 'e[f]'); - expect(prefix).toBe('e[f]'); - return value.getTime(); - } - return value; - }; - - // st.equal(stringify(obj, { filter: filterFunc }), 'a=b&e%5Bf%5D=1257894000000'); - // st.equal(calls, 5); - expect(stringify(obj, { filter: filterFunc })).toBe('a=b&e%5Bf%5D=1257894000000'); - expect(calls).toBe(5); - }); - - test('can disable uri encoding', function () { - // st.equal(stringify({ a: 'b' }, { encode: false }), 'a=b'); - // st.equal(stringify({ a: { b: 'c' } }, { encode: false }), 'a[b]=c'); - // st.equal( - // stringify({ a: 'b', c: null }, { strictNullHandling: true, encode: false }), - // 'a=b&c', - // ); - expect(stringify({ a: 'b' }, { encode: false })).toBe('a=b'); - expect(stringify({ a: { b: 'c' } }, { encode: false })).toBe('a[b]=c'); - expect(stringify({ a: 'b', c: null }, { strictNullHandling: true, encode: false })).toBe('a=b&c'); - }); - - test('can sort the keys', function () { - // @ts-expect-error - var sort: NonNullable = function (a: string, b: string) { - return a.localeCompare(b); - }; - // st.equal(stringify({ a: 'c', z: 'y', b: 'f' }, { sort: sort }), 'a=c&b=f&z=y'); - // st.equal( - // stringify({ a: 'c', z: { j: 'a', i: 'b' }, b: 'f' }, { sort: sort }), - // 'a=c&b=f&z%5Bi%5D=b&z%5Bj%5D=a', - // ); - expect(stringify({ a: 'c', z: 'y', b: 'f' }, { sort: sort })).toBe('a=c&b=f&z=y'); - expect(stringify({ a: 'c', z: { j: 'a', i: 'b' }, b: 'f' }, { sort: sort })).toBe( - 'a=c&b=f&z%5Bi%5D=b&z%5Bj%5D=a', - ); - }); - - test('can sort the keys at depth 3 or more too', function () { - // @ts-expect-error - var sort: NonNullable = function (a: string, b: string) { - return a.localeCompare(b); - }; - // st.equal( - // stringify( - // { a: 'a', z: { zj: { zjb: 'zjb', zja: 'zja' }, zi: { zib: 'zib', zia: 'zia' } }, b: 'b' }, - // { sort: sort, encode: false }, - // ), - // 'a=a&b=b&z[zi][zia]=zia&z[zi][zib]=zib&z[zj][zja]=zja&z[zj][zjb]=zjb', - // ); - // st.equal( - // stringify( - // { a: 'a', z: { zj: { zjb: 'zjb', zja: 'zja' }, zi: { zib: 'zib', zia: 'zia' } }, b: 'b' }, - // { sort: null, encode: false }, - // ), - // 'a=a&z[zj][zjb]=zjb&z[zj][zja]=zja&z[zi][zib]=zib&z[zi][zia]=zia&b=b', - // ); - expect( - stringify( - { a: 'a', z: { zj: { zjb: 'zjb', zja: 'zja' }, zi: { zib: 'zib', zia: 'zia' } }, b: 'b' }, - { sort: sort, encode: false }, - ), - ).toBe('a=a&b=b&z[zi][zia]=zia&z[zi][zib]=zib&z[zj][zja]=zja&z[zj][zjb]=zjb'); - expect( - stringify( - { a: 'a', z: { zj: { zjb: 'zjb', zja: 'zja' }, zi: { zib: 'zib', zia: 'zia' } }, b: 'b' }, - { sort: null, encode: false }, - ), - ).toBe('a=a&z[zj][zjb]=zjb&z[zj][zja]=zja&z[zi][zib]=zib&z[zi][zia]=zia&b=b'); - }); - - test('can stringify with custom encoding', function () { - // st.equal( - // stringify( - // { 県: '大阪府', '': '' }, - // { - // encoder: function (str) { - // if (str.length === 0) { - // return ''; - // } - // var buf = iconv.encode(str, 'shiftjis'); - // var result = []; - // for (var i = 0; i < buf.length; ++i) { - // result.push(buf.readUInt8(i).toString(16)); - // } - // return '%' + result.join('%'); - // }, - // }, - // ), - // '%8c%a7=%91%e5%8d%e3%95%7b&=', - // ); - expect( - stringify( - { 県: '大阪府', '': '' }, - { - encoder: function (str) { - if (str.length === 0) { - return ''; - } - var buf = iconv.encode(str, 'shiftjis'); - var result = []; - for (var i = 0; i < buf.length; ++i) { - result.push(buf.readUInt8(i).toString(16)); - } - return '%' + result.join('%'); - }, - }, - ), - ).toBe('%8c%a7=%91%e5%8d%e3%95%7b&='); - }); - - test('receives the default encoder as a second argument', function () { - // stringify( - // { a: 1, b: new Date(), c: true, d: [1] }, - // { - // encoder: function (str) { - // st.match(typeof str, /^(?:string|number|boolean)$/); - // return ''; - // }, - // }, - // ); - - stringify( - { a: 1, b: new Date(), c: true, d: [1] }, - { - encoder: function (str) { - // st.match(typeof str, /^(?:string|number|boolean)$/); - assert.match(typeof str, /^(?:string|number|boolean)$/); - return ''; - }, - }, - ); - }); - - test('receives the default encoder as a second argument', function () { - // stringify( - // { a: 1 }, - // { - // encoder: function (str, defaultEncoder) { - // st.equal(defaultEncoder, utils.encode); - // }, - // }, - // ); - - stringify( - { a: 1 }, - { - // @ts-ignore - encoder: function (_str, defaultEncoder) { - expect(defaultEncoder).toBe(encode); - }, - }, - ); - }); - - test('throws error with wrong encoder', function () { - // st['throws'](function () { - // stringify({}, { encoder: 'string' }); - // }, new TypeError('Encoder has to be a function.')); - // st.end(); - expect(() => { - // @ts-expect-error - stringify({}, { encoder: 'string' }); - }).toThrow(TypeError); - }); - - (typeof Buffer === 'undefined' ? test.skip : test)( - 'can use custom encoder for a buffer object', - function () { - // st.equal( - // stringify( - // { a: Buffer.from([1]) }, - // { - // encoder: function (buffer) { - // if (typeof buffer === 'string') { - // return buffer; - // } - // return String.fromCharCode(buffer.readUInt8(0) + 97); - // }, - // }, - // ), - // 'a=b', - // ); - expect( - stringify( - { a: Buffer.from([1]) }, - { - encoder: function (buffer) { - if (typeof buffer === 'string') { - return buffer; - } - return String.fromCharCode(buffer.readUInt8(0) + 97); - }, - }, - ), - ).toBe('a=b'); - - // st.equal( - // stringify( - // { a: Buffer.from('a b') }, - // { - // encoder: function (buffer) { - // return buffer; - // }, - // }, - // ), - // 'a=a b', - // ); - expect( - stringify( - { a: Buffer.from('a b') }, - { - encoder: function (buffer) { - return buffer; - }, - }, - ), - ).toBe('a=a b'); - }, - ); - - test('serializeDate option', function () { - var date = new Date(); - // st.equal( - // stringify({ a: date }), - // 'a=' + date.toISOString().replace(/:/g, '%3A'), - // 'default is toISOString', - // ); - expect(stringify({ a: date })).toBe('a=' + date.toISOString().replace(/:/g, '%3A')); - - var mutatedDate = new Date(); - mutatedDate.toISOString = function () { - throw new SyntaxError(); - }; - // st['throws'](function () { - // mutatedDate.toISOString(); - // }, SyntaxError); - expect(() => { - mutatedDate.toISOString(); - }).toThrow(SyntaxError); - // st.equal( - // stringify({ a: mutatedDate }), - // 'a=' + Date.prototype.toISOString.call(mutatedDate).replace(/:/g, '%3A'), - // 'toISOString works even when method is not locally present', - // ); - expect(stringify({ a: mutatedDate })).toBe( - 'a=' + Date.prototype.toISOString.call(mutatedDate).replace(/:/g, '%3A'), - ); - - var specificDate = new Date(6); - // st.equal( - // stringify( - // { a: specificDate }, - // { - // serializeDate: function (d) { - // return d.getTime() * 7; - // }, - // }, - // ), - // 'a=42', - // 'custom serializeDate function called', - // ); - expect( - stringify( - { a: specificDate }, - { - // @ts-ignore - serializeDate: function (d) { - return d.getTime() * 7; - }, - }, - ), - ).toBe('a=42'); - - // st.equal( - // stringify( - // { a: [date] }, - // { - // serializeDate: function (d) { - // return d.getTime(); - // }, - // arrayFormat: 'comma', - // }, - // ), - // 'a=' + date.getTime(), - // 'works with arrayFormat comma', - // ); - // st.equal( - // stringify( - // { a: [date] }, - // { - // serializeDate: function (d) { - // return d.getTime(); - // }, - // arrayFormat: 'comma', - // commaRoundTrip: true, - // }, - // ), - // 'a%5B%5D=' + date.getTime(), - // 'works with arrayFormat comma', - // ); - expect( - stringify( - { a: [date] }, - { - // @ts-expect-error - serializeDate: function (d) { - return d.getTime(); - }, - arrayFormat: 'comma', - }, - ), - ).toBe('a=' + date.getTime()); - expect( - stringify( - { a: [date] }, - { - // @ts-expect-error - serializeDate: function (d) { - return d.getTime(); - }, - arrayFormat: 'comma', - commaRoundTrip: true, - }, - ), - ).toBe('a%5B%5D=' + date.getTime()); - }); - - test('RFC 1738 serialization', function () { - // st.equal(stringify({ a: 'b c' }, { format: formats.RFC1738 }), 'a=b+c'); - // st.equal(stringify({ 'a b': 'c d' }, { format: formats.RFC1738 }), 'a+b=c+d'); - // st.equal( - // stringify({ 'a b': Buffer.from('a b') }, { format: formats.RFC1738 }), - // 'a+b=a+b', - // ); - expect(stringify({ a: 'b c' }, { format: 'RFC1738' })).toBe('a=b+c'); - expect(stringify({ 'a b': 'c d' }, { format: 'RFC1738' })).toBe('a+b=c+d'); - expect(stringify({ 'a b': Buffer.from('a b') }, { format: 'RFC1738' })).toBe('a+b=a+b'); - - // st.equal(stringify({ 'foo(ref)': 'bar' }, { format: formats.RFC1738 }), 'foo(ref)=bar'); - expect(stringify({ 'foo(ref)': 'bar' }, { format: 'RFC1738' })).toBe('foo(ref)=bar'); - }); - - test('RFC 3986 spaces serialization', function () { - // st.equal(stringify({ a: 'b c' }, { format: formats.RFC3986 }), 'a=b%20c'); - // st.equal(stringify({ 'a b': 'c d' }, { format: formats.RFC3986 }), 'a%20b=c%20d'); - // st.equal( - // stringify({ 'a b': Buffer.from('a b') }, { format: formats.RFC3986 }), - // 'a%20b=a%20b', - // ); - expect(stringify({ a: 'b c' }, { format: 'RFC3986' })).toBe('a=b%20c'); - expect(stringify({ 'a b': 'c d' }, { format: 'RFC3986' })).toBe('a%20b=c%20d'); - expect(stringify({ 'a b': Buffer.from('a b') }, { format: 'RFC3986' })).toBe('a%20b=a%20b'); - }); - - test('Backward compatibility to RFC 3986', function () { - // st.equal(stringify({ a: 'b c' }), 'a=b%20c'); - // st.equal(stringify({ 'a b': Buffer.from('a b') }), 'a%20b=a%20b'); - expect(stringify({ a: 'b c' })).toBe('a=b%20c'); - expect(stringify({ 'a b': Buffer.from('a b') })).toBe('a%20b=a%20b'); - }); - - test('Edge cases and unknown formats', function () { - ['UFO1234', false, 1234, null, {}, []].forEach(function (format) { - // st['throws'](function () { - // stringify({ a: 'b c' }, { format: format }); - // }, new TypeError('Unknown format option provided.')); - expect(() => { - // @ts-expect-error - stringify({ a: 'b c' }, { format: format }); - }).toThrow(TypeError); - }); - }); - - test('encodeValuesOnly', function () { - // st.equal( - // stringify( - // { a: 'b', c: ['d', 'e=f'], f: [['g'], ['h']] }, - // { encodeValuesOnly: true, arrayFormat: 'indices' }, - // ), - // 'a=b&c[0]=d&c[1]=e%3Df&f[0][0]=g&f[1][0]=h', - // 'encodeValuesOnly + indices', - // ); - // st.equal( - // stringify( - // { a: 'b', c: ['d', 'e=f'], f: [['g'], ['h']] }, - // { encodeValuesOnly: true, arrayFormat: 'brackets' }, - // ), - // 'a=b&c[]=d&c[]=e%3Df&f[][]=g&f[][]=h', - // 'encodeValuesOnly + brackets', - // ); - // st.equal( - // stringify( - // { a: 'b', c: ['d', 'e=f'], f: [['g'], ['h']] }, - // { encodeValuesOnly: true, arrayFormat: 'repeat' }, - // ), - // 'a=b&c=d&c=e%3Df&f=g&f=h', - // 'encodeValuesOnly + repeat', - // ); - expect( - stringify( - { a: 'b', c: ['d', 'e=f'], f: [['g'], ['h']] }, - { encodeValuesOnly: true, arrayFormat: 'indices' }, - ), - ).toBe('a=b&c[0]=d&c[1]=e%3Df&f[0][0]=g&f[1][0]=h'); - expect( - stringify( - { a: 'b', c: ['d', 'e=f'], f: [['g'], ['h']] }, - { encodeValuesOnly: true, arrayFormat: 'brackets' }, - ), - ).toBe('a=b&c[]=d&c[]=e%3Df&f[][]=g&f[][]=h'); - expect( - stringify( - { a: 'b', c: ['d', 'e=f'], f: [['g'], ['h']] }, - { encodeValuesOnly: true, arrayFormat: 'repeat' }, - ), - ).toBe('a=b&c=d&c=e%3Df&f=g&f=h'); - - // st.equal( - // stringify({ a: 'b', c: ['d', 'e'], f: [['g'], ['h']] }, { arrayFormat: 'indices' }), - // 'a=b&c%5B0%5D=d&c%5B1%5D=e&f%5B0%5D%5B0%5D=g&f%5B1%5D%5B0%5D=h', - // 'no encodeValuesOnly + indices', - // ); - // st.equal( - // stringify({ a: 'b', c: ['d', 'e'], f: [['g'], ['h']] }, { arrayFormat: 'brackets' }), - // 'a=b&c%5B%5D=d&c%5B%5D=e&f%5B%5D%5B%5D=g&f%5B%5D%5B%5D=h', - // 'no encodeValuesOnly + brackets', - // ); - // st.equal( - // stringify({ a: 'b', c: ['d', 'e'], f: [['g'], ['h']] }, { arrayFormat: 'repeat' }), - // 'a=b&c=d&c=e&f=g&f=h', - // 'no encodeValuesOnly + repeat', - // ); - expect(stringify({ a: 'b', c: ['d', 'e'], f: [['g'], ['h']] }, { arrayFormat: 'indices' })).toBe( - 'a=b&c%5B0%5D=d&c%5B1%5D=e&f%5B0%5D%5B0%5D=g&f%5B1%5D%5B0%5D=h', - ); - expect(stringify({ a: 'b', c: ['d', 'e'], f: [['g'], ['h']] }, { arrayFormat: 'brackets' })).toBe( - 'a=b&c%5B%5D=d&c%5B%5D=e&f%5B%5D%5B%5D=g&f%5B%5D%5B%5D=h', - ); - expect(stringify({ a: 'b', c: ['d', 'e'], f: [['g'], ['h']] }, { arrayFormat: 'repeat' })).toBe( - 'a=b&c=d&c=e&f=g&f=h', - ); - }); - - test('encodeValuesOnly - strictNullHandling', function () { - // st.equal( - // stringify({ a: { b: null } }, { encodeValuesOnly: true, strictNullHandling: true }), - // 'a[b]', - // ); - expect(stringify({ a: { b: null } }, { encodeValuesOnly: true, strictNullHandling: true })).toBe('a[b]'); - }); - - test('throws if an invalid charset is specified', function () { - // st['throws'](function () { - // stringify({ a: 'b' }, { charset: 'foobar' }); - // }, new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined')); - expect(() => { - // @ts-expect-error - stringify({ a: 'b' }, { charset: 'foobar' }); - }).toThrow(TypeError); - }); - - test('respects a charset of iso-8859-1', function () { - // st.equal(stringify({ æ: 'æ' }, { charset: 'iso-8859-1' }), '%E6=%E6'); - expect(stringify({ æ: 'æ' }, { charset: 'iso-8859-1' })).toBe('%E6=%E6'); - }); - - test('encodes unrepresentable chars as numeric entities in iso-8859-1 mode', function () { - // st.equal(stringify({ a: '☺' }, { charset: 'iso-8859-1' }), 'a=%26%239786%3B'); - expect(stringify({ a: '☺' }, { charset: 'iso-8859-1' })).toBe('a=%26%239786%3B'); - }); - - test('respects an explicit charset of utf-8 (the default)', function () { - // st.equal(stringify({ a: 'æ' }, { charset: 'utf-8' }), 'a=%C3%A6'); - expect(stringify({ a: 'æ' }, { charset: 'utf-8' })).toBe('a=%C3%A6'); - }); - - test('`charsetSentinel` option', function () { - // st.equal( - // stringify({ a: 'æ' }, { charsetSentinel: true, charset: 'utf-8' }), - // 'utf8=%E2%9C%93&a=%C3%A6', - // 'adds the right sentinel when instructed to and the charset is utf-8', - // ); - expect(stringify({ a: 'æ' }, { charsetSentinel: true, charset: 'utf-8' })).toBe( - 'utf8=%E2%9C%93&a=%C3%A6', - ); - - // st.equal( - // stringify({ a: 'æ' }, { charsetSentinel: true, charset: 'iso-8859-1' }), - // 'utf8=%26%2310003%3B&a=%E6', - // 'adds the right sentinel when instructed to and the charset is iso-8859-1', - // ); - expect(stringify({ a: 'æ' }, { charsetSentinel: true, charset: 'iso-8859-1' })).toBe( - 'utf8=%26%2310003%3B&a=%E6', - ); - }); - - test('does not mutate the options argument', function () { - var options = {}; - stringify({}, options); - // st.deepEqual(options, {}); - expect(options).toEqual({}); - }); - - test('strictNullHandling works with custom filter', function () { - // @ts-expect-error - var filter = function (_prefix, value) { - return value; - }; - - var options = { strictNullHandling: true, filter: filter }; - // st.equal(stringify({ key: null }, options), 'key'); - expect(stringify({ key: null }, options)).toBe('key'); - }); - - test('strictNullHandling works with null serializeDate', function () { - var serializeDate = function () { - return null; - }; - var options = { strictNullHandling: true, serializeDate: serializeDate }; - var date = new Date(); - // st.equal(stringify({ key: date }, options), 'key'); - // @ts-expect-error - expect(stringify({ key: date }, options)).toBe('key'); - }); - - test('allows for encoding keys and values differently', function () { - // @ts-expect-error - var encoder = function (str, defaultEncoder, charset, type) { - if (type === 'key') { - return defaultEncoder(str, defaultEncoder, charset, type).toLowerCase(); - } - if (type === 'value') { - return defaultEncoder(str, defaultEncoder, charset, type).toUpperCase(); - } - throw 'this should never happen! type: ' + type; - }; - - // st.deepEqual(stringify({ KeY: 'vAlUe' }, { encoder: encoder }), 'key=VALUE'); - expect(stringify({ KeY: 'vAlUe' }, { encoder: encoder })).toBe('key=VALUE'); - }); - - test('objects inside arrays', function () { - var obj = { a: { b: { c: 'd', e: 'f' } } }; - var withArray = { a: { b: [{ c: 'd', e: 'f' }] } }; - - // st.equal( - // stringify(obj, { encode: false }), - // 'a[b][c]=d&a[b][e]=f', - // 'no array, no arrayFormat', - // ); - // st.equal( - // stringify(obj, { encode: false, arrayFormat: 'brackets' }), - // 'a[b][c]=d&a[b][e]=f', - // 'no array, bracket', - // ); - // st.equal( - // stringify(obj, { encode: false, arrayFormat: 'indices' }), - // 'a[b][c]=d&a[b][e]=f', - // 'no array, indices', - // ); - // st.equal( - // stringify(obj, { encode: false, arrayFormat: 'repeat' }), - // 'a[b][c]=d&a[b][e]=f', - // 'no array, repeat', - // ); - // st.equal( - // stringify(obj, { encode: false, arrayFormat: 'comma' }), - // 'a[b][c]=d&a[b][e]=f', - // 'no array, comma', - // ); - expect(stringify(obj, { encode: false })).toBe('a[b][c]=d&a[b][e]=f'); - expect(stringify(obj, { encode: false, arrayFormat: 'brackets' })).toBe('a[b][c]=d&a[b][e]=f'); - expect(stringify(obj, { encode: false, arrayFormat: 'indices' })).toBe('a[b][c]=d&a[b][e]=f'); - expect(stringify(obj, { encode: false, arrayFormat: 'repeat' })).toBe('a[b][c]=d&a[b][e]=f'); - expect(stringify(obj, { encode: false, arrayFormat: 'comma' })).toBe('a[b][c]=d&a[b][e]=f'); - - // st.equal( - // stringify(withArray, { encode: false }), - // 'a[b][0][c]=d&a[b][0][e]=f', - // 'array, no arrayFormat', - // ); - // st.equal( - // stringify(withArray, { encode: false, arrayFormat: 'brackets' }), - // 'a[b][][c]=d&a[b][][e]=f', - // 'array, bracket', - // ); - // st.equal( - // stringify(withArray, { encode: false, arrayFormat: 'indices' }), - // 'a[b][0][c]=d&a[b][0][e]=f', - // 'array, indices', - // ); - // st.equal( - // stringify(withArray, { encode: false, arrayFormat: 'repeat' }), - // 'a[b][c]=d&a[b][e]=f', - // 'array, repeat', - // ); - // st.equal( - // stringify(withArray, { encode: false, arrayFormat: 'comma' }), - // '???', - // 'array, comma', - // { skip: 'TODO: figure out what this should do' }, - // ); - expect(stringify(withArray, { encode: false })).toBe('a[b][0][c]=d&a[b][0][e]=f'); - expect(stringify(withArray, { encode: false, arrayFormat: 'brackets' })).toBe('a[b][][c]=d&a[b][][e]=f'); - expect(stringify(withArray, { encode: false, arrayFormat: 'indices' })).toBe('a[b][0][c]=d&a[b][0][e]=f'); - expect(stringify(withArray, { encode: false, arrayFormat: 'repeat' })).toBe('a[b][c]=d&a[b][e]=f'); - // !TODo: Figure out what this should do - // expect(stringify(withArray, { encode: false, arrayFormat: 'comma' })).toBe( - // 'a[b][c]=d&a[b][e]=f', - // ); - }); - - test('stringifies sparse arrays', function () { - // st.equal( - // stringify({ a: [, '2', , , '1'] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), - // 'a[1]=2&a[4]=1', - // ); - // st.equal( - // stringify({ a: [, '2', , , '1'] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), - // 'a[]=2&a[]=1', - // ); - // st.equal( - // stringify({ a: [, '2', , , '1'] }, { encodeValuesOnly: true, arrayFormat: 'repeat' }), - // 'a=2&a=1', - // ); - expect(stringify({ a: [, '2', , , '1'] }, { encodeValuesOnly: true, arrayFormat: 'indices' })).toBe( - 'a[1]=2&a[4]=1', - ); - expect(stringify({ a: [, '2', , , '1'] }, { encodeValuesOnly: true, arrayFormat: 'brackets' })).toBe( - 'a[]=2&a[]=1', - ); - expect(stringify({ a: [, '2', , , '1'] }, { encodeValuesOnly: true, arrayFormat: 'repeat' })).toBe( - 'a=2&a=1', - ); - - // st.equal( - // stringify( - // { a: [, { b: [, , { c: '1' }] }] }, - // { encodeValuesOnly: true, arrayFormat: 'indices' }, - // ), - // 'a[1][b][2][c]=1', - // ); - // st.equal( - // stringify( - // { a: [, { b: [, , { c: '1' }] }] }, - // { encodeValuesOnly: true, arrayFormat: 'brackets' }, - // ), - // 'a[][b][][c]=1', - // ); - // st.equal( - // stringify( - // { a: [, { b: [, , { c: '1' }] }] }, - // { encodeValuesOnly: true, arrayFormat: 'repeat' }, - // ), - // 'a[b][c]=1', - // ); - expect( - stringify({ a: [, { b: [, , { c: '1' }] }] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), - ).toBe('a[1][b][2][c]=1'); - expect( - stringify({ a: [, { b: [, , { c: '1' }] }] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), - ).toBe('a[][b][][c]=1'); - expect( - stringify({ a: [, { b: [, , { c: '1' }] }] }, { encodeValuesOnly: true, arrayFormat: 'repeat' }), - ).toBe('a[b][c]=1'); - - // st.equal( - // stringify( - // { a: [, [, , [, , , { c: '1' }]]] }, - // { encodeValuesOnly: true, arrayFormat: 'indices' }, - // ), - // 'a[1][2][3][c]=1', - // ); - // st.equal( - // stringify( - // { a: [, [, , [, , , { c: '1' }]]] }, - // { encodeValuesOnly: true, arrayFormat: 'brackets' }, - // ), - // 'a[][][][c]=1', - // ); - // st.equal( - // stringify( - // { a: [, [, , [, , , { c: '1' }]]] }, - // { encodeValuesOnly: true, arrayFormat: 'repeat' }, - // ), - // 'a[c]=1', - // ); - expect( - stringify({ a: [, [, , [, , , { c: '1' }]]] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), - ).toBe('a[1][2][3][c]=1'); - expect( - stringify({ a: [, [, , [, , , { c: '1' }]]] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), - ).toBe('a[][][][c]=1'); - expect( - stringify({ a: [, [, , [, , , { c: '1' }]]] }, { encodeValuesOnly: true, arrayFormat: 'repeat' }), - ).toBe('a[c]=1'); - - // st.equal( - // stringify( - // { a: [, [, , [, , , { c: [, '1'] }]]] }, - // { encodeValuesOnly: true, arrayFormat: 'indices' }, - // ), - // 'a[1][2][3][c][1]=1', - // ); - // st.equal( - // stringify( - // { a: [, [, , [, , , { c: [, '1'] }]]] }, - // { encodeValuesOnly: true, arrayFormat: 'brackets' }, - // ), - // 'a[][][][c][]=1', - // ); - // st.equal( - // stringify( - // { a: [, [, , [, , , { c: [, '1'] }]]] }, - // { encodeValuesOnly: true, arrayFormat: 'repeat' }, - // ), - // 'a[c]=1', - // ); - expect( - stringify({ a: [, [, , [, , , { c: [, '1'] }]]] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), - ).toBe('a[1][2][3][c][1]=1'); - expect( - stringify({ a: [, [, , [, , , { c: [, '1'] }]]] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), - ).toBe('a[][][][c][]=1'); - expect( - stringify({ a: [, [, , [, , , { c: [, '1'] }]]] }, { encodeValuesOnly: true, arrayFormat: 'repeat' }), - ).toBe('a[c]=1'); - }); - - test('encodes a very long string', function () { - var chars = []; - var expected = []; - for (var i = 0; i < 5e3; i++) { - chars.push(' ' + i); - - expected.push('%20' + i); - } - - var obj = { - foo: chars.join(''), - }; - - // st.equal( - // stringify(obj, { arrayFormat: 'bracket', charset: 'utf-8' }), - // 'foo=' + expected.join(''), - // ); - // @ts-expect-error - expect(stringify(obj, { arrayFormat: 'bracket', charset: 'utf-8' })).toBe('foo=' + expected.join('')); - }); -}); - -describe('stringifies empty keys', function () { - empty_test_cases.forEach(function (testCase) { - test('stringifies an object with empty string key with ' + testCase.input, function () { - // st.deepEqual( - // stringify(testCase.withEmptyKeys, { encode: false, arrayFormat: 'indices' }), - // testCase.stringifyOutput.indices, - // 'test case: ' + testCase.input + ', indices', - // ); - // st.deepEqual( - // stringify(testCase.withEmptyKeys, { encode: false, arrayFormat: 'brackets' }), - // testCase.stringifyOutput.brackets, - // 'test case: ' + testCase.input + ', brackets', - // ); - // st.deepEqual( - // stringify(testCase.withEmptyKeys, { encode: false, arrayFormat: 'repeat' }), - // testCase.stringifyOutput.repeat, - // 'test case: ' + testCase.input + ', repeat', - // ); - expect(stringify(testCase.with_empty_keys, { encode: false, arrayFormat: 'indices' })).toBe( - testCase.stringify_output.indices, - ); - expect(stringify(testCase.with_empty_keys, { encode: false, arrayFormat: 'brackets' })).toBe( - testCase.stringify_output.brackets, - ); - expect(stringify(testCase.with_empty_keys, { encode: false, arrayFormat: 'repeat' })).toBe( - testCase.stringify_output.repeat, - ); - }); - }); - - test('edge case with object/arrays', function () { - // st.deepEqual(stringify({ '': { '': [2, 3] } }, { encode: false }), '[][0]=2&[][1]=3'); - // st.deepEqual( - // stringify({ '': { '': [2, 3], a: 2 } }, { encode: false }), - // '[][0]=2&[][1]=3&[a]=2', - // ); - // st.deepEqual( - // stringify({ '': { '': [2, 3] } }, { encode: false, arrayFormat: 'indices' }), - // '[][0]=2&[][1]=3', - // ); - // st.deepEqual( - // stringify({ '': { '': [2, 3], a: 2 } }, { encode: false, arrayFormat: 'indices' }), - // '[][0]=2&[][1]=3&[a]=2', - // ); - expect(stringify({ '': { '': [2, 3] } }, { encode: false })).toBe('[][0]=2&[][1]=3'); - expect(stringify({ '': { '': [2, 3], a: 2 } }, { encode: false })).toBe('[][0]=2&[][1]=3&[a]=2'); - expect(stringify({ '': { '': [2, 3] } }, { encode: false, arrayFormat: 'indices' })).toBe( - '[][0]=2&[][1]=3', - ); - expect(stringify({ '': { '': [2, 3], a: 2 } }, { encode: false, arrayFormat: 'indices' })).toBe( - '[][0]=2&[][1]=3&[a]=2', - ); - }); -}); diff --git a/tests/qs/utils.test.ts b/tests/qs/utils.test.ts deleted file mode 100644 index 08f0e6da..00000000 --- a/tests/qs/utils.test.ts +++ /dev/null @@ -1,169 +0,0 @@ -import { combine, merge, is_buffer, assign_single_source } from '@hyperspell/hyperspell/internal/qs/utils'; - -describe('merge()', function () { - // t.deepEqual(merge(null, true), [null, true], 'merges true into null'); - expect(merge(null, true)).toEqual([null, true]); - - // t.deepEqual(merge(null, [42]), [null, 42], 'merges null into an array'); - expect(merge(null, [42])).toEqual([null, 42]); - - // t.deepEqual( - // merge({ a: 'b' }, { a: 'c' }), - // { a: ['b', 'c'] }, - // 'merges two objects with the same key', - // ); - expect(merge({ a: 'b' }, { a: 'c' })).toEqual({ a: ['b', 'c'] }); - - var oneMerged = merge({ foo: 'bar' }, { foo: { first: '123' } }); - // t.deepEqual( - // oneMerged, - // { foo: ['bar', { first: '123' }] }, - // 'merges a standalone and an object into an array', - // ); - expect(oneMerged).toEqual({ foo: ['bar', { first: '123' }] }); - - var twoMerged = merge({ foo: ['bar', { first: '123' }] }, { foo: { second: '456' } }); - // t.deepEqual( - // twoMerged, - // { foo: { 0: 'bar', 1: { first: '123' }, second: '456' } }, - // 'merges a standalone and two objects into an array', - // ); - expect(twoMerged).toEqual({ foo: { 0: 'bar', 1: { first: '123' }, second: '456' } }); - - var sandwiched = merge({ foo: ['bar', { first: '123', second: '456' }] }, { foo: 'baz' }); - // t.deepEqual( - // sandwiched, - // { foo: ['bar', { first: '123', second: '456' }, 'baz'] }, - // 'merges an object sandwiched by two standalones into an array', - // ); - expect(sandwiched).toEqual({ foo: ['bar', { first: '123', second: '456' }, 'baz'] }); - - var nestedArrays = merge({ foo: ['baz'] }, { foo: ['bar', 'xyzzy'] }); - // t.deepEqual(nestedArrays, { foo: ['baz', 'bar', 'xyzzy'] }); - expect(nestedArrays).toEqual({ foo: ['baz', 'bar', 'xyzzy'] }); - - var noOptionsNonObjectSource = merge({ foo: 'baz' }, 'bar'); - // t.deepEqual(noOptionsNonObjectSource, { foo: 'baz', bar: true }); - expect(noOptionsNonObjectSource).toEqual({ foo: 'baz', bar: true }); - - (typeof Object.defineProperty !== 'function' ? test.skip : test)( - 'avoids invoking array setters unnecessarily', - function () { - var setCount = 0; - var getCount = 0; - var observed: any[] = []; - Object.defineProperty(observed, 0, { - get: function () { - getCount += 1; - return { bar: 'baz' }; - }, - set: function () { - setCount += 1; - }, - }); - merge(observed, [null]); - // st.equal(setCount, 0); - // st.equal(getCount, 1); - expect(setCount).toEqual(0); - expect(getCount).toEqual(1); - observed[0] = observed[0]; - // st.equal(setCount, 1); - // st.equal(getCount, 2); - expect(setCount).toEqual(1); - expect(getCount).toEqual(2); - }, - ); -}); - -test('assign()', function () { - var target = { a: 1, b: 2 }; - var source = { b: 3, c: 4 }; - var result = assign_single_source(target, source); - - expect(result).toEqual(target); - expect(target).toEqual({ a: 1, b: 3, c: 4 }); - expect(source).toEqual({ b: 3, c: 4 }); -}); - -describe('combine()', function () { - test('both arrays', function () { - var a = [1]; - var b = [2]; - var combined = combine(a, b); - - // st.deepEqual(a, [1], 'a is not mutated'); - // st.deepEqual(b, [2], 'b is not mutated'); - // st.notEqual(a, combined, 'a !== combined'); - // st.notEqual(b, combined, 'b !== combined'); - // st.deepEqual(combined, [1, 2], 'combined is a + b'); - expect(a).toEqual([1]); - expect(b).toEqual([2]); - expect(combined).toEqual([1, 2]); - expect(a).not.toEqual(combined); - expect(b).not.toEqual(combined); - }); - - test('one array, one non-array', function () { - var aN = 1; - var a = [aN]; - var bN = 2; - var b = [bN]; - - var combinedAnB = combine(aN, b); - // st.deepEqual(b, [bN], 'b is not mutated'); - // st.notEqual(aN, combinedAnB, 'aN + b !== aN'); - // st.notEqual(a, combinedAnB, 'aN + b !== a'); - // st.notEqual(bN, combinedAnB, 'aN + b !== bN'); - // st.notEqual(b, combinedAnB, 'aN + b !== b'); - // st.deepEqual([1, 2], combinedAnB, 'first argument is array-wrapped when not an array'); - expect(b).toEqual([bN]); - expect(combinedAnB).not.toEqual(aN); - expect(combinedAnB).not.toEqual(a); - expect(combinedAnB).not.toEqual(bN); - expect(combinedAnB).not.toEqual(b); - expect(combinedAnB).toEqual([1, 2]); - - var combinedABn = combine(a, bN); - // st.deepEqual(a, [aN], 'a is not mutated'); - // st.notEqual(aN, combinedABn, 'a + bN !== aN'); - // st.notEqual(a, combinedABn, 'a + bN !== a'); - // st.notEqual(bN, combinedABn, 'a + bN !== bN'); - // st.notEqual(b, combinedABn, 'a + bN !== b'); - // st.deepEqual([1, 2], combinedABn, 'second argument is array-wrapped when not an array'); - expect(a).toEqual([aN]); - expect(combinedABn).not.toEqual(aN); - expect(combinedABn).not.toEqual(a); - expect(combinedABn).not.toEqual(bN); - expect(combinedABn).not.toEqual(b); - expect(combinedABn).toEqual([1, 2]); - }); - - test('neither is an array', function () { - var combined = combine(1, 2); - // st.notEqual(1, combined, '1 + 2 !== 1'); - // st.notEqual(2, combined, '1 + 2 !== 2'); - // st.deepEqual([1, 2], combined, 'both arguments are array-wrapped when not an array'); - expect(combined).not.toEqual(1); - expect(combined).not.toEqual(2); - expect(combined).toEqual([1, 2]); - }); -}); - -test('is_buffer()', function () { - for (const x of [null, undefined, true, false, '', 'abc', 42, 0, NaN, {}, [], function () {}, /a/g]) { - // t.equal(is_buffer(x), false, inspect(x) + ' is not a buffer'); - expect(is_buffer(x)).toEqual(false); - } - - var fakeBuffer = { constructor: Buffer }; - // t.equal(is_buffer(fakeBuffer), false, 'fake buffer is not a buffer'); - expect(is_buffer(fakeBuffer)).toEqual(false); - - var saferBuffer = Buffer.from('abc'); - // t.equal(is_buffer(saferBuffer), true, 'SaferBuffer instance is a buffer'); - expect(is_buffer(saferBuffer)).toEqual(true); - - var buffer = Buffer.from('abc'); - // t.equal(is_buffer(buffer), true, 'real Buffer instance is a buffer'); - expect(is_buffer(buffer)).toEqual(true); -}); diff --git a/tests/stringifyQuery.test.ts b/tests/stringifyQuery.test.ts index ce88c6f0..56a3842e 100644 --- a/tests/stringifyQuery.test.ts +++ b/tests/stringifyQuery.test.ts @@ -18,4 +18,10 @@ describe(stringifyQuery, () => { expect(stringifyQuery(input)).toEqual(expected); }); } + + for (const value of [[], {}, new Date()]) { + it(`${JSON.stringify(value)} -> `, () => { + expect(() => stringifyQuery({ value })).toThrow(`Cannot stringify type ${typeof value}`); + }); + } });