@raycast/api 1.97.0 → 1.98.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.
@@ -1 +1 @@
1
- "use strict";var P=Object.create;var m=Object.defineProperty;var G=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var O=Object.getPrototypeOf,L=Object.prototype.hasOwnProperty;var I=(t,n)=>()=>(n||t((n={exports:{}}).exports,n),n.exports),R=(t,n)=>{for(var i in n)m(t,i,{get:n[i],enumerable:!0})},A=(t,n,i,c)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of D(n))!L.call(t,o)&&o!==i&&m(t,o,{get:()=>n[o],enumerable:!(c=G(n,o))||c.enumerable});return t};var h=(t,n,i)=>(i=t!=null?P(O(t)):{},A(n||!t||!t.__esModule?m(i,"default",{value:t,enumerable:!0}):i,t)),F=t=>A(m({},"__esModule",{value:!0}),t);var B=I((Q,k)=>{var Y=require("node:tty"),J=Y?.WriteStream?.prototype?.hasColors?.()??!1,r=(t,n)=>{if(!J)return o=>o;let i=`\x1B[${t}m`,c=`\x1B[${n}m`;return o=>{let p=o+"",d=p.indexOf(c);if(d===-1)return i+p+c;let x=i,g=0;for(;d!==-1;)x+=p.slice(g,d)+i,g=d+c.length,d=p.indexOf(c,g);return x+=p.slice(g)+c,x}},e={};e.reset=r(0,0);e.bold=r(1,22);e.dim=r(2,22);e.italic=r(3,23);e.underline=r(4,24);e.overline=r(53,55);e.inverse=r(7,27);e.hidden=r(8,28);e.strikethrough=r(9,29);e.black=r(30,39);e.red=r(31,39);e.green=r(32,39);e.yellow=r(33,39);e.blue=r(34,39);e.magenta=r(35,39);e.cyan=r(36,39);e.white=r(37,39);e.gray=r(90,39);e.bgBlack=r(40,49);e.bgRed=r(41,49);e.bgGreen=r(42,49);e.bgYellow=r(43,49);e.bgBlue=r(44,49);e.bgMagenta=r(45,49);e.bgCyan=r(46,49);e.bgWhite=r(47,49);e.bgGray=r(100,49);e.redBright=r(91,39);e.greenBright=r(92,39);e.yellowBright=r(93,39);e.blueBright=r(94,39);e.magentaBright=r(95,39);e.cyanBright=r(96,39);e.whiteBright=r(97,39);e.bgRedBright=r(101,49);e.bgGreenBright=r(102,49);e.bgYellowBright=r(103,49);e.bgBlueBright=r(104,49);e.bgMagentaBright=r(105,49);e.bgCyanBright=r(106,49);e.bgWhiteBright=r(107,49);k.exports=e});var $=I((oe,H)=>{H.exports={name:"ray",description:"Build extensions for Raycast with React and Node.js.",version:"1.97.0",author:"mathieudutour",private:!0,bin:{ray:"./bin/run.js"},dependencies:{"@oclif/core":"^4.0.33","@oclif/plugin-autocomplete":"^3.2.10","@oclif/plugin-help":"^6.2.18","@oclif/plugin-not-found":"^3.2.28","@raycast/eslint-plugin":"^1.0.15","@raycast/extract-tools-info":"file:../extract-tools-info",ajv:"^8.17.1",archiver:"^7.0.1",camelcase:"^8.0.0",chokidar:"^4.0.1","cli-progress":"^3.12.0",clipboardy:"^2.3.0",execa:"^9.5.1","json-source-map":"^0.6.1",json5:"^2.2.3","node-fetch-cjs":"^3.3.2",open:"^8.4.2",ora:"^8.1.1","terminal-link":"^3.0.0",yaml:"^2.6.1","yoctocolors-cjs":"^2.1.2"},devDependencies:{"@raycast/eslint-config":"^1.0.11","@types/archiver":"^6.0.3","@types/cli-progress":"^3.11.6","@types/node":"20.8.4",esbuild:"^0.25.1",eslint:"^8","json-schema-to-typescript":"^15.0.3",oclif:"^4.15.28",typescript:"^5.6.3"},files:["/bin","/dist","/oclif.manifest.json"],license:"MIT",main:"dist/index.js",oclif:{bin:"ray",dirname:"ray",commands:"./dist/commands",plugins:["@oclif/plugin-autocomplete","@oclif/plugin-help","@oclif/plugin-not-found"]},scripts:{"json-schema-to-ts":"json2ts ../../api/schema.json -y > src/types/manifest-schema.d.ts","build-scripts":'tsc "./scripts/build.ts" "./scripts/build-command.ts" "./scripts/dev-command.ts" --outDir ./scripts/dist --esModuleInterop',prebuild:"npm run json-schema-to-ts && npm run build-scripts",build:"node ./scripts/dist/build-command.js",predev:"npm run json-schema-to-ts && npm run build-scripts",dev:"node ./scripts/dist/dev-command.js",lint:"eslint . --ext .ts"},types:"dist/index.d.ts"}});var K={};R(K,{default:()=>b});module.exports=F(K);var l=require("@oclif/core");var f=h(require("node:fs")),w=h(require("node:path")),T=h(require("node:os"));var v={production:{url:"https://www.raycast.com",clientID:"KqAdcGhNfBKiUpfjD3nU3VNgh1t0iMPoX2hYEkN9d4I"},staging:{url:"https://www.rayca.st",clientID:"KqAdcGhNfBKiUpfjD3nU3VNgh1t0iMPoX2hYEkN9d4I"},development:{url:"http://localhost:3000",clientID:"rOCD_LhnXFObSLu9v7788qOGu25FZDqEzGjet4Q45ZY"}}[process.env.API_ENV||"production"],S="e69bae0ec90f5e838555",a={},E;function C(t){E=t;try{a=JSON.parse(f.readFileSync(w.join(M(),"config.json"),"utf8"))}catch(n){if(n instanceof Error&&n.code==="ENOENT")return;throw new Error(`Failed to read config file: ${n}`)}}function U(t){switch(t){case"raycastApiURL":return process.env.RAY_APIURL||a.APIURL||v.url;case"raycastAccessToken":return process.env.RAY_TOKEN||a.Token||a.AccessToken||"";case"raycastClientId":return process.env.RAY_CLIENT_ID||a.ClientID||v.clientID;case"githubClientId":return process.env.RAY_GithubClientID||a.GithubClientID||S;case"githubAccessToken":return process.env.GITHUB_ACCESS_TOKEN||a.GithubAccessToken||"";case"flavorName":return process.env.RAY_Target||(typeof a.Target>"u"?N("release"):a.Target)}}function N(t){switch(t){case"debug":return"debug";case"internal":return"internal";case"release":return"";case"x":return"x";case"x-internal":return"x-internal";case"x-debug":return"x-debug";case void 0:return U("flavorName")}}function _(){let t=N(E);return t==""?"raycast":`raycast-${t}`}function M(){let t=w.join(T.default.homedir(),".config",_());return f.mkdirSync(t,{recursive:!0}),t}var s=h(B());var ee=(0,s.blue)((0,s.dim)("internal only"));var u={wait:`\u{1F550}${(0,s.blue)("wait")} - `,info:`${process.env.GITHUB_ACTIONS==="true"?"\u2139\uFE0F":"\u2139\uFE0F "}${(0,s.cyan)("info")} - `,success:`\u2705${(0,s.green)("ready")} - `,warn:`${process.env.GITHUB_ACTIONS==="true"?"\u26A0\uFE0F":"\u26A0\uFE0F "}${(0,s.yellow)("warn")} - `,error:`\u{1F4A5}${(0,s.red)("error")} - `,event:`\u26A1\uFE0F${(0,s.magenta)("event")} - `,paymentPrompt:`\u{1F4B0}${(0,s.yellowBright)("plan")} - `},q=!0;function j(t,n){t||(u.wait=`${(0,s.blue)("wait")} - `,u.info=`${(0,s.cyan)("info")} - `,u.success=`${(0,s.green)("ready")} - `,u.warn=`${(0,s.yellow)("warn")} - `,u.error=`${(0,s.red)("error")} - `,u.event=`${(0,s.magenta)("event")} - `,u.paymentPrompt=`${(0,s.yellowBright)("plan")} - `),n&&(q=!1)}var y=class extends l.Command{static baseFlags={"exit-on-error":l.Flags.boolean({default:!0,helpGroup:"GLOBAL",aliases:["exitOnError"],deprecateAliases:!0,summary:"Always exit with non-zero code on error",allowNo:!0}),emoji:l.Flags.boolean({default:!1,helpGroup:"GLOBAL",summary:"Prefix output with emojis \u{1F308}"}),help:l.Flags.boolean({default:!1,helpGroup:"GLOBAL",summary:"Show the help message for the command"}),"non-interactive":l.Flags.boolean({char:"I",default:!1,helpGroup:"GLOBAL",summary:"Disable interactive outputs, useful for CI"}),target:l.Flags.option({char:"t",description:"Raycast app target",helpGroup:"GLOBAL",multiple:!1,options:["debug","internal","release","x","x-debug","x-internal"],hidden:!0})()};flags;args;async init(){await super.init(),process.on("SIGINT",()=>process.exit(1));let{args:n,flags:i}=await this.parse({flags:this.ctor.flags,baseFlags:super.ctor.baseFlags,enableJsonFlag:this.ctor.enableJsonFlag,args:this.ctor.args,strict:this.ctor.strict});this.flags=i,this.args=n,C(this.flags.target),j(this.flags.emoji,this.flags["non-interactive"])}error(n,i){return i?.message&&n instanceof Error&&(n.message=`${i.message} (${n.message})`,delete i.message),super.error(n,i)}async catch(n){return super.catch(n)}async finally(n){return super.finally(n)}};var b=class t extends y{static description="Print the version number";async run(){await this.parse(t),this.log(`${$().version}`)}};
1
+ "use strict";var P=Object.create;var m=Object.defineProperty;var G=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var O=Object.getPrototypeOf,L=Object.prototype.hasOwnProperty;var I=(t,n)=>()=>(n||t((n={exports:{}}).exports,n),n.exports),R=(t,n)=>{for(var i in n)m(t,i,{get:n[i],enumerable:!0})},A=(t,n,i,c)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of D(n))!L.call(t,o)&&o!==i&&m(t,o,{get:()=>n[o],enumerable:!(c=G(n,o))||c.enumerable});return t};var h=(t,n,i)=>(i=t!=null?P(O(t)):{},A(n||!t||!t.__esModule?m(i,"default",{value:t,enumerable:!0}):i,t)),F=t=>A(m({},"__esModule",{value:!0}),t);var B=I((Q,k)=>{var Y=require("node:tty"),J=Y?.WriteStream?.prototype?.hasColors?.()??!1,r=(t,n)=>{if(!J)return o=>o;let i=`\x1B[${t}m`,c=`\x1B[${n}m`;return o=>{let p=o+"",d=p.indexOf(c);if(d===-1)return i+p+c;let x=i,g=0;for(;d!==-1;)x+=p.slice(g,d)+i,g=d+c.length,d=p.indexOf(c,g);return x+=p.slice(g)+c,x}},e={};e.reset=r(0,0);e.bold=r(1,22);e.dim=r(2,22);e.italic=r(3,23);e.underline=r(4,24);e.overline=r(53,55);e.inverse=r(7,27);e.hidden=r(8,28);e.strikethrough=r(9,29);e.black=r(30,39);e.red=r(31,39);e.green=r(32,39);e.yellow=r(33,39);e.blue=r(34,39);e.magenta=r(35,39);e.cyan=r(36,39);e.white=r(37,39);e.gray=r(90,39);e.bgBlack=r(40,49);e.bgRed=r(41,49);e.bgGreen=r(42,49);e.bgYellow=r(43,49);e.bgBlue=r(44,49);e.bgMagenta=r(45,49);e.bgCyan=r(46,49);e.bgWhite=r(47,49);e.bgGray=r(100,49);e.redBright=r(91,39);e.greenBright=r(92,39);e.yellowBright=r(93,39);e.blueBright=r(94,39);e.magentaBright=r(95,39);e.cyanBright=r(96,39);e.whiteBright=r(97,39);e.bgRedBright=r(101,49);e.bgGreenBright=r(102,49);e.bgYellowBright=r(103,49);e.bgBlueBright=r(104,49);e.bgMagentaBright=r(105,49);e.bgCyanBright=r(106,49);e.bgWhiteBright=r(107,49);k.exports=e});var $=I((oe,H)=>{H.exports={name:"ray",description:"Build extensions for Raycast with React and Node.js.",version:"1.98.0",author:"mathieudutour",private:!0,bin:{ray:"./bin/run.js"},dependencies:{"@oclif/core":"^4.0.33","@oclif/plugin-autocomplete":"^3.2.10","@oclif/plugin-help":"^6.2.18","@oclif/plugin-not-found":"^3.2.28","@raycast/eslint-plugin":"^1.0.15","@raycast/extract-tools-info":"file:../extract-tools-info",ajv:"^8.17.1",archiver:"^7.0.1",camelcase:"^8.0.0",chokidar:"^4.0.1","cli-progress":"^3.12.0",clipboardy:"^2.3.0",execa:"^9.5.1","json-source-map":"^0.6.1",json5:"^2.2.3","node-fetch-cjs":"^3.3.2",open:"^8.4.2",ora:"^8.1.1","terminal-link":"^3.0.0",yaml:"^2.6.1","yoctocolors-cjs":"^2.1.2"},devDependencies:{"@raycast/eslint-config":"^1.0.11","@types/archiver":"^6.0.3","@types/cli-progress":"^3.11.6","@types/node":"20.8.4",esbuild:"^0.25.1",eslint:"^8","json-schema-to-typescript":"^15.0.3",oclif:"^4.15.28",typescript:"^5.6.3"},files:["/bin","/dist","/oclif.manifest.json"],license:"MIT",main:"dist/index.js",oclif:{bin:"ray",dirname:"ray",commands:"./dist/commands",plugins:["@oclif/plugin-autocomplete","@oclif/plugin-help","@oclif/plugin-not-found"]},scripts:{"json-schema-to-ts":"json2ts ../../api/schema.json -y > src/types/manifest-schema.d.ts","build-scripts":'tsc "./scripts/build.ts" "./scripts/build-command.ts" "./scripts/dev-command.ts" --outDir ./scripts/dist --esModuleInterop',prebuild:"npm run json-schema-to-ts && npm run build-scripts",build:"node ./scripts/dist/build-command.js",predev:"npm run json-schema-to-ts && npm run build-scripts",dev:"node ./scripts/dist/dev-command.js",lint:"eslint . --ext .ts"},types:"dist/index.d.ts"}});var K={};R(K,{default:()=>b});module.exports=F(K);var l=require("@oclif/core");var f=h(require("node:fs")),w=h(require("node:path")),T=h(require("node:os"));var v={production:{url:"https://www.raycast.com",clientID:"KqAdcGhNfBKiUpfjD3nU3VNgh1t0iMPoX2hYEkN9d4I"},staging:{url:"https://www.rayca.st",clientID:"KqAdcGhNfBKiUpfjD3nU3VNgh1t0iMPoX2hYEkN9d4I"},development:{url:"http://localhost:3000",clientID:"rOCD_LhnXFObSLu9v7788qOGu25FZDqEzGjet4Q45ZY"}}[process.env.API_ENV||"production"],S="e69bae0ec90f5e838555",a={},E;function C(t){E=t;try{a=JSON.parse(f.readFileSync(w.join(M(),"config.json"),"utf8"))}catch(n){if(n instanceof Error&&n.code==="ENOENT")return;throw new Error(`Failed to read config file: ${n}`)}}function U(t){switch(t){case"raycastApiURL":return process.env.RAY_APIURL||a.APIURL||v.url;case"raycastAccessToken":return process.env.RAY_TOKEN||a.Token||a.AccessToken||"";case"raycastClientId":return process.env.RAY_CLIENT_ID||a.ClientID||v.clientID;case"githubClientId":return process.env.RAY_GithubClientID||a.GithubClientID||S;case"githubAccessToken":return process.env.GITHUB_ACCESS_TOKEN||a.GithubAccessToken||"";case"flavorName":return process.env.RAY_Target||(typeof a.Target>"u"?N("release"):a.Target)}}function N(t){switch(t){case"debug":return"debug";case"internal":return"internal";case"release":return"";case"x":return"x";case"x-internal":return"x-internal";case"x-debug":return"x-debug";case void 0:return U("flavorName")}}function _(){let t=N(E);return t==""?"raycast":`raycast-${t}`}function M(){let t=w.join(T.default.homedir(),".config",_());return f.mkdirSync(t,{recursive:!0}),t}var s=h(B());var ee=(0,s.blue)((0,s.dim)("internal only"));var u={wait:`\u{1F550}${(0,s.blue)("wait")} - `,info:`${process.env.GITHUB_ACTIONS==="true"?"\u2139\uFE0F":"\u2139\uFE0F "}${(0,s.cyan)("info")} - `,success:`\u2705${(0,s.green)("ready")} - `,warn:`${process.env.GITHUB_ACTIONS==="true"?"\u26A0\uFE0F":"\u26A0\uFE0F "}${(0,s.yellow)("warn")} - `,error:`\u{1F4A5}${(0,s.red)("error")} - `,event:`\u26A1\uFE0F${(0,s.magenta)("event")} - `,paymentPrompt:`\u{1F4B0}${(0,s.yellowBright)("plan")} - `},q=!0;function j(t,n){t||(u.wait=`${(0,s.blue)("wait")} - `,u.info=`${(0,s.cyan)("info")} - `,u.success=`${(0,s.green)("ready")} - `,u.warn=`${(0,s.yellow)("warn")} - `,u.error=`${(0,s.red)("error")} - `,u.event=`${(0,s.magenta)("event")} - `,u.paymentPrompt=`${(0,s.yellowBright)("plan")} - `),n&&(q=!1)}var y=class extends l.Command{static baseFlags={"exit-on-error":l.Flags.boolean({default:!0,helpGroup:"GLOBAL",aliases:["exitOnError"],deprecateAliases:!0,summary:"Always exit with non-zero code on error",allowNo:!0}),emoji:l.Flags.boolean({default:!1,helpGroup:"GLOBAL",summary:"Prefix output with emojis \u{1F308}"}),help:l.Flags.boolean({default:!1,helpGroup:"GLOBAL",summary:"Show the help message for the command"}),"non-interactive":l.Flags.boolean({char:"I",default:!1,helpGroup:"GLOBAL",summary:"Disable interactive outputs, useful for CI"}),target:l.Flags.option({char:"t",description:"Raycast app target",helpGroup:"GLOBAL",multiple:!1,options:["debug","internal","release","x","x-debug","x-internal"],hidden:!0})()};flags;args;async init(){await super.init(),process.on("SIGINT",()=>process.exit(1));let{args:n,flags:i}=await this.parse({flags:this.ctor.flags,baseFlags:super.ctor.baseFlags,enableJsonFlag:this.ctor.enableJsonFlag,args:this.ctor.args,strict:this.ctor.strict});this.flags=i,this.args=n,C(this.flags.target),j(this.flags.emoji,this.flags["non-interactive"])}error(n,i){return i?.message&&n instanceof Error&&(n.message=`${i.message} (${n.message})`,delete i.message),super.error(n,i)}async catch(n){return super.catch(n)}async finally(n){return super.finally(n)}};var b=class t extends y{static description="Print the version number";async run(){await this.parse(t),this.log(`${$().version}`)}};
@@ -1138,5 +1138,5 @@
1138
1138
  ]
1139
1139
  }
1140
1140
  },
1141
- "version": "1.97.0"
1141
+ "version": "1.98.0"
1142
1142
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raycast/api",
3
- "version": "1.97.0",
3
+ "version": "1.98.0",
4
4
  "description": "Build extensions for Raycast with React and Node.js.",
5
5
  "author": "Raycast Technologies Ltd.",
6
6
  "homepage": "https://developers.raycast.com",
package/types/index.d.ts CHANGED
@@ -1608,7 +1608,28 @@ declare interface ConvenienceActions {
1608
1608
  * ```
1609
1609
  */
1610
1610
  CreateQuicklink: typeof CreateQuicklink;
1611
-
1611
+ /**
1612
+ * Action that navigates to the the Intall MCP Server command with some or all of the fields prefilled.
1613
+ *
1614
+ * @example
1615
+ * ```typescript
1616
+ * import { ActionPanel, Detail, Action } from "@raycast/api";
1617
+ *
1618
+ * export default function Command() {
1619
+ * return (
1620
+ * <Detail
1621
+ * markdown="Test out MCP Server installation"
1622
+ * actions={
1623
+ * <ActionPanel>
1624
+ * <Action.InstallMCPServer server={{ name: "Sequential Thinking", transport: "stdio", command: "npx", args: ["-y", "@modelcontextprotocol/server-sequential-thinking"] }} />
1625
+ * </ActionPanel>
1626
+ * }
1627
+ * />
1628
+ * );
1629
+ * }
1630
+ * ```
1631
+ */
1632
+ InstallMCPServer: typeof InstallMCPServer;
1612
1633
  /**
1613
1634
  * Action that toggles the Quick Look to preview a file.
1614
1635
  *
@@ -5425,6 +5446,30 @@ export declare const ImageMask: typeof Image.Mask;
5425
5446
  */
5426
5447
  export declare type ImageSource = Image.Source;
5427
5448
 
5449
+ /**
5450
+ * See {@link Action.InstallMCPServer}
5451
+ */
5452
+ declare const InstallMCPServer: FunctionComponent<InstallMCPServerProps>;
5453
+
5454
+ declare interface InstallMCPServerProps {
5455
+ /**
5456
+ * The {@link StdioMCPServer} or {@link SSEMCPServer} to create.
5457
+ */
5458
+ server: StdioMCPServer | SSEMCPServer;
5459
+ /**
5460
+ * An optional title for the Action.
5461
+ */
5462
+ title?: string;
5463
+ /**
5464
+ * A optional icon displayed for the Action. See {@link Image.ImageLike} for the supported formats and types.
5465
+ */
5466
+ icon?: Image.ImageLike;
5467
+ /**
5468
+ * The keyboard shortcut for the Action.
5469
+ */
5470
+ shortcut?: Keyboard.Shortcut;
5471
+ }
5472
+
5428
5473
  /**
5429
5474
  * Options for launching a command from another extension.
5430
5475
  */
@@ -6550,6 +6595,21 @@ declare interface LabelProps {
6550
6595
  export declare interface LocalStorageValues extends LocalStorage.Values {
6551
6596
  }
6552
6597
 
6598
+ declare interface MCPServer {
6599
+ /**
6600
+ * The icon to display for the MCP server.
6601
+ */
6602
+ icon?: Icon;
6603
+ /**
6604
+ * The name of the MCP server.
6605
+ */
6606
+ name: string;
6607
+ /**
6608
+ * The description of the MCP server.
6609
+ */
6610
+ description?: string;
6611
+ }
6612
+
6553
6613
  /**
6554
6614
  * Adds an item to the menu bar, optionally with a menu attached in case its `children` prop is non-empty.
6555
6615
  *
@@ -8007,6 +8067,25 @@ declare interface LabelProps {
8007
8067
  backspace: string;
8008
8068
  };
8009
8069
 
8070
+ declare interface StdioMCPServer extends MCPServer {
8071
+ /**
8072
+ * The transport type of the MCP server.
8073
+ */
8074
+ transport: "stdio";
8075
+ /**
8076
+ * The command to run the MCP server.
8077
+ */
8078
+ command: string;
8079
+ /**
8080
+ * The arguments to pass to the MCP server.
8081
+ */
8082
+ args?: string[];
8083
+ /**
8084
+ * The environment variables to pass to the MCP server.
8085
+ */
8086
+ env?: Record<string, string>;
8087
+ }
8088
+
8010
8089
  /**
8011
8090
  * See {@link ActionPanel.Submenu}
8012
8091
  */