@sanity/cli 8.29.0 → 8.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/README.md +6 -6
  2. package/dist/actions/deploy/deployApp.js +12 -6
  3. package/dist/actions/deploy/deployApp.js.map +1 -1
  4. package/dist/actions/deploy/deployStudio.js +14 -14
  5. package/dist/actions/deploy/deployStudio.js.map +1 -1
  6. package/dist/actions/deploy/deployStudioSchemasAndManifests.js +1 -2
  7. package/dist/actions/deploy/deployStudioSchemasAndManifests.js.map +1 -1
  8. package/dist/actions/deploy/types.js +0 -1
  9. package/dist/actions/deploy/types.js.map +1 -1
  10. package/dist/actions/dev/devAction.js +5 -1
  11. package/dist/actions/dev/devAction.js.map +1 -1
  12. package/dist/actions/dev/servers/getDashboardAppUrl.js +2 -2
  13. package/dist/actions/dev/servers/getDashboardAppUrl.js.map +1 -1
  14. package/dist/actions/dev/servers/startAppDevServer.js +6 -5
  15. package/dist/actions/dev/servers/startAppDevServer.js.map +1 -1
  16. package/dist/actions/dev/servers/startStudioDevServer.js +16 -15
  17. package/dist/actions/dev/servers/startStudioDevServer.js.map +1 -1
  18. package/dist/actions/dev/types.js.map +1 -1
  19. package/dist/actions/documents/validateDocuments.worker.js +11 -7
  20. package/dist/actions/documents/validateDocuments.worker.js.map +1 -1
  21. package/dist/actions/manifest/extractManifest.js +2 -1
  22. package/dist/actions/manifest/extractManifest.js.map +1 -1
  23. package/dist/actions/manifest/extractStudioManifest.js +1 -0
  24. package/dist/actions/manifest/extractStudioManifest.js.map +1 -1
  25. package/dist/actions/mcp/detectAvailableEditors.js +5 -13
  26. package/dist/actions/mcp/detectAvailableEditors.js.map +1 -1
  27. package/dist/actions/mcp/editorConfigs.js +43 -89
  28. package/dist/actions/mcp/editorConfigs.js.map +1 -1
  29. package/dist/actions/mcp/promptForMCPSetup.js +2 -5
  30. package/dist/actions/mcp/promptForMCPSetup.js.map +1 -1
  31. package/dist/actions/mcp/setupMCP.js +37 -50
  32. package/dist/actions/mcp/setupMCP.js.map +1 -1
  33. package/dist/actions/mcp/types.js.map +1 -1
  34. package/dist/actions/mcp/writeMCPConfig.js +3 -3
  35. package/dist/actions/mcp/writeMCPConfig.js.map +1 -1
  36. package/dist/commands/mcp/configure.js +2 -22
  37. package/dist/commands/mcp/configure.js.map +1 -1
  38. package/dist/commands/skills/install.js +1 -1
  39. package/dist/commands/skills/install.js.map +1 -1
  40. package/dist/exports/invokeSanityCli/index.d.ts +4 -2
  41. package/dist/services/mcp.js +1 -73
  42. package/dist/services/mcp.js.map +1 -1
  43. package/oclif.manifest.json +2626 -2626
  44. package/package.json +15 -15
  45. package/dist/actions/mcp/validateEditorTokens.js +0 -56
  46. package/dist/actions/mcp/validateEditorTokens.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/cli",
3
- "version": "8.29.0",
3
+ "version": "8.31.0",
4
4
  "description": "Sanity CLI tool for managing Sanity projects and organizations",
5
5
  "keywords": [
6
6
  "cli",
@@ -59,12 +59,12 @@
59
59
  "access": "public"
60
60
  },
61
61
  "dependencies": {
62
- "@oclif/core": "^4.11.14",
63
- "@oclif/plugin-help": "^6.2.53",
64
- "@oclif/plugin-not-found": "^3.2.88",
62
+ "@oclif/core": "^4.14.0",
63
+ "@oclif/plugin-help": "^6.3.0",
64
+ "@oclif/plugin-not-found": "^3.3.0",
65
65
  "@sanity/blueprints": "^0.33.0",
66
- "@sanity/cli-build": "^7.2.0",
67
- "@sanity/cli-core": "^3.15.0",
66
+ "@sanity/cli-build": "^7.3.0",
67
+ "@sanity/cli-core": "^3.15.1",
68
68
  "@sanity/client": "^8.15.0",
69
69
  "@sanity/codegen": "^8.3.0",
70
70
  "@sanity/descriptors": "^1.3.0",
@@ -81,7 +81,7 @@
81
81
  "@sanity/types": "^6.22.0",
82
82
  "@sanity/util": "^6.22.0",
83
83
  "@sanity/validation": "^6.23.0",
84
- "@sanity/workbench-cli": "^2.16.0",
84
+ "@sanity/workbench-cli": "^2.18.0",
85
85
  "@sanity/worker-channels": "^2.0.0",
86
86
  "@sanity/workflow-cli": "^0.37.0",
87
87
  "@sanity/workflow-engine": "^0.37.0",
@@ -90,12 +90,12 @@
90
90
  "console-table-printer": "^2.16.1",
91
91
  "eventsource": "^5.1.5",
92
92
  "execa": "^10.0.1",
93
- "form-data": "^4.0.5",
93
+ "form-data": "^4.0.6",
94
94
  "get-latest-version": "^6.0.1",
95
95
  "groq-js": "^2.0.1",
96
96
  "gunzip-maybe": "^1.4.2",
97
97
  "import-meta-resolve": "^4.2.0",
98
- "is-installed-globally": "^1.0.0",
98
+ "is-installed-globally": "^1.0.1",
99
99
  "json5": "^2.2.3",
100
100
  "jsonc-parser": "^3.3.1",
101
101
  "lodash-es": "^4.18.1",
@@ -114,14 +114,14 @@
114
114
  "smol-toml": "^1.6.1",
115
115
  "string-argv": "^0.3.2",
116
116
  "string-width": "^7.2.0",
117
- "tar": "^7.5.22",
117
+ "tar": "^7.5.23",
118
118
  "tar-stream": "^3.2.2",
119
119
  "tinyglobby": "^0.2.17",
120
120
  "valibot": "^1.4.2",
121
121
  "vite": "^8.3.8",
122
122
  "which": "^6.0.1",
123
123
  "wrap-ansi": "^9.0.2",
124
- "yaml": "^2.9.0",
124
+ "yaml": "^2.9.1",
125
125
  "zod": "^4.6.7"
126
126
  },
127
127
  "devDependencies": {
@@ -129,7 +129,7 @@
129
129
  "@oxc-project/types": "0.156.0",
130
130
  "@repo/package.config": "0.0.1",
131
131
  "@repo/tsconfig": "3.70.0",
132
- "@sanity/cli-test": "25.0.0",
132
+ "@sanity/cli-test": "25.0.1",
133
133
  "@sanity/eslint-config-cli": "1.1.3",
134
134
  "@sanity/pkg-utils": "^12.3.4",
135
135
  "@swc/cli": "^0.8.2",
@@ -145,15 +145,15 @@
145
145
  "@vitest/coverage-istanbul": "^5.1.0",
146
146
  "babel-plugin-react-compiler": "^1.0.0",
147
147
  "eslint": "^10.7.0",
148
- "get-it": "^9.5.4",
148
+ "get-it": "^9.7.0",
149
149
  "jsdom": "^29.1.1",
150
150
  "nock": "^14.0.17",
151
- "oclif": "^4.23.27",
151
+ "oclif": "^4.24.0",
152
152
  "oxc-transform-react": "^0.158.0",
153
153
  "publint": "^0.3.21",
154
154
  "rimraf": "^6.0.1",
155
155
  "sanity": "^6.22.0",
156
- "tsx": "^4.23.12",
156
+ "tsx": "^4.23.15",
157
157
  "typescript": "^6.0.3",
158
158
  "vitest": "^5.1.0"
159
159
  },
@@ -1,56 +0,0 @@
1
- import { subdebug } from '@sanity/cli-core';
2
- import { validateMCPToken } from '../../services/mcp.js';
3
- const debug = subdebug('mcp:validateEditorTokens');
4
- /**
5
- * Validate existing MCP tokens for all configured editors.
6
- *
7
- * Collects unique tokens, validates each once against the Sanity API,
8
- * and sets `authStatus` on each editor that has a token.
9
- * Editors without a config or token are left unchanged.
10
- */ export async function validateEditorTokens(editors) {
11
- // Collect unique tokens and map them to their editors
12
- const tokenToEditors = new Map();
13
- for (const editor of editors){
14
- if (editor.existingToken) {
15
- const existing = tokenToEditors.get(editor.existingToken);
16
- if (existing) {
17
- existing.push(editor);
18
- } else {
19
- tokenToEditors.set(editor.existingToken, [
20
- editor
21
- ]);
22
- }
23
- }
24
- }
25
- if (tokenToEditors.size === 0) {
26
- debug('No existing tokens to validate');
27
- return;
28
- }
29
- const editorCount = [
30
- ...tokenToEditors.values()
31
- ].reduce((sum, eds)=>sum + eds.length, 0);
32
- debug('Validating %d unique token(s) across %d editor(s)', tokenToEditors.size, editorCount);
33
- // Validate all unique tokens in parallel to avoid stacking timeouts
34
- await Promise.all([
35
- ...tokenToEditors.entries()
36
- ].map(async ([token, tokenEditors])=>{
37
- let status;
38
- try {
39
- const valid = await validateMCPToken(token);
40
- status = valid ? 'valid' : 'unauthorized';
41
- } catch (err) {
42
- // Network errors, timeouts, or unexpected failures — assume the token
43
- // is valid rather than falsely marking it as expired. We only mark
44
- // tokens as unauthorized when the server explicitly says so (401/403).
45
- debug('Token validation error (assuming valid): %s', err);
46
- status = 'valid';
47
- }
48
- debug('Token ending ...%s is %s (used by %s)', token.slice(-4), status, tokenEditors.map((e)=>e.name).join(', '));
49
- // Apply status to all editors sharing this token
50
- for (const editor of tokenEditors){
51
- editor.authStatus = status;
52
- }
53
- }));
54
- }
55
-
56
- //# sourceMappingURL=validateEditorTokens.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/actions/mcp/validateEditorTokens.ts"],"sourcesContent":["import {subdebug} from '@sanity/cli-core'\n\nimport {validateMCPToken} from '../../services/mcp.js'\nimport {type AuthStatus, type Editor} from './types.js'\n\nconst debug = subdebug('mcp:validateEditorTokens')\n\n/**\n * Validate existing MCP tokens for all configured editors.\n *\n * Collects unique tokens, validates each once against the Sanity API,\n * and sets `authStatus` on each editor that has a token.\n * Editors without a config or token are left unchanged.\n */\nexport async function validateEditorTokens(editors: Editor[]): Promise<void> {\n // Collect unique tokens and map them to their editors\n const tokenToEditors = new Map<string, Editor[]>()\n for (const editor of editors) {\n if (editor.existingToken) {\n const existing = tokenToEditors.get(editor.existingToken)\n if (existing) {\n existing.push(editor)\n } else {\n tokenToEditors.set(editor.existingToken, [editor])\n }\n }\n }\n\n if (tokenToEditors.size === 0) {\n debug('No existing tokens to validate')\n return\n }\n\n const editorCount = [...tokenToEditors.values()].reduce((sum, eds) => sum + eds.length, 0)\n debug('Validating %d unique token(s) across %d editor(s)', tokenToEditors.size, editorCount)\n\n // Validate all unique tokens in parallel to avoid stacking timeouts\n await Promise.all(\n [...tokenToEditors.entries()].map(async ([token, tokenEditors]) => {\n let status: AuthStatus\n try {\n const valid = await validateMCPToken(token)\n status = valid ? 'valid' : 'unauthorized'\n } catch (err) {\n // Network errors, timeouts, or unexpected failures — assume the token\n // is valid rather than falsely marking it as expired. We only mark\n // tokens as unauthorized when the server explicitly says so (401/403).\n debug('Token validation error (assuming valid): %s', err)\n status = 'valid'\n }\n\n debug(\n 'Token ending ...%s is %s (used by %s)',\n token.slice(-4),\n status,\n tokenEditors.map((e) => e.name).join(', '),\n )\n\n // Apply status to all editors sharing this token\n for (const editor of tokenEditors) {\n editor.authStatus = status\n }\n }),\n )\n}\n"],"names":["subdebug","validateMCPToken","debug","validateEditorTokens","editors","tokenToEditors","Map","editor","existingToken","existing","get","push","set","size","editorCount","values","reduce","sum","eds","length","Promise","all","entries","map","token","tokenEditors","status","valid","err","slice","e","name","join","authStatus"],"mappings":"AAAA,SAAQA,QAAQ,QAAO,mBAAkB;AAEzC,SAAQC,gBAAgB,QAAO,wBAAuB;AAGtD,MAAMC,QAAQF,SAAS;AAEvB;;;;;;CAMC,GACD,OAAO,eAAeG,qBAAqBC,OAAiB;IAC1D,sDAAsD;IACtD,MAAMC,iBAAiB,IAAIC;IAC3B,KAAK,MAAMC,UAAUH,QAAS;QAC5B,IAAIG,OAAOC,aAAa,EAAE;YACxB,MAAMC,WAAWJ,eAAeK,GAAG,CAACH,OAAOC,aAAa;YACxD,IAAIC,UAAU;gBACZA,SAASE,IAAI,CAACJ;YAChB,OAAO;gBACLF,eAAeO,GAAG,CAACL,OAAOC,aAAa,EAAE;oBAACD;iBAAO;YACnD;QACF;IACF;IAEA,IAAIF,eAAeQ,IAAI,KAAK,GAAG;QAC7BX,MAAM;QACN;IACF;IAEA,MAAMY,cAAc;WAAIT,eAAeU,MAAM;KAAG,CAACC,MAAM,CAAC,CAACC,KAAKC,MAAQD,MAAMC,IAAIC,MAAM,EAAE;IACxFjB,MAAM,qDAAqDG,eAAeQ,IAAI,EAAEC;IAEhF,oEAAoE;IACpE,MAAMM,QAAQC,GAAG,CACf;WAAIhB,eAAeiB,OAAO;KAAG,CAACC,GAAG,CAAC,OAAO,CAACC,OAAOC,aAAa;QAC5D,IAAIC;QACJ,IAAI;YACF,MAAMC,QAAQ,MAAM1B,iBAAiBuB;YACrCE,SAASC,QAAQ,UAAU;QAC7B,EAAE,OAAOC,KAAK;YACZ,sEAAsE;YACtE,mEAAmE;YACnE,uEAAuE;YACvE1B,MAAM,+CAA+C0B;YACrDF,SAAS;QACX;QAEAxB,MACE,yCACAsB,MAAMK,KAAK,CAAC,CAAC,IACbH,QACAD,aAAaF,GAAG,CAAC,CAACO,IAAMA,EAAEC,IAAI,EAAEC,IAAI,CAAC;QAGvC,iDAAiD;QACjD,KAAK,MAAMzB,UAAUkB,aAAc;YACjClB,OAAO0B,UAAU,GAAGP;QACtB;IACF;AAEJ"}