@fnclaude/cli 1.1.0 → 1.1.1
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 +1 -1
- package/src/argv.ts +16 -0
package/package.json
CHANGED
package/src/argv.ts
CHANGED
|
@@ -86,6 +86,13 @@ export function buildFnclaudeMCPConfigJSON(noop: boolean): string | null {
|
|
|
86
86
|
* appended to that existing value. Empty fragments are dropped. Returns
|
|
87
87
|
* `passthrough` unchanged when no non-empty fragments remain.
|
|
88
88
|
*
|
|
89
|
+
* Sentinel-aware: when `passthrough` contains a `--` end-of-options
|
|
90
|
+
* sentinel and no existing --append-system-prompt match is found, the new
|
|
91
|
+
* `--append-system-prompt <joined>` pair is inserted BEFORE the sentinel
|
|
92
|
+
* so claude parses it as a flag, not as additional prompt text. Without
|
|
93
|
+
* this, `fnc -- "say hi"` produced `claude … -- say hi --append-system-prompt
|
|
94
|
+
* <fragments>` and claude swallowed the whole tail as prompt content.
|
|
95
|
+
*
|
|
89
96
|
* Never mutates the input slice.
|
|
90
97
|
*/
|
|
91
98
|
export function withAppendedSystemPrompts(
|
|
@@ -110,6 +117,15 @@ export function withAppendedSystemPrompts(
|
|
|
110
117
|
return out;
|
|
111
118
|
}
|
|
112
119
|
}
|
|
120
|
+
const sentinelAt = passthrough.indexOf('--');
|
|
121
|
+
if (sentinelAt >= 0) {
|
|
122
|
+
return [
|
|
123
|
+
...passthrough.slice(0, sentinelAt),
|
|
124
|
+
'--append-system-prompt',
|
|
125
|
+
joined,
|
|
126
|
+
...passthrough.slice(sentinelAt),
|
|
127
|
+
];
|
|
128
|
+
}
|
|
113
129
|
return [...passthrough, '--append-system-prompt', joined];
|
|
114
130
|
}
|
|
115
131
|
|