@cloud411716/fancy-webnovel 0.1.70 → 0.1.71

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloud411716/fancy-webnovel",
3
- "version": "0.1.70",
3
+ "version": "0.1.71",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "exports": {
@@ -20,22 +20,19 @@ export async function apply(ctx) {
20
20
  const session = invocation.agent.session;
21
21
  const rawInput = invocation.rawInput ? invocation.rawInput.trim() : '';
22
22
 
23
- // ─── TEST: 验证 ctx.get('sessions') 是否可访问 ───────────────────────
23
+ // ─── TEST: 验证直接用 invocation.agent.session 追加事件 ─────────────────
24
24
  {
25
- const sessions = ctx.get('sessions');
26
- notify(session, `[TEST] ctx.get('sessions') = ${sessions ? 'AVAILABLE' : 'UNDEFINED'}`);
27
- if (sessions) {
28
- const s = sessions.active;
29
- notify(session, `[TEST] sessions.active = ${s ? s.id : 'UNDEFINED'}`);
30
- if (s) {
31
- // 追加一个 fake tool/call,看 status bar 是否出现进度
32
- s.append('tool/call', {
33
- callId: 'test-call-1',
34
- name: 'fancy-scan/progress',
35
- arguments: JSON.stringify({ platform: 'test', length: 'test' }),
36
- });
37
- notify(session, '[TEST] 追加了 fake tool/call 事件');
38
- }
25
+ // invocation.agent.session 就是 Session 对象,直接 append
26
+ const s = invocation.agent.session;
27
+ notify(session, `[TEST] session.id = ${s?.id ?? 'UNDEFINED'}`);
28
+ if (s) {
29
+ // 追加一个 fake tool/call,看 status bar 是否出现进度
30
+ s.append('tool/call', {
31
+ callId: 'test-call-1',
32
+ name: 'fancy-scan/progress',
33
+ arguments: JSON.stringify({ platform: 'test', length: 'test' }),
34
+ });
35
+ notify(session, '[TEST] session.append(tool/call) 成功');
39
36
  }
40
37
  }
41
38
  // ─── TEST 结束 ───────────────────────────────────────────────────────