@staff0rd/assist 0.247.0 → 0.249.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 +66 -66
- package/dist/index.js +29 -41
- 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.249.0",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -332,17 +332,6 @@ function loadConfig() {
|
|
|
332
332
|
const merged = mergeRawConfigs(globalRaw, projectRaw);
|
|
333
333
|
return assistConfigSchema.parse(merged);
|
|
334
334
|
}
|
|
335
|
-
function loadConfigFrom(startDir) {
|
|
336
|
-
const found = findConfigUp(startDir);
|
|
337
|
-
const configPath = found?.configPath ?? join(startDir, "assist.yml");
|
|
338
|
-
const globalRaw = loadRawYaml(getGlobalConfigPath());
|
|
339
|
-
const projectRaw = loadRawYaml(configPath);
|
|
340
|
-
const merged = mergeRawConfigs(globalRaw, projectRaw);
|
|
341
|
-
return {
|
|
342
|
-
config: assistConfigSchema.parse(merged),
|
|
343
|
-
configDir: dirname(configPath)
|
|
344
|
-
};
|
|
345
|
-
}
|
|
346
335
|
function loadProjectConfig() {
|
|
347
336
|
return loadRawYaml(getConfigPath());
|
|
348
337
|
}
|
|
@@ -514,8 +503,8 @@ var SCHEMA = `
|
|
|
514
503
|
value TEXT NOT NULL
|
|
515
504
|
);
|
|
516
505
|
`;
|
|
517
|
-
async function ensureSchema(
|
|
518
|
-
await
|
|
506
|
+
async function ensureSchema(exec4) {
|
|
507
|
+
await exec4(SCHEMA);
|
|
519
508
|
}
|
|
520
509
|
|
|
521
510
|
// src/commands/backlog/getBacklogOrm.ts
|
|
@@ -4508,6 +4497,27 @@ function getHtml() {
|
|
|
4508
4497
|
</html>`;
|
|
4509
4498
|
}
|
|
4510
4499
|
|
|
4500
|
+
// src/commands/sessions/web/openInCode.ts
|
|
4501
|
+
import { exec as exec2 } from "child_process";
|
|
4502
|
+
import { promisify } from "util";
|
|
4503
|
+
var execAsync = promisify(exec2);
|
|
4504
|
+
async function openInCode(req, res) {
|
|
4505
|
+
const url = new URL(req.url ?? "/", "http://localhost");
|
|
4506
|
+
const cwd = url.searchParams.get("cwd");
|
|
4507
|
+
if (!cwd) {
|
|
4508
|
+
respondJson(res, 400, { error: "Missing cwd" });
|
|
4509
|
+
return;
|
|
4510
|
+
}
|
|
4511
|
+
try {
|
|
4512
|
+
await execAsync(`code "${cwd}"`);
|
|
4513
|
+
respondJson(res, 200, { ok: true });
|
|
4514
|
+
} catch {
|
|
4515
|
+
respondJson(res, 500, {
|
|
4516
|
+
error: "Failed to open VS Code. Is the 'code' command on your PATH?"
|
|
4517
|
+
});
|
|
4518
|
+
}
|
|
4519
|
+
}
|
|
4520
|
+
|
|
4511
4521
|
// src/commands/sessions/web/handleRequest.ts
|
|
4512
4522
|
var require3 = createRequire2(import.meta.url);
|
|
4513
4523
|
function createCssHandler(packageEntry) {
|
|
@@ -4532,7 +4542,8 @@ var routes = {
|
|
|
4532
4542
|
"GET /api/items": listItems,
|
|
4533
4543
|
"POST /api/items": createItem,
|
|
4534
4544
|
"GET /api/backlog/exists": getBacklogExists,
|
|
4535
|
-
"POST /api/backlog/init": initBacklog
|
|
4545
|
+
"POST /api/backlog/init": initBacklog,
|
|
4546
|
+
"POST /api/open-in-code": openInCode
|
|
4536
4547
|
};
|
|
4537
4548
|
var handleRequest = createFallbackHandler(
|
|
4538
4549
|
routes,
|
|
@@ -4542,12 +4553,7 @@ var handleRequest = createFallbackHandler(
|
|
|
4542
4553
|
|
|
4543
4554
|
// src/commands/sessions/web/handleSocket.ts
|
|
4544
4555
|
import { createInterface as createInterface2 } from "readline";
|
|
4545
|
-
var CWD_DEFAULTED_TYPES = /* @__PURE__ */ new Set([
|
|
4546
|
-
"create",
|
|
4547
|
-
"create-run",
|
|
4548
|
-
"create-assist",
|
|
4549
|
-
"run-configs"
|
|
4550
|
-
]);
|
|
4556
|
+
var CWD_DEFAULTED_TYPES = /* @__PURE__ */ new Set(["create", "create-run", "create-assist"]);
|
|
4551
4557
|
function handleSocket(ws, ctx) {
|
|
4552
4558
|
const connection = openDaemonConnection(ws, ctx);
|
|
4553
4559
|
connection.catch(() => {
|
|
@@ -6850,10 +6856,10 @@ function hasSubcommands(helpText) {
|
|
|
6850
6856
|
}
|
|
6851
6857
|
|
|
6852
6858
|
// src/commands/permitCliReads/runHelp.ts
|
|
6853
|
-
import { exec as
|
|
6859
|
+
import { exec as exec3 } from "child_process";
|
|
6854
6860
|
function runHelp(args) {
|
|
6855
6861
|
return new Promise((resolve16) => {
|
|
6856
|
-
|
|
6862
|
+
exec3(
|
|
6857
6863
|
`${args.join(" ")} --help`,
|
|
6858
6864
|
{ encoding: "utf-8", timeout: 3e4 },
|
|
6859
6865
|
(_err, stdout, stderr) => {
|
|
@@ -17577,20 +17583,6 @@ import * as net2 from "net";
|
|
|
17577
17583
|
// src/commands/sessions/daemon/handleConnection.ts
|
|
17578
17584
|
import { createInterface as createInterface5 } from "readline";
|
|
17579
17585
|
|
|
17580
|
-
// src/commands/sessions/daemon/handleRunConfigs.ts
|
|
17581
|
-
function handleRunConfigs(client, cwd) {
|
|
17582
|
-
try {
|
|
17583
|
-
const { config, configDir } = loadConfigFrom(cwd);
|
|
17584
|
-
const configs = resolveRunConfigs(config.run, configDir);
|
|
17585
|
-
sendTo(client, {
|
|
17586
|
-
type: "run-configs",
|
|
17587
|
-
configs: configs.map(({ name, params }) => ({ name, params }))
|
|
17588
|
-
});
|
|
17589
|
-
} catch {
|
|
17590
|
-
sendTo(client, { type: "run-configs", configs: [] });
|
|
17591
|
-
}
|
|
17592
|
-
}
|
|
17593
|
-
|
|
17594
17586
|
// src/commands/sessions/daemon/dispatchMessage.ts
|
|
17595
17587
|
function sendCreated(client, id) {
|
|
17596
17588
|
sendTo(client, { type: "created", sessionId: id });
|
|
@@ -17633,9 +17625,6 @@ function handleResume(client, manager, data) {
|
|
|
17633
17625
|
)
|
|
17634
17626
|
);
|
|
17635
17627
|
}
|
|
17636
|
-
function runConfigs(client, _manager, data) {
|
|
17637
|
-
handleRunConfigs(client, data.cwd);
|
|
17638
|
-
}
|
|
17639
17628
|
function handleHistory(client, manager) {
|
|
17640
17629
|
manager.getHistory().then((history) => {
|
|
17641
17630
|
sendTo(client, { type: "history", sessions: history });
|
|
@@ -17652,7 +17641,6 @@ var handlers = {
|
|
|
17652
17641
|
"create-run": handleCreateRun,
|
|
17653
17642
|
"create-assist": handleCreateAssist,
|
|
17654
17643
|
resume: handleResume,
|
|
17655
|
-
"run-configs": runConfigs,
|
|
17656
17644
|
history: handleHistory,
|
|
17657
17645
|
shutdown: handleShutdown,
|
|
17658
17646
|
input: (_client, m, d) => m.writeToSession(d.sessionId, d.data),
|