@ai-setting/roy-task-plugin 0.7.7 → 0.7.8
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/cli.js +33 -2
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1853,6 +1853,8 @@ async function adoptExistingCard(input) {
|
|
|
1853
1853
|
return;
|
|
1854
1854
|
if (record.status === "closed")
|
|
1855
1855
|
return;
|
|
1856
|
+
if (record.chatId !== input.chatId)
|
|
1857
|
+
return;
|
|
1856
1858
|
return { messageId: record.messageId, pinned: record.pinned };
|
|
1857
1859
|
} catch {
|
|
1858
1860
|
return;
|
|
@@ -2020,6 +2022,11 @@ function normaliseMcpToolName(tool) {
|
|
|
2020
2022
|
}
|
|
2021
2023
|
|
|
2022
2024
|
// ../../../packages/cli/src/daemon/mcp-notify.ts
|
|
2025
|
+
var MCP_NOTIFY_ENV_KEYS = [
|
|
2026
|
+
"ROY_TASK_NOTIFY_ENABLED",
|
|
2027
|
+
"ROY_TASK_NOTIFY_CHAT_ID",
|
|
2028
|
+
"ROY_TASK_NOTIFY_PROFILE"
|
|
2029
|
+
];
|
|
2023
2030
|
function buildMcpNotifyEnv(destination, options = {}) {
|
|
2024
2031
|
const env = {};
|
|
2025
2032
|
if (!destination.chatId)
|
|
@@ -2035,6 +2042,30 @@ function buildMcpNotifyEnv(destination, options = {}) {
|
|
|
2035
2042
|
function notifyEnvFromDispatch(plan, options = {}) {
|
|
2036
2043
|
return buildMcpNotifyEnv({ chatId: plan.chatId, profile: plan.profile }, options);
|
|
2037
2044
|
}
|
|
2045
|
+
function mergeNotifyEnv(base, notify) {
|
|
2046
|
+
const merged = { ...base };
|
|
2047
|
+
for (const key of MCP_NOTIFY_ENV_KEYS) {
|
|
2048
|
+
if (notify[key] !== undefined)
|
|
2049
|
+
merged[key] = notify[key];
|
|
2050
|
+
else
|
|
2051
|
+
delete merged[key];
|
|
2052
|
+
}
|
|
2053
|
+
if (merged["ROY_TASK_NOTIFY_PROFILE"] === undefined) {
|
|
2054
|
+
const profile = base["ROY_TASK_NOTIFY_PROFILE"];
|
|
2055
|
+
if (profile !== undefined)
|
|
2056
|
+
merged["ROY_TASK_NOTIFY_PROFILE"] = profile;
|
|
2057
|
+
}
|
|
2058
|
+
return merged;
|
|
2059
|
+
}
|
|
2060
|
+
function processNotifyEnv() {
|
|
2061
|
+
const env = {};
|
|
2062
|
+
for (const key of MCP_NOTIFY_ENV_KEYS) {
|
|
2063
|
+
const value = process.env[key];
|
|
2064
|
+
if (value)
|
|
2065
|
+
env[key] = value;
|
|
2066
|
+
}
|
|
2067
|
+
return env;
|
|
2068
|
+
}
|
|
2038
2069
|
|
|
2039
2070
|
// ../../../packages/cli/src/daemon/dispatcher.ts
|
|
2040
2071
|
function cardReport(handle) {
|
|
@@ -2165,7 +2196,7 @@ class Dispatcher {
|
|
|
2165
2196
|
agent: plan.agent,
|
|
2166
2197
|
sessionId: plan.sessionId,
|
|
2167
2198
|
onProgress,
|
|
2168
|
-
mcpEnv: notifyEnvFromDispatch({ chatId, profile }, this.notifyOptions)
|
|
2199
|
+
mcpEnv: mergeNotifyEnv(processNotifyEnv(), notifyEnvFromDispatch({ chatId, profile }, this.notifyOptions))
|
|
2169
2200
|
}), (r) => r.error);
|
|
2170
2201
|
const card = earlyCard ? await earlyCard : await this.trace("dispatch.openCard", () => this.openCard({
|
|
2171
2202
|
chatId,
|
|
@@ -3434,7 +3465,7 @@ function formatStatus(report) {
|
|
|
3434
3465
|
}
|
|
3435
3466
|
|
|
3436
3467
|
// ../../../packages/cli/src/main.ts
|
|
3437
|
-
var VERSION = "0.7.
|
|
3468
|
+
var VERSION = "0.7.8";
|
|
3438
3469
|
async function main(argv) {
|
|
3439
3470
|
const parsed = parseArgs(argv);
|
|
3440
3471
|
switch (parsed.command) {
|