@danypops/pi-papyrus 0.45.2 → 0.45.3
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.
|
@@ -16,6 +16,8 @@ import { readDiscussionExtra } from "@danypops/papyrus";
|
|
|
16
16
|
import type { PiVehicleInteractiveFollowUp } from "@danypops/vehicle-client-pi";
|
|
17
17
|
import { askQuestion } from "./discuss-ask-view.ts";
|
|
18
18
|
|
|
19
|
+
const LIVE_REPLY_PERMISSIONS = ["discuss:read", "discuss:write"] as const;
|
|
20
|
+
|
|
19
21
|
export const discussLiveFollowUp: PiVehicleInteractiveFollowUp = async (request, output, client) => {
|
|
20
22
|
const live = (request.input as { live?: unknown } | undefined)?.live === true;
|
|
21
23
|
if (!live || !request.context.hasUI) return undefined;
|
|
@@ -52,13 +54,22 @@ export const discussLiveFollowUp: PiVehicleInteractiveFollowUp = async (request,
|
|
|
52
54
|
});
|
|
53
55
|
if (!answer) return undefined; // canceled, or no UI capable of answering -- default content/details stand
|
|
54
56
|
|
|
55
|
-
const answered = (await client.invoke(
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
57
|
+
const answered = (await client.invoke(
|
|
58
|
+
"discuss.reply",
|
|
59
|
+
1,
|
|
60
|
+
{
|
|
61
|
+
id: result.discussion.id,
|
|
62
|
+
actor: "human",
|
|
63
|
+
content: answer.content,
|
|
64
|
+
...(answer.selected ? { selected: answer.selected } : {}),
|
|
65
|
+
source: "discuss-live",
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
permissions: LIVE_REPLY_PERMISSIONS,
|
|
69
|
+
principal: { id: "pi-papyrus" },
|
|
70
|
+
signal: request.signal,
|
|
71
|
+
},
|
|
72
|
+
)) as DiscussionAndRounds;
|
|
62
73
|
return {
|
|
63
74
|
content: [{ type: "text", text: `"${answered.discussion.title}": ${answer.content}` }],
|
|
64
75
|
output: answered,
|
package/package.json
CHANGED