@pptalker/agent 1.0.5 → 1.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/dist/index.js CHANGED
@@ -54,7 +54,7 @@ const TOOLS = [
54
54
  { name: 'pptalker_status', schema: StatusInput, handler: handleStatus,
55
55
  description: '按 request_id 做纯短 GET,默认 wait=false。返回 uploaded(仅 slot assigned)/preparing/needs_notes/needs_confirmation/queued/rendering/done/failed/unknown。wait=true 仅客户端轮询 10–45 秒,支持取消。未知先查状态,失败只按明确 action 恢复;需要讲稿时允许确认后用同一 id 调 render,完成任务不重渲染。' },
56
56
  { name: 'pptalker_account', schema: AccountInput, handler: handleAccount,
57
- description: '读取当前账号额度、可用音色与限制,同时返回 cloned_voices(克隆音色,需 Max 套餐)与 last_tasks 本地恢复日志(最多 50 条,含 id、文件名、阶段、是否已提交,不含密钥或 URL)。API 失败时仍返回可读取的本地记录;可用于找回被 SDK 取消丢弃的结果。日志不是服务端事实,恢复前必须查 status。' },
57
+ description: '读取当前账号额度、可用音色与限制,同时返回 cloned_voices(克隆音色,需 Max 套餐)、defaults(本机配置里生效的默认语言/音色/语速/字幕,确认参数前必须先看这里,不要凭空猜默认值)与 last_tasks 本地恢复日志(最多 50 条,含 id、文件名、阶段、是否已提交,不含密钥或 URL)。API 失败时仍返回可读取的本地记录;可用于找回被 SDK 取消丢弃的结果。日志不是服务端事实,恢复前必须查 status。' },
58
58
  ];
59
59
 
60
60
  export function createAgentServer(cfg, client = new AgentClient(cfg)) {
@@ -25,7 +25,20 @@ export async function handleAccount(client, cfg, input = {}, extra = {}) {
25
25
  let cacheStatus = cfg.journal?.enabled ? 'enabled' : 'disabled';
26
26
  try { lastTasks = await cfg.journal?.list() || []; }
27
27
  catch { cacheStatus = 'unavailable'; }
28
- const recovery = { last_tasks: lastTasks, local_cache: cacheStatus };
28
+ // 把「本机配置里实际生效的默认值」显式回给调用方。
29
+ // 否则模型看不到 MCP 的环境变量,只能按 schema 描述瞎猜,
30
+ // 还会在确认话术里谎报默认音色/语速。
31
+ const defaults = {
32
+ language: cfg.defaultLanguage,
33
+ style: cfg.defaultStyle,
34
+ voice: cfg.defaultVoice || null,
35
+ speed: Number.isFinite(cfg.defaultSpeed) ? cfg.defaultSpeed : 100,
36
+ subtitles: cfg.defaultSubtitles === null || cfg.defaultSubtitles === undefined ? true : cfg.defaultSubtitles,
37
+ subtitle_size: cfg.defaultSubtitleSize || 'medium',
38
+ subtitle_color: cfg.defaultSubtitleColor || 'white',
39
+ subtitle_bg: cfg.defaultSubtitleBg || 'semi-transparent',
40
+ };
41
+ const recovery = { last_tasks: lastTasks, local_cache: cacheStatus, defaults };
29
42
  try {
30
43
  const raw = await withBudget(signal => client.call(`${API_PREFIX}/account`, { timeoutMs: 10000, signal }), 10000, extra.signal);
31
44
  const result = { ok: raw?.ok === true, ...recovery };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pptalker/agent",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "独立 PPTalker Agent MCP:异步准备、讲稿确认、私有视频与可取消的短状态查询。",
5
5
  "keywords": [
6
6
  "mcp",
Binary file
@@ -96,6 +96,27 @@ Key 从 https://www.pptalker.com/profile 获取,与网页端用的是同一个
96
96
 
97
97
  无参数。返回剩余额度、套餐、可用音色、风格与限制,以及本地恢复记录 `last_tasks`(最多 50 条,不含 key 和 URL)。
98
98
 
99
+ ## 先看 defaults,别重复询问
100
+
101
+ `pptalker_account` 会返回本机 MCP 配置里**实际生效**的默认值:
102
+
103
+ ```json
104
+ "defaults": {
105
+ "language": "zh-CN", "style": "clean", "voice": "智斌", "speed": 120,
106
+ "subtitles": true, "subtitle_size": "medium",
107
+ "subtitle_color": "white", "subtitle_bg": "semi-transparent"
108
+ }
109
+ ```
110
+
111
+ 用户把这些写进 MCP 环境变量后就**不想再被问一遍**。规则:
112
+
113
+ 1. 用户在对话里没提音色/语速/字幕时,**不要传这些参数**,让配置的默认值生效。
114
+ 2. 需要在话术里说明"将用什么"时,从 `defaults` 读,**不要按 schema 说明猜**。
115
+ `defaults.voice` 是 `智斌` 就说"按你的配置用智斌",不能说"默认女声智菊"。
116
+ 3. `defaults` 里为 `null` 的项(通常只有 voice)才需要问,或用户主动要改时才问。
117
+ 4. 确认讲稿时**只问讲稿本身**,不要把所有参数重新列一遍。
118
+ 5. 用户主动指定了新的音色/语速,就按他说的传,此时才覆盖配置。
119
+
99
120
  ## 音色与语速(别让用户报 ID)
100
121
 
101
122
  **默认不传 `voice`** —— 系统会按 `language` 取该语言的第一个音色。能出片就别多问一轮。