@cloud411716/fancy-webnovel 0.1.39 → 0.1.41

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.
Files changed (2) hide show
  1. package/infra.js +9 -7
  2. package/package.json +1 -1
package/infra.js CHANGED
@@ -17,8 +17,7 @@ export function notify(session, text) {
17
17
  queueMicrotask(() => {
18
18
  session.append(
19
19
  'user/message',
20
- { content: [{ type: 'text', text }], source: { kind: 'user' } },
21
- { surfaceOp: 'append' }
20
+ { content: [{ type: 'text', text: String(text) }], source: { kind: 'user' } }
22
21
  );
23
22
  });
24
23
  }
@@ -28,10 +27,11 @@ export function notify(session, text) {
28
27
  // ---------------------------------------------------------------------------
29
28
 
30
29
  export function llmFollowup(invocation, content) {
31
- const message = typeof content === 'string'
32
- ? { content: [{ type: 'text', text: content }], source: { kind: 'user' } }
33
- : content; // 允许传入完整消息对象
34
- invocation.agent.followup(message);
30
+ const prompt = typeof content === 'string' ? content : JSON.stringify(content);
31
+ invocation.agent.followup({
32
+ content: [{ type: 'text', text: prompt }],
33
+ source: { kind: 'user' },
34
+ });
35
35
  }
36
36
 
37
37
  // ---------------------------------------------------------------------------
@@ -53,7 +53,9 @@ export function spawnScript(cmd, args, { timeout = 30000, cwd } = {}) {
53
53
  ok: parsed.ok === true,
54
54
  output: stdout,
55
55
  error: parsed.error
56
- ? (parsed.error.message || JSON.stringify(parsed.error))
56
+ ? (typeof parsed.error === 'object'
57
+ ? (parsed.error.message || JSON.stringify(parsed.error))
58
+ : String(parsed.error))
57
59
  : stderr || undefined,
58
60
  });
59
61
  } catch (_) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloud411716/fancy-webnovel",
3
- "version": "0.1.39",
3
+ "version": "0.1.41",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "exports": {