negotium 0.6.4 → 0.6.5

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/main.js CHANGED
@@ -3674,7 +3674,7 @@ var exports_version = {};
3674
3674
  __export(exports_version, {
3675
3675
  NEGOTIUM_VERSION: () => NEGOTIUM_VERSION
3676
3676
  });
3677
- var NEGOTIUM_VERSION = "0.6.4";
3677
+ var NEGOTIUM_VERSION = "0.6.5";
3678
3678
 
3679
3679
  // ../../packages/core/src/agents/codex-native-multi-agent.ts
3680
3680
  import { spawn as spawn2 } from "child_process";
@@ -24094,6 +24094,7 @@ __export(exports_node_host, {
24094
24094
  startBashrsCompletionsWorker: () => startBashrsCompletionsWorker,
24095
24095
  startAskUserQuestionGateOwner: () => startAskUserQuestionGateOwner,
24096
24096
  startAiTurn: () => startAiTurn,
24097
+ softDeleteApiMessage: () => softDeleteApiMessage,
24097
24098
  setRuntimeMcpPort: () => setRuntimeMcpPort,
24098
24099
  setNodeMcpServers: () => setNodeMcpServers,
24099
24100
  setGlobalAiName: () => setGlobalAiName,
@@ -32528,6 +32529,7 @@ function createNodeControlHandler(options) {
32528
32529
  "turn-events-sse-resume",
32529
32530
  "canonical-topic-read",
32530
32531
  "canonical-message-read",
32532
+ "canonical-message-delete",
32531
32533
  "canonical-topic-usage",
32532
32534
  "canonical-file-read",
32533
32535
  "canonical-visual-read",
@@ -32812,6 +32814,36 @@ function createNodeControlHandler(options) {
32812
32814
  });
32813
32815
  return Response.json({ ok: true, v: NODE_RUNTIME_CONTRACT_VERSION, ...result });
32814
32816
  }
32817
+ const runtimeMessageMatch = runtimePath.match(/^\/topics\/([^/]+)\/messages\/([^/]+)$/);
32818
+ if (runtimeMessageMatch && req.method === "DELETE") {
32819
+ const body = await bodyRecord(req);
32820
+ if (body.v !== NODE_RUNTIME_CONTRACT_VERSION)
32821
+ return jsonError(400, "Unsupported v");
32822
+ const topicId = decodeURIComponent(runtimeMessageMatch[1]);
32823
+ const messageId = decodeURIComponent(runtimeMessageMatch[2]);
32824
+ const topic = getTopic(topicId);
32825
+ if (!topic || !topicInRequestScope(req, topic))
32826
+ return jsonError(404, "Topic not found");
32827
+ const actorUserId = requiredText(body.actorUserId, "actorUserId");
32828
+ if (body.allowAdmin !== undefined && typeof body.allowAdmin !== "boolean") {
32829
+ return jsonError(400, "allowAdmin must be boolean");
32830
+ }
32831
+ const existing = getApiMessage(topicId, messageId);
32832
+ if (!existing || existing.deleted)
32833
+ return jsonError(404, "Message not found");
32834
+ if (existing.authorId !== actorUserId && body.allowAdmin !== true) {
32835
+ return jsonError(403, "Not allowed");
32836
+ }
32837
+ const message = softDeleteApiMessage(topicId, messageId);
32838
+ if (!message)
32839
+ return jsonError(404, "Message not found");
32840
+ WsHub.get().broadcastMessageUpdated(topicId, messageId, { deleted: true, text: "" });
32841
+ return Response.json({
32842
+ ok: true,
32843
+ v: NODE_RUNTIME_CONTRACT_VERSION,
32844
+ message
32845
+ });
32846
+ }
32815
32847
  if (req.method === "GET" && runtimePath === "/topics") {
32816
32848
  const topics = gatewayVisibleTopics(req);
32817
32849
  const previews = getLastMessagePreviews(topics.map((topic) => topic.id));
@@ -46582,6 +46614,8 @@ function allowedRuntimePath(path, method) {
46582
46614
  return /^\/topics\/[^/]+\/(abort|session\/(reset|compact))$/.test(path);
46583
46615
  }
46584
46616
  if (method === "DELETE" || method === "PATCH") {
46617
+ if (method === "DELETE" && /^\/topics\/[^/]+\/messages\/[^/]+$/.test(path))
46618
+ return true;
46585
46619
  return /^\/topics\/[^/]+$/.test(path) || /^\/cron\/jobs\/[^/]+$/.test(path);
46586
46620
  }
46587
46621
  return false;
@@ -48632,4 +48666,4 @@ switch (command) {
48632
48666
  }
48633
48667
  }
48634
48668
 
48635
- //# debugId=FFCB7D41CEEC0A6064756E2164756E21
48669
+ //# debugId=0FC049F7BD1544D864756E2164756E21