@staff0rd/assist 0.247.0 → 0.248.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.
- package/dist/commands/sessions/web/bundle.js +67 -67
- package/dist/index.js +28 -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.248.0",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -514,8 +514,8 @@ var SCHEMA = `
|
|
|
514
514
|
value TEXT NOT NULL
|
|
515
515
|
);
|
|
516
516
|
`;
|
|
517
|
-
async function ensureSchema(
|
|
518
|
-
await
|
|
517
|
+
async function ensureSchema(exec4) {
|
|
518
|
+
await exec4(SCHEMA);
|
|
519
519
|
}
|
|
520
520
|
|
|
521
521
|
// src/commands/backlog/getBacklogOrm.ts
|
|
@@ -4508,6 +4508,27 @@ function getHtml() {
|
|
|
4508
4508
|
</html>`;
|
|
4509
4509
|
}
|
|
4510
4510
|
|
|
4511
|
+
// src/commands/sessions/web/openInCode.ts
|
|
4512
|
+
import { exec as exec2 } from "child_process";
|
|
4513
|
+
import { promisify } from "util";
|
|
4514
|
+
var execAsync = promisify(exec2);
|
|
4515
|
+
async function openInCode(req, res) {
|
|
4516
|
+
const url = new URL(req.url ?? "/", "http://localhost");
|
|
4517
|
+
const cwd = url.searchParams.get("cwd");
|
|
4518
|
+
if (!cwd) {
|
|
4519
|
+
respondJson(res, 400, { error: "Missing cwd" });
|
|
4520
|
+
return;
|
|
4521
|
+
}
|
|
4522
|
+
try {
|
|
4523
|
+
await execAsync(`code "${cwd}"`);
|
|
4524
|
+
respondJson(res, 200, { ok: true });
|
|
4525
|
+
} catch {
|
|
4526
|
+
respondJson(res, 500, {
|
|
4527
|
+
error: "Failed to open VS Code. Is the 'code' command on your PATH?"
|
|
4528
|
+
});
|
|
4529
|
+
}
|
|
4530
|
+
}
|
|
4531
|
+
|
|
4511
4532
|
// src/commands/sessions/web/handleRequest.ts
|
|
4512
4533
|
var require3 = createRequire2(import.meta.url);
|
|
4513
4534
|
function createCssHandler(packageEntry) {
|
|
@@ -4532,7 +4553,8 @@ var routes = {
|
|
|
4532
4553
|
"GET /api/items": listItems,
|
|
4533
4554
|
"POST /api/items": createItem,
|
|
4534
4555
|
"GET /api/backlog/exists": getBacklogExists,
|
|
4535
|
-
"POST /api/backlog/init": initBacklog
|
|
4556
|
+
"POST /api/backlog/init": initBacklog,
|
|
4557
|
+
"POST /api/open-in-code": openInCode
|
|
4536
4558
|
};
|
|
4537
4559
|
var handleRequest = createFallbackHandler(
|
|
4538
4560
|
routes,
|
|
@@ -6850,10 +6872,10 @@ function hasSubcommands(helpText) {
|
|
|
6850
6872
|
}
|
|
6851
6873
|
|
|
6852
6874
|
// src/commands/permitCliReads/runHelp.ts
|
|
6853
|
-
import { exec as
|
|
6875
|
+
import { exec as exec3 } from "child_process";
|
|
6854
6876
|
function runHelp(args) {
|
|
6855
6877
|
return new Promise((resolve16) => {
|
|
6856
|
-
|
|
6878
|
+
exec3(
|
|
6857
6879
|
`${args.join(" ")} --help`,
|
|
6858
6880
|
{ encoding: "utf-8", timeout: 3e4 },
|
|
6859
6881
|
(_err, stdout, stderr) => {
|