@honor-claw/yoyo 2026.9.4-beta.1 → 2026.9.4-beta.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.
@@ -39,8 +39,8 @@ async function u(t, r) {
39
39
  }
40
40
  let u = [];
41
41
  for (let e of l) {
42
- if (!await p(e, t, i)) continue;
43
- let n = m(e);
42
+ if (!await m(e, t, i)) continue;
43
+ let n = h(e);
44
44
  n && u.push(n);
45
45
  }
46
46
  return a.info("cron list for chat", {
@@ -79,20 +79,37 @@ async function f(t) {
79
79
  ok: !0,
80
80
  removed: (await n.remove(t))?.removed === !0
81
81
  };
82
- } catch (n) {
83
- return a.error("cron remove failed", n, { jobId: t }), {
82
+ } catch (r) {
83
+ return await p(n, t) === !1 ? (a.warn("cron remove errored but job no longer exists, treated as success", {
84
+ jobId: t,
85
+ error: e(r)
86
+ }), {
87
+ ok: !0,
88
+ removed: !1
89
+ }) : (a.error("cron remove failed", r, { jobId: t }), {
84
90
  ok: !1,
85
- error: e(n)
86
- };
91
+ error: e(r)
92
+ });
87
93
  }
88
94
  }
89
- async function p(e, t, n) {
95
+ async function p(t, n) {
96
+ try {
97
+ return (await t.list({ includeDisabled: !0 })).some((e) => e?.id === n);
98
+ } catch (t) {
99
+ a.warn("cron job presence lookup failed", {
100
+ jobId: n,
101
+ error: e(t)
102
+ });
103
+ return;
104
+ }
105
+ }
106
+ async function m(e, t, n) {
90
107
  let i = e.delivery?.to;
91
108
  return typeof i != "string" || i.length === 0 ? !1 : await r(i, t) === n;
92
109
  }
93
- function m(e) {
110
+ function h(e) {
94
111
  if (e.enabled !== !0) return;
95
- let t = h(e.schedule);
112
+ let t = g(e.schedule);
96
113
  if (!t) return;
97
114
  let n = e.state, r = n?.lastRunAtMs;
98
115
  if (r != null) {
@@ -105,11 +122,11 @@ function m(e) {
105
122
  ...e.description ? { description: e.description } : {},
106
123
  schedule: t,
107
124
  nextRunAtMs: n?.nextRunAtMs ?? null,
108
- ...n?.lastRunStatus === void 0 ? {} : { lastRunStatus: g(n.lastRunStatus) },
125
+ ...n?.lastRunStatus === void 0 ? {} : { lastRunStatus: _(n.lastRunStatus) },
109
126
  ...r === void 0 ? {} : { lastRunAtMs: r }
110
127
  };
111
128
  }
112
- function h(e) {
129
+ function g(e) {
113
130
  switch (e?.kind) {
114
131
  case "cron": return {
115
132
  kind: "cron",
@@ -129,7 +146,7 @@ function h(e) {
129
146
  default: return;
130
147
  }
131
148
  }
132
- function g(e) {
149
+ function _(e) {
133
150
  switch (e) {
134
151
  case "ok": return i.Success;
135
152
  case "error": return i.Failed;
@@ -1,19 +1,28 @@
1
- import "../../consts.mjs";
2
- import { looksLikeChatId as e } from "../../messaging/target/chat-id.mjs";
3
- import { readChatIdFromSessionKey as t } from "../../messaging/target/address.mjs";
1
+ import { clawLogger as e } from "../../utils/claw-logger.mjs";
2
+ import { looksLikeChatId as t } from "../../messaging/target/chat-id.mjs";
3
+ import { readChatIdFromSessionKey as n } from "../../messaging/target/address.mjs";
4
4
  import "../../messaging/target/index.mjs";
5
5
  //#region src/core/prompt/cron.ts
6
- function n(t) {
7
- return t.chatId && e(t.chatId) ? t.chatId : void 0;
6
+ var r = e("cron");
7
+ function i(e) {
8
+ return e.chatId && t(e.chatId) ? e.chatId : void 0;
8
9
  }
9
- function r(e) {
10
- if (!e || t(e.sessionKey)) return {};
11
- let r = e.channel === "yoyo" ? n(e) : void 0;
12
- return r ? { prependSystemContext: `## 定时任务投递目标
13
-
14
- 当前对话来自 YOYO 手机侧会话(chatId: ${r})。在本会话中创建定时任务时:
15
- - 创建方式优先使用 automations 或 cron 工具;两者都不可用时再使用 openclaw cron 命令行。
16
- - 无论用哪种方式创建,delivery 必须配置为 {mode:"announce", channel:"yoyo", to:"chat:${r}"},确保任务执行结果能自动推送回本会话对应的手机侧。` } : {};
10
+ function a(e) {
11
+ let t = e ? n(e.sessionKey) : void 0, a = t || (e ? i(e) : void 0);
12
+ return !e || !a ? (r.debug("cron delivery prompt skipped: no resolvable chatId", {
13
+ sessionKey: e?.sessionKey ?? null,
14
+ turnChatId: e?.chatId ?? null
15
+ }), {}) : (r.info("cron delivery prompt injected", {
16
+ sessionKey: e.sessionKey ?? null,
17
+ chatId: a,
18
+ source: t ? "sessionKey" : "turn"
19
+ }), { prependSystemContext: `# 定时任务投递目标
20
+ 当前对话来自 YOYO 手机侧会话(chatId: ${a}),在本会话中创建定时任务时:
21
+ - 创建方式优先使用 automations 或 cron 工具;两者都不可用时再考虑使用 openclaw cron 命令行,尽量不要使用 subagent。
22
+ - 无论用哪种方式创建,delivery 必须完整包含以下三个字段,缺一不可:
23
+ {mode:"announce", channel:"yoyo", to:"chat:${a}"}
24
+ - 特别注意 to 字段必须显式写为 "chat:${a}"。即使工具或命令行看起来能自动推断投递目标,也不省略 to —— 缺少 to 的任务执行结果无法推送回本会话。
25
+ - 当用户显式指定投递给其他手机、设备或者 channel 时,可以不按当前规则处理,to 也可以为目标设备对应的 device:{deviceId}` });
17
26
  }
18
27
  //#endregion
19
- export { r as resolveCronDeliveryPromptContribution };
28
+ export { a as resolveCronDeliveryPromptContribution };
@@ -30,19 +30,23 @@ async function p(e) {
30
30
  count: Object.keys(M).length,
31
31
  mapping: Object.entries(M).map(([e, t]) => `${e} -> ${t}`).join(", ")
32
32
  });
33
- let P = c(t), F = P.changed;
34
- if (!g && !_ && !O && !j && !N && !F && !y) return;
35
- let I = { ...t.plugins };
36
- g && delete I.allow;
37
- let L = {
33
+ let P = c(t), F = P.changed, I = t.plugins?.entries?.[e]?.hooks?.allowConversationAccess !== !0;
34
+ if (!g && !_ && !O && !j && !N && !F && !y && !I) return;
35
+ let L = { ...t.plugins };
36
+ g && delete L.allow;
37
+ let R = {
38
38
  ...t,
39
39
  plugins: {
40
- ...I,
40
+ ...L,
41
41
  entries: {
42
42
  ...t.plugins?.entries,
43
43
  [e]: {
44
44
  ...t.plugins?.entries?.[e],
45
45
  enabled: !0,
46
+ ...I ? { hooks: {
47
+ ...t.plugins?.entries?.[e]?.hooks,
48
+ allowConversationAccess: !0
49
+ } } : {},
46
50
  config: A
47
51
  }
48
52
  }
@@ -52,11 +56,11 @@ async function p(e) {
52
56
  alsoAllow: b
53
57
  } } : {}
54
58
  };
55
- F && (L = {
56
- ...L,
59
+ F && (R = {
60
+ ...R,
57
61
  agents: P.agents
58
- }, d.info("refreshed agents.defaults values", { changes: P.changes.join(", ") })), _ && (L = {
59
- ...L,
62
+ }, d.info("refreshed agents.defaults values", { changes: P.changes.join(", ") })), _ && (R = {
63
+ ...R,
60
64
  skills: {
61
65
  ...r,
62
66
  load: {
@@ -64,7 +68,7 @@ async function p(e) {
64
68
  watch: !1
65
69
  }
66
70
  }
67
- }, d.info("disabled skills.load.watch for plugin")), N && (L = u(L, M), d.info("provider renaming completed")), await a(L);
71
+ }, d.info("disabled skills.load.watch for plugin")), N && (R = u(R, M), d.info("provider renaming completed")), await a(R);
68
72
  } catch (e) {
69
73
  throw t(e, "failed to initialize plugin config");
70
74
  }
@@ -4,7 +4,8 @@
4
4
  "skills": ["./skills"],
5
5
  "enabledByDefault": true,
6
6
  "activation": {
7
- "onStartup": true
7
+ "onStartup": true,
8
+ "onCapabilities": ["hook"]
8
9
  },
9
10
  "contracts": {
10
11
  "tools": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@honor-claw/yoyo",
3
- "version": "2026.9.4-beta.1",
3
+ "version": "2026.9.4-beta.3",
4
4
  "description": "OpenClaw Honor Yoyo connection plugin",
5
5
  "keywords": [
6
6
  "ai",