taskwindow 0.1.7 → 0.1.8

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 CHANGED
@@ -40,12 +40,15 @@ Or just keep `npx taskwindow` running in a terminal — both work.
40
40
 
41
41
  ### 2. Install the Chrome extension
42
42
 
43
- 1. Download `TaskWindow-extension-*.zip` from the
44
- [latest release](https://github.com/clawnify/taskwindow/releases) and unzip it
45
- 2. Open `chrome://extensions`
46
- 3. Enable **Developer mode** (top right)
47
- 4. Click **Load unpacked** and select the unzipped folder
48
- 5. Click the TaskWindow icon in the toolbar
43
+ ```bash
44
+ taskwindow install --extension
45
+ ```
46
+
47
+ That downloads the latest release, unpacks it, opens Chrome at
48
+ `chrome://extensions`, and prints the last 3 clicks (Developer mode →
49
+ Load unpacked → select the printed folder). Chrome's own policy requires
50
+ those clicks — no tool can do them for you. A Web Store listing (one-click
51
+ install + auto-updates) is planned.
49
52
 
50
53
  ### 3. Pair the extension with the daemon
51
54
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taskwindow",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "TaskWindow local daemon: bridges the TaskWindow Chrome extension to any MCP client over Streamable HTTP",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
package/src/index.js CHANGED
@@ -5,7 +5,7 @@ import { fileURLToPath } from "node:url";
5
5
  import { loadConfig } from "./config.js";
6
6
  import { Bridge } from "./bridge.js";
7
7
  import { createMcpRequestHandler } from "./mcp-http.js";
8
- import { installService, uninstallService } from "./service.js";
8
+ import { installService, uninstallService, installExtension } from "./service.js";
9
9
  import { createRequire } from "node:module";
10
10
 
11
11
  const { version: VERSION } = createRequire(import.meta.url)("../package.json");
@@ -57,6 +57,10 @@ if (verb === "install") {
57
57
  if (!flags.includes("--no-service")) {
58
58
  installService(fileURLToPath(new URL("./index.js", import.meta.url)));
59
59
  }
60
+ const extFlag = flags.indexOf("--extension");
61
+ if (extFlag !== -1) {
62
+ installExtension(flags[extFlag + 1] && !flags[extFlag + 1].startsWith("--") ? flags[extFlag + 1] : null);
63
+ }
60
64
  if (flags.includes("--claude") || flags.includes("--cursor") || flags.includes("--opencode")) {
61
65
  if (flags.includes("--claude")) registerClaude(config);
62
66
  if (flags.includes("--cursor")) registerCursor(config);
package/src/service.js CHANGED
@@ -75,6 +75,53 @@ WantedBy=default.target
75
75
  console.log(`[taskwindow] run the daemon with: node ${daemonEntryPath}`);
76
76
  }
77
77
 
78
+ /**
79
+ * Extension onboarding: fetch (or unzip a given) release zip, open Chrome at
80
+ * chrome://extensions, and print the exact remaining clicks. Chrome blocks
81
+ * programmatic unpacked installs, so a human does the final 3 clicks — the
82
+ * command does everything else.
83
+ */
84
+ export function installExtension(zipPath) {
85
+ const extDir = join(homedir(), ".taskwindow", "extension");
86
+ const open = (u) => {
87
+ try {
88
+ execSync(`open -a "Google Chrome" "${u}"`);
89
+ return true;
90
+ } catch {
91
+ return false;
92
+ }
93
+ };
94
+
95
+ if (!zipPath) {
96
+ // No zip given: fetch the latest release asset from GitHub.
97
+ try {
98
+ const api = "https://api.github.com/repos/clawnify/taskwindow/releases/latest";
99
+ const release = JSON.parse(execSync(`curl -sL "${api}"`, { maxBuffer: 20e6 }).toString());
100
+ const asset = (release.assets || []).find((a) => a.name.startsWith("TaskWindow-extension-"));
101
+ if (!asset) throw new Error("no extension asset in the latest release");
102
+ zipPath = join(homedir(), ".taskwindow", asset.name);
103
+ execSync(`curl -sL -o "${zipPath}" "${asset.browser_download_url}"`);
104
+ console.log(`[taskwindow] downloaded ${asset.name}`);
105
+ } catch (err) {
106
+ console.error(`[taskwindow] couldn't download the extension zip (${err.message}).`);
107
+ console.error(`[taskwindow] download it from https://github.com/clawnify/taskwindow/releases and re-run with --extension <zip>`);
108
+ return;
109
+ }
110
+ }
111
+
112
+ mkdirSync(extDir, { recursive: true });
113
+ execSync(`unzip -oq "${zipPath}" -d "${extDir}"`);
114
+ console.log(`[taskwindow] extension unpacked to ${extDir}`);
115
+ if (open("chrome://extensions")) {
116
+ console.log("[taskwindow] opened chrome://extensions in Chrome — finish in 3 clicks:");
117
+ } else {
118
+ console.log("[taskwindow] open chrome://extensions in Chrome — finish in 3 clicks:");
119
+ }
120
+ console.log(" 1. turn on Developer mode (top right)");
121
+ console.log(` 2. click "Load unpacked" and select: ${extDir}`);
122
+ console.log(" 3. done — the extension pairs itself from here (options page if it asks)");
123
+ }
124
+
78
125
  export function uninstallService() {
79
126
  const system = platform();
80
127
  try {