opencode-mailbox 0.0.10 → 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 +23 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -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) => {
|