@tiens.nguyen/gu-cli 1.0.824 → 1.0.825

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.
@@ -2198,11 +2198,41 @@ def _machine_context(platform_name: str = "", arch: str = "", cwd: str = "") ->
2198
2198
  )
2199
2199
 
2200
2200
 
2201
+ # A reply that ENDS by announcing its next action is a plan, not an answer (#139, live: "Two
2202
+ # logical changes to commit: 1. … 2. … Let me check what changed in api/latest.json …" was
2203
+ # wrapped as the answer to "commit" because its numbered list looked finished). Only the LAST
2204
+ # paragraph counts, "let me know" / "I'll be" are not actions, and a step handed to the user
2205
+ # ("I'll push when you say so") is a finished answer.
2206
+ _NEXT_STEP_RE = re.compile(
2207
+ r"\b(?:let me|let's|let us|i'll|i will|i'm going to|i am going to|i need to|"
2208
+ r"next,? i(?:'ll| will| need to)?|now i(?:'ll| will)?)\s+(?:also\s+|now\s+|first\s+|quickly\s+)?"
2209
+ r"(?:check|look|see|read|run|inspect|verify|review|examine|find|search|grep|open|"
2210
+ r"stage|commit|create|write|edit|fix|update|add|build|test|install|start|try|"
2211
+ r"fetch|list|compare|construct|draft|prepare|explore|query|confirm|diff|do)\b",
2212
+ re.I,
2213
+ )
2214
+ _HANDED_TO_USER_RE = re.compile(
2215
+ r"\b(?:when|if|once|whenever|after) you\b|\byour (?:call|go-ahead|word|court)\b|"
2216
+ r"\band i(?:'ll| will)\b|\b(?:tell|give|ask|show) me\b|\bsay (?:the word|which|'|\")", re.I)
2217
+
2218
+
2219
+ def _announces_next_step(stripped: str) -> bool:
2220
+ """True if the reply's last paragraph says what the model will do NEXT (and it did not
2221
+ do it). Pure, so the live replies can be replayed."""
2222
+ paras = [p for p in re.split(r"\n\s*\n", stripped or "") if p.strip()]
2223
+ if not paras:
2224
+ return False
2225
+ last = paras[-1]
2226
+ return bool(_NEXT_STEP_RE.search(last)) and not _HANDED_TO_USER_RE.search(last)
2227
+
2228
+
2201
2229
  def _looks_like_scratchpad(stripped: str) -> bool:
2202
2230
  """True if `stripped` reads like unresolved internal deliberation rather than a
2203
- finished, user-facing answer — see module comment above for the two signals used."""
2231
+ finished, user-facing answer — see module comment above for the signals used."""
2204
2232
  if _SCRATCHPAD_START_RE.match(stripped):
2205
2233
  return True
2234
+ if _announces_next_step(stripped):
2235
+ return True
2206
2236
  return len(_DELIBERATION_RE.findall(stripped)) >= 3
2207
2237
 
2208
2238
 
@@ -10197,7 +10227,10 @@ def run_agent_chat(cfg):
10197
10227
  "find a URL, THEN fetch_url to read it). You SEE the Observation before the next step. "
10198
10228
  "When you have enough to answer, call final_answer(<your answer>) in a code block — pass a readable "
10199
10229
  "markdown/prose recap (what you did, what you verified, what is left), never a dict, list or JSON. "
10200
- "Prefer FEWER steps, and never repeat a tool call that already succeeded.\n\n"
10230
+ "Prefer FEWER steps, and never repeat a tool call that already succeeded. "
10231
+ # #139: Kimi K3 replied "…Let me check X" with no block, and that plan became the answer.
10232
+ "A reply WITHOUT a code block ENDS your turn and is shown to the user as your answer — "
10233
+ "never end on \"Let me check…\"; if there is more to do, put that call in the block NOW.\n\n"
10201
10234
  "{{TOOL_LIST}}\n" # filled in below, once from the REAL registered tool objects
10202
10235
  + _skills_mod.prompt_block(_skills)
10203
10236
  + _rag_tool_block + _ws_tool_block + _auto_test_block +
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiens.nguyen/gu-cli",
3
- "version": "1.0.824",
3
+ "version": "1.0.825",
4
4
  "description": "Gu CLI — the gu terminal plus the local worker that runs agent / OCR / PDF / embedding jobs on your Mac (Ollama / MLX / OpenAI-compatible).",
5
5
  "type": "module",
6
6
  "license": "MIT",