@drawsy/companion 0.1.29 → 0.1.31
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 +40 -51
- package/dist/drawsy/cli-ui.js +121 -0
- package/dist/drawsy/cli.js +65 -31
- package/package.json +1 -1
- package/skills/drawsy-fast-diagrams/SKILL.md +1 -1
package/README.md
CHANGED
|
@@ -1,86 +1,75 @@
|
|
|
1
|
-
# Drawsy Companion
|
|
1
|
+
# Install Drawsy Companion
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Choose the desktop app unless you specifically want to control Companion from a terminal.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Desktop app: one line, no Node.js needed
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
- Node.js 22 or later with npm, installed for your user account.
|
|
9
|
-
- The public npm package [@drawsy/companion](https://www.npmjs.com/package/@drawsy/companion).
|
|
7
|
+
Open Terminal on macOS/Linux, or Command Prompt or PowerShell on Windows. The desktop app does not need Node.js, npm, administrator access, or `sudo`.
|
|
10
8
|
|
|
11
|
-
|
|
9
|
+
macOS (Apple Silicon) or Linux (x64):
|
|
12
10
|
|
|
13
|
-
|
|
11
|
+
```sh
|
|
12
|
+
curl -fsSL https://raw.githubusercontent.com/DrawsyAI/drawsy-ai-companion/main/scripts/install.sh | sh
|
|
13
|
+
```
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
Windows (64-bit), in Command Prompt or PowerShell:
|
|
16
16
|
|
|
17
|
-
```
|
|
18
|
-
|
|
17
|
+
```cmd
|
|
18
|
+
winget install --id 9PD4MGJ9BW4F --source msstore
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
This installs the
|
|
21
|
+
This installs the Store version. You can also [open the Microsoft Store listing](https://apps.microsoft.com/detail/9PD4MGJ9BW4F). The GitHub release page still includes an unsigned Windows `.exe` and `.zip` for people who specifically need those files; Windows may show a security warning for them.
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
The macOS/Linux command downloads the latest stable GitHub release, checks its SHA-256 checksum, installs it for your account, and opens Companion. To update the desktop app, close Companion and run the same install command again. To update the Windows Store app, update it through Microsoft Store. Supported builds are Apple Silicon macOS, 64-bit Windows, and x64 Linux.
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
drawsy-companion setup
|
|
27
|
-
```
|
|
25
|
+
The desktop app stays available in the tray/menu bar while it is open. It does not start automatically when you sign in. Closing its window leaves it running in the background; choose **Quit Drawsy Companion** from the tray/menu to stop it.
|
|
28
26
|
|
|
29
|
-
|
|
27
|
+
## Terminal CLI: background service and controls
|
|
30
28
|
|
|
31
|
-
|
|
29
|
+
Choose this if you want Companion to run without its desktop window and start when you sign in. It requires Node.js 22 or later to remain installed. Use npm, pnpm, or Bun only if you already have it; there is no need to install another package manager.
|
|
32
30
|
|
|
33
|
-
macOS/Linux:
|
|
31
|
+
macOS/Linux, using npm:
|
|
34
32
|
|
|
35
33
|
```sh
|
|
36
|
-
npm install --global --ignore-scripts @drawsy/companion && drawsy-companion setup
|
|
34
|
+
npm install --global --ignore-scripts @drawsy/companion@latest && drawsy-companion setup
|
|
37
35
|
```
|
|
38
36
|
|
|
39
|
-
Windows PowerShell:
|
|
37
|
+
Windows PowerShell, using npm:
|
|
40
38
|
|
|
41
39
|
```powershell
|
|
42
|
-
npm.cmd install --global --ignore-scripts @drawsy/companion; if ($LASTEXITCODE -eq 0) { drawsy-companion.cmd setup }
|
|
40
|
+
npm.cmd install --global --ignore-scripts @drawsy/companion@latest; if ($LASTEXITCODE -eq 0) { drawsy-companion.cmd setup }
|
|
43
41
|
```
|
|
44
42
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
### Optional GitHub tarball source
|
|
48
|
-
|
|
49
|
-
If you prefer to install a published GitHub release tarball, use its versioned `.tgz` asset. For CLI version 0.1.28:
|
|
50
|
-
|
|
51
|
-
```sh
|
|
52
|
-
npm install --global --ignore-scripts https://github.com/DrawsyAI/drawsy-ai-companion/releases/download/cli-v0.1.28/drawsy-companion-0.1.28.tgz
|
|
53
|
-
```
|
|
43
|
+
If you already use a different package manager, run only its command:
|
|
54
44
|
|
|
55
|
-
|
|
45
|
+
- macOS/Linux with pnpm: `pnpm add --global --ignore-scripts @drawsy/companion@latest && drawsy-companion setup`
|
|
46
|
+
- macOS/Linux with Bun: `bun add --global --ignore-scripts @drawsy/companion@latest && drawsy-companion setup`
|
|
47
|
+
- Windows PowerShell with pnpm: `pnpm.cmd add --global --ignore-scripts @drawsy/companion@latest; if ($LASTEXITCODE -eq 0) { drawsy-companion.cmd setup }`
|
|
48
|
+
- Windows PowerShell with Bun: `bun add --global --ignore-scripts @drawsy/companion@latest; if ($LASTEXITCODE -eq 0) { drawsy-companion.cmd setup }`
|
|
56
49
|
|
|
57
|
-
|
|
50
|
+
`setup` starts Companion in the background and enables it when you sign in. Useful commands:
|
|
58
51
|
|
|
59
52
|
```sh
|
|
60
|
-
drawsy-companion start
|
|
61
|
-
drawsy-companion stop
|
|
62
53
|
drawsy-companion status
|
|
63
54
|
drawsy-companion logs
|
|
64
|
-
drawsy-companion
|
|
65
|
-
drawsy-companion
|
|
55
|
+
drawsy-companion start
|
|
56
|
+
drawsy-companion stop
|
|
66
57
|
drawsy-companion autostart disable
|
|
67
58
|
```
|
|
68
59
|
|
|
69
|
-
|
|
60
|
+
On Windows, use `drawsy-companion.cmd` in PowerShell. Desktop app and CLI use the same local server; close the desktop app before starting the CLI. The CLI will not stop or replace another Companion.
|
|
70
61
|
|
|
71
|
-
|
|
62
|
+
## Updates and removal
|
|
72
63
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
Run `drawsy-companion autostart disable`, then `drawsy-companion stop` before updating from the public npm registry:
|
|
64
|
+
The desktop app and CLI update separately. To update the desktop app, close it and run its installer command again. To update the CLI, disable sign-in startup, stop it, install the latest package with the same package manager, then run setup again. Example for npm:
|
|
76
65
|
|
|
77
66
|
```sh
|
|
67
|
+
drawsy-companion autostart disable
|
|
78
68
|
npm install --global --ignore-scripts @drawsy/companion@latest
|
|
69
|
+
drawsy-companion setup
|
|
79
70
|
```
|
|
80
71
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
Before removing the package, disable startup at login, stop Companion, and remove the package:
|
|
72
|
+
To remove the CLI, disable startup and stop it first, then uninstall the package with the same package manager:
|
|
84
73
|
|
|
85
74
|
```sh
|
|
86
75
|
drawsy-companion autostart disable
|
|
@@ -88,12 +77,12 @@ drawsy-companion stop
|
|
|
88
77
|
npm uninstall --global @drawsy/companion
|
|
89
78
|
```
|
|
90
79
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
## Release preparation
|
|
80
|
+
Neither install route installs, updates, or signs in to Codex or OpenCode. Keep using the installation and login flow you already have for those tools.
|
|
94
81
|
|
|
95
|
-
|
|
82
|
+
## Release sources
|
|
96
83
|
|
|
97
|
-
|
|
84
|
+
- macOS and Linux desktop installers are built and published to this repository's [GitHub Releases](https://github.com/DrawsyAI/drawsy-ai-companion/releases/latest). The release page also retains the unsigned Windows `.exe` and `.zip` alternate. The Windows Store package is built separately and submitted through Partner Center.
|
|
85
|
+
- The npm CLI is published separately by the repository's **Publish Companion CLI to npm** GitHub workflow. Installing or updating the desktop app does not publish or update the npm package.
|
|
86
|
+
- The CLI release tarball excludes Electron, the desktop window, build dependencies, personal configuration, and credentials.
|
|
98
87
|
|
|
99
|
-
|
|
88
|
+
For maintainers: desktop releases follow a version tag matching `package.json` (`v` followed by the package version) and are built by the release workflow. npm releases require a package version bump on `main` and a deliberate run of **Publish Companion CLI to npm** in GitHub Actions. The two release routes do not trigger each other.
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
const colors = {
|
|
2
|
+
violet: "38;2;101;84;217",
|
|
3
|
+
coral: "38;2;255;125;136",
|
|
4
|
+
blue: "38;2;88;162;232",
|
|
5
|
+
orange: "38;2;245;119;45",
|
|
6
|
+
green: "38;2;55;153;80",
|
|
7
|
+
muted: "38;2;137;143;156",
|
|
8
|
+
amber: "38;2;210;153;34",
|
|
9
|
+
};
|
|
10
|
+
const canColor = () => Boolean(process.stdout.isTTY && !("NO_COLOR" in process.env) && process.env.TERM !== "dumb");
|
|
11
|
+
const paint = (text, color, bold = false) => canColor() ? `\u001b[${bold ? "1;" : ""}${color}m${text}\u001b[0m` : text;
|
|
12
|
+
const delay = (milliseconds) => new Promise((resolve) => setTimeout(resolve, milliseconds));
|
|
13
|
+
function wordmark() {
|
|
14
|
+
return [
|
|
15
|
+
paint("D", colors.violet, true),
|
|
16
|
+
paint("r", colors.violet, true),
|
|
17
|
+
paint("a", colors.coral, true),
|
|
18
|
+
paint("w", colors.orange, true),
|
|
19
|
+
paint("s", colors.green, true),
|
|
20
|
+
paint("y", colors.blue, true),
|
|
21
|
+
].join("");
|
|
22
|
+
}
|
|
23
|
+
async function printHeader(animate) {
|
|
24
|
+
const letters = ["D", "r", "a", "w", "s", "y"];
|
|
25
|
+
const letterColors = [colors.violet, colors.violet, colors.coral, colors.orange, colors.green, colors.blue];
|
|
26
|
+
const animated = animate && process.stdout.isTTY && !process.env.CI && process.env.TERM !== "dumb";
|
|
27
|
+
if (animated) {
|
|
28
|
+
let visible = "";
|
|
29
|
+
for (let index = 0; index < letters.length; index++) {
|
|
30
|
+
visible += paint(letters[index], letterColors[index], true);
|
|
31
|
+
process.stdout.write(`\r ${visible} Companion`);
|
|
32
|
+
await delay(38);
|
|
33
|
+
}
|
|
34
|
+
process.stdout.write("\n");
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
console.log(`\n ${wordmark()} Companion`);
|
|
38
|
+
}
|
|
39
|
+
/** Animate one drawn stroke across the line only in an interactive terminal. */
|
|
40
|
+
export function startDrawsyIndicator(label) {
|
|
41
|
+
if (!process.stdout.isTTY || process.env.CI || process.env.TERM === "dumb") {
|
|
42
|
+
return { stop: () => undefined };
|
|
43
|
+
}
|
|
44
|
+
const width = 9;
|
|
45
|
+
let position = 0;
|
|
46
|
+
let direction = 1;
|
|
47
|
+
const render = () => {
|
|
48
|
+
const stroke = `${"-".repeat(position)}${paint("/", colors.violet)}${"-".repeat(width - position - 1)}`;
|
|
49
|
+
process.stdout.write(`\r\u001b[2K ${stroke} ${label}`);
|
|
50
|
+
position += direction;
|
|
51
|
+
if (position === width - 1 || position === 0)
|
|
52
|
+
direction *= -1;
|
|
53
|
+
};
|
|
54
|
+
render();
|
|
55
|
+
const timer = setInterval(render, 75);
|
|
56
|
+
timer.unref();
|
|
57
|
+
return {
|
|
58
|
+
stop(message) {
|
|
59
|
+
clearInterval(timer);
|
|
60
|
+
process.stdout.write(`\r\u001b[2K ${paint("OK", colors.green, true)} ${message}\n`);
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
export async function printDashboard(state, animate = false) {
|
|
65
|
+
await printHeader(animate);
|
|
66
|
+
console.log(` ${paint("Local bridge", colors.muted)} ${paint(`v${state.version}`, colors.muted)}`);
|
|
67
|
+
console.log("");
|
|
68
|
+
const companionLabel = {
|
|
69
|
+
running: ["Running", colors.green],
|
|
70
|
+
starting: ["Starting", colors.amber],
|
|
71
|
+
stopped: ["Not running", colors.muted],
|
|
72
|
+
other: ["Another Companion is running", colors.amber],
|
|
73
|
+
};
|
|
74
|
+
const [companionText, companionColor] = companionLabel[state.companion];
|
|
75
|
+
const companionVersion = state.companionVersion ? ` · v${state.companionVersion}` : "";
|
|
76
|
+
console.log(` ${"Companion".padEnd(12)} ${paint(`${companionText}${companionVersion}`, companionColor)}`);
|
|
77
|
+
for (const engine of state.engines) {
|
|
78
|
+
let label;
|
|
79
|
+
let color;
|
|
80
|
+
if (!engine.installed) {
|
|
81
|
+
label = "Not found";
|
|
82
|
+
color = colors.muted;
|
|
83
|
+
}
|
|
84
|
+
else if (engine.id === "opencode" && process.platform === "win32") {
|
|
85
|
+
label = "Installed · unavailable on Windows";
|
|
86
|
+
color = colors.amber;
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
label = `Available${engine.version ? ` · v${engine.version}` : ""}`;
|
|
90
|
+
color = colors.green;
|
|
91
|
+
}
|
|
92
|
+
console.log(` ${engine.name.padEnd(12)} ${paint(label, color)}`);
|
|
93
|
+
}
|
|
94
|
+
if (state.autostart !== undefined) {
|
|
95
|
+
console.log(` ${"At sign-in".padEnd(12)} ${paint(state.autostart ? "Enabled" : "Off", state.autostart ? colors.green : colors.muted)}`);
|
|
96
|
+
}
|
|
97
|
+
if (state.includeLinks) {
|
|
98
|
+
console.log("");
|
|
99
|
+
console.log(` Open Drawsy ${paint("https://drawsyai.com", colors.blue)}`);
|
|
100
|
+
console.log(` Plans ${paint("https://app.drawsyai.com/pricing", colors.muted)}`);
|
|
101
|
+
}
|
|
102
|
+
if (state.hint) {
|
|
103
|
+
console.log("");
|
|
104
|
+
console.log(` ${paint(state.hint, colors.muted)}`);
|
|
105
|
+
}
|
|
106
|
+
console.log("");
|
|
107
|
+
}
|
|
108
|
+
export async function printHelp(version) {
|
|
109
|
+
await printHeader(false);
|
|
110
|
+
console.log(` ${paint(`v${version}`, colors.muted)} · local canvas bridge`);
|
|
111
|
+
console.log("");
|
|
112
|
+
console.log(" no command Show status and links");
|
|
113
|
+
console.log(" setup Start now and at sign-in");
|
|
114
|
+
console.log(" start Start for this login session");
|
|
115
|
+
console.log(" serve Run in this terminal");
|
|
116
|
+
console.log(" status | stop | logs");
|
|
117
|
+
console.log(" autostart enable | disable");
|
|
118
|
+
console.log("");
|
|
119
|
+
console.log(" Update: npm install --global --ignore-scripts @drawsy/companion@latest");
|
|
120
|
+
console.log("");
|
|
121
|
+
}
|
package/dist/drawsy/cli.js
CHANGED
|
@@ -11,6 +11,7 @@ import { createWriteStream } from "node:fs";
|
|
|
11
11
|
import { createDrawsyBridge } from "./bridge.js";
|
|
12
12
|
import { readLocalEngineStatus } from "./engine-status.js";
|
|
13
13
|
import { enableAutostart, disableAutostart, autostartEnabled } from "./cli-autostart.js";
|
|
14
|
+
import { printDashboard, printHelp, startDrawsyIndicator } from "./cli-ui.js";
|
|
14
15
|
const directory = path.join(homedir(), ".drawsy-companion");
|
|
15
16
|
const lockDirectory = path.join(directory, "runtime.lock");
|
|
16
17
|
const recordPath = path.join(lockDirectory, "runtime.json");
|
|
@@ -67,6 +68,29 @@ const bridgePresent = async () => {
|
|
|
67
68
|
return null;
|
|
68
69
|
}
|
|
69
70
|
};
|
|
71
|
+
const showStatus = async (options = {}) => {
|
|
72
|
+
const running = await control("status");
|
|
73
|
+
const other = running ? null : await bridgePresent();
|
|
74
|
+
const autostart = await autostartEnabled();
|
|
75
|
+
const companion = running ? "running" : other ? "other" : options.missingState ?? "stopped";
|
|
76
|
+
const hint = options.hint ?? (other
|
|
77
|
+
? "Quit the desktop app before starting CLI mode."
|
|
78
|
+
: running
|
|
79
|
+
? autostart ? "Ready for Drawsy." : "Run drawsy-companion setup to keep it ready at sign-in."
|
|
80
|
+
: companion === "starting"
|
|
81
|
+
? "Startup is enabled; run drawsy-companion status to check readiness."
|
|
82
|
+
: "Run drawsy-companion setup to start now and at sign-in.");
|
|
83
|
+
await printDashboard({
|
|
84
|
+
version: manifest.version,
|
|
85
|
+
companion,
|
|
86
|
+
companionVersion: running?.version ?? other?.version,
|
|
87
|
+
autostart,
|
|
88
|
+
engines: readLocalEngineStatus(),
|
|
89
|
+
includeLinks: options.includeLinks,
|
|
90
|
+
hint,
|
|
91
|
+
}, options.animate);
|
|
92
|
+
return { running, other, autostart };
|
|
93
|
+
};
|
|
70
94
|
const acquire = async () => {
|
|
71
95
|
await mkdir(directory, { recursive: true, mode: 0o700 });
|
|
72
96
|
try {
|
|
@@ -148,7 +172,14 @@ const serve = async (backgroundLog) => {
|
|
|
148
172
|
await writeFile(recordPath, JSON.stringify({ pid: process.pid, port: address.port, token, version: manifest.version }), { mode: 0o600 });
|
|
149
173
|
process.once("SIGINT", () => { void shutdown(); });
|
|
150
174
|
process.once("SIGTERM", () => { void shutdown(); });
|
|
151
|
-
|
|
175
|
+
await printDashboard({
|
|
176
|
+
version: manifest.version,
|
|
177
|
+
companion: "running",
|
|
178
|
+
companionVersion: manifest.version,
|
|
179
|
+
engines: readLocalEngineStatus(),
|
|
180
|
+
includeLinks: !backgroundLog,
|
|
181
|
+
hint: backgroundLog ? `Local bridge ready at ${bridge.address}.` : "Press Ctrl+C to stop.",
|
|
182
|
+
});
|
|
152
183
|
process.send?.({ ready: true });
|
|
153
184
|
process.disconnect?.();
|
|
154
185
|
}
|
|
@@ -165,13 +196,14 @@ const serve = async (backgroundLog) => {
|
|
|
165
196
|
const start = async () => {
|
|
166
197
|
const existing = await control("status");
|
|
167
198
|
if (existing) {
|
|
168
|
-
|
|
199
|
+
await showStatus({ includeLinks: true });
|
|
169
200
|
return;
|
|
170
201
|
}
|
|
171
202
|
if (await bridgePresent())
|
|
172
203
|
throw new Error("The desktop app or another Companion server is running. Quit it first; this command will not replace it.");
|
|
173
204
|
await mkdir(directory, { recursive: true, mode: 0o700 });
|
|
174
205
|
const output = await open(logPath, "a", 0o600);
|
|
206
|
+
const indicator = startDrawsyIndicator("Starting local Companion");
|
|
175
207
|
try {
|
|
176
208
|
await new Promise((resolve, reject) => {
|
|
177
209
|
const child = spawn(process.execPath, [entry, "serve"], {
|
|
@@ -192,30 +224,27 @@ const start = async () => {
|
|
|
192
224
|
});
|
|
193
225
|
});
|
|
194
226
|
}
|
|
227
|
+
catch (error) {
|
|
228
|
+
indicator.stop("Startup did not finish.");
|
|
229
|
+
throw error;
|
|
230
|
+
}
|
|
195
231
|
finally {
|
|
196
232
|
await output.close();
|
|
197
233
|
}
|
|
198
|
-
|
|
234
|
+
indicator.stop("Local Companion started.");
|
|
235
|
+
await showStatus({ includeLinks: true });
|
|
199
236
|
};
|
|
200
|
-
const help = () => console.log(`Drawsy Companion ${manifest.version}
|
|
201
|
-
|
|
202
|
-
setup Start now and automatically when you sign in
|
|
203
|
-
start Start in the background for this login session
|
|
204
|
-
serve Run visibly in this terminal (Ctrl+C stops it)
|
|
205
|
-
stop Stop the CLI server; keep login startup configured
|
|
206
|
-
status Show server and automatic startup status
|
|
207
|
-
logs Show the latest local log output
|
|
208
|
-
autostart enable Enable startup at login
|
|
209
|
-
autostart disable Disable startup at login and stop its managed job
|
|
210
|
-
|
|
211
|
-
Requires Node.js 22 or later. Codex/OpenCode installation and login stay unchanged.
|
|
212
|
-
Update or remove the package with npm after disabling automatic startup.
|
|
213
|
-
Only the CLI's authenticated process is stopped; the desktop app is never killed.`);
|
|
214
237
|
try {
|
|
215
|
-
const [command = "
|
|
238
|
+
const [command = "welcome", option, ...extra] = process.argv.slice(2);
|
|
216
239
|
if (extra.length || (option && command !== "autostart" && !(command === "serve" && option === "--background-log")))
|
|
217
240
|
throw new Error("Unexpected arguments. Use drawsy-companion help.");
|
|
218
241
|
switch (command) {
|
|
242
|
+
case "welcome":
|
|
243
|
+
await showStatus({
|
|
244
|
+
includeLinks: true,
|
|
245
|
+
animate: true,
|
|
246
|
+
});
|
|
247
|
+
break;
|
|
219
248
|
case "serve":
|
|
220
249
|
await serve(option === "--background-log");
|
|
221
250
|
break;
|
|
@@ -230,17 +259,11 @@ try {
|
|
|
230
259
|
if (alive(running.pid))
|
|
231
260
|
throw new Error("Shutdown is still in progress. Check status before restarting.");
|
|
232
261
|
}
|
|
233
|
-
|
|
262
|
+
await showStatus({ hint: running ? "Companion CLI stopped." : "Companion CLI is not running." });
|
|
234
263
|
break;
|
|
235
264
|
}
|
|
236
265
|
case "status": {
|
|
237
|
-
|
|
238
|
-
const other = running ? null : await bridgePresent();
|
|
239
|
-
console.log(running ? `Companion CLI ${running.version} running.` : other ? `Another Companion server ${other.version ?? ""} is running.` : "Companion is not running.");
|
|
240
|
-
console.log(`Startup at login: ${await autostartEnabled() ? "enabled" : "disabled"}.`);
|
|
241
|
-
for (const engine of readLocalEngineStatus()) {
|
|
242
|
-
console.log(`${engine.name}: ${engine.id === "opencode" && process.platform === "win32" ? "not supported by Companion on Windows" : engine.installed ? `available${engine.version ? ` (${engine.version})` : ""}` : "not found"}.`);
|
|
243
|
-
}
|
|
266
|
+
await showStatus();
|
|
244
267
|
break;
|
|
245
268
|
}
|
|
246
269
|
case "logs": {
|
|
@@ -269,18 +292,29 @@ try {
|
|
|
269
292
|
if (action === "disable") {
|
|
270
293
|
await control("stop");
|
|
271
294
|
await disableAutostart();
|
|
272
|
-
|
|
295
|
+
await showStatus({ hint: "Startup at sign-in disabled." });
|
|
273
296
|
}
|
|
274
297
|
else if (action === "enable") {
|
|
275
298
|
if (await autostartEnabled() && await control("status")) {
|
|
276
|
-
|
|
299
|
+
await showStatus({ includeLinks: true, hint: "Ready at sign-in." });
|
|
277
300
|
break;
|
|
278
301
|
}
|
|
279
302
|
if (await control("status") || await bridgePresent())
|
|
280
303
|
throw new Error("Stop Companion first, then run setup. Existing sessions will not be interrupted automatically.");
|
|
281
304
|
await mkdir(directory, { recursive: true, mode: 0o700 });
|
|
282
|
-
|
|
283
|
-
|
|
305
|
+
const indicator = startDrawsyIndicator("Setting up sign-in startup");
|
|
306
|
+
try {
|
|
307
|
+
await enableAutostart(process.execPath, entry);
|
|
308
|
+
}
|
|
309
|
+
catch (error) {
|
|
310
|
+
indicator.stop("Setup could not be completed.");
|
|
311
|
+
throw error;
|
|
312
|
+
}
|
|
313
|
+
indicator.stop("Startup at sign-in enabled.");
|
|
314
|
+
await showStatus({
|
|
315
|
+
includeLinks: true,
|
|
316
|
+
missingState: "starting",
|
|
317
|
+
});
|
|
284
318
|
}
|
|
285
319
|
else
|
|
286
320
|
throw new Error("Use autostart enable or autostart disable.");
|
|
@@ -289,7 +323,7 @@ try {
|
|
|
289
323
|
case "help":
|
|
290
324
|
case "--help":
|
|
291
325
|
case "-h":
|
|
292
|
-
|
|
326
|
+
await printHelp(manifest.version);
|
|
293
327
|
break;
|
|
294
328
|
case "--version":
|
|
295
329
|
console.log(manifest.version);
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@ description: Generate semantic Mermaid source and render it through Drawsy Fast
|
|
|
8
8
|
Use this skill only for Fast Mode canvas diagram work.
|
|
9
9
|
|
|
10
10
|
- Read the current canvas and call `get_canvas_capabilities`. When present, treat `diagramCode.nativeEditableTypes` and `diagramCode.sourceMaxBytes` as the converter's runtime authority. Choose Mermaid syntax from the request's meaning and actual support; do not use a fixed intent-to-family mapping or prescribe a visual style. Keep the user's facts, supplied numbers, canvas context, and existing visual language intact. Never invent data to force a chart.
|
|
11
|
-
-
|
|
11
|
+
- Discover editable diagram families from the live `diagramCode.nativeEditableTypes` catalog rather than a bundled list, so newly installed converters are available automatically. The installed parser may accept more syntax and render it as an image. Check `outputKind` (`editable-vector` or `image-fallback`) and `diagramType`; do not promise that fallback content stays editable. Mermaid's official syntax references follow `https://mermaid.js.org/syntax/<diagram-name>.html`; documentation can describe newer syntax than Drawsy's bundled parser.
|
|
12
12
|
- Use `render_diagram_code` to create a whole diagram. Fast Mode still supports normal canvas management: use `apply_canvas_changes` to update existing elements or delete existing elements, including failed or intermediate work you created; never delete unrelated content. Use `create_or_update_connector` and `set_container_label` for existing objects, and image insertion/replacement, canvas capture, and live preview when requested. The runtime checks raw upserts against the live canvas; never use them to create new shapes or diagram structures. The diagram result includes `outputKind`, `diagramType`, `elementCount`, inserted `elementIds`, and `bounds`; use those IDs and bounds to review the inserted group.
|
|
13
13
|
- Do not use native pointer gestures or another canvas path to bypass the diagram converter when creating a whole diagram. Preserve the user's visual choices when managing existing content.
|
|
14
14
|
- A syntax correction is for a request that failed conversion: make at most one focused correction and retry with a new `operationId`; reuse an id only to retry the same unchanged request. A post-render correction follows a successful conversion after inspection: read the canvas again, make a focused correction, and set `replaceOperationId` to the prior successful operation id so only that converter-created group is replaced.
|