@honor-claw/yoyo 1.3.0-beta.9 → 1.4.0-alpha.1

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.
@@ -5,7 +5,12 @@ import { wrapError as r } from "../../utils/error.mjs";
5
5
  import { useClawLogger as i } from "../../utils/logger.mjs";
6
6
  import { detectProvidersToRename as a, updateProviderReferences as o } from "./provider.mjs";
7
7
  //#region src/modules/configs/config-manager.ts
8
- var s = "yoyo", c = { watch: !0 }, l = 250, u = /* @__PURE__ */ "alarm.create,alarm.delete,alarm.disable,alarm.enable,alarm.query,alarm.update,app.close,app.open,call.phone,call.search,capture-screenshot,contact.search,file-upload,hotspot,local-search,message.search,message.send,mobile-data,no-disturb,quiet-mode,ringing-mode,schedule.create,schedule.delete,schedule.search,schedule.update,screen-record,vibration-mode,volume.operate,wlan,bluetooth,location-service,nfc,usb-shared-network,eyecomfort,status-bar-show,brightness,autoscreen-onnotice,dark-mode,device-operation,camera,app.uninstall,audio-record,battery,gui.create,gui.pause,gui.terminate,mcp.tool.call".split(","), d = class {
8
+ var s = "yoyo", c = { watch: !0 }, l = 250, u = /* @__PURE__ */ "alarm.create,alarm.delete,alarm.disable,alarm.enable,alarm.query,alarm.update,app.close,app.open,call.phone,call.search,capture-screenshot,contact.search,file-upload,hotspot,local-search,message.search,message.send,mobile-data,no-disturb,quiet-mode,ringing-mode,schedule.create,schedule.delete,schedule.search,schedule.update,screen-record,vibration-mode,volume.operate,wlan,bluetooth,location-service,nfc,usb-shared-network,eyecomfort,status-bar-show,brightness,autoscreen-onnotice,dark-mode,device-operation,camera,app.uninstall,audio-record,battery,gui.create,gui.pause,gui.terminate,mcp.tool.call".split(","), d = {
9
+ input: 0,
10
+ output: 0,
11
+ cacheRead: 0,
12
+ cacheWrite: 0
13
+ }, f = class {
9
14
  loadConfig() {
10
15
  try {
11
16
  return t().config.loadConfig();
@@ -246,30 +251,30 @@ var s = "yoyo", c = { watch: !0 }, l = 250, u = /* @__PURE__ */ "alarm.create,al
246
251
  }
247
252
  async initializePluginConfig(t) {
248
253
  try {
249
- let r = this.loadConfig(), s = r.plugins?.allow || [], d = s.includes(t) ? s : [...s, t], f = r.gateway?.nodes?.allowCommands || [], p = Array.from(new Set([...f, ...u])), m = r.skills || {}, h = m.load || {}, g = h.watch === c.watch && h.watchDebounceMs !== void 0 ? h : {
250
- ...h,
254
+ let r = this.loadConfig(), s = r.plugins?.allow || [], f = s.includes(t) ? s : [...s, t], p = r.gateway?.nodes?.allowCommands || [], m = Array.from(new Set([...p, ...u])), h = r.skills || {}, g = h.load || {}, _ = g.watch === c.watch && g.watchDebounceMs !== void 0 ? g : {
255
+ ...g,
251
256
  ...c,
252
- watchDebounceMs: h.watchDebounceMs ?? l
253
- }, _ = r.plugins?.entries?.[t]?.config?.envInfo, v = r.plugins?.entries?.[t]?.config?.env, y = !!(_?.env || v), b = n(), x = !!_?.env && _.source === "env", S = !_?.env && !!v || x && b && _.env !== b, C = !y || S, w = {
254
- env: b || v || (e() ? "test" : "production"),
257
+ watchDebounceMs: g.watchDebounceMs ?? l
258
+ }, v = r.plugins?.entries?.[t]?.config?.envInfo, y = r.plugins?.entries?.[t]?.config?.env, b = !!(v?.env || y), x = n(), S = !!v?.env && v.source === "env", C = !v?.env && !!y || S && x && v.env !== x, w = !b || C, T = {
259
+ env: x || y || (e() ? "test" : "production"),
255
260
  source: "env"
256
- }, T = r.plugins?.entries?.[t]?.config || {}, E = C ? {
257
- ...T,
258
- envInfo: w,
261
+ }, E = r.plugins?.entries?.[t]?.config || {}, D = w ? {
262
+ ...E,
263
+ envInfo: T,
259
264
  env: void 0
260
- } : T, D = a(r);
261
- Object.keys(D).length > 0 && i().info(`[claw-configs] Found ${Object.keys(D).length} providers to rename: ${Object.entries(D).map(([e, t]) => `${e} -> ${t}`).join(", ")}`);
262
- let O = {
265
+ } : E, O = a(r);
266
+ Object.keys(O).length > 0 && i().info(`[claw-configs] Found ${Object.keys(O).length} providers to rename: ${Object.entries(O).map(([e, t]) => `${e} -> ${t}`).join(", ")}`);
267
+ let k = {
263
268
  ...r,
264
269
  plugins: {
265
270
  ...r.plugins,
266
- allow: d,
271
+ allow: f,
267
272
  entries: {
268
273
  ...r.plugins?.entries,
269
274
  [t]: {
270
275
  ...r.plugins?.entries?.[t],
271
276
  enabled: !0,
272
- config: E
277
+ config: D
273
278
  }
274
279
  }
275
280
  },
@@ -277,22 +282,25 @@ var s = "yoyo", c = { watch: !0 }, l = 250, u = /* @__PURE__ */ "alarm.create,al
277
282
  ...r.gateway,
278
283
  nodes: {
279
284
  ...r.gateway?.nodes,
280
- allowCommands: p
285
+ allowCommands: m
281
286
  }
282
287
  },
283
288
  skills: {
284
- ...m,
285
- load: g
289
+ ...h,
290
+ load: _
286
291
  }
287
292
  };
288
- Object.keys(D).length > 0 && (O = o(O, D), i().info("[claw-configs] Provider renaming completed")), await this.saveConfig(O);
293
+ if (Object.keys(O).length > 0 && (k = o(k, O), i().info("[claw-configs] Provider renaming completed")), k.models?.providers) {
294
+ for (let e of Object.values(k.models.providers)) if (Array.isArray(e.models)) for (let t of e.models) t.cost ||= d;
295
+ }
296
+ await this.saveConfig(k);
289
297
  } catch (e) {
290
298
  throw r(e, "failed to initialize plugin config");
291
299
  }
292
300
  }
293
- }, f = null;
294
- function p() {
295
- return f ||= new d(), f;
301
+ }, p = null;
302
+ function m() {
303
+ return p ||= new f(), p;
296
304
  }
297
305
  //#endregion
298
- export { d as ConfigManager, p as getConfigManager };
306
+ export { f as ConfigManager, m as getConfigManager };
@@ -1,7 +1,7 @@
1
1
  //#region src/utils/version.ts
2
2
  var e = null;
3
3
  function t() {
4
- return e === null && (e = "1.3.0-beta.9".includes("beta") || "1.3.0-beta.9".includes("alpha")), !!e;
4
+ return e === null && (e = "1.4.0-alpha.1".includes("beta") || "1.4.0-alpha.1".includes("alpha")), !!e;
5
5
  }
6
6
  //#endregion
7
7
  export { t as isBetaVersion };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@honor-claw/yoyo",
3
- "version": "1.3.0-beta.9",
3
+ "version": "1.4.0-alpha.1",
4
4
  "description": "OpenClaw Honor Yoyo connection plugin",
5
5
  "keywords": [
6
6
  "ai",
@@ -145,8 +145,7 @@ metadata: { "openclaw": { "emoji": "📱", "always": true } }
145
145
 
146
146
  | 工具名称 | 工具说明 | 支持的设备ID列表 (nodeID, 逗号分隔) |
147
147
  | ------- | ------- | --------------- |
148
- <!-- yoyo-mcp-tools:start -->
149
- <!-- yoyo-mcp-tools:end -->
148
+ {{full-mcp-tool-list}}
150
149
 
151
150
  **当工具支持的设备ID列表中包含当前设备ID时,该工具才可被调用。**
152
151