@vicinae/api 0.16.0 → 0.16.2

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 (43) hide show
  1. package/bin/run.js +1 -1
  2. package/dist/api/ai.d.ts +2 -2
  3. package/dist/api/ai.js +2 -2
  4. package/dist/api/bus.d.ts +7 -2
  5. package/dist/api/cache.js +18 -12
  6. package/dist/api/clipboard.js +2 -2
  7. package/dist/api/command.js +2 -2
  8. package/dist/api/components/action-pannel.js +1 -1
  9. package/dist/api/components/actions.d.ts +21 -0
  10. package/dist/api/components/actions.js +25 -1
  11. package/dist/api/components/dropdown.js +2 -2
  12. package/dist/api/components/form.d.ts +19 -1
  13. package/dist/api/components/form.js +34 -11
  14. package/dist/api/components/grid.d.ts +1 -1
  15. package/dist/api/components/grid.js +11 -11
  16. package/dist/api/context/navigation-provider.js +1 -4
  17. package/dist/api/controls.js +6 -4
  18. package/dist/api/environment.d.ts +4 -0
  19. package/dist/api/file-search.d.ts +18 -18
  20. package/dist/api/file-search.js +18 -19
  21. package/dist/api/keyboard.d.ts +1 -1
  22. package/dist/api/keyboard.js +15 -17
  23. package/dist/api/lib/result.js +7 -1
  24. package/dist/api/oauth.d.ts +3 -8
  25. package/dist/api/oauth.js +51 -21
  26. package/dist/api/preference.js +2 -2
  27. package/dist/api/proto/application.d.ts +10 -0
  28. package/dist/api/proto/application.js +150 -3
  29. package/dist/api/proto/manager.d.ts +2 -0
  30. package/dist/api/proto/manager.js +32 -0
  31. package/dist/api/proto/oauth.d.ts +42 -0
  32. package/dist/api/proto/oauth.js +620 -5
  33. package/dist/api/proto/wm.d.ts +20 -0
  34. package/dist/api/proto/wm.js +291 -7
  35. package/dist/api/utils.d.ts +43 -0
  36. package/dist/api/utils.js +25 -2
  37. package/dist/api/window-management.d.ts +31 -2
  38. package/dist/api/window-management.js +29 -10
  39. package/dist/commands/develop/index.js +13 -11
  40. package/dist/schemas/manifest.d.ts +1 -1
  41. package/dist/schemas/manifest.js +5 -3
  42. package/package.json +73 -76
  43. package/types/jsx.d.ts +189 -170
@@ -7,7 +7,7 @@ const transformWorkspace = (proto) => {
7
7
  id: proto.id,
8
8
  name: proto.name,
9
9
  active: proto.active,
10
- monitorId: proto.monitor
10
+ monitorId: proto.monitor,
11
11
  };
12
12
  };
13
13
  const transformWindow = (proto) => {
@@ -15,8 +15,11 @@ const transformWindow = (proto) => {
15
15
  id: proto.id,
16
16
  workspaceId: proto.workspaceId,
17
17
  active: proto.active,
18
- bounds: { position: { x: proto.x, y: proto.y }, size: { width: proto.width, height: proto.height } },
19
- application: proto.app
18
+ bounds: {
19
+ position: { x: proto.x, y: proto.y },
20
+ size: { width: proto.width, height: proto.height },
21
+ },
22
+ application: proto.app,
20
23
  };
21
24
  };
22
25
  /**
@@ -38,22 +41,39 @@ const transformWindow = (proto) => {
38
41
  var WindowManagement;
39
42
  (function (WindowManagement) {
40
43
  async function ping() {
41
- const res = await bus_1.bus.turboRequest('wm.ping', {});
44
+ const res = await bus_1.bus.turboRequest("wm.ping", {});
42
45
  return res.unwrap().ok;
43
46
  }
44
47
  WindowManagement.ping = ping;
45
48
  async function getWindows(options = {}) {
46
- const res = await bus_1.bus.turboRequest('wm.getWindows', options);
49
+ const res = await bus_1.bus.turboRequest("wm.getWindows", options);
47
50
  return res.unwrap().windows.map(transformWindow);
48
51
  }
49
52
  WindowManagement.getWindows = getWindows;
53
+ /**
54
+ * Return the list of screens (physical and virtual) currently attached to the computer.
55
+ */
56
+ async function getScreens() {
57
+ const res = await bus_1.bus.turboRequest("wm.getScreens", {});
58
+ return res.unwrap().screens.map((sc) => ({
59
+ name: sc.name,
60
+ make: sc.make,
61
+ model: sc.model,
62
+ serial: sc.serial,
63
+ bounds: {
64
+ position: { x: sc.x, y: sc.y },
65
+ size: { width: sc.width, height: sc.height },
66
+ },
67
+ }));
68
+ }
69
+ WindowManagement.getScreens = getScreens;
50
70
  async function getActiveWorkspace() {
51
- const res = await bus_1.bus.turboRequest('wm.getActiveWorkspace', {});
71
+ const res = await bus_1.bus.turboRequest("wm.getActiveWorkspace", {});
52
72
  return transformWorkspace(res.unwrap().workspace);
53
73
  }
54
74
  WindowManagement.getActiveWorkspace = getActiveWorkspace;
55
75
  async function getWorkspaces() {
56
- const res = await bus_1.bus.turboRequest('wm.getWorkspaces', {});
76
+ const res = await bus_1.bus.turboRequest("wm.getWorkspaces", {});
57
77
  return res.unwrap().workspaces.map(transformWorkspace);
58
78
  }
59
79
  WindowManagement.getWorkspaces = getWorkspaces;
@@ -63,13 +83,12 @@ var WindowManagement;
63
83
  }
64
84
  WindowManagement.getWindowsOnActiveWorkspace = getWindowsOnActiveWorkspace;
65
85
  async function setWindowBounds(payload) {
66
- await bus_1.bus.turboRequest('wm.setWindowBounds', payload);
86
+ await bus_1.bus.turboRequest("wm.setWindowBounds", payload);
67
87
  }
68
88
  WindowManagement.setWindowBounds = setWindowBounds;
69
89
  async function getActiveWindow() {
70
- const res = await bus_1.bus.turboRequest('wm.getActiveWindow', {});
90
+ const res = await bus_1.bus.turboRequest("wm.getActiveWindow", {});
71
91
  return transformWindow(res.unwrap().window);
72
92
  }
73
93
  WindowManagement.getActiveWindow = getActiveWindow;
74
94
  })(WindowManagement || (exports.WindowManagement = WindowManagement = {}));
75
- ;
@@ -94,16 +94,18 @@ class Develop extends core_1.Command {
94
94
  };
95
95
  const build = async (outDir) => {
96
96
  /*
97
- logger.logInfo("Started type checking in background thread");
98
- typeCheck().then(({ error, ok }) => {
99
- if (!ok) {
100
- logger.logInfo(`Type checking error: ${error}`);
101
- }
102
-
103
- logger.logInfo("Done type checking");
104
- });
105
- */
106
- const entryPoints = manifest.commands.map((cmd) => (0, node_path_1.join)("src", `${cmd.name}.tsx`)).filter(node_fs_1.existsSync);
97
+ logger.logInfo("Started type checking in background thread");
98
+ typeCheck().then(({ error, ok }) => {
99
+ if (!ok) {
100
+ logger.logInfo(`Type checking error: ${error}`);
101
+ }
102
+
103
+ logger.logInfo("Done type checking");
104
+ });
105
+ */
106
+ const entryPoints = manifest.commands
107
+ .map((cmd) => (0, node_path_1.join)("src", `${cmd.name}.tsx`))
108
+ .filter(node_fs_1.existsSync);
107
109
  logger.logInfo(`entrypoints [${entryPoints.join(", ")}]`);
108
110
  const promises = manifest.commands.map((cmd) => {
109
111
  const base = (0, node_path_1.join)(process.cwd(), "src", `${cmd.name}`);
@@ -190,7 +192,7 @@ class Develop extends core_1.Command {
190
192
  ignoreInitial: true,
191
193
  })
192
194
  .on("all", async (_, path) => {
193
- if (path.endsWith('package.json')) {
195
+ if (path.endsWith("package.json")) {
194
196
  manifest = parseManifest();
195
197
  }
196
198
  logger.logEvent(`changed file ${path}`);
@@ -29,8 +29,8 @@ declare const _default: z.ZodObject<{
29
29
  icon: z.ZodOptional<z.ZodString>;
30
30
  mode: z.ZodEnum<{
31
31
  "menu-bar": "menu-bar";
32
- "no-view": "no-view";
33
32
  view: "view";
33
+ "no-view": "no-view";
34
34
  }>;
35
35
  name: z.ZodString;
36
36
  title: z.ZodString;
@@ -194,7 +194,8 @@ exports.default = zod_1.z.object({
194
194
  .any()
195
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
196
  .optional(),
197
- categories: zod_1.z.array(zod_1.z.enum([
197
+ categories: zod_1.z
198
+ .array(zod_1.z.enum([
198
199
  "Applications",
199
200
  "Communication",
200
201
  "Data",
@@ -209,8 +210,9 @@ exports.default = zod_1.z.object({
209
210
  "Security",
210
211
  "System",
211
212
  "Web",
212
- "Other"
213
- ])).optional(),
213
+ "Other",
214
+ ]))
215
+ .optional(),
214
216
  contributors: zod_1.z
215
217
  .array(zod_1.z
216
218
  .string()
package/package.json CHANGED
@@ -1,78 +1,75 @@
1
1
  {
2
- "name": "@vicinae/api",
3
- "version": "0.16.0",
4
- "description": "TypeScript SDK to build Vicinae extensions",
5
- "scripts": {
6
- "test": "echo \"Error: no test specified\" && exit 1",
7
- "build": "tsc --outDir dist",
8
- "protogen": "mkdir -p ./src/api/proto && protoc --plugin=./node_modules/.bin/protoc-gen-ts_proto -I../../proto ../../proto/*.proto --ts_proto_out ./src/api/proto",
9
- "pack": "npm run build && npm pack",
10
- "docgen-html": "typedoc src/api/index.ts",
11
- "docgen-md": "typedoc src/api/index.ts --disableSources --readme none --plugin typedoc-plugin-markdown --out ./docs"
12
- },
13
- "bin": {
14
- "vici": "./bin/run.js"
15
- },
16
- "files": [
17
- "dist",
18
- "types"
19
- ],
20
- "keywords": [],
21
- "author": "",
22
- "license": "ISC",
23
- "types": [
24
- "./dist/index.d.ts"
25
- ],
26
- "publishConfig": {
27
- "access": "public"
28
- },
29
- "main": "dist/index.js",
30
- "dependencies": {
31
- "@jgoz/esbuild-plugin-typecheck": "^4.0.3",
32
- "@oclif/core": "^4",
33
- "@oclif/plugin-help": "^6",
34
- "@oclif/plugin-plugins": "^5",
35
- "@types/node": ">=18",
36
- "@types/react": "19.0.10",
37
- "chalk": "^5.6.0",
38
- "chokidar": "^4.0.3",
39
- "esbuild": "^0.25.2",
40
- "react": "19.0.0",
41
- "zod": "^4.0.17"
42
- },
43
- "peerDependencies": {
44
- "@types/node": ">=18",
45
- "@types/react": "19.0.10"
46
- },
47
- "devDependencies": {
48
- "@bufbuild/protobuf": "^2.7.0",
49
- "@eslint/compat": "^1",
50
- "@oclif/prettier-config": "^0.2.1",
51
- "@oclif/test": "^4",
52
- "@types/chai": "^4",
53
- "@types/mocha": "^10",
54
- "chai": "^4",
55
- "eslint": "^9",
56
- "eslint-config-oclif": "^6",
57
- "eslint-config-prettier": "^10",
58
- "mocha": "^10",
59
- "oclif": "^4",
60
- "shx": "^0.3.3",
61
- "ts-node": "^10",
62
- "ts-proto": "^2.7.5",
63
- "typedoc": "^0.28.13",
64
- "typedoc-plugin-markdown": "^4.8.1",
65
- "typescript": "^5"
66
- },
67
- "oclif": {
68
- "bin": "vici",
69
- "dirname": "vici",
70
- "commands": "./dist/commands",
71
- "plugins": [
72
- "@oclif/plugin-help"
73
- ],
74
- "topicSeparator": " ",
75
- "topics": {}
76
- },
77
- "repository": "vicinaehq/vicinae"
2
+ "name": "@vicinae/api",
3
+ "version": "0.16.2",
4
+ "description": "TypeScript SDK to build Vicinae extensions",
5
+ "scripts": {
6
+ "test": "echo \"Error: no test specified\" && exit 1",
7
+ "build": "tsc --outDir dist",
8
+ "protogen": "mkdir -p ./src/api/proto && protoc --plugin=./node_modules/.bin/protoc-gen-ts_proto -I../../proto ../../proto/*.proto --ts_proto_out ./src/api/proto",
9
+ "pack": "npm run build && npm pack",
10
+ "docgen-html": "typedoc src/api/index.ts",
11
+ "docgen-md": "typedoc src/api/index.ts --disableSources --readme none --plugin typedoc-plugin-markdown --out ./docs",
12
+ "format": "biome format --write"
13
+ },
14
+ "bin": {
15
+ "vici": "./bin/run.js"
16
+ },
17
+ "files": [
18
+ "dist",
19
+ "types"
20
+ ],
21
+ "keywords": [],
22
+ "author": "",
23
+ "license": "ISC",
24
+ "types": [
25
+ "./dist/index.d.ts"
26
+ ],
27
+ "publishConfig": {
28
+ "access": "public"
29
+ },
30
+ "main": "dist/index.js",
31
+ "dependencies": {
32
+ "@jgoz/esbuild-plugin-typecheck": "^4.0.3",
33
+ "@oclif/core": "^4",
34
+ "@oclif/plugin-help": "^6",
35
+ "@oclif/plugin-plugins": "^5",
36
+ "@types/node": ">=18",
37
+ "@types/react": "19.0.10",
38
+ "chalk": "^5.6.0",
39
+ "chokidar": "^4.0.3",
40
+ "esbuild": "^0.25.2",
41
+ "react": "19.0.0",
42
+ "zod": "^4.0.17"
43
+ },
44
+ "peerDependencies": {
45
+ "@types/node": ">=18",
46
+ "@types/react": "19.0.10"
47
+ },
48
+ "devDependencies": {
49
+ "@biomejs/biome": "2.3.2",
50
+ "@bufbuild/protobuf": "^2.7.0",
51
+ "@oclif/test": "^4",
52
+ "@types/chai": "^4",
53
+ "@types/mocha": "^10",
54
+ "chai": "^4",
55
+ "mocha": "^10",
56
+ "oclif": "^4",
57
+ "shx": "^0.3.3",
58
+ "ts-node": "^10",
59
+ "ts-proto": "^2.7.5",
60
+ "typedoc": "^0.28.13",
61
+ "typedoc-plugin-markdown": "^4.8.1",
62
+ "typescript": "^5"
63
+ },
64
+ "oclif": {
65
+ "bin": "vici",
66
+ "dirname": "vici",
67
+ "commands": "./dist/commands",
68
+ "plugins": [
69
+ "@oclif/plugin-help"
70
+ ],
71
+ "topicSeparator": " ",
72
+ "topics": {}
73
+ },
74
+ "repository": "vicinaehq/vicinae"
78
75
  }