@ynhcj/xiaoyi-channel 1.1.29 → 1.1.31
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 {
|
|
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 ||
|
|
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 {
|
|
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 ||
|
|
25
|
+
port: urlObj.port || DEFAULT_HTTPS_PORT,
|
|
26
26
|
path: urlObj.pathname + urlObj.search,
|
|
27
27
|
method: method,
|
|
28
28
|
headers: headers,
|
|
@@ -16,7 +16,6 @@ import { createGetAlarmToolSchemaTool } from "./get-alarm-tool-schema.js";
|
|
|
16
16
|
import { createGetCollectionToolSchemaTool } from "./get-collection-tool-schema.js";
|
|
17
17
|
// import { createGetEmailToolSchemaTool } from "./get-email-tool-schema.js";
|
|
18
18
|
import { createLoginTokenTool } from "./login-token-tool.js";
|
|
19
|
-
import { createAgentAsSkillTool } from "./agent-as-skill-tool.js";
|
|
20
19
|
import { logger } from "../utils/logger.js";
|
|
21
20
|
/**
|
|
22
21
|
* Create all XY channel tools for the given session context.
|
|
@@ -52,7 +51,7 @@ export function createAllTools(ctx) {
|
|
|
52
51
|
timestampToUtc8Tool,
|
|
53
52
|
createSaveSelfEvolutionSkillTool(ctx),
|
|
54
53
|
createLoginTokenTool(ctx),
|
|
55
|
-
createAgentAsSkillTool(ctx),
|
|
54
|
+
// createAgentAsSkillTool(ctx),
|
|
56
55
|
// createCheckPluginPrivilegeTool(ctx),
|
|
57
56
|
];
|
|
58
57
|
}
|
|
@@ -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,
|
|
@@ -15,6 +15,13 @@ const DEVICE_TOOL_POLICY = {
|
|
|
15
15
|
"search_message",
|
|
16
16
|
"search_contact",
|
|
17
17
|
"get_contact_tool_schema",
|
|
18
|
+
"send_html_card"
|
|
19
|
+
],
|
|
20
|
+
},
|
|
21
|
+
"pad": {
|
|
22
|
+
allowlist: false,
|
|
23
|
+
tools: [
|
|
24
|
+
"xiaoyi_gui_agent"
|
|
18
25
|
],
|
|
19
26
|
},
|
|
20
27
|
"web": {
|