@staff0rd/assist 0.198.0 → 0.199.1
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/dist/index.js +14 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { Command } from "commander";
|
|
|
6
6
|
// package.json
|
|
7
7
|
var package_default = {
|
|
8
8
|
name: "@staff0rd/assist",
|
|
9
|
-
version: "0.
|
|
9
|
+
version: "0.199.1",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -1346,7 +1346,6 @@ function printComments(item) {
|
|
|
1346
1346
|
}
|
|
1347
1347
|
|
|
1348
1348
|
// src/shared/web.ts
|
|
1349
|
-
import { exec } from "child_process";
|
|
1350
1349
|
import { readFileSync as readFileSync6 } from "fs";
|
|
1351
1350
|
import {
|
|
1352
1351
|
createServer
|
|
@@ -1354,6 +1353,15 @@ import {
|
|
|
1354
1353
|
import { dirname, join as join7 } from "path";
|
|
1355
1354
|
import { fileURLToPath } from "url";
|
|
1356
1355
|
import chalk15 from "chalk";
|
|
1356
|
+
|
|
1357
|
+
// src/shared/openBrowser.ts
|
|
1358
|
+
import { exec } from "child_process";
|
|
1359
|
+
function openBrowser(url) {
|
|
1360
|
+
const cmd = process.platform === "win32" ? `start ${url}` : process.platform === "darwin" ? `open ${url}` : `xdg-open ${url}`;
|
|
1361
|
+
exec(cmd);
|
|
1362
|
+
}
|
|
1363
|
+
|
|
1364
|
+
// src/shared/web.ts
|
|
1357
1365
|
function respondJson(res, status2, data) {
|
|
1358
1366
|
res.writeHead(status2, { "Content-Type": "application/json" });
|
|
1359
1367
|
res.end(JSON.stringify(data));
|
|
@@ -1399,7 +1407,7 @@ function startWebServer(label2, port, handler) {
|
|
|
1399
1407
|
server.listen(port, () => {
|
|
1400
1408
|
console.log(chalk15.green(`${label2}: ${url}`));
|
|
1401
1409
|
console.log(chalk15.dim("Press Ctrl+C to stop"));
|
|
1402
|
-
|
|
1410
|
+
openBrowser(url);
|
|
1403
1411
|
});
|
|
1404
1412
|
return server;
|
|
1405
1413
|
}
|
|
@@ -11885,7 +11893,7 @@ function tryExec(commands) {
|
|
|
11885
11893
|
}
|
|
11886
11894
|
return false;
|
|
11887
11895
|
}
|
|
11888
|
-
function
|
|
11896
|
+
function openBrowser2(url) {
|
|
11889
11897
|
const platform = detectPlatform();
|
|
11890
11898
|
const quoted = JSON.stringify(url);
|
|
11891
11899
|
const commands = [];
|
|
@@ -11979,7 +11987,7 @@ function buildAuthorizeUrl(clientId, state) {
|
|
|
11979
11987
|
return `https://ro.am/oauth/authorize?${params}`;
|
|
11980
11988
|
}
|
|
11981
11989
|
async function authorizeInBrowser(clientId, state) {
|
|
11982
|
-
|
|
11990
|
+
openBrowser2(buildAuthorizeUrl(clientId, state));
|
|
11983
11991
|
const code = await waitForCallback(PORT, state);
|
|
11984
11992
|
return { code, redirectUri: REDIRECT_URI };
|
|
11985
11993
|
}
|
|
@@ -13565,7 +13573,7 @@ async function update2() {
|
|
|
13565
13573
|
|
|
13566
13574
|
// src/index.ts
|
|
13567
13575
|
var program = new Command();
|
|
13568
|
-
program.name("assist").description("CLI application").version(package_default.version);
|
|
13576
|
+
program.name("assist").description("CLI application").version(package_default.version).action(() => web3({ port: "3100" }));
|
|
13569
13577
|
program.command("sync").description("Copy command files to ~/.claude/commands").option("-y, --yes", "Overwrite settings.json without prompting").action((options2) => sync(options2));
|
|
13570
13578
|
program.command("init").description("Initialize VS Code and verify configurations").action(init4);
|
|
13571
13579
|
program.command("commit").description("Create a git commit with validation").argument("<args...>", "status | <message> [files...]").action(commit);
|