@cloud411716/fancy-webnovel 1.0.20 → 1.0.22

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.
@@ -91,7 +91,7 @@ export function apply(ctx) {
91
91
  }
92
92
 
93
93
  if (projectRoot === '.') {
94
- projectRoot = process.cwd();
94
+ projectRoot = session.header?.cwd ?? process.cwd();
95
95
  notify(session, bootstrap.notify({ type: 'using_cwd', projectRoot }));
96
96
  }
97
97
 
@@ -126,7 +126,7 @@ export function apply(ctx) {
126
126
  const { signal } = invocation;
127
127
 
128
128
  // ---------- check project root ----------
129
- const projectRoot = process.cwd();
129
+ const projectRoot = session.header?.cwd ?? process.cwd();
130
130
  if (!existsSync(join(projectRoot, '.fancy-deployed'))) {
131
131
  notify(session, scan.notify({ type: 'not_initialized' }));
132
132
  return { kind: 'success', text: '' };
package/infra.js CHANGED
@@ -2,7 +2,7 @@
2
2
  * infra.js — DSH Plugin Core Infrastructure
3
3
  *
4
4
  * Provides:
5
- * notify(session, text) — append a user-facing message to the session log
5
+ * notify(session, text) — append a user-facing message (LLM-invisible)
6
6
  * llmFollowup(invocation,prompt) — hand a prompt to the LLM as a user message
7
7
  * StatusLine(session) — in-place updatable status bar via surfaceOp replace
8
8
  * scanProgress(ctx, phase, data) — emit structured scan progress events
@@ -12,7 +12,7 @@
12
12
  */
13
13
 
14
14
  // --------------------------------------------------------------------------
15
- // notify — append a text message as a session event (no LLM round-trip)
15
+ // notify — append a text message visible to the user but invisible to LLM
16
16
  // --------------------------------------------------------------------------
17
17
 
18
18
  /** Strip ANSI escape sequences from a string (defensive, prevents TTY leak). */
@@ -25,11 +25,11 @@ function stripAnsi(str) {
25
25
  * @param {string} text
26
26
  */
27
27
  export function notify(session, text) {
28
- session.append(
29
- 'user/message',
30
- { content: [{ type: 'text', text: stripAnsi(text) }], source: { kind: 'user' } },
31
- { surfaceOp: 'append' }
32
- );
28
+ session.append('command/done', {
29
+ commandId: `fancy-notify-${Date.now()}`,
30
+ kind: 'success',
31
+ text: stripAnsi(text),
32
+ });
33
33
  }
34
34
 
35
35
  // --------------------------------------------------------------------------
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloud411716/fancy-webnovel",
3
- "version": "1.0.20",
3
+ "version": "1.0.22",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "exports": {