@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.
- package/commands/bootstrap/index.js +1 -1
- package/commands/scan/index.js +1 -1
- package/infra.js +7 -7
- package/package.json +1 -1
package/commands/scan/index.js
CHANGED
|
@@ -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
|
|
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
|
|
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
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
// --------------------------------------------------------------------------
|