@sanity/cli 8.27.0 → 8.28.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1515 -408
- package/dist/actions/context/commandTable.js +215 -0
- package/dist/actions/context/commandTable.js.map +1 -0
- package/dist/actions/context/contextCommand.js +246 -0
- package/dist/actions/context/contextCommand.js.map +1 -0
- package/dist/actions/context/contextSpec.js +18 -0
- package/dist/actions/context/contextSpec.js.map +1 -0
- package/dist/actions/context/distillContextOperations.js +335 -0
- package/dist/actions/context/distillContextOperations.js.map +1 -0
- package/dist/actions/context/mcpEndpoint.js.map +1 -1
- package/dist/actions/context/operationInput.js +226 -0
- package/dist/actions/context/operationInput.js.map +1 -0
- package/dist/actions/context/operationTypes.js +3 -0
- package/dist/actions/context/operationTypes.js.map +1 -0
- package/dist/actions/context/removedCommands.js +26 -0
- package/dist/actions/context/removedCommands.js.map +1 -0
- package/dist/actions/context/renderOperationResult.js +72 -0
- package/dist/actions/context/renderOperationResult.js.map +1 -0
- package/dist/actions/context/sourceFile.js +31 -0
- package/dist/actions/context/sourceFile.js.map +1 -0
- package/dist/actions/context/syncOutput.js +17 -0
- package/dist/actions/context/syncOutput.js.map +1 -0
- package/dist/actions/context/table.js +13 -0
- package/dist/actions/context/table.js.map +1 -0
- package/dist/actions/context/waitForJob.js.map +1 -1
- package/dist/actions/context/waitForSourceSync.js +48 -0
- package/dist/actions/context/waitForSourceSync.js.map +1 -0
- package/dist/actions/context/watchJob.js.map +1 -1
- package/dist/actions/context/watchSourceSync.js +40 -0
- package/dist/actions/context/watchSourceSync.js.map +1 -0
- package/dist/actions/dev/servers/startStudioDevServer.js +4 -1
- package/dist/actions/dev/servers/startStudioDevServer.js.map +1 -1
- package/dist/commands/context/build.js +19 -81
- package/dist/commands/context/build.js.map +1 -1
- package/dist/commands/context/create.js +3 -90
- package/dist/commands/context/create.js.map +1 -1
- package/dist/commands/context/delete.js +3 -73
- package/dist/commands/context/delete.js.map +1 -1
- package/dist/commands/context/documents/content.js +117 -0
- package/dist/commands/context/documents/content.js.map +1 -0
- package/dist/commands/context/documents/delete.js +5 -0
- package/dist/commands/context/documents/delete.js.map +1 -0
- package/dist/commands/context/documents/edit.js +5 -0
- package/dist/commands/context/documents/edit.js.map +1 -0
- package/dist/commands/context/documents/get.js +5 -0
- package/dist/commands/context/documents/get.js.map +1 -0
- package/dist/commands/context/documents/list.js +5 -0
- package/dist/commands/context/documents/list.js.map +1 -0
- package/dist/commands/context/entries/list.js +2 -2
- package/dist/commands/context/entries/list.js.map +1 -1
- package/dist/commands/context/entries/rebuild.js +3 -93
- package/dist/commands/context/entries/rebuild.js.map +1 -1
- package/dist/commands/context/get.js +3 -88
- package/dist/commands/context/get.js.map +1 -1
- package/dist/commands/context/instructions/create.js +5 -0
- package/dist/commands/context/instructions/create.js.map +1 -0
- package/dist/commands/context/instructions/delete.js +5 -0
- package/dist/commands/context/instructions/delete.js.map +1 -0
- package/dist/commands/context/instructions/edit.js +5 -0
- package/dist/commands/context/instructions/edit.js.map +1 -0
- package/dist/commands/context/issues/apply.js +3 -84
- package/dist/commands/context/issues/apply.js.map +1 -1
- package/dist/commands/context/issues/dismiss.js +3 -50
- package/dist/commands/context/issues/dismiss.js.map +1 -1
- package/dist/commands/context/issues/reopen.js +3 -51
- package/dist/commands/context/issues/reopen.js.map +1 -1
- package/dist/commands/context/issues/resolve.js +23 -92
- package/dist/commands/context/issues/resolve.js.map +1 -1
- package/dist/commands/context/jobs/get.js +3 -88
- package/dist/commands/context/jobs/get.js.map +1 -1
- package/dist/commands/context/list.js +3 -95
- package/dist/commands/context/list.js.map +1 -1
- package/dist/commands/context/mcp/initial-context.js +5 -0
- package/dist/commands/context/mcp/initial-context.js.map +1 -0
- package/dist/commands/context/mcp/list.js +2 -2
- package/dist/commands/context/mcp/list.js.map +1 -1
- package/dist/commands/context/mcp/status.js.map +1 -1
- package/dist/commands/context/mcp/update.js.map +1 -1
- package/dist/commands/context/sources/create.js +175 -0
- package/dist/commands/context/sources/create.js.map +1 -0
- package/dist/commands/context/sources/delete.js +5 -0
- package/dist/commands/context/sources/delete.js.map +1 -0
- package/dist/commands/context/sources/edit.js +29 -0
- package/dist/commands/context/sources/edit.js.map +1 -0
- package/dist/commands/context/sources/get.js +5 -0
- package/dist/commands/context/sources/get.js.map +1 -0
- package/dist/commands/context/sources/list.js +5 -0
- package/dist/commands/context/sources/list.js.map +1 -0
- package/dist/commands/context/sources/sync.js +5 -0
- package/dist/commands/context/sources/sync.js.map +1 -0
- package/dist/commands/context/sources/syncs/confirm.js +5 -0
- package/dist/commands/context/sources/syncs/confirm.js.map +1 -0
- package/dist/commands/context/sources/syncs/discard.js +5 -0
- package/dist/commands/context/sources/syncs/discard.js.map +1 -0
- package/dist/commands/context/sources/syncs/get.js +5 -0
- package/dist/commands/context/sources/syncs/get.js.map +1 -0
- package/dist/commands/context/sources/syncs/list.js +5 -0
- package/dist/commands/context/sources/syncs/list.js.map +1 -0
- package/dist/commands/context/sources/upload.js +63 -0
- package/dist/commands/context/sources/upload.js.map +1 -0
- package/dist/commands/context/sync.js +5 -0
- package/dist/commands/context/sync.js.map +1 -0
- package/dist/commands/context/update.js +3 -136
- package/dist/commands/context/update.js.map +1 -1
- package/dist/exports/invokeSanityCli/commandPolicies/mcpPolicy.js +41 -26
- package/dist/exports/invokeSanityCli/commandPolicies/mcpPolicy.js.map +1 -1
- package/dist/generated/apiRoutes.js +28 -0
- package/dist/generated/apiRoutes.js.map +1 -1
- package/dist/generated/contextOperations.js +1116 -0
- package/dist/generated/contextOperations.js.map +1 -0
- package/dist/hooks/commandNotFound/topicAliases.js +8 -2
- package/dist/hooks/commandNotFound/topicAliases.js.map +1 -1
- package/dist/services/context.js +241 -268
- package/dist/services/context.js.map +1 -1
- package/dist/util/telemetry/cliCommandIdentity.js +10 -18
- package/dist/util/telemetry/cliCommandIdentity.js.map +1 -1
- package/oclif.manifest.json +3380 -1910
- package/package.json +24 -23
- package/templates/app-quickstart/.claude/skills/sanity-app-sdk/SKILL.md +49 -0
- package/templates/app-quickstart/AGENTS.md +49 -0
- package/templates/app-sanity-ui/.claude/skills/sanity-app-sdk/SKILL.md +49 -0
- package/templates/app-sanity-ui/AGENTS.md +49 -0
- package/templates/shared/dashboard/app-quickstart/.claude/skills/sanity-app-sdk/SKILL.md +49 -0
- package/templates/shared/dashboard/app-quickstart/AGENTS.md +49 -0
- package/templates/shared/dashboard/app-sanity-ui/.claude/skills/sanity-app-sdk/SKILL.md +49 -0
- package/templates/shared/dashboard/app-sanity-ui/AGENTS.md +49 -0
- package/dist/commands/context/imports/create.js +0 -270
- package/dist/commands/context/imports/create.js.map +0 -1
- package/dist/commands/context/imports/delete.js +0 -73
- package/dist/commands/context/imports/delete.js.map +0 -1
- package/dist/commands/context/imports/download.js +0 -60
- package/dist/commands/context/imports/download.js.map +0 -1
- package/dist/commands/context/imports/get.js +0 -88
- package/dist/commands/context/imports/get.js.map +0 -1
- package/dist/commands/context/imports/list.js +0 -100
- package/dist/commands/context/imports/list.js.map +0 -1
- package/dist/commands/context/refresh.js +0 -46
- package/dist/commands/context/refresh.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/generated/contextOperations.ts"],"sourcesContent":["/**\n * GENERATED FILE - DO NOT EDIT\n *\n * The Context API operations the context commands call, distilled from the\n * OpenAPI spec `@sanity/client` vendors.\n *\n * Regenerate with: pnpm generate:context-commands\n */\nimport {type ContextOperation} from '../actions/context/operationTypes.js'\n\nexport const contextOperations = {\n applyIssues: {\n body: 'required',\n description: 'Accepts the issues in `issueIds`, then queues a job that applies them, rewrites the affected entries, and saves a new revision. Returns a job ID. IDs of issues that no longer exist are skipped. Returns `409` with code `issueNotAutoApplicable`, and accepts none of the issues, if any of them cannot be applied: a `conflict` (resolve it with `POST .../issues/{issueId}/resolve`), or an `update_required` issue whose `scopePath` is `*` or names an entry that no longer exists. Dismiss those instead.',\n fields: [\n {\n description: 'The IDs of the issues to accept and apply.',\n in: 'body',\n name: 'issueIds',\n required: true,\n type: 'string[]'\n }\n ],\n noContent: false,\n paginated: false,\n pathParams: [\n {\n description: 'The knowledge base\\'s ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.',\n name: 'knowledgeBaseId'\n }\n ],\n route: 'POST /knowledge-bases/{knowledgeBaseId}/issues/apply',\n startsJob: true,\n summary: 'Accept and apply issues'\n },\n buildKnowledgeBase: {\n body: 'none',\n description: 'Queues a build over the knowledge base\\'s current sources and returns a job ID immediately. If a build is already running, the response returns that build\\'s job ID instead of starting a second build. A draft can\\'t be built: the request returns `409` with code `knowledgeBaseIsDraft`.',\n fields: [],\n noContent: false,\n paginated: false,\n pathParams: [\n {\n description: 'The knowledge base\\'s ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.',\n name: 'knowledgeBaseId'\n }\n ],\n route: 'POST /knowledge-bases/{knowledgeBaseId}/build',\n startsJob: true,\n summary: 'Start a knowledge base build'\n },\n confirmSync: {\n body: 'none',\n description: 'Deletes the documents a `held` sync didn\\'t find, unless a sync has found them since, completes the sync, and starts a refresh of each knowledge base that uses the source, which removes their citations from entries. A sync that isn\\'t `held` returns `409` with code `syncNotHeld`.',\n fields: [],\n noContent: false,\n paginated: false,\n pathParams: [\n {\n description: 'The knowledge base\\'s ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.',\n name: 'knowledgeBaseId'\n },\n {\n description: 'The source\\'s ID.',\n name: 'sourceId'\n },\n {\n description: 'The sync\\'s ID.',\n name: 'syncId'\n }\n ],\n route: 'POST /knowledge-bases/{knowledgeBaseId}/sources/{sourceId}/syncs/{syncId}/confirm',\n startsJob: false,\n summary: 'Confirm a held sync\\'s deletions'\n },\n createInstruction: {\n body: 'required',\n description: 'Creates a standing instruction for how entries built from its documents are written. Every instruction applies to specific documents, set in `scopeDocumentIds`. To rebuild entries under the new instruction right away, pass their paths in `rebuildPaths`. The response includes the rebuild job ID, or `null` if the rebuild could not start. The instruction is saved either way. After the instruction is saved, a background check files issues for entries that contradict it. If you already checked the instruction for contradictions, set `verified` to skip the background check. If the requested rebuild does not start, the background check runs even when `verified` is set.',\n fields: [\n {\n description: 'The instruction in plain language. Builds follow it over what the sources say.',\n in: 'body',\n name: 'statement',\n required: true,\n type: 'string'\n },\n {\n description: 'IDs of the documents the instruction applies to. Builds apply it when they write entries built from these documents. IDs of documents that no longer exist are dropped. If none exist, the request returns `422` with code `instructionScopeVanished`.',\n in: 'body',\n name: 'scopeDocumentIds',\n required: true,\n type: 'string[]'\n },\n {\n description: 'Paths of entries to rebuild under the new instruction right away. The response returns the rebuild job ID in `rebuildJobId`.',\n in: 'body',\n name: 'rebuildPaths',\n type: 'string[]'\n },\n {\n description: 'Whether you already checked the instruction for entries that contradict it. When `true`, the background check that files issues for those entries is skipped. It still runs if the rebuild you requested in `rebuildPaths` does not start.',\n in: 'body',\n name: 'verified',\n type: 'boolean'\n }\n ],\n noContent: false,\n paginated: false,\n pathParams: [\n {\n description: 'The knowledge base\\'s ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.',\n name: 'knowledgeBaseId'\n }\n ],\n route: 'POST /knowledge-bases/{knowledgeBaseId}/instructions',\n startsJob: false,\n summary: 'Create an instruction'\n },\n createKnowledgeBase: {\n body: 'required',\n description: 'Creates a knowledge base in your organization. To add content to it, add a source. Set `draft` to `true` to create a draft, which needs no title or description until you finish it. If your organization\\'s Context document store can\\'t be used, the request returns `503` with code `contextStoreUnavailable` and you can retry.',\n fields: [\n {\n description: 'The ID of the organization to create the knowledge base in.',\n in: 'body',\n name: 'organizationId',\n required: true,\n type: 'string'\n },\n {\n description: 'The knowledge base\\'s title. Required unless `draft` is `true`.',\n in: 'body',\n name: 'title',\n type: 'string'\n },\n {\n description: 'A short description of what the knowledge base covers. Required unless `draft` is `true`.',\n in: 'body',\n name: 'description',\n type: 'string'\n },\n {\n description: 'Whether to create the knowledge base as a draft. You can add sources to a draft, and they sync right away, but you can\\'t build it, and the list leaves it out unless you set `includeDrafts` to `true`. A draft counts toward your plan\\'s knowledge base limit. To finish it, update it with `draft` set to `false`.',\n in: 'body',\n name: 'draft',\n type: 'boolean'\n }\n ],\n noContent: false,\n paginated: false,\n pathParams: [],\n route: 'POST /knowledge-bases',\n startsJob: false,\n summary: 'Create a knowledge base'\n },\n createSource: {\n body: 'required',\n description: 'Adds a source to a knowledge base. Set `type` to choose what it reads:\\n\\n- `web`: a website, crawled from `url`\\n- `sanity-dataset`: the documents a GROQ query selects in a Sanity dataset\\n- `files`: files you upload with `POST .../sources/{sourceId}/uploads`, or text you send in `content`\\n\\nA website or dataset starts its first sync right away. A `files` source syncs when you upload a file, or right away when you send `content`: one request stores the text, adds the source and starts its sync. For a website, set `dryRun` to `true` to preview the crawl without adding the source.\\n\\nAdding a website that is already a source returns `409` with code `webSourceRootConflict`, and adding more websites than your limit allows returns `409` with code `webSourceRootLimitExceeded`. When the organization\\'s knowledge bases already hold as many source chunks as its plan allows, returns `403` with code `planLimitReached` and adds nothing. Supports the `Idempotency-Key` header.',\n fields: [\n {\n description: 'The source type. `web` crawls a website.',\n in: 'body',\n name: 'type',\n options: [\n 'web',\n 'sanity-dataset',\n 'files'\n ],\n required: true,\n type: 'string'\n },\n {\n description: 'The URL to start crawling from. It must be a public `http` or `https` URL.',\n in: 'body',\n name: 'url',\n type: 'string',\n variants: [\n 'web'\n ]\n },\n {\n description: 'Regular expressions for URL paths to crawl. When set, the crawl only includes pages whose path matches one of them.',\n in: 'body',\n name: 'includePaths',\n parent: 'crawlOptions',\n type: 'string[]',\n variants: [\n 'web'\n ]\n },\n {\n description: 'Regular expressions for URL paths to skip. Pages whose path matches one of them aren\\'t crawled.',\n in: 'body',\n name: 'excludePaths',\n parent: 'crawlOptions',\n type: 'string[]',\n variants: [\n 'web'\n ]\n },\n {\n description: 'How many levels deep the crawl goes from the root URL.',\n in: 'body',\n name: 'maxDepth',\n parent: 'crawlOptions',\n type: 'integer',\n variants: [\n 'web'\n ]\n },\n {\n description: 'Whether to crawl only the pages listed in the site\\'s sitemap.',\n in: 'body',\n name: 'sitemapOnly',\n parent: 'crawlOptions',\n type: 'boolean',\n variants: [\n 'web'\n ]\n },\n {\n description: 'Whether to treat URLs that differ only by query string as one page. New crawls set it to `true` unless you set it. Set it to `false` when the query string selects different content, such as pagination.',\n in: 'body',\n name: 'ignoreQueryParameters',\n parent: 'crawlOptions',\n type: 'boolean',\n variants: [\n 'web'\n ]\n },\n {\n description: 'The maximum number of pages to crawl. The crawl can stop sooner when the knowledge base reaches its source limit.',\n in: 'body',\n name: 'pageLimit',\n parent: 'crawlOptions',\n type: 'integer',\n variants: [\n 'web'\n ]\n },\n {\n description: 'Set to `true` to estimate what a crawl would fetch without adding the source. The response is then `200` with a preview of the pages the site has, grouped by path.',\n in: 'body',\n name: 'dryRun',\n type: 'boolean',\n variants: [\n 'web'\n ]\n },\n {\n description: 'The ID of the Sanity project to read documents from. You need full read access to the dataset and, on its project, the Administrator or Developer role or a custom role that can create datasets.',\n in: 'body',\n name: 'sanityProjectId',\n type: 'string',\n variants: [\n 'sanity-dataset'\n ]\n },\n {\n description: 'The dataset to read documents from.',\n in: 'body',\n name: 'sanityDatasetId',\n type: 'string',\n variants: [\n 'sanity-dataset'\n ]\n },\n {\n description: 'A GROQ query that selects the documents, with an optional projection. Each sync runs it again.',\n in: 'body',\n name: 'query',\n type: 'string',\n variants: [\n 'sanity-dataset'\n ]\n },\n {\n description: 'The source\\'s title.',\n in: 'body',\n name: 'title',\n type: 'string',\n variants: [\n 'files'\n ]\n },\n {\n description: 'Text or markdown for the source to hold, up to 1,000,000 bytes of UTF-8. The source syncs it at once, with no upload. Larger content goes through `POST .../sources/{sourceId}/uploads`.',\n in: 'body',\n name: 'content',\n type: 'string',\n variants: [\n 'files'\n ]\n },\n {\n description: 'The format of `content`: `text/markdown` (the default) or `text/plain`. Only with `content`.',\n in: 'body',\n name: 'contentType',\n options: [\n 'text/markdown',\n 'text/plain'\n ],\n type: 'string',\n variants: [\n 'files'\n ]\n }\n ],\n noContent: false,\n paginated: false,\n pathParams: [\n {\n description: 'The knowledge base\\'s ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.',\n name: 'knowledgeBaseId'\n }\n ],\n route: 'POST /knowledge-bases/{knowledgeBaseId}/sources',\n startsJob: false,\n summary: 'Add a source'\n },\n deleteDocument: {\n body: 'none',\n description: 'Deletes a document from its source. A page that is still on the website comes back on the next sync of its source unless the crawl options exclude it. Entries that cite the document stay the same until the next build or refresh, which removes the citations.',\n fields: [],\n noContent: true,\n paginated: false,\n pathParams: [\n {\n description: 'The knowledge base\\'s ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.',\n name: 'knowledgeBaseId'\n },\n {\n description: 'The document\\'s ID.',\n name: 'documentId'\n }\n ],\n route: 'DELETE /knowledge-bases/{knowledgeBaseId}/documents/{documentId}',\n startsJob: false,\n summary: 'Delete a document'\n },\n deleteInstruction: {\n body: 'none',\n description: 'Deletes the instruction. Builds stop applying it from the next run. Entries already written under it keep their text until they are rebuilt; pass `rebuild=true` to rebuild every entry built from its documents right away.',\n fields: [\n {\n description: 'Set to `true` to rebuild every entry built from the instruction\\'s documents once it is deleted, so pages written under the instruction reflect their documents again. The response returns the rebuild job ID in `rebuildJobId`.',\n in: 'query',\n name: 'rebuild',\n type: 'boolean'\n }\n ],\n noContent: false,\n paginated: false,\n pathParams: [\n {\n description: 'The knowledge base\\'s ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.',\n name: 'knowledgeBaseId'\n },\n {\n description: 'The instruction\\'s ID.',\n name: 'instructionId'\n }\n ],\n route: 'DELETE /knowledge-bases/{knowledgeBaseId}/instructions/{instructionId}',\n startsJob: false,\n summary: 'Delete an instruction'\n },\n deleteKnowledgeBase: {\n body: 'none',\n description: 'Deletes the knowledge base and everything it owns: its sources, revisions, stored source files, and its documents in your organization\\'s document store. While a build, refresh, apply, or sync is running, the request returns `409` with code `buildInFlight`. Retry after that work finishes.',\n fields: [],\n noContent: true,\n paginated: false,\n pathParams: [\n {\n description: 'The knowledge base\\'s ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.',\n name: 'knowledgeBaseId'\n }\n ],\n route: 'DELETE /knowledge-bases/{knowledgeBaseId}',\n startsJob: false,\n summary: 'Delete a knowledge base'\n },\n deleteSource: {\n body: 'none',\n description: 'Removes a source and its documents from the knowledge base, and starts a refresh that removes their citations from entries and deletes the entries left with none. A source no other knowledge base uses stops syncing and is deleted once that refresh has run.',\n fields: [],\n noContent: true,\n paginated: false,\n pathParams: [\n {\n description: 'The knowledge base\\'s ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.',\n name: 'knowledgeBaseId'\n },\n {\n description: 'The source\\'s ID.',\n name: 'sourceId'\n }\n ],\n route: 'DELETE /knowledge-bases/{knowledgeBaseId}/sources/{sourceId}',\n startsJob: false,\n summary: 'Delete a source'\n },\n discardSync: {\n body: 'none',\n description: 'Completes a `held` sync without deleting anything: every document stays as it is. A sync that isn\\'t `held` returns `409` with code `syncNotHeld`.',\n fields: [],\n noContent: false,\n paginated: false,\n pathParams: [\n {\n description: 'The knowledge base\\'s ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.',\n name: 'knowledgeBaseId'\n },\n {\n description: 'The source\\'s ID.',\n name: 'sourceId'\n },\n {\n description: 'The sync\\'s ID.',\n name: 'syncId'\n }\n ],\n route: 'POST /knowledge-bases/{knowledgeBaseId}/sources/{sourceId}/syncs/{syncId}/discard',\n startsJob: false,\n summary: 'Discard a held sync\\'s deletions'\n },\n dismissIssue: {\n body: 'none',\n description: 'Marks the issue as rejected. If the issue already left triage, the request returns it unchanged. Returns `422` with code `issueDocumentInvalid` if the issue document was edited into a shape the API cannot verify. Returns `409` with code `issueTransitionConflict` if another change to the issue happened at the same time. You can safely retry a `409`.',\n fields: [],\n noContent: false,\n paginated: false,\n pathParams: [\n {\n description: 'The knowledge base\\'s ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.',\n name: 'knowledgeBaseId'\n },\n {\n description: 'The issue\\'s document ID.',\n name: 'issueId'\n }\n ],\n route: 'POST /knowledge-bases/{knowledgeBaseId}/issues/{issueId}/dismiss',\n startsJob: false,\n summary: 'Dismiss an issue'\n },\n getDocument: {\n body: 'none',\n description: 'Returns a document with its conversion status and the chunks of its markdown. Entry citations point at a document\\'s chunks.',\n fields: [],\n noContent: false,\n paginated: false,\n pathParams: [\n {\n description: 'The knowledge base\\'s ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.',\n name: 'knowledgeBaseId'\n },\n {\n description: 'The document\\'s ID.',\n name: 'documentId'\n }\n ],\n route: 'GET /knowledge-bases/{knowledgeBaseId}/documents/{documentId}',\n startsJob: false,\n summary: 'Get a document'\n },\n getDocumentContent: {\n body: 'none',\n description: 'Returns the markdown a document converted to: the text builds read, and the line numbers citations use. Set `chunk` or `lines` to get part of it, and `format` to `markdown` or `plain` to get the text alone instead of JSON. Until the document is converted, the request returns `409` with code `documentNotConverted`. With `format=raw` it returns the document as its source gave it, as an attachment, or `409` with code `documentNotStored` when the document was too large to keep.',\n fields: [\n {\n description: 'Response format. `json` (default) returns the markdown with its line numbers. `markdown` and `plain` return the markdown alone, ready to pass to a model. `raw` returns the bytes the source gave, before conversion: the uploaded file, the crawled page, the dataset document as JSON.',\n in: 'query',\n name: 'format',\n options: [\n 'json',\n 'markdown',\n 'plain',\n 'raw'\n ],\n type: 'string'\n },\n {\n description: 'Return only this chunk\\'s lines. Citations name the chunk they quote.',\n in: 'query',\n name: 'chunk',\n type: 'string'\n },\n {\n description: 'Return only these lines, from 1 and inclusive: `10-20`, or `10` for line 10 to the end. A range past the end returns up to the last line.',\n in: 'query',\n name: 'lines',\n type: 'string'\n }\n ],\n noContent: false,\n paginated: false,\n pathParams: [\n {\n description: 'The knowledge base\\'s ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.',\n name: 'knowledgeBaseId'\n },\n {\n description: 'The document\\'s ID.',\n name: 'documentId'\n }\n ],\n route: 'GET /knowledge-bases/{knowledgeBaseId}/documents/{documentId}/content',\n startsJob: false,\n summary: 'Get a document\\'s markdown'\n },\n getJob: {\n body: 'none',\n description: 'Returns the status of a background job, such as a build, sync, or refresh. The endpoint that starts the work returns the job ID.',\n fields: [],\n noContent: false,\n paginated: false,\n pathParams: [\n {\n description: 'The knowledge base\\'s ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.',\n name: 'knowledgeBaseId'\n },\n {\n description: 'The job ID returned by the endpoint that started the work.',\n name: 'jobId'\n }\n ],\n route: 'GET /knowledge-bases/{knowledgeBaseId}/jobs/{jobId}',\n startsJob: false,\n summary: 'Get a job'\n },\n getKnowledgeBase: {\n body: 'none',\n description: 'Returns a knowledge base\\'s metadata and state. `knowledgeBaseId` accepts the public ID (`kb...`) or the UUID, and you don\\'t need to pass an organization. If you can\\'t read the knowledge base, the request returns `404`. To read the built entries, query `sanity.context.entry` documents with GROQ from your organization\\'s document store.',\n fields: [],\n noContent: false,\n paginated: false,\n pathParams: [\n {\n description: 'The knowledge base\\'s ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.',\n name: 'knowledgeBaseId'\n }\n ],\n route: 'GET /knowledge-bases/{knowledgeBaseId}',\n startsJob: false,\n summary: 'Get a knowledge base'\n },\n getMcpEndpointInitialContext: {\n body: 'none',\n description: 'Returns the same text as the `initial_context` MCP tool, as plain text you can add to a system prompt. `heading_offset` shifts markdown headings down by that many levels. The default is `1`, so `#` becomes `##`.',\n fields: [\n {\n description: 'A JSON array that adds `_url` fields to query results. Each item has `types` (document types), `baseUrl`, and an optional `slugExpression`, a GROQ expression that defaults to `slug.current`. Invalid JSON is ignored.',\n in: 'query',\n name: 'linkResolver',\n type: 'string'\n },\n {\n description: 'How many levels to shift markdown headings down, from `0` to `6`. Defaults to `1`, so `#` becomes `##`.',\n in: 'query',\n name: 'heading_offset',\n type: 'string'\n }\n ],\n noContent: false,\n paginated: false,\n pathParams: [\n {\n description: 'The ID of the organization.',\n name: 'organizationId'\n },\n {\n description: 'The MCP endpoint\\'s name, set when the endpoint was created.',\n name: 'mcpEndpoint'\n }\n ],\n route: 'GET /organizations/{organizationId}/mcp/{mcpEndpoint}/initial-context',\n startsJob: false,\n summary: 'Get an MCP endpoint\\'s initial context'\n },\n getSource: {\n body: 'none',\n description: 'Returns a source with its settings, document counts and latest sync.',\n fields: [],\n noContent: false,\n paginated: false,\n pathParams: [\n {\n description: 'The knowledge base\\'s ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.',\n name: 'knowledgeBaseId'\n },\n {\n description: 'The source\\'s ID.',\n name: 'sourceId'\n }\n ],\n route: 'GET /knowledge-bases/{knowledgeBaseId}/sources/{sourceId}',\n startsJob: false,\n summary: 'Get a source'\n },\n getSync: {\n body: 'none',\n description: 'Returns one sync of a source with its status and counts.',\n fields: [],\n noContent: false,\n paginated: false,\n pathParams: [\n {\n description: 'The knowledge base\\'s ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.',\n name: 'knowledgeBaseId'\n },\n {\n description: 'The source\\'s ID.',\n name: 'sourceId'\n },\n {\n description: 'The sync\\'s ID.',\n name: 'syncId'\n }\n ],\n route: 'GET /knowledge-bases/{knowledgeBaseId}/sources/{sourceId}/syncs/{syncId}',\n startsJob: false,\n summary: 'Get a sync'\n },\n listDocuments: {\n body: 'none',\n description: 'Lists the documents in a knowledge base: the pages, dataset documents and files its sources yield, which builds read and cite. Results are cursor-paginated, and you can filter them by `source` and `state`.',\n fields: [\n {\n description: 'The `nextCursor` value from the previous page. Omit it to get the first page.',\n in: 'query',\n name: 'cursor',\n type: 'string'\n },\n {\n description: 'The maximum number of items to return.',\n in: 'query',\n name: 'limit',\n type: 'integer'\n },\n {\n description: 'Return only the documents of this source.',\n in: 'query',\n name: 'source',\n type: 'string'\n },\n {\n description: 'Return only documents in this state. Without it, `deleted` documents are left out.',\n in: 'query',\n name: 'state',\n options: [\n 'active',\n 'missing',\n 'deleted'\n ],\n type: 'string'\n },\n {\n description: 'Comma-separated IDs of the documents to return, up to 200, in any state. Use it to look up the documents entry citations point at.',\n in: 'query',\n name: 'ids',\n type: 'string'\n }\n ],\n noContent: false,\n pageSize: 200,\n paginated: true,\n pathParams: [\n {\n description: 'The knowledge base\\'s ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.',\n name: 'knowledgeBaseId'\n }\n ],\n route: 'GET /knowledge-bases/{knowledgeBaseId}/documents',\n startsJob: false,\n summary: 'List documents'\n },\n listKnowledgeBases: {\n body: 'none',\n description: 'Returns the knowledge bases you can access in the organization set by `organizationId`. Drafts are left out unless you set `includeDrafts` to `true`. Results are cursor-paginated, newest first.',\n fields: [\n {\n description: 'The `nextCursor` value from the previous page. Omit it to get the first page.',\n in: 'query',\n name: 'cursor',\n type: 'string'\n },\n {\n description: 'The maximum number of items to return.',\n in: 'query',\n name: 'limit',\n type: 'integer'\n },\n {\n description: 'The organization to list knowledge bases for.',\n in: 'query',\n name: 'organizationId',\n required: true,\n type: 'string'\n },\n {\n description: 'Set to `true` to also list the organization\\'s drafts, which have `state` set to `draft`. Drafts count toward the plan\\'s knowledge base limit, and `createdBy` says who started each one.',\n in: 'query',\n name: 'includeDrafts',\n type: 'boolean'\n }\n ],\n noContent: false,\n pageSize: 200,\n paginated: true,\n pathParams: [],\n route: 'GET /knowledge-bases',\n startsJob: false,\n summary: 'List knowledge bases'\n },\n listSources: {\n body: 'none',\n description: 'Lists the sources of a knowledge base: the websites, Sanity datasets and files its documents come from, each with its document counts and its latest sync. Results are cursor-paginated.',\n fields: [\n {\n description: 'The `nextCursor` value from the previous page. Omit it to get the first page.',\n in: 'query',\n name: 'cursor',\n type: 'string'\n },\n {\n description: 'The maximum number of items to return.',\n in: 'query',\n name: 'limit',\n type: 'integer'\n }\n ],\n noContent: false,\n pageSize: 200,\n paginated: true,\n pathParams: [\n {\n description: 'The knowledge base\\'s ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.',\n name: 'knowledgeBaseId'\n }\n ],\n route: 'GET /knowledge-bases/{knowledgeBaseId}/sources',\n startsJob: false,\n summary: 'List sources'\n },\n listSyncs: {\n body: 'none',\n description: 'Lists the syncs of a source, newest first. Results are cursor-paginated.',\n fields: [\n {\n description: 'The `nextCursor` value from the previous page. Omit it to get the first page.',\n in: 'query',\n name: 'cursor',\n type: 'string'\n },\n {\n description: 'The maximum number of items to return.',\n in: 'query',\n name: 'limit',\n type: 'integer'\n }\n ],\n noContent: false,\n pageSize: 200,\n paginated: true,\n pathParams: [\n {\n description: 'The knowledge base\\'s ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.',\n name: 'knowledgeBaseId'\n },\n {\n description: 'The source\\'s ID.',\n name: 'sourceId'\n }\n ],\n route: 'GET /knowledge-bases/{knowledgeBaseId}/sources/{sourceId}/syncs',\n startsJob: false,\n summary: 'List a source\\'s syncs'\n },\n rebuildEntry: {\n body: 'none',\n description: 'Queues a rewrite of the entry at `entryPath` from its cited sources and the active instructions, and returns a job ID immediately. The response also lists the other entries built from any of the same sources. An instruction applies to every entry built from its sources, so those entries can change too. Returns `422` with code `entryDocumentInvalid` if the entry document was edited into a shape the API cannot read.',\n fields: [],\n noContent: false,\n paginated: false,\n pathParams: [\n {\n description: 'The knowledge base\\'s ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.',\n name: 'knowledgeBaseId'\n },\n {\n description: 'The entry\\'s slash-delimited path, such as `pricing/plans/free`, URL-encoded.',\n name: 'entryPath'\n }\n ],\n route: 'POST /knowledge-bases/{knowledgeBaseId}/entries/{entryPath}/rebuild',\n startsJob: true,\n summary: 'Rebuild an entry from its sources'\n },\n reopenIssue: {\n body: 'none',\n description: 'Returns an accepted conflict issue to triage, clears its resolution, and deletes the instruction the resolution created. Reopening an open or dismissed conflict returns it unchanged. Other issue types return `422` with code `issueNotResolvable`.',\n fields: [],\n noContent: false,\n paginated: false,\n pathParams: [\n {\n description: 'The knowledge base\\'s ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.',\n name: 'knowledgeBaseId'\n },\n {\n description: 'The issue\\'s document ID.',\n name: 'issueId'\n }\n ],\n route: 'POST /knowledge-bases/{knowledgeBaseId}/issues/{issueId}/reopen',\n startsJob: false,\n summary: 'Reopen an accepted conflict'\n },\n resolveIssue: {\n body: 'required',\n description: 'Resolves a conflict issue by choosing one of its sides. Set `resolution` to the index of a side in `content.sides`. For a conflict on a single entry, index `0` is the entry\\'s current content, so choosing it keeps the entry as it is. Choosing any other side rewrites the entry, and the returned `jobId` tracks the rewrite. The decision becomes a standing instruction for every future build, and `resolvedBy` records who made it. To change a decision, resolve the accepted conflict again. Other issue types, dismissed conflicts, and out-of-range indexes return `422` with code `issueNotResolvable`.',\n fields: [\n {\n description: 'The index of the chosen side in the issue\\'s `content.sides`.',\n in: 'body',\n name: 'resolution',\n required: true,\n type: 'integer'\n }\n ],\n noContent: false,\n paginated: false,\n pathParams: [\n {\n description: 'The knowledge base\\'s ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.',\n name: 'knowledgeBaseId'\n },\n {\n description: 'The issue\\'s document ID.',\n name: 'issueId'\n }\n ],\n route: 'POST /knowledge-bases/{knowledgeBaseId}/issues/{issueId}/resolve',\n startsJob: true,\n summary: 'Resolve a conflict issue'\n },\n startSourceUpload: {\n body: 'required',\n description: 'Returns a single-use signed URL for one file of a `files` source, valid for one hour. To add the file:\\n\\n1. Send the file in a `PUT` request to `uploadUrl`.\\n2. Call `POST .../sources/{sourceId}/syncs` with the `uploadId`.\\n\\nThe file can be a single document or a zip, tar or gzip archive of them. It replaces the source\\'s current file when it syncs. An upload no sync takes within 24 hours is deleted. A source that isn\\'t `files` returns `422` with code `sourceTypeMismatch`. When the organization\\'s knowledge bases already hold as many source chunks as its plan allows, returns `403` with code `planLimitReached`. Supports the `Idempotency-Key` header.',\n fields: [\n {\n description: 'The file\\'s name.',\n in: 'body',\n name: 'filename',\n required: true,\n type: 'string'\n },\n {\n description: 'The media type of the file. When set, the `PUT` request must send the same `Content-Type` header.',\n in: 'body',\n name: 'contentType',\n type: 'string'\n }\n ],\n noContent: false,\n paginated: false,\n pathParams: [\n {\n description: 'The knowledge base\\'s ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.',\n name: 'knowledgeBaseId'\n },\n {\n description: 'The source\\'s ID.',\n name: 'sourceId'\n }\n ],\n route: 'POST /knowledge-bases/{knowledgeBaseId}/sources/{sourceId}/uploads',\n startsJob: false,\n summary: 'Upload a file to a source'\n },\n startSync: {\n body: 'required',\n description: 'Starts a sync of the source. A website or dataset is read again: its sync is queued, and starts once any sync of the source that is running ends, including the first one that started when it was added. Asking again while one waits queues nothing more. Follow it with the source\\'s `latestSync`.\\n\\nFor a `files` source, set `uploadId` to the upload whose file the source should hold from now on; without it, the source reads its current file again. Its sync starts at once and returns a job ID to poll; the finished job\\'s `result` names the sync and whether it is `held`. While a sync of a `files` source is running, including the first one, the request returns `409` with code `syncInProgress` and leaves the upload for a later request. An `uploadId` whose file never arrived returns `404` with code `uploadNotFound`, and an `uploadId` on a source that isn\\'t `files` returns `422` with code `sourceTypeMismatch`.\\n\\nSupports the `Idempotency-Key` header.',\n fields: [\n {\n description: 'For a `files` source, the `uploadId` of the file to sync, from `POST .../sources/{sourceId}/uploads`. Without it, a `files` source reads its current file again. Not allowed for other types.',\n in: 'body',\n name: 'uploadId',\n type: 'string'\n }\n ],\n noContent: false,\n paginated: false,\n pathParams: [\n {\n description: 'The knowledge base\\'s ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.',\n name: 'knowledgeBaseId'\n },\n {\n description: 'The source\\'s ID.',\n name: 'sourceId'\n }\n ],\n route: 'POST /knowledge-bases/{knowledgeBaseId}/sources/{sourceId}/syncs',\n startsJob: true,\n summary: 'Sync a source'\n },\n syncAllSources: {\n body: 'none',\n description: 'Queues a sync of every website and dataset source, which starts once any sync of the source that is running ends. `files` sources sync when you upload a file.',\n fields: [],\n noContent: false,\n paginated: false,\n pathParams: [\n {\n description: 'The knowledge base\\'s ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.',\n name: 'knowledgeBaseId'\n }\n ],\n route: 'POST /knowledge-bases/{knowledgeBaseId}/sync',\n startsJob: false,\n summary: 'Sync every source'\n },\n updateDocument: {\n body: 'required',\n description: 'Keeps a `missing` web page in the knowledge base by setting its `state` back to `active`. A document that isn\\'t `missing` returns `409` with code `documentInvalidState`.',\n fields: [\n {\n description: 'Set to `active` to keep a `missing` page in the knowledge base. The count of crawls that missed it starts again.',\n in: 'body',\n name: 'state',\n options: [\n 'active'\n ],\n required: true,\n type: 'string'\n }\n ],\n noContent: false,\n paginated: false,\n pathParams: [\n {\n description: 'The knowledge base\\'s ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.',\n name: 'knowledgeBaseId'\n },\n {\n description: 'The document\\'s ID.',\n name: 'documentId'\n }\n ],\n route: 'PATCH /knowledge-bases/{knowledgeBaseId}/documents/{documentId}',\n startsJob: false,\n summary: 'Keep a missing document'\n },\n updateInstruction: {\n body: 'required',\n description: 'Updates the instruction\\'s statement or documents. The change applies from the next build. Any update also reactivates an archived instruction and ties it to the current content of its documents.',\n fields: [\n {\n description: 'The new instruction text. Omit it to keep the current text.',\n in: 'body',\n name: 'statement',\n type: 'string'\n },\n {\n description: 'IDs of the documents the instruction applies to. Replaces the current list. Omit it to keep the current documents. IDs of documents that no longer exist are dropped. If none exist, the request returns `422` with code `instructionScopeVanished`.',\n in: 'body',\n name: 'scopeDocumentIds',\n type: 'string[]'\n }\n ],\n noContent: false,\n paginated: false,\n pathParams: [\n {\n description: 'The knowledge base\\'s ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.',\n name: 'knowledgeBaseId'\n },\n {\n description: 'The instruction\\'s ID.',\n name: 'instructionId'\n }\n ],\n route: 'PATCH /knowledge-bases/{knowledgeBaseId}/instructions/{instructionId}',\n startsJob: false,\n summary: 'Update an instruction'\n },\n updateKnowledgeBase: {\n body: 'required',\n description: 'Updates the title or the description, or finishes a draft (`draft: false`). Fields equal to their current value are ignored, so sending the current values changes nothing. Finishing a draft with no title returns `422` with code `draftTitleRequired`. How often a website or dataset syncs is set on the source, with `PATCH .../sources/{sourceId}`.',\n fields: [\n {\n description: 'The knowledge base\\'s new title.',\n in: 'body',\n name: 'title',\n type: 'string'\n },\n {\n description: 'The knowledge base\\'s new description.',\n in: 'body',\n name: 'description',\n type: 'string'\n },\n {\n description: 'Set to `false` to finish a draft, so it can be built and is listed with your other knowledge bases. The knowledge base needs a title, sent here or set before. Ignored when the knowledge base isn\\'t a draft. A finished knowledge base can\\'t become a draft again.',\n in: 'body',\n name: 'draft',\n type: 'boolean'\n }\n ],\n noContent: false,\n paginated: false,\n pathParams: [\n {\n description: 'The knowledge base\\'s ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.',\n name: 'knowledgeBaseId'\n }\n ],\n route: 'PATCH /knowledge-bases/{knowledgeBaseId}',\n startsJob: false,\n summary: 'Update a knowledge base'\n },\n updateSource: {\n body: 'required',\n description: 'Changes a source\\'s title, a website\\'s crawl options, a dataset\\'s query, or how often a website or dataset syncs on its own. New crawl options delete the documents whose path they leave out. When that would delete all of the source\\'s documents, or five or more that are over a fifth of them, the request returns `409` with code `sourceDeletionsUnconfirmed` until you send it again with `confirmDeletions` set to `true`. New crawl options sent while the source syncs return `409` with code `syncInProgress`; send them again once the sync finishes. A new query queues a sync, which removes the documents the query no longer selects.\\n\\nCrawl options on a source that isn\\'t a website, a query on one that isn\\'t a dataset, or a sync frequency on a `files` source, return `422` with code `sourceTypeMismatch`. Setting a sync frequency on a plan without scheduled syncs returns `403` with code `featureNotInPlan`; setting it to `null` always works.',\n fields: [\n {\n description: 'The source\\'s title.',\n in: 'body',\n name: 'title',\n type: 'string'\n },\n {\n description: 'Regular expressions for URL paths to crawl. When set, the crawl only includes pages whose path matches one of them.',\n in: 'body',\n name: 'includePaths',\n parent: 'crawlOptions',\n type: 'string[]'\n },\n {\n description: 'Regular expressions for URL paths to skip. Pages whose path matches one of them aren\\'t crawled.',\n in: 'body',\n name: 'excludePaths',\n parent: 'crawlOptions',\n type: 'string[]'\n },\n {\n description: 'How many levels deep the crawl goes from the root URL.',\n in: 'body',\n name: 'maxDepth',\n parent: 'crawlOptions',\n type: 'integer'\n },\n {\n description: 'Whether to crawl only the pages listed in the site\\'s sitemap.',\n in: 'body',\n name: 'sitemapOnly',\n parent: 'crawlOptions',\n type: 'boolean'\n },\n {\n description: 'Whether to treat URLs that differ only by query string as one page. New crawls set it to `true` unless you set it. Set it to `false` when the query string selects different content, such as pagination.',\n in: 'body',\n name: 'ignoreQueryParameters',\n parent: 'crawlOptions',\n type: 'boolean'\n },\n {\n description: 'The maximum number of pages to crawl. The crawl can stop sooner when the knowledge base reaches its source limit.',\n in: 'body',\n name: 'pageLimit',\n parent: 'crawlOptions',\n type: 'integer'\n },\n {\n description: 'For a `sanity-dataset` source, the GROQ query, replacing the stored one. A sync is queued, and removes the documents the query no longer returns.',\n in: 'body',\n name: 'query',\n type: 'string'\n },\n {\n description: 'For a `web` or `sanity-dataset` source, how often it syncs on its own: `weekly` or `monthly`. `null` stops scheduled syncs, and you can still start a sync yourself. Setting a frequency requires a plan that includes scheduled syncs; without one, the request returns `403` with code `featureNotInPlan`.',\n in: 'body',\n name: 'syncFrequency',\n nullable: true,\n options: [\n 'weekly',\n 'monthly'\n ],\n type: 'string'\n },\n {\n description: 'Set to `true` to apply new crawl options that delete many documents. Without it, a change that would delete all of the documents, or five or more that are over a fifth of them, returns `409` with code `sourceDeletionsUnconfirmed`.',\n in: 'body',\n name: 'confirmDeletions',\n type: 'boolean'\n }\n ],\n noContent: false,\n paginated: false,\n pathParams: [\n {\n description: 'The knowledge base\\'s ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.',\n name: 'knowledgeBaseId'\n },\n {\n description: 'The source\\'s ID.',\n name: 'sourceId'\n }\n ],\n route: 'PATCH /knowledge-bases/{knowledgeBaseId}/sources/{sourceId}',\n startsJob: false,\n summary: 'Update a source'\n }\n} as const satisfies Record<string, ContextOperation>\n"],"names":["contextOperations","applyIssues","body","description","fields","in","name","required","type","noContent","paginated","pathParams","route","startsJob","summary","buildKnowledgeBase","confirmSync","createInstruction","createKnowledgeBase","createSource","options","variants","parent","deleteDocument","deleteInstruction","deleteKnowledgeBase","deleteSource","discardSync","dismissIssue","getDocument","getDocumentContent","getJob","getKnowledgeBase","getMcpEndpointInitialContext","getSource","getSync","listDocuments","pageSize","listKnowledgeBases","listSources","listSyncs","rebuildEntry","reopenIssue","resolveIssue","startSourceUpload","startSync","syncAllSources","updateDocument","updateInstruction","updateKnowledgeBase","updateSource","nullable"],"mappings":"AAAA;;;;;;;CAOC,GAGD,OAAO,MAAMA,oBAAoB;IAC/BC,aAAa;QACXC,MAAM;QACNC,aAAa;QACbC,QAAQ;YACN;gBACED,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNC,UAAU;gBACVC,MAAM;YACR;SACD;QACDC,WAAW;QACXC,WAAW;QACXC,YAAY;YACV;gBACER,aAAa;gBACbG,MAAM;YACR;SACD;QACDM,OAAO;QACPC,WAAW;QACXC,SAAS;IACX;IACAC,oBAAoB;QAClBb,MAAM;QACNC,aAAa;QACbC,QAAQ,EAAE;QACVK,WAAW;QACXC,WAAW;QACXC,YAAY;YACV;gBACER,aAAa;gBACbG,MAAM;YACR;SACD;QACDM,OAAO;QACPC,WAAW;QACXC,SAAS;IACX;IACAE,aAAa;QACXd,MAAM;QACNC,aAAa;QACbC,QAAQ,EAAE;QACVK,WAAW;QACXC,WAAW;QACXC,YAAY;YACV;gBACER,aAAa;gBACbG,MAAM;YACR;YACA;gBACEH,aAAa;gBACbG,MAAM;YACR;YACA;gBACEH,aAAa;gBACbG,MAAM;YACR;SACD;QACDM,OAAO;QACPC,WAAW;QACXC,SAAS;IACX;IACAG,mBAAmB;QACjBf,MAAM;QACNC,aAAa;QACbC,QAAQ;YACN;gBACED,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNC,UAAU;gBACVC,MAAM;YACR;YACA;gBACEL,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNC,UAAU;gBACVC,MAAM;YACR;YACA;gBACEL,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNE,MAAM;YACR;YACA;gBACEL,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNE,MAAM;YACR;SACD;QACDC,WAAW;QACXC,WAAW;QACXC,YAAY;YACV;gBACER,aAAa;gBACbG,MAAM;YACR;SACD;QACDM,OAAO;QACPC,WAAW;QACXC,SAAS;IACX;IACAI,qBAAqB;QACnBhB,MAAM;QACNC,aAAa;QACbC,QAAQ;YACN;gBACED,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNC,UAAU;gBACVC,MAAM;YACR;YACA;gBACEL,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNE,MAAM;YACR;YACA;gBACEL,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNE,MAAM;YACR;YACA;gBACEL,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNE,MAAM;YACR;SACD;QACDC,WAAW;QACXC,WAAW;QACXC,YAAY,EAAE;QACdC,OAAO;QACPC,WAAW;QACXC,SAAS;IACX;IACAK,cAAc;QACZjB,MAAM;QACNC,aAAa;QACbC,QAAQ;YACN;gBACED,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNc,SAAS;oBACP;oBACA;oBACA;iBACD;gBACDb,UAAU;gBACVC,MAAM;YACR;YACA;gBACEL,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNE,MAAM;gBACNa,UAAU;oBACR;iBACD;YACH;YACA;gBACElB,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNgB,QAAQ;gBACRd,MAAM;gBACNa,UAAU;oBACR;iBACD;YACH;YACA;gBACElB,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNgB,QAAQ;gBACRd,MAAM;gBACNa,UAAU;oBACR;iBACD;YACH;YACA;gBACElB,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNgB,QAAQ;gBACRd,MAAM;gBACNa,UAAU;oBACR;iBACD;YACH;YACA;gBACElB,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNgB,QAAQ;gBACRd,MAAM;gBACNa,UAAU;oBACR;iBACD;YACH;YACA;gBACElB,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNgB,QAAQ;gBACRd,MAAM;gBACNa,UAAU;oBACR;iBACD;YACH;YACA;gBACElB,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNgB,QAAQ;gBACRd,MAAM;gBACNa,UAAU;oBACR;iBACD;YACH;YACA;gBACElB,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNE,MAAM;gBACNa,UAAU;oBACR;iBACD;YACH;YACA;gBACElB,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNE,MAAM;gBACNa,UAAU;oBACR;iBACD;YACH;YACA;gBACElB,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNE,MAAM;gBACNa,UAAU;oBACR;iBACD;YACH;YACA;gBACElB,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNE,MAAM;gBACNa,UAAU;oBACR;iBACD;YACH;YACA;gBACElB,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNE,MAAM;gBACNa,UAAU;oBACR;iBACD;YACH;YACA;gBACElB,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNE,MAAM;gBACNa,UAAU;oBACR;iBACD;YACH;YACA;gBACElB,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNc,SAAS;oBACP;oBACA;iBACD;gBACDZ,MAAM;gBACNa,UAAU;oBACR;iBACD;YACH;SACD;QACDZ,WAAW;QACXC,WAAW;QACXC,YAAY;YACV;gBACER,aAAa;gBACbG,MAAM;YACR;SACD;QACDM,OAAO;QACPC,WAAW;QACXC,SAAS;IACX;IACAS,gBAAgB;QACdrB,MAAM;QACNC,aAAa;QACbC,QAAQ,EAAE;QACVK,WAAW;QACXC,WAAW;QACXC,YAAY;YACV;gBACER,aAAa;gBACbG,MAAM;YACR;YACA;gBACEH,aAAa;gBACbG,MAAM;YACR;SACD;QACDM,OAAO;QACPC,WAAW;QACXC,SAAS;IACX;IACAU,mBAAmB;QACjBtB,MAAM;QACNC,aAAa;QACbC,QAAQ;YACN;gBACED,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNE,MAAM;YACR;SACD;QACDC,WAAW;QACXC,WAAW;QACXC,YAAY;YACV;gBACER,aAAa;gBACbG,MAAM;YACR;YACA;gBACEH,aAAa;gBACbG,MAAM;YACR;SACD;QACDM,OAAO;QACPC,WAAW;QACXC,SAAS;IACX;IACAW,qBAAqB;QACnBvB,MAAM;QACNC,aAAa;QACbC,QAAQ,EAAE;QACVK,WAAW;QACXC,WAAW;QACXC,YAAY;YACV;gBACER,aAAa;gBACbG,MAAM;YACR;SACD;QACDM,OAAO;QACPC,WAAW;QACXC,SAAS;IACX;IACAY,cAAc;QACZxB,MAAM;QACNC,aAAa;QACbC,QAAQ,EAAE;QACVK,WAAW;QACXC,WAAW;QACXC,YAAY;YACV;gBACER,aAAa;gBACbG,MAAM;YACR;YACA;gBACEH,aAAa;gBACbG,MAAM;YACR;SACD;QACDM,OAAO;QACPC,WAAW;QACXC,SAAS;IACX;IACAa,aAAa;QACXzB,MAAM;QACNC,aAAa;QACbC,QAAQ,EAAE;QACVK,WAAW;QACXC,WAAW;QACXC,YAAY;YACV;gBACER,aAAa;gBACbG,MAAM;YACR;YACA;gBACEH,aAAa;gBACbG,MAAM;YACR;YACA;gBACEH,aAAa;gBACbG,MAAM;YACR;SACD;QACDM,OAAO;QACPC,WAAW;QACXC,SAAS;IACX;IACAc,cAAc;QACZ1B,MAAM;QACNC,aAAa;QACbC,QAAQ,EAAE;QACVK,WAAW;QACXC,WAAW;QACXC,YAAY;YACV;gBACER,aAAa;gBACbG,MAAM;YACR;YACA;gBACEH,aAAa;gBACbG,MAAM;YACR;SACD;QACDM,OAAO;QACPC,WAAW;QACXC,SAAS;IACX;IACAe,aAAa;QACX3B,MAAM;QACNC,aAAa;QACbC,QAAQ,EAAE;QACVK,WAAW;QACXC,WAAW;QACXC,YAAY;YACV;gBACER,aAAa;gBACbG,MAAM;YACR;YACA;gBACEH,aAAa;gBACbG,MAAM;YACR;SACD;QACDM,OAAO;QACPC,WAAW;QACXC,SAAS;IACX;IACAgB,oBAAoB;QAClB5B,MAAM;QACNC,aAAa;QACbC,QAAQ;YACN;gBACED,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNc,SAAS;oBACP;oBACA;oBACA;oBACA;iBACD;gBACDZ,MAAM;YACR;YACA;gBACEL,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNE,MAAM;YACR;YACA;gBACEL,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNE,MAAM;YACR;SACD;QACDC,WAAW;QACXC,WAAW;QACXC,YAAY;YACV;gBACER,aAAa;gBACbG,MAAM;YACR;YACA;gBACEH,aAAa;gBACbG,MAAM;YACR;SACD;QACDM,OAAO;QACPC,WAAW;QACXC,SAAS;IACX;IACAiB,QAAQ;QACN7B,MAAM;QACNC,aAAa;QACbC,QAAQ,EAAE;QACVK,WAAW;QACXC,WAAW;QACXC,YAAY;YACV;gBACER,aAAa;gBACbG,MAAM;YACR;YACA;gBACEH,aAAa;gBACbG,MAAM;YACR;SACD;QACDM,OAAO;QACPC,WAAW;QACXC,SAAS;IACX;IACAkB,kBAAkB;QAChB9B,MAAM;QACNC,aAAa;QACbC,QAAQ,EAAE;QACVK,WAAW;QACXC,WAAW;QACXC,YAAY;YACV;gBACER,aAAa;gBACbG,MAAM;YACR;SACD;QACDM,OAAO;QACPC,WAAW;QACXC,SAAS;IACX;IACAmB,8BAA8B;QAC5B/B,MAAM;QACNC,aAAa;QACbC,QAAQ;YACN;gBACED,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNE,MAAM;YACR;YACA;gBACEL,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNE,MAAM;YACR;SACD;QACDC,WAAW;QACXC,WAAW;QACXC,YAAY;YACV;gBACER,aAAa;gBACbG,MAAM;YACR;YACA;gBACEH,aAAa;gBACbG,MAAM;YACR;SACD;QACDM,OAAO;QACPC,WAAW;QACXC,SAAS;IACX;IACAoB,WAAW;QACThC,MAAM;QACNC,aAAa;QACbC,QAAQ,EAAE;QACVK,WAAW;QACXC,WAAW;QACXC,YAAY;YACV;gBACER,aAAa;gBACbG,MAAM;YACR;YACA;gBACEH,aAAa;gBACbG,MAAM;YACR;SACD;QACDM,OAAO;QACPC,WAAW;QACXC,SAAS;IACX;IACAqB,SAAS;QACPjC,MAAM;QACNC,aAAa;QACbC,QAAQ,EAAE;QACVK,WAAW;QACXC,WAAW;QACXC,YAAY;YACV;gBACER,aAAa;gBACbG,MAAM;YACR;YACA;gBACEH,aAAa;gBACbG,MAAM;YACR;YACA;gBACEH,aAAa;gBACbG,MAAM;YACR;SACD;QACDM,OAAO;QACPC,WAAW;QACXC,SAAS;IACX;IACAsB,eAAe;QACblC,MAAM;QACNC,aAAa;QACbC,QAAQ;YACN;gBACED,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNE,MAAM;YACR;YACA;gBACEL,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNE,MAAM;YACR;YACA;gBACEL,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNE,MAAM;YACR;YACA;gBACEL,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNc,SAAS;oBACP;oBACA;oBACA;iBACD;gBACDZ,MAAM;YACR;YACA;gBACEL,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNE,MAAM;YACR;SACD;QACDC,WAAW;QACX4B,UAAU;QACV3B,WAAW;QACXC,YAAY;YACV;gBACER,aAAa;gBACbG,MAAM;YACR;SACD;QACDM,OAAO;QACPC,WAAW;QACXC,SAAS;IACX;IACAwB,oBAAoB;QAClBpC,MAAM;QACNC,aAAa;QACbC,QAAQ;YACN;gBACED,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNE,MAAM;YACR;YACA;gBACEL,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNE,MAAM;YACR;YACA;gBACEL,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNC,UAAU;gBACVC,MAAM;YACR;YACA;gBACEL,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNE,MAAM;YACR;SACD;QACDC,WAAW;QACX4B,UAAU;QACV3B,WAAW;QACXC,YAAY,EAAE;QACdC,OAAO;QACPC,WAAW;QACXC,SAAS;IACX;IACAyB,aAAa;QACXrC,MAAM;QACNC,aAAa;QACbC,QAAQ;YACN;gBACED,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNE,MAAM;YACR;YACA;gBACEL,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNE,MAAM;YACR;SACD;QACDC,WAAW;QACX4B,UAAU;QACV3B,WAAW;QACXC,YAAY;YACV;gBACER,aAAa;gBACbG,MAAM;YACR;SACD;QACDM,OAAO;QACPC,WAAW;QACXC,SAAS;IACX;IACA0B,WAAW;QACTtC,MAAM;QACNC,aAAa;QACbC,QAAQ;YACN;gBACED,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNE,MAAM;YACR;YACA;gBACEL,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNE,MAAM;YACR;SACD;QACDC,WAAW;QACX4B,UAAU;QACV3B,WAAW;QACXC,YAAY;YACV;gBACER,aAAa;gBACbG,MAAM;YACR;YACA;gBACEH,aAAa;gBACbG,MAAM;YACR;SACD;QACDM,OAAO;QACPC,WAAW;QACXC,SAAS;IACX;IACA2B,cAAc;QACZvC,MAAM;QACNC,aAAa;QACbC,QAAQ,EAAE;QACVK,WAAW;QACXC,WAAW;QACXC,YAAY;YACV;gBACER,aAAa;gBACbG,MAAM;YACR;YACA;gBACEH,aAAa;gBACbG,MAAM;YACR;SACD;QACDM,OAAO;QACPC,WAAW;QACXC,SAAS;IACX;IACA4B,aAAa;QACXxC,MAAM;QACNC,aAAa;QACbC,QAAQ,EAAE;QACVK,WAAW;QACXC,WAAW;QACXC,YAAY;YACV;gBACER,aAAa;gBACbG,MAAM;YACR;YACA;gBACEH,aAAa;gBACbG,MAAM;YACR;SACD;QACDM,OAAO;QACPC,WAAW;QACXC,SAAS;IACX;IACA6B,cAAc;QACZzC,MAAM;QACNC,aAAa;QACbC,QAAQ;YACN;gBACED,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNC,UAAU;gBACVC,MAAM;YACR;SACD;QACDC,WAAW;QACXC,WAAW;QACXC,YAAY;YACV;gBACER,aAAa;gBACbG,MAAM;YACR;YACA;gBACEH,aAAa;gBACbG,MAAM;YACR;SACD;QACDM,OAAO;QACPC,WAAW;QACXC,SAAS;IACX;IACA8B,mBAAmB;QACjB1C,MAAM;QACNC,aAAa;QACbC,QAAQ;YACN;gBACED,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNC,UAAU;gBACVC,MAAM;YACR;YACA;gBACEL,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNE,MAAM;YACR;SACD;QACDC,WAAW;QACXC,WAAW;QACXC,YAAY;YACV;gBACER,aAAa;gBACbG,MAAM;YACR;YACA;gBACEH,aAAa;gBACbG,MAAM;YACR;SACD;QACDM,OAAO;QACPC,WAAW;QACXC,SAAS;IACX;IACA+B,WAAW;QACT3C,MAAM;QACNC,aAAa;QACbC,QAAQ;YACN;gBACED,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNE,MAAM;YACR;SACD;QACDC,WAAW;QACXC,WAAW;QACXC,YAAY;YACV;gBACER,aAAa;gBACbG,MAAM;YACR;YACA;gBACEH,aAAa;gBACbG,MAAM;YACR;SACD;QACDM,OAAO;QACPC,WAAW;QACXC,SAAS;IACX;IACAgC,gBAAgB;QACd5C,MAAM;QACNC,aAAa;QACbC,QAAQ,EAAE;QACVK,WAAW;QACXC,WAAW;QACXC,YAAY;YACV;gBACER,aAAa;gBACbG,MAAM;YACR;SACD;QACDM,OAAO;QACPC,WAAW;QACXC,SAAS;IACX;IACAiC,gBAAgB;QACd7C,MAAM;QACNC,aAAa;QACbC,QAAQ;YACN;gBACED,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNc,SAAS;oBACP;iBACD;gBACDb,UAAU;gBACVC,MAAM;YACR;SACD;QACDC,WAAW;QACXC,WAAW;QACXC,YAAY;YACV;gBACER,aAAa;gBACbG,MAAM;YACR;YACA;gBACEH,aAAa;gBACbG,MAAM;YACR;SACD;QACDM,OAAO;QACPC,WAAW;QACXC,SAAS;IACX;IACAkC,mBAAmB;QACjB9C,MAAM;QACNC,aAAa;QACbC,QAAQ;YACN;gBACED,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNE,MAAM;YACR;YACA;gBACEL,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNE,MAAM;YACR;SACD;QACDC,WAAW;QACXC,WAAW;QACXC,YAAY;YACV;gBACER,aAAa;gBACbG,MAAM;YACR;YACA;gBACEH,aAAa;gBACbG,MAAM;YACR;SACD;QACDM,OAAO;QACPC,WAAW;QACXC,SAAS;IACX;IACAmC,qBAAqB;QACnB/C,MAAM;QACNC,aAAa;QACbC,QAAQ;YACN;gBACED,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNE,MAAM;YACR;YACA;gBACEL,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNE,MAAM;YACR;YACA;gBACEL,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNE,MAAM;YACR;SACD;QACDC,WAAW;QACXC,WAAW;QACXC,YAAY;YACV;gBACER,aAAa;gBACbG,MAAM;YACR;SACD;QACDM,OAAO;QACPC,WAAW;QACXC,SAAS;IACX;IACAoC,cAAc;QACZhD,MAAM;QACNC,aAAa;QACbC,QAAQ;YACN;gBACED,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNE,MAAM;YACR;YACA;gBACEL,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNgB,QAAQ;gBACRd,MAAM;YACR;YACA;gBACEL,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNgB,QAAQ;gBACRd,MAAM;YACR;YACA;gBACEL,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNgB,QAAQ;gBACRd,MAAM;YACR;YACA;gBACEL,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNgB,QAAQ;gBACRd,MAAM;YACR;YACA;gBACEL,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNgB,QAAQ;gBACRd,MAAM;YACR;YACA;gBACEL,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNgB,QAAQ;gBACRd,MAAM;YACR;YACA;gBACEL,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNE,MAAM;YACR;YACA;gBACEL,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACN6C,UAAU;gBACV/B,SAAS;oBACP;oBACA;iBACD;gBACDZ,MAAM;YACR;YACA;gBACEL,aAAa;gBACbE,IAAI;gBACJC,MAAM;gBACNE,MAAM;YACR;SACD;QACDC,WAAW;QACXC,WAAW;QACXC,YAAY;YACV;gBACER,aAAa;gBACbG,MAAM;YACR;YACA;gBACEH,aAAa;gBACbG,MAAM;YACR;SACD;QACDM,OAAO;QACPC,WAAW;QACXC,SAAS;IACX;AACF,EAAqD"}
|
|
@@ -10,9 +10,11 @@
|
|
|
10
10
|
* Flow:
|
|
11
11
|
* 1. Check if the unrecognized name is a known alias (eg "dataset" for "datasets")
|
|
12
12
|
* 2. If yes: rewrite and run the resolved command (or show topic help for bare topics)
|
|
13
|
-
* 3. If
|
|
13
|
+
* 3. If it names a removed context command, say what replaced it
|
|
14
|
+
* 4. Otherwise: fall back to oclif plugin-not-found's "did you mean?" behavior
|
|
14
15
|
*/ import { toStandardizedId } from '@oclif/core';
|
|
15
|
-
import { subdebug } from '@sanity/cli-core';
|
|
16
|
+
import { exitCodes, subdebug } from '@sanity/cli-core';
|
|
17
|
+
import { removedContextCommandHint } from '../../actions/context/removedCommands.js';
|
|
16
18
|
import { resolveTopicAlias } from '../../topicAliases.js';
|
|
17
19
|
const debug = subdebug('hooks:topicAliases');
|
|
18
20
|
const hook = async function(opts) {
|
|
@@ -34,6 +36,10 @@ const hook = async function(opts) {
|
|
|
34
36
|
// Full command (eg "sanity dataset create") -> run the resolved command
|
|
35
37
|
return config.runCommand(rewrittenId, opts.argv ?? []);
|
|
36
38
|
}
|
|
39
|
+
const removed = removedContextCommandHint(standardId);
|
|
40
|
+
if (removed) return this.error(removed, {
|
|
41
|
+
exit: exitCodes.USAGE_ERROR
|
|
42
|
+
});
|
|
37
43
|
// No alias match - fall back to oclif plugin-not-found's "did you mean?" behavior
|
|
38
44
|
// eslint-disable-next-line no-restricted-syntax -- package import, not a file path
|
|
39
45
|
const { default: notFoundHook } = await import('@oclif/plugin-not-found');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/hooks/commandNotFound/topicAliases.ts"],"sourcesContent":["/**\n * Hook: Topic Alias Resolution + Command Not Found\n *\n * Replaces oclif plugin-not-found as a plugin, calling it as a fallback instead.\n * This avoids a race condition where both hooks run concurrently via Promise.all.\n *\n * This hook only fires for names oclif doesn't recognize. Registered topics\n * and commands (including hiddenAliases) are resolved by oclif before this runs.\n *\n * Flow:\n * 1. Check if the unrecognized name is a known alias (eg \"dataset\" for \"datasets\")\n * 2. If yes: rewrite and run the resolved command (or show topic help for bare topics)\n * 3. If
|
|
1
|
+
{"version":3,"sources":["../../../src/hooks/commandNotFound/topicAliases.ts"],"sourcesContent":["/**\n * Hook: Topic Alias Resolution + Command Not Found\n *\n * Replaces oclif plugin-not-found as a plugin, calling it as a fallback instead.\n * This avoids a race condition where both hooks run concurrently via Promise.all.\n *\n * This hook only fires for names oclif doesn't recognize. Registered topics\n * and commands (including hiddenAliases) are resolved by oclif before this runs.\n *\n * Flow:\n * 1. Check if the unrecognized name is a known alias (eg \"dataset\" for \"datasets\")\n * 2. If yes: rewrite and run the resolved command (or show topic help for bare topics)\n * 3. If it names a removed context command, say what replaced it\n * 4. Otherwise: fall back to oclif plugin-not-found's \"did you mean?\" behavior\n */\n\nimport {type Hook, toStandardizedId} from '@oclif/core'\nimport {exitCodes, subdebug} from '@sanity/cli-core'\n\nimport {removedContextCommandHint} from '../../actions/context/removedCommands.js'\nimport {resolveTopicAlias} from '../../topicAliases.js'\n\nconst debug = subdebug('hooks:topicAliases')\n\nconst hook: Hook.CommandNotFound = async function (opts) {\n const {config, id} = opts\n\n // Standardize the ID (handles topic separator differences)\n const standardId = toStandardizedId(id, config)\n const parts = standardId.split(':')\n const hasTopic = parts.length === 1\n const rewrittenId = resolveTopicAlias(standardId)\n\n const aliasExists =\n rewrittenId && (hasTopic ? config.findTopic(rewrittenId) : config.findCommand(rewrittenId))\n if (aliasExists) {\n debug('Rewriting topic: %s -> %s', parts[0], rewrittenId.split(':')[0])\n\n // Bare topic (eg \"sanity dataset\" with no subcommand) -> show topic help\n if (hasTopic) {\n return config.runCommand('help', [rewrittenId])\n }\n\n // Full command (eg \"sanity dataset create\") -> run the resolved command\n return config.runCommand(rewrittenId, opts.argv ?? [])\n }\n\n const removed = removedContextCommandHint(standardId)\n if (removed) return this.error(removed, {exit: exitCodes.USAGE_ERROR})\n\n // No alias match - fall back to oclif plugin-not-found's \"did you mean?\" behavior\n // eslint-disable-next-line no-restricted-syntax -- package import, not a file path\n const {default: notFoundHook} = await import('@oclif/plugin-not-found')\n return notFoundHook.call(this, opts)\n}\n\nexport default hook\n"],"names":["toStandardizedId","exitCodes","subdebug","removedContextCommandHint","resolveTopicAlias","debug","hook","opts","config","id","standardId","parts","split","hasTopic","length","rewrittenId","aliasExists","findTopic","findCommand","runCommand","argv","removed","error","exit","USAGE_ERROR","default","notFoundHook","call"],"mappings":"AAAA;;;;;;;;;;;;;;CAcC,GAED,SAAmBA,gBAAgB,QAAO,cAAa;AACvD,SAAQC,SAAS,EAAEC,QAAQ,QAAO,mBAAkB;AAEpD,SAAQC,yBAAyB,QAAO,2CAA0C;AAClF,SAAQC,iBAAiB,QAAO,wBAAuB;AAEvD,MAAMC,QAAQH,SAAS;AAEvB,MAAMI,OAA6B,eAAgBC,IAAI;IACrD,MAAM,EAACC,MAAM,EAAEC,EAAE,EAAC,GAAGF;IAErB,2DAA2D;IAC3D,MAAMG,aAAaV,iBAAiBS,IAAID;IACxC,MAAMG,QAAQD,WAAWE,KAAK,CAAC;IAC/B,MAAMC,WAAWF,MAAMG,MAAM,KAAK;IAClC,MAAMC,cAAcX,kBAAkBM;IAEtC,MAAMM,cACJD,eAAgBF,CAAAA,WAAWL,OAAOS,SAAS,CAACF,eAAeP,OAAOU,WAAW,CAACH,YAAW;IAC3F,IAAIC,aAAa;QACfX,MAAM,6BAA6BM,KAAK,CAAC,EAAE,EAAEI,YAAYH,KAAK,CAAC,IAAI,CAAC,EAAE;QAEtE,yEAAyE;QACzE,IAAIC,UAAU;YACZ,OAAOL,OAAOW,UAAU,CAAC,QAAQ;gBAACJ;aAAY;QAChD;QAEA,wEAAwE;QACxE,OAAOP,OAAOW,UAAU,CAACJ,aAAaR,KAAKa,IAAI,IAAI,EAAE;IACvD;IAEA,MAAMC,UAAUlB,0BAA0BO;IAC1C,IAAIW,SAAS,OAAO,IAAI,CAACC,KAAK,CAACD,SAAS;QAACE,MAAMtB,UAAUuB,WAAW;IAAA;IAEpE,kFAAkF;IAClF,mFAAmF;IACnF,MAAM,EAACC,SAASC,YAAY,EAAC,GAAG,MAAM,MAAM,CAAC;IAC7C,OAAOA,aAAaC,IAAI,CAAC,IAAI,EAAEpB;AACjC;AAEA,eAAeD,KAAI"}
|