@ynhcj/xiaoyi-channel 0.0.184-beta → 0.0.186-beta

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.
@@ -4,7 +4,7 @@
4
4
  import https from 'https';
5
5
  import { URL } from 'url';
6
6
  import { getConfig } from './config.js';
7
- import { DEFAULT_HTTP_PORT, HTTP_STATUS_BAD_REQUEST, API_URL_SUFFIX } from './constants.js';
7
+ import { DEFAULT_HTTPS_PORT, HTTP_STATUS_BAD_REQUEST, API_URL_SUFFIX } from './constants.js';
8
8
  function buildHeadersForCelia(config, sessionId) {
9
9
  if (!config.uid || !config.apiKey || !config.skillId || !config.requestFrom) {
10
10
  throw new Error('[SENTINEL HOOK] Missing required configuration: uid, apiKey, skillId, or requestFrom is not defined');
@@ -22,7 +22,7 @@ function buildRequestOptions(url, headers, timeout) {
22
22
  const urlObj = new URL(url);
23
23
  return {
24
24
  hostname: urlObj.hostname,
25
- port: urlObj.port || DEFAULT_HTTP_PORT,
25
+ port: urlObj.port || DEFAULT_HTTPS_PORT,
26
26
  path: urlObj.pathname,
27
27
  method: "POST",
28
28
  headers: headers,
@@ -6,7 +6,7 @@ import path from 'path';
6
6
  import https from 'https';
7
7
  import { URL } from 'url';
8
8
  import { getConfig } from './config.js';
9
- import { DEFAULT_HTTP_PORT, DEFAULT_HTTPS_PORT, MAX_TIMES, CONNECT_TIMEOUT, READ_TIMEOUT, EXPIRE_TIME, OSMS_PREPARE_URL, OSMS_COMPLETE_URL, TEMPORARY_MATERIAL_PACKAGE, FILE_OWNER_UID, FILE_OWNER_TEAM_ID } from './constants.js';
9
+ import { DEFAULT_HTTPS_PORT, MAX_TIMES, CONNECT_TIMEOUT, READ_TIMEOUT, EXPIRE_TIME, OSMS_PREPARE_URL, OSMS_COMPLETE_URL, TEMPORARY_MATERIAL_PACKAGE, FILE_OWNER_UID, FILE_OWNER_TEAM_ID } from './constants.js';
10
10
  function buildOsmsHeaders(config, traceId) {
11
11
  return {
12
12
  'content-type': 'application/json',
@@ -22,7 +22,7 @@ function httpRequest(url, method, headers, body, timeout) {
22
22
  const urlObj = new URL(url);
23
23
  const options = {
24
24
  hostname: urlObj.hostname,
25
- port: urlObj.port || DEFAULT_HTTP_PORT,
25
+ port: urlObj.port || DEFAULT_HTTPS_PORT,
26
26
  path: urlObj.pathname + urlObj.search,
27
27
  method: method,
28
28
  headers: headers,
@@ -430,7 +430,6 @@ export function createXYReplyDispatcher(params) {
430
430
  if (text.length > 0) {
431
431
  accumulatedText += text;
432
432
  hasSentResponse = true;
433
- scopedLog().log(`[PARTIAL-REPLY] Sending A2A text: "${text}"`);
434
433
  await sendA2AResponse({
435
434
  config,
436
435
  sessionId,
@@ -1,4 +1,4 @@
1
1
  /** Known device type enum. */
2
- export declare const DEVICE_TYPES: readonly ["car", "2in1", "phone", "web"];
2
+ export declare const DEVICE_TYPES: readonly ["car", "2in1", "phone", "web", "pad"];
3
3
  export type DeviceType = (typeof DEVICE_TYPES)[number];
4
4
  export declare function filterToolsByDevice(tools: any[], deviceType?: string): any[];
@@ -4,7 +4,7 @@
4
4
  // - denylist: listed tools are blocked, everything else is available (used for permissive devices like pc)
5
5
  // Tools NOT listed in any device entry → available to all devices (no restriction).
6
6
  /** Known device type enum. */
7
- export const DEVICE_TYPES = ["car", "2in1", "phone", "web"];
7
+ export const DEVICE_TYPES = ["car", "2in1", "phone", "web", "pad"];
8
8
  const DEVICE_TOOL_POLICY = {
9
9
  "2in1": {
10
10
  allowlist: false,
@@ -17,6 +17,12 @@ const DEVICE_TOOL_POLICY = {
17
17
  "get_contact_tool_schema",
18
18
  ],
19
19
  },
20
+ "pad": {
21
+ allowlist: false,
22
+ tools: [
23
+ "xiaoyi_gui_agent",
24
+ ],
25
+ },
20
26
  "web": {
21
27
  allowlist: true,
22
28
  tools: [
@@ -75,6 +75,23 @@ export function createModifyAlarmTool(ctx) {
75
75
  required: ["entityId"],
76
76
  },
77
77
  async execute(toolCallId, params) {
78
+ // Coerce numeric string params to actual numbers
79
+ // The model may produce "1" instead of 1, which would fail typeof checks
80
+ const numericParams = [
81
+ "alarmState",
82
+ "alarmSnoozeDuration",
83
+ "alarmSnoozeTotal",
84
+ "alarmRingDuration",
85
+ "daysOfWakeType",
86
+ ];
87
+ for (const key of numericParams) {
88
+ if (typeof params[key] === "string") {
89
+ const num = Number(params[key]);
90
+ if (!isNaN(num)) {
91
+ params[key] = num;
92
+ }
93
+ }
94
+ }
78
95
  // ===== Validate required parameter: entityId =====
79
96
  if (!params.entityId || typeof params.entityId !== "string") {
80
97
  throw new Error("Missing required parameter: entityId must be a string obtained from search_alarm or create_alarm");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ynhcj/xiaoyi-channel",
3
- "version": "0.0.184-beta",
3
+ "version": "0.0.186-beta",
4
4
  "description": "OpenClaw Xiaoyi Channel plugin - Xiaoyi A2A protocol integration",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",