@docyrus/docyrus 0.0.70 → 0.0.71

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docyrus/docyrus",
3
- "version": "0.0.70",
3
+ "version": "0.0.71",
4
4
  "private": false,
5
5
  "description": "Docyrus API CLI",
6
6
  "main": "./main.js",
@@ -14,8 +14,8 @@
14
14
  "@clack/prompts": "^0.11.0",
15
15
  "@ff-labs/fff-node": "0.6.4",
16
16
  "@hono/node-server": "^1.19.13",
17
- "@mariozechner/pi-ai": "0.71.0",
18
- "@mariozechner/pi-coding-agent": "0.71.0",
17
+ "@mariozechner/pi-ai": "0.71.1",
18
+ "@mariozechner/pi-coding-agent": "0.71.1",
19
19
  "@modelcontextprotocol/ext-apps": "^1.2.2",
20
20
  "@modelcontextprotocol/sdk": "^1.25.1",
21
21
  "@mozilla/readability": "^0.6.0",
package/server-loader.js CHANGED
@@ -35692,12 +35692,27 @@ function createEventBridge(params) {
35692
35692
  handleToolExecutionEnd(event);
35693
35693
  break;
35694
35694
  }
35695
+ case "message_end": {
35696
+ handleMessageEnd(event);
35697
+ break;
35698
+ }
35695
35699
  case "agent_end": {
35696
35700
  onDone();
35697
35701
  break;
35698
35702
  }
35699
35703
  }
35700
35704
  }
35705
+ function handleMessageEnd(event) {
35706
+ const message = event.message;
35707
+ if (!message) {
35708
+ return;
35709
+ }
35710
+ const stopReason = message.stopReason;
35711
+ if (stopReason !== "error" && stopReason !== "aborted") {
35712
+ return;
35713
+ }
35714
+ onError(extractAssistantEventErrorMessage(message));
35715
+ }
35701
35716
  function handleMessageUpdate(event) {
35702
35717
  const assistantEvent = event.assistantMessageEvent;
35703
35718
  if (!assistantEvent) {
@@ -45644,6 +45659,35 @@ async function createAgentServer(params) {
45644
45659
  return c.json({ error: message }, 500);
45645
45660
  }
45646
45661
  });
45662
+ app.delete("/api/sessions/:sessionId", async (c) => {
45663
+ const sessionId = c.req.param("sessionId");
45664
+ try {
45665
+ const activeId = activeSession.id?.trim();
45666
+ if (activeId && activeId === sessionId) {
45667
+ return c.json({
45668
+ error: "Cannot delete the active session. Create or switch to a different session first."
45669
+ }, 409);
45670
+ }
45671
+ const sessions = await sessionManager.list();
45672
+ const match2 = sessions.find((s) => s.id === sessionId);
45673
+ if (!match2) {
45674
+ return c.json({ error: "Session not found" }, 404);
45675
+ }
45676
+ if (match2.path) {
45677
+ await (0, import_promises18.rm)(match2.path, { force: true });
45678
+ }
45679
+ const sessionConfigPath = (0, import_node_path22.join)(
45680
+ resolveDocyrusTrackedSessionConfigRootPath(context.cwd),
45681
+ `${sessionId}.json`
45682
+ );
45683
+ await (0, import_promises18.rm)(sessionConfigPath, { force: true }).catch(() => {
45684
+ });
45685
+ return c.body(null, 204);
45686
+ } catch (error48) {
45687
+ const message = error48 instanceof Error ? error48.message : String(error48);
45688
+ return c.json({ error: message }, 500);
45689
+ }
45690
+ });
45647
45691
  app.get("/api/sessions/:sessionId/messages", async (c) => {
45648
45692
  const sessionId = c.req.param("sessionId");
45649
45693
  try {
@@ -47372,6 +47416,8 @@ async function createAgentServer(params) {
47372
47416
  process.stderr.write(` GET /api/sessions \u2014 list sessions
47373
47417
  `);
47374
47418
  process.stderr.write(` POST /api/sessions \u2014 create a new session
47419
+ `);
47420
+ process.stderr.write(` DEL /api/sessions/:sessionId \u2014 delete a session
47375
47421
  `);
47376
47422
  process.stderr.write(` GET /api/sessions/:sessionId/messages \u2014 session messages
47377
47423
  `);
@@ -47990,7 +48036,7 @@ async function main() {
47990
48036
  process.env.PI_SKIP_VERSION_CHECK = "1";
47991
48037
  settingsManager.setQuietStartup(true);
47992
48038
  settingsManager.setCollapseChangelog(true);
47993
- settingsManager.setLastChangelogVersion(version2);
48039
+ settingsManager.setLastChangelogVersion(pi.VERSION || version2);
47994
48040
  }
47995
48041
  renderStartupSplash(version2);
47996
48042
  const spinner = createSpinner("Loading agent...");