@plolink/sdk 0.0.4 → 0.0.6
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/README.md +40 -26
- package/dist/{chunk-4H4RACSE.js → chunk-LHNCGCWW.js} +137 -3
- package/dist/chunk-LHNCGCWW.js.map +1 -0
- package/dist/{chunk-NS3DJP2O.cjs → chunk-WFBN23AH.cjs} +141 -2
- package/dist/chunk-WFBN23AH.cjs.map +1 -0
- package/dist/client-BuUQTr8R.d.cts +766 -0
- package/dist/client-D2HlV7GT.d.ts +766 -0
- package/dist/common/index.cjs +18 -14
- package/dist/common/index.d.cts +126 -1
- package/dist/common/index.d.ts +126 -1
- package/dist/common/index.js +1 -1
- package/dist/index.cjs +647 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +410 -3
- package/dist/index.d.ts +410 -3
- package/dist/index.js +631 -3
- package/dist/index.js.map +1 -1
- package/dist/modules/billing/index.cjs +1 -1
- package/dist/modules/billing/index.d.cts +1 -1
- package/dist/modules/billing/index.d.ts +1 -1
- package/dist/modules/billing/index.js +1 -1
- package/dist/modules/rbac/index.d.cts +1 -1
- package/dist/modules/rbac/index.d.ts +1 -1
- package/dist/modules/team/index.d.cts +1 -1
- package/dist/modules/team/index.d.ts +1 -1
- package/dist/modules/video-psych-analysis/index.cjs +436 -0
- package/dist/modules/video-psych-analysis/index.cjs.map +1 -0
- package/dist/modules/video-psych-analysis/index.d.cts +700 -0
- package/dist/modules/video-psych-analysis/index.d.ts +700 -0
- package/dist/modules/video-psych-analysis/index.js +434 -0
- package/dist/modules/video-psych-analysis/index.js.map +1 -0
- package/dist/modules/virtual-account/index.d.cts +1 -1
- package/dist/modules/virtual-account/index.d.ts +1 -1
- package/package.json +6 -16
- package/dist/chunk-4H4RACSE.js.map +0 -1
- package/dist/chunk-NS3DJP2O.cjs.map +0 -1
- package/dist/client-CAjIQKPm.d.cts +0 -193
- package/dist/client-CwNikk7i.d.ts +0 -193
- package/dist/modules/agent/index.cjs +0 -21
- package/dist/modules/agent/index.cjs.map +0 -1
- package/dist/modules/agent/index.d.cts +0 -71
- package/dist/modules/agent/index.d.ts +0 -71
- package/dist/modules/agent/index.js +0 -19
- package/dist/modules/agent/index.js.map +0 -1
- package/dist/modules/chat/index.cjs +0 -20
- package/dist/modules/chat/index.cjs.map +0 -1
- package/dist/modules/chat/index.d.cts +0 -68
- package/dist/modules/chat/index.d.ts +0 -68
- package/dist/modules/chat/index.js +0 -18
- package/dist/modules/chat/index.js.map +0 -1
- package/dist/modules/psych/index.cjs +0 -20
- package/dist/modules/psych/index.cjs.map +0 -1
- package/dist/modules/psych/index.d.cts +0 -69
- package/dist/modules/psych/index.d.ts +0 -69
- package/dist/modules/psych/index.js +0 -18
- package/dist/modules/psych/index.js.map +0 -1
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
import { b as LoggerFunction, S as SDKConfig } from './core-77EbLgbp.cjs';
|
|
2
|
-
import { AxiosInstance, AxiosRequestConfig } from 'axios';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* SDK 内部日志器
|
|
6
|
-
*
|
|
7
|
-
* @description
|
|
8
|
-
* 提供统一的日志接口,支持用户自定义日志钩子。
|
|
9
|
-
* 默认使用 console 输出,用户可以通过配置自定义 logger 函数来集成 Sentry 等监控系统。
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```typescript
|
|
13
|
-
* const logger = new InternalLogger((level, message, data) => {
|
|
14
|
-
* // 自定义日志处理,例如发送到 Sentry
|
|
15
|
-
* console.log(`[${level}] ${message}`, data);
|
|
16
|
-
* });
|
|
17
|
-
*
|
|
18
|
-
* logger.info('Operation started', { userId: '123' });
|
|
19
|
-
* logger.error('Operation failed', { error: 'Network timeout' });
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
declare class InternalLogger {
|
|
23
|
-
/**
|
|
24
|
-
* 用户自定义的日志钩子函数
|
|
25
|
-
*/
|
|
26
|
-
private readonly userLogger?;
|
|
27
|
-
/**
|
|
28
|
-
* 是否启用日志输出
|
|
29
|
-
* 可以通过环境变量 PLOLINK_SDK_DEBUG 控制
|
|
30
|
-
*/
|
|
31
|
-
private readonly isDebugEnabled;
|
|
32
|
-
/**
|
|
33
|
-
* 创建一个 InternalLogger 实例
|
|
34
|
-
*
|
|
35
|
-
* @param userLogger - 用户自定义的日志钩子函数
|
|
36
|
-
*/
|
|
37
|
-
constructor(userLogger?: LoggerFunction);
|
|
38
|
-
/**
|
|
39
|
-
* 记录信息级别日志
|
|
40
|
-
*
|
|
41
|
-
* @param message - 日志消息
|
|
42
|
-
* @param context - 附加上下文数据
|
|
43
|
-
*/
|
|
44
|
-
info(message: string, context?: unknown): void;
|
|
45
|
-
/**
|
|
46
|
-
* 记录警告级别日志
|
|
47
|
-
*
|
|
48
|
-
* @param message - 日志消息
|
|
49
|
-
* @param context - 附加上下文数据
|
|
50
|
-
*/
|
|
51
|
-
warn(message: string, context?: unknown): void;
|
|
52
|
-
/**
|
|
53
|
-
* 记录错误级别日志
|
|
54
|
-
*
|
|
55
|
-
* @param message - 日志消息
|
|
56
|
-
* @param context - 附加上下文数据
|
|
57
|
-
*/
|
|
58
|
-
error(message: string, context?: unknown): void;
|
|
59
|
-
/**
|
|
60
|
-
* 记录调试级别日志
|
|
61
|
-
* 只有在 debug 模式下才会输出
|
|
62
|
-
*
|
|
63
|
-
* @param message - 日志消息
|
|
64
|
-
* @param context - 附加上下文数据
|
|
65
|
-
*/
|
|
66
|
-
debug(message: string, context?: unknown): void;
|
|
67
|
-
/**
|
|
68
|
-
* 内部日志记录方法
|
|
69
|
-
*
|
|
70
|
-
* @param level - 日志级别
|
|
71
|
-
* @param message - 日志消息
|
|
72
|
-
* @param context - 附加上下文数据
|
|
73
|
-
*/
|
|
74
|
-
private log;
|
|
75
|
-
/**
|
|
76
|
-
* 创建一个带有固定上下文的子 logger
|
|
77
|
-
*
|
|
78
|
-
* @param context - 固定的上下文数据
|
|
79
|
-
* @returns 新的 logger 实例
|
|
80
|
-
*
|
|
81
|
-
* @example
|
|
82
|
-
* ```typescript
|
|
83
|
-
* const logger = new InternalLogger();
|
|
84
|
-
* const moduleLogger = logger.withContext({ module: 'billing' });
|
|
85
|
-
* moduleLogger.info('Payment processed'); // 日志会自动带上 module: 'billing'
|
|
86
|
-
* ```
|
|
87
|
-
*/
|
|
88
|
-
withContext(context: Record<string, unknown>): InternalLogger;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* 为 Axios 实例添加类型安全的请求方法
|
|
93
|
-
*
|
|
94
|
-
* @description
|
|
95
|
-
* 这些方法封装了 Axios 的原始方法,提供更好的类型推断。
|
|
96
|
-
*/
|
|
97
|
-
interface TypedAxiosInstance extends AxiosInstance {
|
|
98
|
-
get<T = unknown>(url: string, config?: AxiosRequestConfig): Promise<T>;
|
|
99
|
-
post<T = unknown>(url: string, data?: unknown, config?: AxiosRequestConfig): Promise<T>;
|
|
100
|
-
put<T = unknown>(url: string, data?: unknown, config?: AxiosRequestConfig): Promise<T>;
|
|
101
|
-
patch<T = unknown>(url: string, data?: unknown, config?: AxiosRequestConfig): Promise<T>;
|
|
102
|
-
delete<T = unknown>(url: string, config?: AxiosRequestConfig): Promise<T>;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Plolink SDK 客户端主类
|
|
107
|
-
*
|
|
108
|
-
* @description
|
|
109
|
-
* PlolinkClient 是 SDK 的核心类,负责:
|
|
110
|
-
* - 管理 SDK 配置(认证 Token、API 地址等)
|
|
111
|
-
* - 初始化 Axios 实例并配置拦截器
|
|
112
|
-
* - 提供统一的日志接口
|
|
113
|
-
* - 作为所有业务模块的基础依赖
|
|
114
|
-
*
|
|
115
|
-
* @example
|
|
116
|
-
* ```typescript
|
|
117
|
-
* // 使用 ApiKey
|
|
118
|
-
* const client = new PlolinkClient({
|
|
119
|
-
* token: 'sk-123456789',
|
|
120
|
-
* logger: (level, msg, data) => {
|
|
121
|
-
* console.log(`[${level}] ${msg}`, data);
|
|
122
|
-
* }
|
|
123
|
-
* });
|
|
124
|
-
*
|
|
125
|
-
* // 使用 SessionId (登录后获取)
|
|
126
|
-
* const client = new PlolinkClient({
|
|
127
|
-
* token: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
|
|
128
|
-
* baseUrl: 'https://api.plolink.com'
|
|
129
|
-
* });
|
|
130
|
-
* ```
|
|
131
|
-
*/
|
|
132
|
-
declare class PlolinkClient {
|
|
133
|
-
/**
|
|
134
|
-
* SDK 配置对象(已填充默认值)
|
|
135
|
-
*/
|
|
136
|
-
readonly config: Required<SDKConfig>;
|
|
137
|
-
/**
|
|
138
|
-
* Axios 实例,用于发起 HTTP 请求
|
|
139
|
-
*/
|
|
140
|
-
readonly axiosInstance: TypedAxiosInstance;
|
|
141
|
-
/**
|
|
142
|
-
* 内部日志记录器
|
|
143
|
-
*/
|
|
144
|
-
readonly logger: InternalLogger;
|
|
145
|
-
/**
|
|
146
|
-
* 创建一个 PlolinkClient 实例
|
|
147
|
-
*
|
|
148
|
-
* @param config - SDK 配置对象
|
|
149
|
-
* @throws {PlolinkError} 当配置验证失败时抛出
|
|
150
|
-
*
|
|
151
|
-
* @example
|
|
152
|
-
* ```typescript
|
|
153
|
-
* const client = new PlolinkClient({
|
|
154
|
-
* token: 'sk-your-api-key'
|
|
155
|
-
* });
|
|
156
|
-
* ```
|
|
157
|
-
*/
|
|
158
|
-
constructor(config: SDKConfig);
|
|
159
|
-
/**
|
|
160
|
-
* 验证 SDK 配置
|
|
161
|
-
*
|
|
162
|
-
* @param config - SDK 配置对象
|
|
163
|
-
* @throws {PlolinkError} 当配置不合法时抛出
|
|
164
|
-
* @private
|
|
165
|
-
*/
|
|
166
|
-
private validateConfig;
|
|
167
|
-
/**
|
|
168
|
-
* 获取当前 SDK 版本
|
|
169
|
-
*
|
|
170
|
-
* @returns SDK 版本号
|
|
171
|
-
*/
|
|
172
|
-
getVersion(): string;
|
|
173
|
-
/**
|
|
174
|
-
* 检查客户端健康状态
|
|
175
|
-
*
|
|
176
|
-
* @returns 健康状态信息
|
|
177
|
-
*
|
|
178
|
-
* @example
|
|
179
|
-
* ```typescript
|
|
180
|
-
* const health = client.healthCheck();
|
|
181
|
-
* console.log(health);
|
|
182
|
-
* // { status: 'ok', baseUrl: '...', version: '...' }
|
|
183
|
-
* ```
|
|
184
|
-
*/
|
|
185
|
-
healthCheck(): {
|
|
186
|
-
status: 'ok';
|
|
187
|
-
baseUrl: string;
|
|
188
|
-
version: string;
|
|
189
|
-
hasToken: boolean;
|
|
190
|
-
};
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
export { InternalLogger as I, PlolinkClient as P };
|
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
import { b as LoggerFunction, S as SDKConfig } from './core-77EbLgbp.js';
|
|
2
|
-
import { AxiosInstance, AxiosRequestConfig } from 'axios';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* SDK 内部日志器
|
|
6
|
-
*
|
|
7
|
-
* @description
|
|
8
|
-
* 提供统一的日志接口,支持用户自定义日志钩子。
|
|
9
|
-
* 默认使用 console 输出,用户可以通过配置自定义 logger 函数来集成 Sentry 等监控系统。
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```typescript
|
|
13
|
-
* const logger = new InternalLogger((level, message, data) => {
|
|
14
|
-
* // 自定义日志处理,例如发送到 Sentry
|
|
15
|
-
* console.log(`[${level}] ${message}`, data);
|
|
16
|
-
* });
|
|
17
|
-
*
|
|
18
|
-
* logger.info('Operation started', { userId: '123' });
|
|
19
|
-
* logger.error('Operation failed', { error: 'Network timeout' });
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
declare class InternalLogger {
|
|
23
|
-
/**
|
|
24
|
-
* 用户自定义的日志钩子函数
|
|
25
|
-
*/
|
|
26
|
-
private readonly userLogger?;
|
|
27
|
-
/**
|
|
28
|
-
* 是否启用日志输出
|
|
29
|
-
* 可以通过环境变量 PLOLINK_SDK_DEBUG 控制
|
|
30
|
-
*/
|
|
31
|
-
private readonly isDebugEnabled;
|
|
32
|
-
/**
|
|
33
|
-
* 创建一个 InternalLogger 实例
|
|
34
|
-
*
|
|
35
|
-
* @param userLogger - 用户自定义的日志钩子函数
|
|
36
|
-
*/
|
|
37
|
-
constructor(userLogger?: LoggerFunction);
|
|
38
|
-
/**
|
|
39
|
-
* 记录信息级别日志
|
|
40
|
-
*
|
|
41
|
-
* @param message - 日志消息
|
|
42
|
-
* @param context - 附加上下文数据
|
|
43
|
-
*/
|
|
44
|
-
info(message: string, context?: unknown): void;
|
|
45
|
-
/**
|
|
46
|
-
* 记录警告级别日志
|
|
47
|
-
*
|
|
48
|
-
* @param message - 日志消息
|
|
49
|
-
* @param context - 附加上下文数据
|
|
50
|
-
*/
|
|
51
|
-
warn(message: string, context?: unknown): void;
|
|
52
|
-
/**
|
|
53
|
-
* 记录错误级别日志
|
|
54
|
-
*
|
|
55
|
-
* @param message - 日志消息
|
|
56
|
-
* @param context - 附加上下文数据
|
|
57
|
-
*/
|
|
58
|
-
error(message: string, context?: unknown): void;
|
|
59
|
-
/**
|
|
60
|
-
* 记录调试级别日志
|
|
61
|
-
* 只有在 debug 模式下才会输出
|
|
62
|
-
*
|
|
63
|
-
* @param message - 日志消息
|
|
64
|
-
* @param context - 附加上下文数据
|
|
65
|
-
*/
|
|
66
|
-
debug(message: string, context?: unknown): void;
|
|
67
|
-
/**
|
|
68
|
-
* 内部日志记录方法
|
|
69
|
-
*
|
|
70
|
-
* @param level - 日志级别
|
|
71
|
-
* @param message - 日志消息
|
|
72
|
-
* @param context - 附加上下文数据
|
|
73
|
-
*/
|
|
74
|
-
private log;
|
|
75
|
-
/**
|
|
76
|
-
* 创建一个带有固定上下文的子 logger
|
|
77
|
-
*
|
|
78
|
-
* @param context - 固定的上下文数据
|
|
79
|
-
* @returns 新的 logger 实例
|
|
80
|
-
*
|
|
81
|
-
* @example
|
|
82
|
-
* ```typescript
|
|
83
|
-
* const logger = new InternalLogger();
|
|
84
|
-
* const moduleLogger = logger.withContext({ module: 'billing' });
|
|
85
|
-
* moduleLogger.info('Payment processed'); // 日志会自动带上 module: 'billing'
|
|
86
|
-
* ```
|
|
87
|
-
*/
|
|
88
|
-
withContext(context: Record<string, unknown>): InternalLogger;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* 为 Axios 实例添加类型安全的请求方法
|
|
93
|
-
*
|
|
94
|
-
* @description
|
|
95
|
-
* 这些方法封装了 Axios 的原始方法,提供更好的类型推断。
|
|
96
|
-
*/
|
|
97
|
-
interface TypedAxiosInstance extends AxiosInstance {
|
|
98
|
-
get<T = unknown>(url: string, config?: AxiosRequestConfig): Promise<T>;
|
|
99
|
-
post<T = unknown>(url: string, data?: unknown, config?: AxiosRequestConfig): Promise<T>;
|
|
100
|
-
put<T = unknown>(url: string, data?: unknown, config?: AxiosRequestConfig): Promise<T>;
|
|
101
|
-
patch<T = unknown>(url: string, data?: unknown, config?: AxiosRequestConfig): Promise<T>;
|
|
102
|
-
delete<T = unknown>(url: string, config?: AxiosRequestConfig): Promise<T>;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Plolink SDK 客户端主类
|
|
107
|
-
*
|
|
108
|
-
* @description
|
|
109
|
-
* PlolinkClient 是 SDK 的核心类,负责:
|
|
110
|
-
* - 管理 SDK 配置(认证 Token、API 地址等)
|
|
111
|
-
* - 初始化 Axios 实例并配置拦截器
|
|
112
|
-
* - 提供统一的日志接口
|
|
113
|
-
* - 作为所有业务模块的基础依赖
|
|
114
|
-
*
|
|
115
|
-
* @example
|
|
116
|
-
* ```typescript
|
|
117
|
-
* // 使用 ApiKey
|
|
118
|
-
* const client = new PlolinkClient({
|
|
119
|
-
* token: 'sk-123456789',
|
|
120
|
-
* logger: (level, msg, data) => {
|
|
121
|
-
* console.log(`[${level}] ${msg}`, data);
|
|
122
|
-
* }
|
|
123
|
-
* });
|
|
124
|
-
*
|
|
125
|
-
* // 使用 SessionId (登录后获取)
|
|
126
|
-
* const client = new PlolinkClient({
|
|
127
|
-
* token: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
|
|
128
|
-
* baseUrl: 'https://api.plolink.com'
|
|
129
|
-
* });
|
|
130
|
-
* ```
|
|
131
|
-
*/
|
|
132
|
-
declare class PlolinkClient {
|
|
133
|
-
/**
|
|
134
|
-
* SDK 配置对象(已填充默认值)
|
|
135
|
-
*/
|
|
136
|
-
readonly config: Required<SDKConfig>;
|
|
137
|
-
/**
|
|
138
|
-
* Axios 实例,用于发起 HTTP 请求
|
|
139
|
-
*/
|
|
140
|
-
readonly axiosInstance: TypedAxiosInstance;
|
|
141
|
-
/**
|
|
142
|
-
* 内部日志记录器
|
|
143
|
-
*/
|
|
144
|
-
readonly logger: InternalLogger;
|
|
145
|
-
/**
|
|
146
|
-
* 创建一个 PlolinkClient 实例
|
|
147
|
-
*
|
|
148
|
-
* @param config - SDK 配置对象
|
|
149
|
-
* @throws {PlolinkError} 当配置验证失败时抛出
|
|
150
|
-
*
|
|
151
|
-
* @example
|
|
152
|
-
* ```typescript
|
|
153
|
-
* const client = new PlolinkClient({
|
|
154
|
-
* token: 'sk-your-api-key'
|
|
155
|
-
* });
|
|
156
|
-
* ```
|
|
157
|
-
*/
|
|
158
|
-
constructor(config: SDKConfig);
|
|
159
|
-
/**
|
|
160
|
-
* 验证 SDK 配置
|
|
161
|
-
*
|
|
162
|
-
* @param config - SDK 配置对象
|
|
163
|
-
* @throws {PlolinkError} 当配置不合法时抛出
|
|
164
|
-
* @private
|
|
165
|
-
*/
|
|
166
|
-
private validateConfig;
|
|
167
|
-
/**
|
|
168
|
-
* 获取当前 SDK 版本
|
|
169
|
-
*
|
|
170
|
-
* @returns SDK 版本号
|
|
171
|
-
*/
|
|
172
|
-
getVersion(): string;
|
|
173
|
-
/**
|
|
174
|
-
* 检查客户端健康状态
|
|
175
|
-
*
|
|
176
|
-
* @returns 健康状态信息
|
|
177
|
-
*
|
|
178
|
-
* @example
|
|
179
|
-
* ```typescript
|
|
180
|
-
* const health = client.healthCheck();
|
|
181
|
-
* console.log(health);
|
|
182
|
-
* // { status: 'ok', baseUrl: '...', version: '...' }
|
|
183
|
-
* ```
|
|
184
|
-
*/
|
|
185
|
-
healthCheck(): {
|
|
186
|
-
status: 'ok';
|
|
187
|
-
baseUrl: string;
|
|
188
|
-
version: string;
|
|
189
|
-
hasToken: boolean;
|
|
190
|
-
};
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
export { InternalLogger as I, PlolinkClient as P };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
// src/modules/agent/index.ts
|
|
4
|
-
var AGENT_MODULE_INFO = {
|
|
5
|
-
name: "agent",
|
|
6
|
-
version: "1.0.0",
|
|
7
|
-
status: "planned",
|
|
8
|
-
features: [
|
|
9
|
-
"task-submit",
|
|
10
|
-
"task-status",
|
|
11
|
-
"task-result",
|
|
12
|
-
"anonymous-skill",
|
|
13
|
-
"file-packaging",
|
|
14
|
-
"task-cancel",
|
|
15
|
-
"real-time-progress"
|
|
16
|
-
]
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
exports.AGENT_MODULE_INFO = AGENT_MODULE_INFO;
|
|
20
|
-
//# sourceMappingURL=index.cjs.map
|
|
21
|
-
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/modules/agent/index.ts"],"names":[],"mappings":";;;AAiEO,IAAM,iBAAA,GAAoB;AAAA,EAC/B,IAAA,EAAM,OAAA;AAAA,EACN,OAAA,EAAS,OAAA;AAAA,EACT,MAAA,EAAQ,SAAA;AAAA,EACR,QAAA,EAAU;AAAA,IACR,aAAA;AAAA,IACA,aAAA;AAAA,IACA,aAAA;AAAA,IACA,iBAAA;AAAA,IACA,gBAAA;AAAA,IACA,aAAA;AAAA,IACA;AAAA;AAEJ","file":"index.cjs","sourcesContent":["/**\n * Agent 任务模块\n * \n * @description\n * 提供 Agent 任务提交、状态查询、结果获取等功能。\n * 支持匿名 Skill 上传,包含 input 和 output 的压缩包打包逻辑。\n * \n * @example\n * ```typescript\n * import { PlolinkClient } from '@plolink/sdk';\n * import { AgentTask } from '@plolink/sdk/agent';\n * \n * const client = new PlolinkClient({ mode: 'apiKey', apiKey: 'xxx' });\n * const agent = new AgentTask(client);\n * \n * // 提交任务\n * const task = await agent.submitTask({\n * skillId: 'skill-123',\n * input: { query: 'Hello' }\n * });\n * ```\n * \n * @module agent\n */\n\n// 预留:将在后续实现 AgentTask 类\n\n/**\n * Agent 模块占位符\n * \n * @description\n * 此模块将在后续版本中实现以下功能:\n * - 任务提交\n * - 任务状态查询\n * - 任务结果获取\n * - 匿名 Skill 上传\n * - Input/Output 压缩包打包\n * - 任务取消\n * - 实时进度推送\n * \n * @example\n * ```typescript\n * // 未来使用方式(预览)\n * const agent = new AgentTask(client);\n * \n * // 提交任务\n * const task = await agent.submitTask({\n * skillId: 'skill-123',\n * input: { query: 'Hello' }\n * });\n * \n * // 监听状态变化\n * task.on('status-change', (status) => {\n * console.log('Task status:', status);\n * });\n * \n * // 监听输出\n * task.on('output', (output) => {\n * console.log('Task output:', output);\n * });\n * \n * // 获取最终结果\n * const result = await task.waitForCompletion();\n * ```\n */\nexport const AGENT_MODULE_INFO = {\n name: 'agent',\n version: '1.0.0',\n status: 'planned',\n features: [\n 'task-submit',\n 'task-status',\n 'task-result',\n 'anonymous-skill',\n 'file-packaging',\n 'task-cancel',\n 'real-time-progress',\n ],\n} as const;\n\n// 导出类型(预留)\nexport type AgentModuleInfo = typeof AGENT_MODULE_INFO;\n\n"]}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Agent 任务模块
|
|
3
|
-
*
|
|
4
|
-
* @description
|
|
5
|
-
* 提供 Agent 任务提交、状态查询、结果获取等功能。
|
|
6
|
-
* 支持匿名 Skill 上传,包含 input 和 output 的压缩包打包逻辑。
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* ```typescript
|
|
10
|
-
* import { PlolinkClient } from '@plolink/sdk';
|
|
11
|
-
* import { AgentTask } from '@plolink/sdk/agent';
|
|
12
|
-
*
|
|
13
|
-
* const client = new PlolinkClient({ mode: 'apiKey', apiKey: 'xxx' });
|
|
14
|
-
* const agent = new AgentTask(client);
|
|
15
|
-
*
|
|
16
|
-
* // 提交任务
|
|
17
|
-
* const task = await agent.submitTask({
|
|
18
|
-
* skillId: 'skill-123',
|
|
19
|
-
* input: { query: 'Hello' }
|
|
20
|
-
* });
|
|
21
|
-
* ```
|
|
22
|
-
*
|
|
23
|
-
* @module agent
|
|
24
|
-
*/
|
|
25
|
-
/**
|
|
26
|
-
* Agent 模块占位符
|
|
27
|
-
*
|
|
28
|
-
* @description
|
|
29
|
-
* 此模块将在后续版本中实现以下功能:
|
|
30
|
-
* - 任务提交
|
|
31
|
-
* - 任务状态查询
|
|
32
|
-
* - 任务结果获取
|
|
33
|
-
* - 匿名 Skill 上传
|
|
34
|
-
* - Input/Output 压缩包打包
|
|
35
|
-
* - 任务取消
|
|
36
|
-
* - 实时进度推送
|
|
37
|
-
*
|
|
38
|
-
* @example
|
|
39
|
-
* ```typescript
|
|
40
|
-
* // 未来使用方式(预览)
|
|
41
|
-
* const agent = new AgentTask(client);
|
|
42
|
-
*
|
|
43
|
-
* // 提交任务
|
|
44
|
-
* const task = await agent.submitTask({
|
|
45
|
-
* skillId: 'skill-123',
|
|
46
|
-
* input: { query: 'Hello' }
|
|
47
|
-
* });
|
|
48
|
-
*
|
|
49
|
-
* // 监听状态变化
|
|
50
|
-
* task.on('status-change', (status) => {
|
|
51
|
-
* console.log('Task status:', status);
|
|
52
|
-
* });
|
|
53
|
-
*
|
|
54
|
-
* // 监听输出
|
|
55
|
-
* task.on('output', (output) => {
|
|
56
|
-
* console.log('Task output:', output);
|
|
57
|
-
* });
|
|
58
|
-
*
|
|
59
|
-
* // 获取最终结果
|
|
60
|
-
* const result = await task.waitForCompletion();
|
|
61
|
-
* ```
|
|
62
|
-
*/
|
|
63
|
-
declare const AGENT_MODULE_INFO: {
|
|
64
|
-
readonly name: "agent";
|
|
65
|
-
readonly version: "1.0.0";
|
|
66
|
-
readonly status: "planned";
|
|
67
|
-
readonly features: readonly ["task-submit", "task-status", "task-result", "anonymous-skill", "file-packaging", "task-cancel", "real-time-progress"];
|
|
68
|
-
};
|
|
69
|
-
type AgentModuleInfo = typeof AGENT_MODULE_INFO;
|
|
70
|
-
|
|
71
|
-
export { AGENT_MODULE_INFO, type AgentModuleInfo };
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Agent 任务模块
|
|
3
|
-
*
|
|
4
|
-
* @description
|
|
5
|
-
* 提供 Agent 任务提交、状态查询、结果获取等功能。
|
|
6
|
-
* 支持匿名 Skill 上传,包含 input 和 output 的压缩包打包逻辑。
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* ```typescript
|
|
10
|
-
* import { PlolinkClient } from '@plolink/sdk';
|
|
11
|
-
* import { AgentTask } from '@plolink/sdk/agent';
|
|
12
|
-
*
|
|
13
|
-
* const client = new PlolinkClient({ mode: 'apiKey', apiKey: 'xxx' });
|
|
14
|
-
* const agent = new AgentTask(client);
|
|
15
|
-
*
|
|
16
|
-
* // 提交任务
|
|
17
|
-
* const task = await agent.submitTask({
|
|
18
|
-
* skillId: 'skill-123',
|
|
19
|
-
* input: { query: 'Hello' }
|
|
20
|
-
* });
|
|
21
|
-
* ```
|
|
22
|
-
*
|
|
23
|
-
* @module agent
|
|
24
|
-
*/
|
|
25
|
-
/**
|
|
26
|
-
* Agent 模块占位符
|
|
27
|
-
*
|
|
28
|
-
* @description
|
|
29
|
-
* 此模块将在后续版本中实现以下功能:
|
|
30
|
-
* - 任务提交
|
|
31
|
-
* - 任务状态查询
|
|
32
|
-
* - 任务结果获取
|
|
33
|
-
* - 匿名 Skill 上传
|
|
34
|
-
* - Input/Output 压缩包打包
|
|
35
|
-
* - 任务取消
|
|
36
|
-
* - 实时进度推送
|
|
37
|
-
*
|
|
38
|
-
* @example
|
|
39
|
-
* ```typescript
|
|
40
|
-
* // 未来使用方式(预览)
|
|
41
|
-
* const agent = new AgentTask(client);
|
|
42
|
-
*
|
|
43
|
-
* // 提交任务
|
|
44
|
-
* const task = await agent.submitTask({
|
|
45
|
-
* skillId: 'skill-123',
|
|
46
|
-
* input: { query: 'Hello' }
|
|
47
|
-
* });
|
|
48
|
-
*
|
|
49
|
-
* // 监听状态变化
|
|
50
|
-
* task.on('status-change', (status) => {
|
|
51
|
-
* console.log('Task status:', status);
|
|
52
|
-
* });
|
|
53
|
-
*
|
|
54
|
-
* // 监听输出
|
|
55
|
-
* task.on('output', (output) => {
|
|
56
|
-
* console.log('Task output:', output);
|
|
57
|
-
* });
|
|
58
|
-
*
|
|
59
|
-
* // 获取最终结果
|
|
60
|
-
* const result = await task.waitForCompletion();
|
|
61
|
-
* ```
|
|
62
|
-
*/
|
|
63
|
-
declare const AGENT_MODULE_INFO: {
|
|
64
|
-
readonly name: "agent";
|
|
65
|
-
readonly version: "1.0.0";
|
|
66
|
-
readonly status: "planned";
|
|
67
|
-
readonly features: readonly ["task-submit", "task-status", "task-result", "anonymous-skill", "file-packaging", "task-cancel", "real-time-progress"];
|
|
68
|
-
};
|
|
69
|
-
type AgentModuleInfo = typeof AGENT_MODULE_INFO;
|
|
70
|
-
|
|
71
|
-
export { AGENT_MODULE_INFO, type AgentModuleInfo };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
// src/modules/agent/index.ts
|
|
2
|
-
var AGENT_MODULE_INFO = {
|
|
3
|
-
name: "agent",
|
|
4
|
-
version: "1.0.0",
|
|
5
|
-
status: "planned",
|
|
6
|
-
features: [
|
|
7
|
-
"task-submit",
|
|
8
|
-
"task-status",
|
|
9
|
-
"task-result",
|
|
10
|
-
"anonymous-skill",
|
|
11
|
-
"file-packaging",
|
|
12
|
-
"task-cancel",
|
|
13
|
-
"real-time-progress"
|
|
14
|
-
]
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export { AGENT_MODULE_INFO };
|
|
18
|
-
//# sourceMappingURL=index.js.map
|
|
19
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/modules/agent/index.ts"],"names":[],"mappings":";AAiEO,IAAM,iBAAA,GAAoB;AAAA,EAC/B,IAAA,EAAM,OAAA;AAAA,EACN,OAAA,EAAS,OAAA;AAAA,EACT,MAAA,EAAQ,SAAA;AAAA,EACR,QAAA,EAAU;AAAA,IACR,aAAA;AAAA,IACA,aAAA;AAAA,IACA,aAAA;AAAA,IACA,iBAAA;AAAA,IACA,gBAAA;AAAA,IACA,aAAA;AAAA,IACA;AAAA;AAEJ","file":"index.js","sourcesContent":["/**\n * Agent 任务模块\n * \n * @description\n * 提供 Agent 任务提交、状态查询、结果获取等功能。\n * 支持匿名 Skill 上传,包含 input 和 output 的压缩包打包逻辑。\n * \n * @example\n * ```typescript\n * import { PlolinkClient } from '@plolink/sdk';\n * import { AgentTask } from '@plolink/sdk/agent';\n * \n * const client = new PlolinkClient({ mode: 'apiKey', apiKey: 'xxx' });\n * const agent = new AgentTask(client);\n * \n * // 提交任务\n * const task = await agent.submitTask({\n * skillId: 'skill-123',\n * input: { query: 'Hello' }\n * });\n * ```\n * \n * @module agent\n */\n\n// 预留:将在后续实现 AgentTask 类\n\n/**\n * Agent 模块占位符\n * \n * @description\n * 此模块将在后续版本中实现以下功能:\n * - 任务提交\n * - 任务状态查询\n * - 任务结果获取\n * - 匿名 Skill 上传\n * - Input/Output 压缩包打包\n * - 任务取消\n * - 实时进度推送\n * \n * @example\n * ```typescript\n * // 未来使用方式(预览)\n * const agent = new AgentTask(client);\n * \n * // 提交任务\n * const task = await agent.submitTask({\n * skillId: 'skill-123',\n * input: { query: 'Hello' }\n * });\n * \n * // 监听状态变化\n * task.on('status-change', (status) => {\n * console.log('Task status:', status);\n * });\n * \n * // 监听输出\n * task.on('output', (output) => {\n * console.log('Task output:', output);\n * });\n * \n * // 获取最终结果\n * const result = await task.waitForCompletion();\n * ```\n */\nexport const AGENT_MODULE_INFO = {\n name: 'agent',\n version: '1.0.0',\n status: 'planned',\n features: [\n 'task-submit',\n 'task-status',\n 'task-result',\n 'anonymous-skill',\n 'file-packaging',\n 'task-cancel',\n 'real-time-progress',\n ],\n} as const;\n\n// 导出类型(预留)\nexport type AgentModuleInfo = typeof AGENT_MODULE_INFO;\n\n"]}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
// src/modules/chat/index.ts
|
|
4
|
-
var CHAT_MODULE_INFO = {
|
|
5
|
-
name: "chat",
|
|
6
|
-
version: "1.0.0",
|
|
7
|
-
status: "planned",
|
|
8
|
-
features: [
|
|
9
|
-
"conversation-create",
|
|
10
|
-
"message-send",
|
|
11
|
-
"history-query",
|
|
12
|
-
"content-moderation",
|
|
13
|
-
"conversation-management",
|
|
14
|
-
"material-association"
|
|
15
|
-
]
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
exports.CHAT_MODULE_INFO = CHAT_MODULE_INFO;
|
|
19
|
-
//# sourceMappingURL=index.cjs.map
|
|
20
|
-
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/modules/chat/index.ts"],"names":[],"mappings":";;;AA8DO,IAAM,gBAAA,GAAmB;AAAA,EAC9B,IAAA,EAAM,MAAA;AAAA,EACN,OAAA,EAAS,OAAA;AAAA,EACT,MAAA,EAAQ,SAAA;AAAA,EACR,QAAA,EAAU;AAAA,IACR,qBAAA;AAAA,IACA,cAAA;AAAA,IACA,eAAA;AAAA,IACA,oBAAA;AAAA,IACA,yBAAA;AAAA,IACA;AAAA;AAEJ","file":"index.cjs","sourcesContent":["/**\n * 对话能力模块\n * \n * @description\n * 提供基于已有信息的对话功能。\n * 使用素材创建对话,聊天历史数据存储在中台。\n * 包含内容审核检查,非流式输出。\n * \n * @example\n * ```typescript\n * import { PlolinkClient } from '@plolink/sdk';\n * import { Chat } from '@plolink/sdk/chat';\n * \n * const client = new PlolinkClient({ mode: 'apiKey', apiKey: 'xxx' });\n * const chat = new Chat(client);\n * \n * // 创建对话\n * const conversation = await chat.createConversation({\n * materialId: 'material-123'\n * });\n * ```\n * \n * @module chat\n */\n\n// 预留:将在后续实现 Chat 类\n\n/**\n * Chat 模块占位符\n * \n * @description\n * 此模块将在后续版本中实现以下功能:\n * - 创建对话会话\n * - 发送消息\n * - 获取对话历史\n * - 内容审核\n * - 对话管理\n * - 素材关联\n * \n * @example\n * ```typescript\n * // 未来使用方式(预览)\n * const chat = new Chat(client);\n * \n * // 创建对话\n * const conversation = await chat.createConversation({\n * materialId: 'material-123',\n * context: '这是关于产品的文档...'\n * });\n * \n * // 发送消息\n * const response = await chat.sendMessage({\n * conversationId: conversation.id,\n * message: '请介绍一下这个产品'\n * });\n * \n * console.log('AI response:', response.content);\n * \n * // 获取历史记录\n * const history = await chat.getHistory(conversation.id);\n * ```\n */\nexport const CHAT_MODULE_INFO = {\n name: 'chat',\n version: '1.0.0',\n status: 'planned',\n features: [\n 'conversation-create',\n 'message-send',\n 'history-query',\n 'content-moderation',\n 'conversation-management',\n 'material-association',\n ],\n} as const;\n\n// 导出类型(预留)\nexport type ChatModuleInfo = typeof CHAT_MODULE_INFO;\n\n"]}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 对话能力模块
|
|
3
|
-
*
|
|
4
|
-
* @description
|
|
5
|
-
* 提供基于已有信息的对话功能。
|
|
6
|
-
* 使用素材创建对话,聊天历史数据存储在中台。
|
|
7
|
-
* 包含内容审核检查,非流式输出。
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```typescript
|
|
11
|
-
* import { PlolinkClient } from '@plolink/sdk';
|
|
12
|
-
* import { Chat } from '@plolink/sdk/chat';
|
|
13
|
-
*
|
|
14
|
-
* const client = new PlolinkClient({ mode: 'apiKey', apiKey: 'xxx' });
|
|
15
|
-
* const chat = new Chat(client);
|
|
16
|
-
*
|
|
17
|
-
* // 创建对话
|
|
18
|
-
* const conversation = await chat.createConversation({
|
|
19
|
-
* materialId: 'material-123'
|
|
20
|
-
* });
|
|
21
|
-
* ```
|
|
22
|
-
*
|
|
23
|
-
* @module chat
|
|
24
|
-
*/
|
|
25
|
-
/**
|
|
26
|
-
* Chat 模块占位符
|
|
27
|
-
*
|
|
28
|
-
* @description
|
|
29
|
-
* 此模块将在后续版本中实现以下功能:
|
|
30
|
-
* - 创建对话会话
|
|
31
|
-
* - 发送消息
|
|
32
|
-
* - 获取对话历史
|
|
33
|
-
* - 内容审核
|
|
34
|
-
* - 对话管理
|
|
35
|
-
* - 素材关联
|
|
36
|
-
*
|
|
37
|
-
* @example
|
|
38
|
-
* ```typescript
|
|
39
|
-
* // 未来使用方式(预览)
|
|
40
|
-
* const chat = new Chat(client);
|
|
41
|
-
*
|
|
42
|
-
* // 创建对话
|
|
43
|
-
* const conversation = await chat.createConversation({
|
|
44
|
-
* materialId: 'material-123',
|
|
45
|
-
* context: '这是关于产品的文档...'
|
|
46
|
-
* });
|
|
47
|
-
*
|
|
48
|
-
* // 发送消息
|
|
49
|
-
* const response = await chat.sendMessage({
|
|
50
|
-
* conversationId: conversation.id,
|
|
51
|
-
* message: '请介绍一下这个产品'
|
|
52
|
-
* });
|
|
53
|
-
*
|
|
54
|
-
* console.log('AI response:', response.content);
|
|
55
|
-
*
|
|
56
|
-
* // 获取历史记录
|
|
57
|
-
* const history = await chat.getHistory(conversation.id);
|
|
58
|
-
* ```
|
|
59
|
-
*/
|
|
60
|
-
declare const CHAT_MODULE_INFO: {
|
|
61
|
-
readonly name: "chat";
|
|
62
|
-
readonly version: "1.0.0";
|
|
63
|
-
readonly status: "planned";
|
|
64
|
-
readonly features: readonly ["conversation-create", "message-send", "history-query", "content-moderation", "conversation-management", "material-association"];
|
|
65
|
-
};
|
|
66
|
-
type ChatModuleInfo = typeof CHAT_MODULE_INFO;
|
|
67
|
-
|
|
68
|
-
export { CHAT_MODULE_INFO, type ChatModuleInfo };
|