@vicinae/api 0.6.2 → 0.7.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 (67) hide show
  1. package/README.md +1 -1
  2. package/bin/run.js +2 -2
  3. package/dist/api/ai.js +11 -10
  4. package/dist/api/alert.d.ts +1 -1
  5. package/dist/api/alert.js +4 -5
  6. package/dist/api/bus.d.ts +27 -27
  7. package/dist/api/bus.js +15 -15
  8. package/dist/api/cache.js +15 -6
  9. package/dist/api/clipboard.d.ts +2 -2
  10. package/dist/api/clipboard.js +14 -15
  11. package/dist/api/color.js +1 -3
  12. package/dist/api/components/action-pannel.js +2 -2
  13. package/dist/api/components/actions.d.ts +3 -3
  14. package/dist/api/components/actions.js +16 -16
  15. package/dist/api/components/detail.d.ts +1 -1
  16. package/dist/api/components/detail.js +1 -1
  17. package/dist/api/components/dropdown.js +3 -3
  18. package/dist/api/components/empty-view.d.ts +2 -2
  19. package/dist/api/components/empty-view.js +1 -1
  20. package/dist/api/components/form.d.ts +2 -2
  21. package/dist/api/components/form.js +4 -12
  22. package/dist/api/components/grid.d.ts +4 -4
  23. package/dist/api/components/grid.js +10 -10
  24. package/dist/api/components/index.d.ts +7 -7
  25. package/dist/api/components/list.d.ts +3 -3
  26. package/dist/api/components/list.js +6 -6
  27. package/dist/api/components/menu-bar.js +1 -1
  28. package/dist/api/components/metadata.d.ts +2 -2
  29. package/dist/api/components/metadata.js +1 -1
  30. package/dist/api/components/tag.d.ts +3 -3
  31. package/dist/api/components/tag.js +4 -3
  32. package/dist/api/context/index.d.ts +1 -1
  33. package/dist/api/context/navigation-context.js +6 -2
  34. package/dist/api/context/navigation-provider.d.ts +1 -1
  35. package/dist/api/context/navigation-provider.js +5 -5
  36. package/dist/api/controls.js +3 -3
  37. package/dist/api/environment.js +0 -2
  38. package/dist/api/hooks/index.d.ts +2 -2
  39. package/dist/api/hooks/use-imperative-form-handle.d.ts +2 -2
  40. package/dist/api/hooks/use-imperative-form-handle.js +3 -3
  41. package/dist/api/hooks.js +4 -2
  42. package/dist/api/image.d.ts +1 -1
  43. package/dist/api/image.js +5 -5
  44. package/dist/api/index.d.ts +19 -19
  45. package/dist/api/keyboard.js +4 -5
  46. package/dist/api/local-storage.js +5 -7
  47. package/dist/api/oauth.d.ts +1 -1
  48. package/dist/api/oauth.js +23 -20
  49. package/dist/api/preference.js +2 -2
  50. package/dist/api/proto/application.js +28 -13
  51. package/dist/api/proto/clipboard.js +70 -37
  52. package/dist/api/proto/common.js +5 -1
  53. package/dist/api/proto/extension.js +104 -49
  54. package/dist/api/proto/google/protobuf/struct.js +25 -8
  55. package/dist/api/proto/ipc.js +99 -52
  56. package/dist/api/proto/manager.js +56 -22
  57. package/dist/api/proto/oauth.js +32 -14
  58. package/dist/api/proto/storage.js +66 -28
  59. package/dist/api/proto/ui.js +233 -124
  60. package/dist/api/toast.js +46 -21
  61. package/dist/api/utils.d.ts +1 -1
  62. package/dist/api/utils.js +16 -12
  63. package/dist/commands/build/index.js +18 -2
  64. package/dist/commands/develop/index.js +18 -3
  65. package/dist/index.d.ts +1 -1
  66. package/dist/schemas/manifest.js +225 -1
  67. package/package.json +1 -1
package/dist/api/utils.js CHANGED
@@ -18,47 +18,51 @@ exports.trash = trash;
18
18
  const open = async (target, app) => {
19
19
  let appId;
20
20
  if (app) {
21
- if (typeof app === 'string') {
21
+ if (typeof app === "string") {
22
22
  appId = app;
23
23
  }
24
24
  else {
25
25
  appId = app.id;
26
26
  }
27
27
  }
28
- await bus_1.bus.turboRequest('app.open', {
28
+ await bus_1.bus.turboRequest("app.open", {
29
29
  target,
30
- appId
30
+ appId,
31
31
  });
32
32
  };
33
33
  exports.open = open;
34
- const deserializeApp = (app) => ({ id: app.id, name: app.name, icon: { iconName: app.icon } });
34
+ const deserializeApp = (app) => ({
35
+ id: app.id,
36
+ name: app.name,
37
+ icon: { iconName: app.icon },
38
+ });
35
39
  const getFrontmostApplication = async () => {
36
- const res = await bus_1.bus.request('apps.get-frontmost');
40
+ const res = await bus_1.bus.request("apps.get-frontmost");
37
41
  if (!res.data.app) {
38
- throw new Error('couldnt get frontmost app');
42
+ throw new Error("couldnt get frontmost app");
39
43
  }
40
44
  return deserializeApp(res.data.app);
41
45
  };
42
46
  exports.getFrontmostApplication = getFrontmostApplication;
43
47
  const getApplications = async (path) => {
44
- const res = await bus_1.bus.turboRequest('app.list', {});
48
+ const res = await bus_1.bus.turboRequest("app.list", {});
45
49
  if (!res.ok)
46
50
  return [];
47
- console.log('got turbo apps', { apps: res.value });
51
+ console.log("got turbo apps", { apps: res.value });
48
52
  return [];
49
53
  };
50
54
  exports.getApplications = getApplications;
51
55
  const getDefaultApplication = async (path) => {
52
- const res = await bus_1.bus.request('apps.get-default', {
53
- target: path.toString()
56
+ const res = await bus_1.bus.request("apps.get-default", {
57
+ target: path.toString(),
54
58
  });
55
59
  if (!res.data.app) {
56
- throw new Error('couldnt get default app');
60
+ throw new Error("couldnt get default app");
57
61
  }
58
62
  return deserializeApp(res.data.app);
59
63
  };
60
64
  exports.getDefaultApplication = getDefaultApplication;
61
65
  const showInFinder = async (path) => {
62
- await bus_1.bus.request('show-in-finder');
66
+ await bus_1.bus.request("show-in-finder");
63
67
  };
64
68
  exports.showInFinder = showInFinder;
@@ -75,7 +75,7 @@ class Build extends core_1.Command {
75
75
  logger.logError(`No package.json found at ${pkgPath}. Does this location point to a valid extension repository?`);
76
76
  process.exit(1);
77
77
  }
78
- const json = JSON.parse((0, node_fs_1.readFileSync)(pkgPath, 'utf8'));
78
+ const json = JSON.parse((0, node_fs_1.readFileSync)(pkgPath, "utf8"));
79
79
  const e = manifest_js_1.default.safeParse(json);
80
80
  if (e.error) {
81
81
  logger.logError(`${pkgPath} is not a valid extension manifest: ${e.error}`);
@@ -87,7 +87,22 @@ class Build extends core_1.Command {
87
87
  const entryPoints = manifest.commands.map((cmd) => (0, node_path_1.join)("src", `${cmd.name}.tsx`));
88
88
  logger.logInfo(`entrypoints [${entryPoints.join(", ")}]`);
89
89
  const promises = manifest.commands.map((cmd) => {
90
- const source = (0, node_path_1.join)(process.cwd(), "src", `${cmd.name}.tsx`);
90
+ const base = (0, node_path_1.join)(process.cwd(), "src", `${cmd.name}`);
91
+ const tsxSource = `${base}.tsx`;
92
+ const tsSource = `${base}.ts`;
93
+ let source = tsxSource;
94
+ if (cmd.mode == "view" && !(0, node_fs_1.existsSync)(tsxSource)) {
95
+ throw new Error(`Unable to find view command ${cmd.name} at ${tsxSource}`);
96
+ }
97
+ // we allow .ts or .tsx for no-view
98
+ if (cmd.mode == "no-view") {
99
+ if (!(0, node_fs_1.existsSync)(tsxSource)) {
100
+ source = tsSource;
101
+ if (!(0, node_fs_1.existsSync)(tsSource)) {
102
+ throw new Error(`Unable to find no-view command ${cmd.name} at ${base}.{ts,tsx}`);
103
+ }
104
+ }
105
+ }
91
106
  return esbuild.build({
92
107
  bundle: true,
93
108
  entryPoints: [source],
@@ -95,6 +110,7 @@ class Build extends core_1.Command {
95
110
  format: "cjs",
96
111
  outfile: (0, node_path_1.join)(outDir, `${cmd.name}.js`),
97
112
  platform: "node",
113
+ minify: true,
98
114
  });
99
115
  });
100
116
  await Promise.all(promises);
@@ -71,7 +71,7 @@ class Develop extends core_1.Command {
71
71
  logger.logError(`No package.json found at ${pkgPath}. Does this location point to a valid extension repository?`);
72
72
  process.exit(1);
73
73
  }
74
- const json = JSON.parse((0, node_fs_1.readFileSync)(pkgPath, 'utf8'));
74
+ const json = JSON.parse((0, node_fs_1.readFileSync)(pkgPath, "utf8"));
75
75
  const e = manifest_js_1.default.safeParse(json);
76
76
  if (e.error) {
77
77
  logger.logError(`${pkgPath} is not a valid extension manifest: ${e.error}`);
@@ -100,7 +100,22 @@ class Develop extends core_1.Command {
100
100
  const entryPoints = manifest.commands.map((cmd) => (0, node_path_1.join)("src", `${cmd.name}.tsx`));
101
101
  logger.logInfo(`entrypoints [${entryPoints.join(", ")}]`);
102
102
  const promises = manifest.commands.map((cmd) => {
103
- const source = (0, node_path_1.join)(process.cwd(), "src", `${cmd.name}.tsx`);
103
+ const base = (0, node_path_1.join)(process.cwd(), "src", `${cmd.name}`);
104
+ const tsxSource = `${base}.tsx`;
105
+ const tsSource = `${base}.ts`;
106
+ let source = tsxSource;
107
+ if (cmd.mode == "view" && !(0, node_fs_1.existsSync)(tsxSource)) {
108
+ throw new Error(`Unable to find view command ${cmd.name} at ${tsxSource}`);
109
+ }
110
+ // we allow .ts or .tsx for no-view
111
+ if (cmd.mode == "no-view") {
112
+ if (!(0, node_fs_1.existsSync)(tsxSource)) {
113
+ source = tsSource;
114
+ if (!(0, node_fs_1.existsSync)(tsSource)) {
115
+ throw new Error(`Unable to find no-view command ${cmd.name} at ${base}.{ts,tsx}`);
116
+ }
117
+ }
118
+ }
104
119
  return esbuild.build({
105
120
  bundle: true,
106
121
  entryPoints: [source],
@@ -128,7 +143,7 @@ class Develop extends core_1.Command {
128
143
  }
129
144
  process.chdir(flags.target);
130
145
  const dataDir = (0, utils_js_1.extensionDataDir)();
131
- const id = `${manifest.name}.dev`;
146
+ const id = `${manifest.name}`;
132
147
  const extensionDir = (0, node_path_1.join)(dataDir, id);
133
148
  const logFile = (0, node_path_1.join)(extensionDir, "dev.log");
134
149
  const pidFile = (0, node_path_1.join)(extensionDir, "cli.pid");
package/dist/index.d.ts CHANGED
@@ -1 +1 @@
1
- export * from './api';
1
+ export * from "./api";
@@ -1,4 +1,228 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const zod_1 = require("zod");
4
- exports.default = zod_1.z.object({ "icon": zod_1.z.string().regex(new RegExp("^[^\\s]+(?:[ ]*[^\\s]+)*$")).describe("A 512x512 icon representing the extension. It will be displayed in the Store and in Preferences. If any of the extension's commands doesn't have an icon, it will 'inherit' the extension's icon. Please note that light and dark themes are supported; just append '@dark' to the filename for the dark theme and the correct icon will be picked at run-time. For example, set for this property 'icon.png' and put in the assets folder the 'icon.png' and 'icon@dark.png' files."), "name": zod_1.z.string().regex(new RegExp("^(@workaround/)?[a-z0-9-~][a-z0-9-_~]*$")).min(3).max(255).describe("The slugged extension's name used internally as identifier and in the store as part of the URL."), "debug": zod_1.z.object({ "reloadShortcut": zod_1.z.object({ "key": zod_1.z.string().min(1).max(2).describe("The keyboard key pressed with the modifier to trigger an action (e.g. ⌘ + B)"), "modifiers": zod_1.z.array(zod_1.z.enum(["command", "option", "control", "shift"])).min(1).max(4).describe("Such as the command modifier (⌘), option modifier (⌥), control modifier (⌃), or shift modifier (⇧).") }).strict().describe("Keyboard shortcut used to refresh/reload a command while the Vicinae window is focused.").optional() }).describe("Compilation and run-time options to improve development experience.").optional(), "owner": zod_1.z.string().regex(new RegExp("^[a-zA-Z0-9-*~][a-zA-Z0-9-*._~]*$")).min(2).max(75).describe("User ultimately responsible for the extension. The extension's store URL is composed of the owner username and the extension's name.").optional(), "title": zod_1.z.string().regex(new RegExp("^[^\\s]+(?: [^\\s]+)*$")).min(2).max(255).describe("The extension title will be displayed in the Store and in Preferences."), "access": zod_1.z.enum(["public", "private"]).describe("Public extensions are downloadable by anybody, while private extensions can only be downloaded by a member of a given organization.").optional(), "author": zod_1.z.string().regex(new RegExp("^[a-zA-Z0-9-*~][a-zA-Z0-9-*._~]*$")).min(2).max(75).describe("User currently contributing the most to the extension."), "license": zod_1.z.literal("MIT").describe("Currently only MIT is accepted, although more licenses will probably be available in the future."), "platforms": zod_1.z.array(zod_1.z.enum(["macOS", "Windows"])).min(1).describe("Currently only `macOS` and `Windows` are accepted. If not present, the extension is assumed to be available on all platforms.").optional(), "commands": zod_1.z.array(zod_1.z.object({ "icon": zod_1.z.string().regex(new RegExp("^[^\\s]+(?:[ ]*[^\\s]+)*$")).describe("A 512x512 icon representing the command. It will be displayed in Preferences and Vicinae root search. If a command doesn't have an icon, it will 'inherit' the extension's icon. Please note that light and dark themes are supported; just append '@dark' or '@light' to the icons name and the correct icon will be picked at run-time. For example, write for this property 'icon.png' and have in the assets folder the 'icon@light.png' and 'icon@dark.png' assets.").optional(), "mode": zod_1.z.enum(["view", "no-view", "menu-bar"]).describe("A value of 'view' indicates that the command will show a main view when performed. 'no-view' means that the command does not push a view to the main navigation stack in Vicinae. The latter is handy for directly opening URL or other API functionality that doesn't require a user interface. 'menu-bar' renders an extra item in the macOS system menu bar at the top of the screen."), "name": zod_1.z.string().regex(new RegExp("^[a-z0-9-~][a-zA-Z0-9-._~]*$")).min(2).max(255).describe("The name directly maps to the entry point file for the command. So a command named 'index' would map to 'src/index.ts' (or any other supported TypeScript or JavaScript file extension such as .tsx, .js, .jsx)."), "title": zod_1.z.string().regex(new RegExp("^[^\\s]+(?: [^\\s]+)*$")).min(2).max(255).describe("The command title will be displayed in the Store, Preferences, and in Vicinae's root search."), "keywords": zod_1.z.any().optional(), "subtitle": zod_1.z.string().regex(new RegExp("^[^\\s]+(?: [^\\s]+)*$")).min(2).max(255).describe("The subtitle (if any) will be displayed next to the command name in the root search. It helps user differentiate potentially similar commands. For example, a Google Suite extension may define 2 commands titled 'Create Document'. To differentiate them, one of the subtitle can be 'Google Docs' while the other can be 'Google Sheets'.").optional(), "description": zod_1.z.string().regex(new RegExp("^[^\\s]+(\\s+[^\\s]+)*$")).min(0).max(2048).describe("It helps users understand what the command does. It will be displayed in the Store and in Preferences."), "interval": zod_1.z.string().regex(new RegExp("^(\\d+)(s|m|h|d)$")).describe("The value specifies that a no-view or menu-bar command should be launched in the background every X seconds (s), minutes (m), hours (h) or days (d). Examples: 90s, 1m, 12h, 1d. The minimum value is 10 seconds (10s).").optional(), "preferences": zod_1.z.any().describe("Commands can optionally contribute preferences that are shown in Vicinae Preferences > Extensions when selecting the command. You can use preferences for configuration values and passwords or personal access tokens. Commands automatically \"inherit\" extension preferences and can also override entries with the same `name`.").optional(), "arguments": zod_1.z.any().describe("An optional array of arguments that are requested from user when the command is called").optional(), "disabledByDefault": zod_1.z.boolean().describe("Defaults to `false`").optional() }).catchall(zod_1.z.any())).min(1).max(100).describe("List of all commands vended by this extensions. An extension must contain at least one command."), "tools": zod_1.z.array(zod_1.z.object({ "icon": zod_1.z.string().regex(new RegExp("^[^\\s]+(?:[ ]*[^\\s]+)*$")).describe("A 512x512 icon representing the tool. It will be displayed in various places across Vicinae. If a tool doesn't have an icon, it will 'inherit' the extension's icon. Please note that light and dark themes are supported; just append '@dark' or '@light' to the icons name and the correct icon will be picked at run-time. For example, write for this property 'icon.png' and have in the assets folder the 'icon@light.png' and 'icon@dark.png' assets.").optional(), "name": zod_1.z.string().regex(new RegExp("^[a-z0-9-][a-zA-Z0-9-_]*$")).min(2).max(64).describe("The name directly maps to the entry point file for the tool. So a tool named 'index' would map to 'src/tools/index.ts' (or any other supported TypeScript or JavaScript file extension such as .tsx, .js, .jsx)."), "title": zod_1.z.string().regex(new RegExp("^[^\\s]+(?: [^\\s]+)*$")).min(2).max(255).describe("The tool title will be displayed in the Store, Preferences, and any other places the tool might be referenced in the Vicinae UI."), "keywords": zod_1.z.any().optional(), "description": zod_1.z.string().regex(new RegExp("^[^\\s]+(\\s+[^\\s]+)*$")).min(12).max(2048).describe("It helps users (and other actors like AI) understand what the tool does. It will be displayed in the Store and in Preferences."), "functionalities": zod_1.z.array(zod_1.z.enum(["AI attachment provider", "AI tool"])).describe("Limits the tool to the specified functionalities. If not specified, the tool can be used in any context (if it matches the requirements for each of them).").optional(), "preferences": zod_1.z.any().describe("Tools can optionally contribute preferences that are shown in Vicinae Preferences > Extensions when selecting the AI Extension item. You can use preferences for configuration values and passwords or personal access tokens. Tools automatically \"inherit\" extension preferences and can also override entries with the same `name`.").optional() }).catchall(zod_1.z.any())).min(0).max(100).describe("List of all tools that the AI can use to interact with this extension.").optional(), "ai": zod_1.z.object({ "instructions": zod_1.z.string().describe("Additional system instructions added when the tools are used in AI").optional(), "evals": zod_1.z.array(zod_1.z.object({ "input": zod_1.z.string().describe("The prompt to evaluate"), "usedAsExample": zod_1.z.boolean().describe("Whether the eval can be used as an example in Vicinae (default `true`)").optional() })).describe("List of tests to evaluate the reliability of the tools when used in AI").optional() }).describe("Additional information related to the AI capabilities of the extension").optional(), "keywords": zod_1.z.any().optional(), "description": zod_1.z.string().regex(new RegExp("^[^\\s]+(\\s+[^\\s]+)*$")).min(16).max(2048).describe("It helps users understand what the extension does. It will be displayed in the Store and in Preferences."), "preferences": zod_1.z.any().describe("Extensions can contribute preferences that are shown in Vicinae Preferences > Extensions. You can use preferences for configuration values and passwords or personal access tokens.").optional(), "categories": zod_1.z.array(zod_1.z.string()).optional(), "contributors": zod_1.z.array(zod_1.z.string().regex(new RegExp("^[a-zA-Z0-9-*~][a-zA-Z0-9-*._~]*$")).min(2).max(75)).min(0).describe("Users who have meaningfully contributed to the extension's commands.").optional(), "pastContributors": zod_1.z.array(zod_1.z.string().regex(new RegExp("^[a-zA-Z0-9-*~][a-zA-Z0-9-*._~]*$")).min(2).max(75)).min(0).describe("Users who have meaningfully contributed to the extension's commands but do not maintain it anymore.").optional(), "dependencies": zod_1.z.object({ "@raycast/api": zod_1.z.string().describe("The Vicinae API version used by this extension.").optional() }).describe("Source dependencies following the npm package.json dependency format."), "external": zod_1.z.array(zod_1.z.string()).describe("An Array of package or file names that should be excluded from the build. The package will not be bundled, but the import is preserved and will be evaluated at runtime.").optional() });
4
+ exports.default = zod_1.z.object({
5
+ icon: zod_1.z
6
+ .string()
7
+ .regex(new RegExp("^[^\\s]+(?:[ ]*[^\\s]+)*$"))
8
+ .describe("A 512x512 icon representing the extension. It will be displayed in the Store and in Preferences. If any of the extension's commands doesn't have an icon, it will 'inherit' the extension's icon. Please note that light and dark themes are supported; just append '@dark' to the filename for the dark theme and the correct icon will be picked at run-time. For example, set for this property 'icon.png' and put in the assets folder the 'icon.png' and 'icon@dark.png' files."),
9
+ name: zod_1.z
10
+ .string()
11
+ .regex(new RegExp("^(@workaround/)?[a-z0-9-~][a-z0-9-_~]*$"))
12
+ .min(3)
13
+ .max(255)
14
+ .describe("The slugged extension's name used internally as identifier and in the store as part of the URL."),
15
+ debug: zod_1.z
16
+ .object({
17
+ reloadShortcut: zod_1.z
18
+ .object({
19
+ key: zod_1.z
20
+ .string()
21
+ .min(1)
22
+ .max(2)
23
+ .describe("The keyboard key pressed with the modifier to trigger an action (e.g. ⌘ + B)"),
24
+ modifiers: zod_1.z
25
+ .array(zod_1.z.enum(["command", "option", "control", "shift"]))
26
+ .min(1)
27
+ .max(4)
28
+ .describe("Such as the command modifier (⌘), option modifier (⌥), control modifier (⌃), or shift modifier (⇧)."),
29
+ })
30
+ .strict()
31
+ .describe("Keyboard shortcut used to refresh/reload a command while the Vicinae window is focused.")
32
+ .optional(),
33
+ })
34
+ .describe("Compilation and run-time options to improve development experience.")
35
+ .optional(),
36
+ owner: zod_1.z
37
+ .string()
38
+ .regex(new RegExp("^[a-zA-Z0-9-*~][a-zA-Z0-9-*._~]*$"))
39
+ .min(2)
40
+ .max(75)
41
+ .describe("User ultimately responsible for the extension. The extension's store URL is composed of the owner username and the extension's name.")
42
+ .optional(),
43
+ title: zod_1.z
44
+ .string()
45
+ .regex(new RegExp("^[^\\s]+(?: [^\\s]+)*$"))
46
+ .min(2)
47
+ .max(255)
48
+ .describe("The extension title will be displayed in the Store and in Preferences."),
49
+ access: zod_1.z
50
+ .enum(["public", "private"])
51
+ .describe("Public extensions are downloadable by anybody, while private extensions can only be downloaded by a member of a given organization.")
52
+ .optional(),
53
+ author: zod_1.z
54
+ .string()
55
+ .regex(new RegExp("^[a-zA-Z0-9-*~][a-zA-Z0-9-*._~]*$"))
56
+ .min(2)
57
+ .max(75)
58
+ .describe("User currently contributing the most to the extension."),
59
+ license: zod_1.z
60
+ .literal("MIT")
61
+ .describe("Currently only MIT is accepted, although more licenses will probably be available in the future."),
62
+ platforms: zod_1.z
63
+ .array(zod_1.z.enum(["macOS", "Windows"]))
64
+ .min(1)
65
+ .describe("Currently only `macOS` and `Windows` are accepted. If not present, the extension is assumed to be available on all platforms.")
66
+ .optional(),
67
+ commands: zod_1.z
68
+ .array(zod_1.z
69
+ .object({
70
+ icon: zod_1.z
71
+ .string()
72
+ .regex(new RegExp("^[^\\s]+(?:[ ]*[^\\s]+)*$"))
73
+ .describe("A 512x512 icon representing the command. It will be displayed in Preferences and Vicinae root search. If a command doesn't have an icon, it will 'inherit' the extension's icon. Please note that light and dark themes are supported; just append '@dark' or '@light' to the icons name and the correct icon will be picked at run-time. For example, write for this property 'icon.png' and have in the assets folder the 'icon@light.png' and 'icon@dark.png' assets.")
74
+ .optional(),
75
+ mode: zod_1.z
76
+ .enum(["view", "no-view", "menu-bar"])
77
+ .describe("A value of 'view' indicates that the command will show a main view when performed. 'no-view' means that the command does not push a view to the main navigation stack in Vicinae. The latter is handy for directly opening URL or other API functionality that doesn't require a user interface. 'menu-bar' renders an extra item in the macOS system menu bar at the top of the screen."),
78
+ name: zod_1.z
79
+ .string()
80
+ .regex(new RegExp("^[a-z0-9-~][a-zA-Z0-9-._~]*$"))
81
+ .min(2)
82
+ .max(255)
83
+ .describe("The name directly maps to the entry point file for the command. So a command named 'index' would map to 'src/index.ts' (or any other supported TypeScript or JavaScript file extension such as .tsx, .js, .jsx)."),
84
+ title: zod_1.z
85
+ .string()
86
+ .regex(new RegExp("^[^\\s]+(?: [^\\s]+)*$"))
87
+ .min(2)
88
+ .max(255)
89
+ .describe("The command title will be displayed in the Store, Preferences, and in Vicinae's root search."),
90
+ keywords: zod_1.z.any().optional(),
91
+ subtitle: zod_1.z
92
+ .string()
93
+ .regex(new RegExp("^[^\\s]+(?: [^\\s]+)*$"))
94
+ .min(2)
95
+ .max(255)
96
+ .describe("The subtitle (if any) will be displayed next to the command name in the root search. It helps user differentiate potentially similar commands. For example, a Google Suite extension may define 2 commands titled 'Create Document'. To differentiate them, one of the subtitle can be 'Google Docs' while the other can be 'Google Sheets'.")
97
+ .optional(),
98
+ description: zod_1.z
99
+ .string()
100
+ .regex(new RegExp("^[^\\s]+(\\s+[^\\s]+)*$"))
101
+ .min(0)
102
+ .max(2048)
103
+ .describe("It helps users understand what the command does. It will be displayed in the Store and in Preferences."),
104
+ interval: zod_1.z
105
+ .string()
106
+ .regex(new RegExp("^(\\d+)(s|m|h|d)$"))
107
+ .describe("The value specifies that a no-view or menu-bar command should be launched in the background every X seconds (s), minutes (m), hours (h) or days (d). Examples: 90s, 1m, 12h, 1d. The minimum value is 10 seconds (10s).")
108
+ .optional(),
109
+ preferences: zod_1.z
110
+ .any()
111
+ .describe('Commands can optionally contribute preferences that are shown in Vicinae Preferences > Extensions when selecting the command. You can use preferences for configuration values and passwords or personal access tokens. Commands automatically "inherit" extension preferences and can also override entries with the same `name`.')
112
+ .optional(),
113
+ arguments: zod_1.z
114
+ .any()
115
+ .describe("An optional array of arguments that are requested from user when the command is called")
116
+ .optional(),
117
+ disabledByDefault: zod_1.z
118
+ .boolean()
119
+ .describe("Defaults to `false`")
120
+ .optional(),
121
+ })
122
+ .catchall(zod_1.z.any()))
123
+ .min(1)
124
+ .max(100)
125
+ .describe("List of all commands vended by this extensions. An extension must contain at least one command."),
126
+ tools: zod_1.z
127
+ .array(zod_1.z
128
+ .object({
129
+ icon: zod_1.z
130
+ .string()
131
+ .regex(new RegExp("^[^\\s]+(?:[ ]*[^\\s]+)*$"))
132
+ .describe("A 512x512 icon representing the tool. It will be displayed in various places across Vicinae. If a tool doesn't have an icon, it will 'inherit' the extension's icon. Please note that light and dark themes are supported; just append '@dark' or '@light' to the icons name and the correct icon will be picked at run-time. For example, write for this property 'icon.png' and have in the assets folder the 'icon@light.png' and 'icon@dark.png' assets.")
133
+ .optional(),
134
+ name: zod_1.z
135
+ .string()
136
+ .regex(new RegExp("^[a-z0-9-][a-zA-Z0-9-_]*$"))
137
+ .min(2)
138
+ .max(64)
139
+ .describe("The name directly maps to the entry point file for the tool. So a tool named 'index' would map to 'src/tools/index.ts' (or any other supported TypeScript or JavaScript file extension such as .tsx, .js, .jsx)."),
140
+ title: zod_1.z
141
+ .string()
142
+ .regex(new RegExp("^[^\\s]+(?: [^\\s]+)*$"))
143
+ .min(2)
144
+ .max(255)
145
+ .describe("The tool title will be displayed in the Store, Preferences, and any other places the tool might be referenced in the Vicinae UI."),
146
+ keywords: zod_1.z.any().optional(),
147
+ description: zod_1.z
148
+ .string()
149
+ .regex(new RegExp("^[^\\s]+(\\s+[^\\s]+)*$"))
150
+ .min(12)
151
+ .max(2048)
152
+ .describe("It helps users (and other actors like AI) understand what the tool does. It will be displayed in the Store and in Preferences."),
153
+ functionalities: zod_1.z
154
+ .array(zod_1.z.enum(["AI attachment provider", "AI tool"]))
155
+ .describe("Limits the tool to the specified functionalities. If not specified, the tool can be used in any context (if it matches the requirements for each of them).")
156
+ .optional(),
157
+ preferences: zod_1.z
158
+ .any()
159
+ .describe('Tools can optionally contribute preferences that are shown in Vicinae Preferences > Extensions when selecting the AI Extension item. You can use preferences for configuration values and passwords or personal access tokens. Tools automatically "inherit" extension preferences and can also override entries with the same `name`.')
160
+ .optional(),
161
+ })
162
+ .catchall(zod_1.z.any()))
163
+ .min(0)
164
+ .max(100)
165
+ .describe("List of all tools that the AI can use to interact with this extension.")
166
+ .optional(),
167
+ ai: zod_1.z
168
+ .object({
169
+ instructions: zod_1.z
170
+ .string()
171
+ .describe("Additional system instructions added when the tools are used in AI")
172
+ .optional(),
173
+ evals: zod_1.z
174
+ .array(zod_1.z.object({
175
+ input: zod_1.z.string().describe("The prompt to evaluate"),
176
+ usedAsExample: zod_1.z
177
+ .boolean()
178
+ .describe("Whether the eval can be used as an example in Vicinae (default `true`)")
179
+ .optional(),
180
+ }))
181
+ .describe("List of tests to evaluate the reliability of the tools when used in AI")
182
+ .optional(),
183
+ })
184
+ .describe("Additional information related to the AI capabilities of the extension")
185
+ .optional(),
186
+ keywords: zod_1.z.any().optional(),
187
+ description: zod_1.z
188
+ .string()
189
+ .regex(new RegExp("^[^\\s]+(\\s+[^\\s]+)*$"))
190
+ .min(16)
191
+ .max(2048)
192
+ .describe("It helps users understand what the extension does. It will be displayed in the Store and in Preferences."),
193
+ preferences: zod_1.z
194
+ .any()
195
+ .describe("Extensions can contribute preferences that are shown in Vicinae Preferences > Extensions. You can use preferences for configuration values and passwords or personal access tokens.")
196
+ .optional(),
197
+ categories: zod_1.z.array(zod_1.z.string()).optional(),
198
+ contributors: zod_1.z
199
+ .array(zod_1.z
200
+ .string()
201
+ .regex(new RegExp("^[a-zA-Z0-9-*~][a-zA-Z0-9-*._~]*$"))
202
+ .min(2)
203
+ .max(75))
204
+ .min(0)
205
+ .describe("Users who have meaningfully contributed to the extension's commands.")
206
+ .optional(),
207
+ pastContributors: zod_1.z
208
+ .array(zod_1.z
209
+ .string()
210
+ .regex(new RegExp("^[a-zA-Z0-9-*~][a-zA-Z0-9-*._~]*$"))
211
+ .min(2)
212
+ .max(75))
213
+ .min(0)
214
+ .describe("Users who have meaningfully contributed to the extension's commands but do not maintain it anymore.")
215
+ .optional(),
216
+ dependencies: zod_1.z
217
+ .object({
218
+ "@raycast/api": zod_1.z
219
+ .string()
220
+ .describe("The Vicinae API version used by this extension.")
221
+ .optional(),
222
+ })
223
+ .describe("Source dependencies following the npm package.json dependency format."),
224
+ external: zod_1.z
225
+ .array(zod_1.z.string())
226
+ .describe("An Array of package or file names that should be excluded from the build. The package will not be bundled, but the import is preserved and will be evaluated at runtime.")
227
+ .optional(),
228
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vicinae/api",
3
- "version": "0.6.2",
3
+ "version": "0.7.0",
4
4
  "description": "TypeScript SDK to build Vicinae extensions",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",