opencode-mailbox 0.0.9 → 0.0.11
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/index.js +24 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -12817,7 +12817,7 @@ ${message.message}
|
|
|
12817
12817
|
injectedText += `---
|
|
12818
12818
|
[Instructions: ${instructions}]
|
|
12819
12819
|
|
|
12820
|
-
IMPORTANT: remember in order for a sender to see your response, you must send them a mail back
|
|
12820
|
+
IMPORTANT: remember in order for a sender to see your response, you must send them a mail back. Respond using markdown. Your markdown front-matter can contain a property "choices" which is an array of choices for the mail sender to choose from. These choices are optional and shouldn't alter your authentic personality in your responses.`;
|
|
12821
12821
|
try {
|
|
12822
12822
|
await client.session.prompt({
|
|
12823
12823
|
path: { id: sessionId },
|
|
@@ -12921,16 +12921,37 @@ var mailboxPlugin = async (ctx) => {
|
|
|
12921
12921
|
return `Stopped watching mail for: ${stoppedWatches.join(", ")}`;
|
|
12922
12922
|
}
|
|
12923
12923
|
});
|
|
12924
|
+
const checkMailboxWatchStatusTool = tool3({
|
|
12925
|
+
description: "Check the watch status for a specific agent name (recipient). Returns whether the agent is being watched and how many sessions are watching it.",
|
|
12926
|
+
args: {
|
|
12927
|
+
name: z.string().describe("Name of the agent/recipient to check watch status for. Note: this does NOT have to be an email. It can just be a name (e.g. 'samus').")
|
|
12928
|
+
},
|
|
12929
|
+
async execute(args) {
|
|
12930
|
+
const name = args.name.toLowerCase();
|
|
12931
|
+
const watch = activeWatches.get(name);
|
|
12932
|
+
if (!watch) {
|
|
12933
|
+
return `No active watch found for "${args.name}"`;
|
|
12934
|
+
}
|
|
12935
|
+
let sessionCount = 0;
|
|
12936
|
+
for (const [, recipients] of watchesBySession) {
|
|
12937
|
+
if (recipients.has(name)) {
|
|
12938
|
+
sessionCount++;
|
|
12939
|
+
}
|
|
12940
|
+
}
|
|
12941
|
+
return `"${args.name}" is being watched by ${watch.refCount} session reference(s) (${sessionCount} unique session(s)) with instructions: ${watch.instructions}`;
|
|
12942
|
+
}
|
|
12943
|
+
});
|
|
12924
12944
|
return {
|
|
12925
12945
|
tool: {
|
|
12926
12946
|
send_mail: sendMailTool,
|
|
12927
12947
|
watch_unread_mail: watchUnreadMailTool,
|
|
12928
|
-
stop_watching_mail: stopWatchingMailTool
|
|
12948
|
+
stop_watching_mail: stopWatchingMailTool,
|
|
12949
|
+
check_mailbox_watch_status: checkMailboxWatchStatusTool
|
|
12929
12950
|
},
|
|
12930
12951
|
config: async (input) => {
|
|
12931
12952
|
input.experimental ??= {};
|
|
12932
12953
|
input.experimental.primary_tools ??= [];
|
|
12933
|
-
input.experimental.primary_tools.push("send_mail", "watch_unread_mail", "stop_watching_mail");
|
|
12954
|
+
input.experimental.primary_tools.push("send_mail", "watch_unread_mail", "stop_watching_mail", "check_mailbox_watch_status");
|
|
12934
12955
|
},
|
|
12935
12956
|
hooks: {
|
|
12936
12957
|
"session.end": async (input) => {
|