prizmkit 1.1.144 → 1.1.145

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.
@@ -1,5 +1,5 @@
1
1
  {
2
- "frameworkVersion": "1.1.144",
3
- "bundledAt": "2026-07-22T02:07:34.475Z",
4
- "bundledFrom": "a2ab913"
2
+ "frameworkVersion": "1.1.145",
3
+ "bundledAt": "2026-07-22T06:54:58.505Z",
4
+ "bundledFrom": "1dccf5b"
5
5
  }
@@ -316,6 +316,21 @@ class ProgressTracker:
316
316
  self.last_text_snippet = text.strip()[-120:]
317
317
  self._detect_phase(text)
318
318
  self._detect_terminal_error(text, require_error_context=True)
319
+ if (
320
+ event_type == "message_end"
321
+ and isinstance(message, dict)
322
+ and message.get("role") == "assistant"
323
+ ):
324
+ stop_reason = str(message.get("stopReason") or "")
325
+ if stop_reason:
326
+ self.stop_reason = stop_reason
327
+ if stop_reason in {"error", "aborted"}:
328
+ error_text = str(message.get("errorMessage") or stop_reason)
329
+ self.result_subtype = "error"
330
+ self.last_result_is_error = True
331
+ self.terminal_result_text = error_text[:1000]
332
+ self.errors.append(error_text[:500])
333
+ self._detect_terminal_error(error_text, require_error_context=True)
319
334
  elif event_type == "tool_execution_start":
320
335
  tool_name = str(event.get("toolName") or "unknown")
321
336
  self.current_tool = tool_name
@@ -340,6 +355,13 @@ class ProgressTracker:
340
355
  elif event_type == "agent_end":
341
356
  self.current_tool = None
342
357
  self.is_active = False
358
+ if (
359
+ self.result_subtype != "error"
360
+ and not self.last_result_is_error
361
+ and not self.fatal_error_code
362
+ ):
363
+ self.result_subtype = "success"
364
+ self.terminal_success_at = datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ")
343
365
  return
344
366
 
345
367
  # ── Codex exec --json JSONL format ──────────────────────────
@@ -963,6 +963,35 @@ def test_progress_parser_normalizes_pi_json_events():
963
963
  assert {item["name"]: item["count"] for item in data["tool_calls"]}["edit"] == 1
964
964
  assert data["current_phase"] == "implement"
965
965
  assert data["is_active"] is False
966
+ assert data["result_subtype"] == "success"
967
+ assert data["terminal_success_at"]
968
+
969
+
970
+ def test_progress_parser_does_not_mark_failed_pi_agent_end_as_success():
971
+ module = _load_progress_parser_module()
972
+ tracker = module.ProgressTracker()
973
+ tracker.process_event({"type": "session", "version": 3, "id": "pi-session", "cwd": "/tmp/project"})
974
+ tracker.process_event({"type": "agent_start"})
975
+ tracker.process_event({
976
+ "type": "message_end",
977
+ "message": {
978
+ "role": "assistant",
979
+ "content": [],
980
+ "stopReason": "error",
981
+ "errorMessage": "provider request failed",
982
+ },
983
+ })
984
+ tracker.process_event({"type": "agent_end", "messages": []})
985
+
986
+ data = tracker.to_dict()
987
+
988
+ assert data["event_format"] == "pi-json"
989
+ assert data["is_active"] is False
990
+ assert data["result_subtype"] == "error"
991
+ assert data["stop_reason"] == "error"
992
+ assert data["last_result_is_error"] is True
993
+ assert data["terminal_success_at"] == ""
994
+ assert "provider request failed" in data["errors"]
966
995
 
967
996
 
968
997
  def test_progress_parser_normalizes_claude_subagents_without_double_counting(tmp_path):
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.1.144",
2
+ "version": "1.1.145",
3
3
  "skills": {
4
4
  "prizmkit": {
5
5
  "description": "Framework introduction and navigation for the formal single-requirement lifecycle, project initialization, Prizm docs, and independent deployment.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prizmkit",
3
- "version": "1.1.144",
3
+ "version": "1.1.145",
4
4
  "description": "Create a new PrizmKit-powered project with clean initialization — no framework dev files, just what you need.",
5
5
  "type": "module",
6
6
  "bin": {