@staff0rd/assist 0.291.1 → 0.293.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 +62 -62
- package/dist/index.js +40 -48
- 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.293.0",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -4639,49 +4639,6 @@ function createFallbackHandler(routes2, htmlHandler2, extra) {
|
|
|
4639
4639
|
};
|
|
4640
4640
|
}
|
|
4641
4641
|
|
|
4642
|
-
// src/commands/backlog/web/applyCwdFromReq.ts
|
|
4643
|
-
function applyCwdFromReq(req) {
|
|
4644
|
-
const url = new URL(req.url ?? "/", "http://localhost");
|
|
4645
|
-
setBacklogDir(url.searchParams.get("cwd") ?? void 0);
|
|
4646
|
-
}
|
|
4647
|
-
|
|
4648
|
-
// src/commands/backlog/web/parseItemBody.ts
|
|
4649
|
-
function readBody(req) {
|
|
4650
|
-
return new Promise((resolve16, reject) => {
|
|
4651
|
-
let body = "";
|
|
4652
|
-
req.on("data", (chunk) => {
|
|
4653
|
-
body += chunk.toString();
|
|
4654
|
-
});
|
|
4655
|
-
req.on("end", () => resolve16(body));
|
|
4656
|
-
req.on("error", reject);
|
|
4657
|
-
});
|
|
4658
|
-
}
|
|
4659
|
-
async function parseItemBody(req) {
|
|
4660
|
-
return JSON.parse(await readBody(req));
|
|
4661
|
-
}
|
|
4662
|
-
async function parseStatusBody(req) {
|
|
4663
|
-
return JSON.parse(await readBody(req));
|
|
4664
|
-
}
|
|
4665
|
-
async function parseRewindBody(req) {
|
|
4666
|
-
return JSON.parse(await readBody(req));
|
|
4667
|
-
}
|
|
4668
|
-
|
|
4669
|
-
// src/commands/backlog/web/createItem.ts
|
|
4670
|
-
async function createItem(req, res) {
|
|
4671
|
-
const body = await parseItemBody(req);
|
|
4672
|
-
applyCwdFromReq(req);
|
|
4673
|
-
const orm = await getBacklogOrm();
|
|
4674
|
-
const newItem = {
|
|
4675
|
-
type: body.type ?? "story",
|
|
4676
|
-
name: body.name,
|
|
4677
|
-
description: body.description,
|
|
4678
|
-
acceptanceCriteria: body.acceptanceCriteria ?? [],
|
|
4679
|
-
status: "todo"
|
|
4680
|
-
};
|
|
4681
|
-
const id = await insertItem(orm, newItem, getOrigin());
|
|
4682
|
-
respondJson(res, 201, { id, ...newItem });
|
|
4683
|
-
}
|
|
4684
|
-
|
|
4685
4642
|
// src/commands/backlog/loadBacklogSummaries.ts
|
|
4686
4643
|
import { eq as eq11 } from "drizzle-orm";
|
|
4687
4644
|
|
|
@@ -4722,6 +4679,12 @@ async function backlogHasItems() {
|
|
|
4722
4679
|
return row !== void 0;
|
|
4723
4680
|
}
|
|
4724
4681
|
|
|
4682
|
+
// src/commands/backlog/web/applyCwdFromReq.ts
|
|
4683
|
+
function applyCwdFromReq(req) {
|
|
4684
|
+
const url = new URL(req.url ?? "/", "http://localhost");
|
|
4685
|
+
setBacklogDir(url.searchParams.get("cwd") ?? void 0);
|
|
4686
|
+
}
|
|
4687
|
+
|
|
4725
4688
|
// src/commands/backlog/web/getBacklogExists.ts
|
|
4726
4689
|
async function getBacklogExists(req, res) {
|
|
4727
4690
|
applyCwdFromReq(req);
|
|
@@ -4731,6 +4694,27 @@ async function getBacklogExists(req, res) {
|
|
|
4731
4694
|
// src/commands/backlog/web/rewindItemPhase.ts
|
|
4732
4695
|
import { eq as eq13 } from "drizzle-orm";
|
|
4733
4696
|
|
|
4697
|
+
// src/commands/backlog/web/parseItemBody.ts
|
|
4698
|
+
function readBody(req) {
|
|
4699
|
+
return new Promise((resolve16, reject) => {
|
|
4700
|
+
let body = "";
|
|
4701
|
+
req.on("data", (chunk) => {
|
|
4702
|
+
body += chunk.toString();
|
|
4703
|
+
});
|
|
4704
|
+
req.on("end", () => resolve16(body));
|
|
4705
|
+
req.on("error", reject);
|
|
4706
|
+
});
|
|
4707
|
+
}
|
|
4708
|
+
async function parseItemBody(req) {
|
|
4709
|
+
return JSON.parse(await readBody(req));
|
|
4710
|
+
}
|
|
4711
|
+
async function parseStatusBody(req) {
|
|
4712
|
+
return JSON.parse(await readBody(req));
|
|
4713
|
+
}
|
|
4714
|
+
async function parseRewindBody(req) {
|
|
4715
|
+
return JSON.parse(await readBody(req));
|
|
4716
|
+
}
|
|
4717
|
+
|
|
4734
4718
|
// src/commands/backlog/deleteComment.ts
|
|
4735
4719
|
import { and as and2, eq as eq12 } from "drizzle-orm";
|
|
4736
4720
|
async function deleteComment(orm, itemId, commentId) {
|
|
@@ -5332,7 +5316,6 @@ var routes = {
|
|
|
5332
5316
|
),
|
|
5333
5317
|
"GET /xterm.css": createCssHandler("@xterm/xterm/css/xterm.css"),
|
|
5334
5318
|
"GET /api/items": listItems,
|
|
5335
|
-
"POST /api/items": createItem,
|
|
5336
5319
|
"GET /api/backlog/exists": getBacklogExists,
|
|
5337
5320
|
"POST /api/backlog/init": initBacklog,
|
|
5338
5321
|
"POST /api/open-in-code": openInCode,
|
|
@@ -18897,7 +18880,12 @@ function handleHello(state, msg) {
|
|
|
18897
18880
|
function handleCreated(state, msg) {
|
|
18898
18881
|
daemonLog(`windows daemon: created session ${nsId(msg)}`);
|
|
18899
18882
|
const client = state.pendingCreators.shift();
|
|
18900
|
-
if (client)
|
|
18883
|
+
if (client)
|
|
18884
|
+
sendTo(client, {
|
|
18885
|
+
type: "created",
|
|
18886
|
+
sessionId: nsId(msg),
|
|
18887
|
+
isNew: msg.isNew
|
|
18888
|
+
});
|
|
18901
18889
|
else daemonLog("windows daemon: created with no pending creator (dropped)");
|
|
18902
18890
|
}
|
|
18903
18891
|
function handleSessions(state, msg) {
|
|
@@ -19603,10 +19591,10 @@ function safeParse2(line) {
|
|
|
19603
19591
|
}
|
|
19604
19592
|
|
|
19605
19593
|
// src/commands/sessions/daemon/dispatchMessage.ts
|
|
19606
|
-
function creator(spawn12) {
|
|
19594
|
+
function creator(isNew, spawn12) {
|
|
19607
19595
|
return (client, m, d) => {
|
|
19608
19596
|
if (m.windowsProxy.route(client, d)) return;
|
|
19609
|
-
sendTo(client, { type: "created", sessionId: spawn12(m, d) });
|
|
19597
|
+
sendTo(client, { type: "created", sessionId: spawn12(m, d), isNew });
|
|
19610
19598
|
};
|
|
19611
19599
|
}
|
|
19612
19600
|
function handleHistory(client) {
|
|
@@ -19634,9 +19622,11 @@ var handlers = {
|
|
|
19634
19622
|
ping: (client) => sendTo(client, { type: "pong", pid: process.pid }),
|
|
19635
19623
|
hello: (client) => sendTo(client, buildHello()),
|
|
19636
19624
|
create: creator(
|
|
19625
|
+
true,
|
|
19637
19626
|
(m, d) => m.spawn(d.prompt, d.cwd)
|
|
19638
19627
|
),
|
|
19639
19628
|
"create-run": creator(
|
|
19629
|
+
true,
|
|
19640
19630
|
(m, d) => m.spawnRun(
|
|
19641
19631
|
d.runName,
|
|
19642
19632
|
d.runArgs ?? [],
|
|
@@ -19644,12 +19634,14 @@ var handlers = {
|
|
|
19644
19634
|
)
|
|
19645
19635
|
),
|
|
19646
19636
|
"create-assist": creator(
|
|
19637
|
+
true,
|
|
19647
19638
|
(m, d) => m.spawnAssist(
|
|
19648
19639
|
d.assistArgs ?? [],
|
|
19649
19640
|
d.cwd
|
|
19650
19641
|
)
|
|
19651
19642
|
),
|
|
19652
19643
|
resume: creator(
|
|
19644
|
+
false,
|
|
19653
19645
|
(m, d) => m.resume(
|
|
19654
19646
|
d.sessionId,
|
|
19655
19647
|
d.cwd,
|