@storvia/sdk 0.2.1 → 0.3.0

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/dist/index.d.mts CHANGED
@@ -20,7 +20,7 @@ type StorviaErrorCode = 'UNAUTHORIZED' | 'INSUFFICIENT_BALANCE' | 'RATE_LIMITED'
20
20
  interface ChatSendOptions {
21
21
  message: string;
22
22
  topic?: string;
23
- context?: string;
23
+ scene_key?: string;
24
24
  stream?: boolean;
25
25
  onChunk?: (text: string) => void;
26
26
  onDone?: (id: string) => void;
@@ -32,7 +32,7 @@ interface ChatSaveOptions {
32
32
  }
33
33
  interface ChatGenerateOptions {
34
34
  topic?: string;
35
- context?: string;
35
+ scene_key?: string;
36
36
  stream?: boolean;
37
37
  save?: boolean;
38
38
  onChunk?: (text: string) => void;
@@ -40,7 +40,7 @@ interface ChatGenerateOptions {
40
40
  }
41
41
  interface ChatRetryOptions {
42
42
  topic?: string;
43
- context?: string;
43
+ scene_key?: string;
44
44
  stream?: boolean;
45
45
  onChunk?: (text: string) => void;
46
46
  onDone?: (id: string) => void;
@@ -162,7 +162,7 @@ declare class ChatModule {
162
162
  id: string;
163
163
  }>;
164
164
  /**
165
- * 基于 topic 历史 + context 请求 AI 生成回复(无需当前轮用户输入)
165
+ * 基于 topic 历史 + scene_key 请求 AI 生成回复(无需当前轮用户输入)
166
166
  * 适用于群聊 NPC 回复、NPC 自动发言、弹幕生成等
167
167
  */
168
168
  generate(options: ChatGenerateOptions): Promise<ChatResponse | void>;
@@ -171,7 +171,10 @@ declare class ChatModule {
171
171
  * 适用于 AI 回复出错或不满意时重新生成
172
172
  */
173
173
  retry(options?: ChatRetryOptions): Promise<ChatResponse | void>;
174
- /** 预览模式:发到 /preview 端点 */
174
+ /** 预览模式:发到 /preview 端点
175
+ * - 创作台预览:父页面已注入 previewConfig,请求体塞 prompt_config,服务端不查库
176
+ * - 本地预览 / dev:无 previewConfig,请求体塞 game_id,服务端按 hash_id 查 prompts
177
+ */
175
178
  private sendPreview;
176
179
  }
177
180
 
@@ -197,6 +200,14 @@ declare class CharactersModule {
197
200
  update(name: string, data: CharacterUpdateOptions): Promise<void>;
198
201
  remove(name: string): Promise<void>;
199
202
  detail(name: string): Promise<CharacterDetail>;
203
+ /**
204
+ * 调整 NPC 的重要程度(0-100,越高越不容易被挤出场景)。
205
+ * 预设 NPC 不可修改(固定为 100),调用会抛错。
206
+ * 超出范围会自动钳位到 0 或 100。
207
+ *
208
+ * 等价写法:`state.update(name, { priority: value })`
209
+ */
210
+ setPriority(name: string, value: number): Promise<void>;
200
211
  }
201
212
 
202
213
  declare class RelationshipsModule {