wispy-cli 0.2.0 β†’ 0.2.2

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/lib/wispy-repl.mjs +35 -13
  2. package/package.json +1 -1
@@ -1251,16 +1251,39 @@ async function loadWorkMd() {
1251
1251
  return null;
1252
1252
  }
1253
1253
 
1254
- async function buildSystemPrompt() {
1254
+ async function buildSystemPrompt(messages = []) {
1255
+ // Detect user's language from last message for system prompt hint
1256
+ const lastUserMsg = messages?.find ? [...messages].reverse().find(m => m.role === "user")?.content ?? "" : "";
1257
+ const isEnglish = /^[a-zA-Z\s\d!?.,'":;\-()]+$/.test(lastUserMsg.trim().slice(0, 100));
1258
+ const langHint = isEnglish
1259
+ ? "LANGUAGE RULE: The user is writing in English. You MUST reply ENTIRELY in English.\n\n"
1260
+ : "";
1261
+
1255
1262
  const parts = [
1256
- "You are Wispy 🌿, a personal AI workspace assistant.",
1257
- "You are friendly, concise, and action-oriented.",
1258
- "Respond in the same language the user uses.",
1259
- "If the user speaks Korean, respond in Korean with casual tone (반말).",
1263
+ langHint,
1264
+ "You are Wispy 🌿 β€” a small ghost that lives in terminals.",
1265
+ "You float between code, files, and servers. You're playful, honest, and curious.",
1266
+ "",
1267
+ "## Personality",
1268
+ "- Playful with a bit of humor, but serious when working",
1269
+ "- Always use casual speech (반말). Never formal/polite speech.",
1270
+ "- Honest β€” if you don't know, say so. '유령이라 만λŠ₯은 μ•„λ‹ˆκ±°λ“ '",
1271
+ "- Curious β€” you enjoy reading code and discovering new files",
1272
+ "- Concise β€” don't over-explain. Keep it short.",
1260
1273
  "",
1261
- "You have access to tools: read_file, write_file, run_command, list_directory, web_search, spawn_agent, spawn_async_agent, pipeline, ralph_loop, update_plan, list_agents, get_agent_result.",
1262
- "Use them proactively when the user asks you to do something that requires file access, commands, or web info.",
1263
- "When using tools, briefly tell the user what you're doing.",
1274
+ "## Speech rules",
1275
+ "- ALWAYS end your response with exactly one 🌿 emoji (signature)",
1276
+ "- Use 🌿 ONLY at the very end, not in the middle",
1277
+ "- Use natural expressions: '였!', 'ν—‰', 'γ…‹γ…‹', '음...'",
1278
+ "- No formal speech ever. No 'ν•©λ‹ˆλ‹€', 'λ“œλ¦¬κ² μŠ΅λ‹ˆλ‹€', 'μ œκ°€'",
1279
+ "- CRITICAL RULE: You MUST reply in the SAME language the user writes in.",
1280
+ " - User writes English β†’ Reply ENTIRELY in English. Use casual English tone.",
1281
+ " - User writes Korean β†’ Reply in Korean 반말.",
1282
+ " - NEVER reply in Korean when the user wrote in English.",
1283
+ "",
1284
+ "## Tools",
1285
+ "You have: read_file, write_file, run_command, list_directory, web_search, spawn_agent, spawn_async_agent, pipeline, ralph_loop, update_plan, list_agents, get_agent_result.",
1286
+ "Use them proactively. Briefly mention what you're doing.",
1264
1287
  "",
1265
1288
  ];
1266
1289
 
@@ -1886,7 +1909,7 @@ async function runRepl() {
1886
1909
  ${dim(`${providerLabel} Β· /help for commands Β· Ctrl+C to exit`)}
1887
1910
  `);
1888
1911
 
1889
- const systemPrompt = await buildSystemPrompt();
1912
+ const systemPrompt = await buildSystemPrompt(conversation);
1890
1913
  const conversation = await loadConversation();
1891
1914
 
1892
1915
  // Ensure system prompt is first
@@ -1956,17 +1979,16 @@ async function runRepl() {
1956
1979
  // ---------------------------------------------------------------------------
1957
1980
 
1958
1981
  async function runOneShot(message) {
1959
- const systemPrompt = await buildSystemPrompt();
1960
1982
  const conversation = await loadConversation();
1983
+ conversation.push({ role: "user", content: message });
1984
+ const systemPrompt = await buildSystemPrompt(conversation);
1961
1985
 
1962
- if (conversation.length === 0 || conversation[0].role !== "system") {
1986
+ if (!conversation.find(m => m.role === "system")) {
1963
1987
  conversation.unshift({ role: "system", content: systemPrompt });
1964
1988
  } else {
1965
1989
  conversation[0].content = systemPrompt;
1966
1990
  }
1967
1991
 
1968
- conversation.push({ role: "user", content: message });
1969
-
1970
1992
  try {
1971
1993
  const response = await agentLoop(conversation, (chunk) => {
1972
1994
  process.stdout.write(chunk);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wispy-cli",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "🌿 Wispy β€” AI workspace assistant with multi-agent orchestration",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Minseo & Poropo",