prizmkit 1.1.190 → 1.1.191
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/bin/create-prizmkit.js +4 -4
- package/bundled/VERSION.json +3 -3
- package/bundled/adapters/antigravity/assets/prizmkit-hook.cjs +150 -0
- package/bundled/adapters/antigravity/hooks-adapter.js +195 -0
- package/bundled/adapters/antigravity/paths.js +14 -0
- package/bundled/adapters/antigravity/rules-adapter.js +54 -0
- package/bundled/adapters/antigravity/skill-adapter.js +29 -0
- package/bundled/dev-pipeline/README.md +16 -5
- package/bundled/dev-pipeline/prizmkit_runtime/config.py +13 -2
- package/bundled/dev-pipeline/prizmkit_runtime/gitops.py +12 -12
- package/bundled/dev-pipeline/prizmkit_runtime/platform_detection.py +13 -4
- package/bundled/dev-pipeline/prizmkit_runtime/runners.py +8 -2
- package/bundled/dev-pipeline/prizmkit_runtime/sessions.py +186 -24
- package/bundled/dev-pipeline/prizmkit_runtime/status.py +2 -0
- package/bundled/dev-pipeline/scripts/parse-stream-progress.py +305 -17
- package/bundled/dev-pipeline/scripts/utils.py +5 -3
- package/bundled/dev-pipeline/tests/live_ai_cli_log_smoke.py +1 -0
- package/bundled/dev-pipeline/tests/test_python_runner_parity.py +135 -0
- package/bundled/dev-pipeline/tests/test_unified_cli.py +363 -0
- package/bundled/rules/USAGE.md +1 -0
- package/bundled/skills/_metadata.json +1 -1
- package/bundled/skills/feature-planner/SKILL.md +2 -2
- package/bundled/skills/prizmkit-init/SKILL.md +1 -1
- package/bundled/skills/prizmkit-init/references/config-schema.md +2 -2
- package/bundled/skills/prizmkit-prizm-docs/assets/prizm-docs-format.md +1 -1
- package/bundled/skills/prizmkit-prizm-docs/references/op-init.md +1 -1
- package/package.json +1 -1
- package/src/ai-cli-launch.js +1 -1
- package/src/clean.js +40 -4
- package/src/config.js +64 -4
- package/src/detect-platform.js +10 -6
- package/src/external-skills.js +2 -2
- package/src/index.js +1 -0
- package/src/manifest.js +1 -1
- package/src/platforms.js +6 -2
- package/src/prompts.js +11 -3
- package/src/scaffold.js +59 -4
- package/src/upgrade.js +9 -3
|
@@ -221,9 +221,9 @@ def _cursor_tool_call_parts(event):
|
|
|
221
221
|
|
|
222
222
|
|
|
223
223
|
def _cursor_compact_value(value, limit=800):
|
|
224
|
-
"""Render
|
|
224
|
+
"""Render tool metadata without copying full file content into logs."""
|
|
225
225
|
def compact(item, key=""):
|
|
226
|
-
if key in {"fileText", "content"} and isinstance(item, str):
|
|
226
|
+
if key in {"fileText", "content", "Content", "Replacement", "TargetContent", "CodeContent"} and isinstance(item, str):
|
|
227
227
|
return f"<{len(item)} chars>"
|
|
228
228
|
if isinstance(item, dict):
|
|
229
229
|
return {child_key: compact(child, child_key) for child_key, child in item.items()}
|
|
@@ -576,9 +576,118 @@ class SemanticLogNormalizer:
|
|
|
576
576
|
text = str(text or "")
|
|
577
577
|
return self._complete("output", text.rstrip("\n")) if text.strip() else ""
|
|
578
578
|
|
|
579
|
+
def _antigravity_event(self, event):
|
|
580
|
+
ag_event = str(event.get("event") or "")
|
|
581
|
+
rendered = ""
|
|
582
|
+
if ag_event == "init":
|
|
583
|
+
self._scope += 1
|
|
584
|
+
return ""
|
|
585
|
+
if ag_event == "step_update":
|
|
586
|
+
payload = event.get("step_update") if isinstance(event.get("step_update"), dict) else event
|
|
587
|
+
step_index = payload.get("step_index", 0)
|
|
588
|
+
step_type = str(payload.get("step_type") or "")
|
|
589
|
+
state = str(payload.get("state") or "").upper()
|
|
590
|
+
|
|
591
|
+
think_id = f"ag:{self._scope}:{step_index}:think"
|
|
592
|
+
thinking_delta = payload.get("thinking_delta")
|
|
593
|
+
thinking_text = payload.get("thinking")
|
|
594
|
+
if isinstance(thinking_delta, str) and thinking_delta:
|
|
595
|
+
rendered += self._stream("think", think_id, "delta", thinking_delta)
|
|
596
|
+
elif step_type == "thinking" and isinstance(thinking_text, str) and thinking_text:
|
|
597
|
+
rendered += self._complete("think", thinking_text, deduplicate=True)
|
|
598
|
+
if state in {"DONE", "COMPLETED"} and think_id in self._stream_buffers:
|
|
599
|
+
rendered += self._stream("think", think_id, "end")
|
|
600
|
+
|
|
601
|
+
final_id = f"ag:{self._scope}:{step_index}:final"
|
|
602
|
+
text_delta = payload.get("text_delta")
|
|
603
|
+
text = payload.get("text") or payload.get("response")
|
|
604
|
+
if isinstance(text_delta, str) and text_delta:
|
|
605
|
+
rendered += self._stream("final", final_id, "delta", text_delta)
|
|
606
|
+
elif step_type == "agent_response" and isinstance(text, str) and text and final_id not in self._stream_buffers:
|
|
607
|
+
if state in {"DONE", "COMPLETED"}:
|
|
608
|
+
rendered += self._complete("final", text, deduplicate=True)
|
|
609
|
+
else:
|
|
610
|
+
rendered += self._snapshot("final", final_id, text, final=False)
|
|
611
|
+
if state in {"DONE", "COMPLETED"}:
|
|
612
|
+
if final_id in self._stream_buffers:
|
|
613
|
+
rendered += self._stream("final", final_id, "end")
|
|
614
|
+
elif final_id in self._snapshots:
|
|
615
|
+
rendered += self._snapshot("final", final_id, self._snapshots[final_id], final=True)
|
|
616
|
+
|
|
617
|
+
tool_info = payload.get("tool_info") if isinstance(payload.get("tool_info"), dict) else None
|
|
618
|
+
if step_type == "tool" or tool_info is not None:
|
|
619
|
+
info = tool_info or {}
|
|
620
|
+
tool_name = str(info.get("name") or payload.get("tool_name") or "tool")
|
|
621
|
+
params = info.get("parameters") or info.get("args") or {}
|
|
622
|
+
action_key = f"ag:{self._scope}:{step_index}:{tool_name}"
|
|
623
|
+
if action_key not in self._recent_action_id_set:
|
|
624
|
+
self._remember_action_id(action_key)
|
|
625
|
+
rendered += self._complete("action", f"{tool_name} {_cursor_compact_value(params)}")
|
|
626
|
+
if state in {"DONE", "COMPLETED", "ERROR", "FAILED"} or info.get("output") not in (None, "") or info.get("error"):
|
|
627
|
+
output = info.get("output")
|
|
628
|
+
obs_key = f"{action_key}:obs"
|
|
629
|
+
if output not in (None, "") and obs_key not in self._recent_output_id_set:
|
|
630
|
+
self._remember_output_id(obs_key)
|
|
631
|
+
rendered += self._complete("observation", f"{tool_name} {_cursor_compact_value(output)}")
|
|
632
|
+
tool_err = info.get("error")
|
|
633
|
+
err_key = f"{action_key}:err"
|
|
634
|
+
if tool_err and err_key not in self._recent_output_id_set:
|
|
635
|
+
self._remember_output_id(err_key)
|
|
636
|
+
rendered += self._complete("error", f"{tool_name} failed: {self._value_text(tool_err)}")
|
|
637
|
+
|
|
638
|
+
step_err = payload.get("error")
|
|
639
|
+
if step_err:
|
|
640
|
+
rendered += self._complete("error", self._value_text(step_err))
|
|
641
|
+
return rendered
|
|
642
|
+
|
|
643
|
+
if ag_event == "result":
|
|
644
|
+
for sid in list(self._stream_buffers):
|
|
645
|
+
kind = "final" if sid.endswith(":final") else "think"
|
|
646
|
+
rendered += self._stream(kind, sid, "end")
|
|
647
|
+
for sid in list(self._snapshots):
|
|
648
|
+
kind = "final" if sid.endswith(":final") else "think"
|
|
649
|
+
rendered += self._snapshot(kind, sid, self._snapshots[sid], final=True)
|
|
650
|
+
result_payload = event.get("result") if isinstance(event.get("result"), dict) else event
|
|
651
|
+
raw_status = str(result_payload.get("status") or event.get("status") or "")
|
|
652
|
+
err_val = result_payload.get("error") if result_payload.get("error") is not None else event.get("error")
|
|
653
|
+
normalized_status = raw_status.strip().lower()
|
|
654
|
+
is_error = bool(
|
|
655
|
+
event.get("is_error")
|
|
656
|
+
or result_payload.get("is_error")
|
|
657
|
+
or err_val
|
|
658
|
+
or normalized_status in self._ERROR_STOPS
|
|
659
|
+
or normalized_status.startswith(("error", "failed", "failure", "cancel"))
|
|
660
|
+
)
|
|
661
|
+
resp_val = (
|
|
662
|
+
result_payload.get("response")
|
|
663
|
+
or result_payload.get("result")
|
|
664
|
+
or result_payload.get("message")
|
|
665
|
+
or event.get("response")
|
|
666
|
+
or event.get("message")
|
|
667
|
+
or ""
|
|
668
|
+
)
|
|
669
|
+
if isinstance(resp_val, dict):
|
|
670
|
+
resp_val = ""
|
|
671
|
+
if err_val and is_error:
|
|
672
|
+
rendered += self._complete("error", self._value_text(err_val))
|
|
673
|
+
elif resp_val:
|
|
674
|
+
rendered += self._complete(
|
|
675
|
+
"error" if is_error else "final",
|
|
676
|
+
self._value_text(resp_val),
|
|
677
|
+
deduplicate=not is_error,
|
|
678
|
+
)
|
|
679
|
+
rendered += self._session_end(f"status={'error' if is_error else 'success'}")
|
|
680
|
+
return rendered
|
|
681
|
+
|
|
682
|
+
if ag_event == "error":
|
|
683
|
+
return self._complete("error", self._value_text(event.get("error") or event.get("message") or "runtime error"))
|
|
684
|
+
return ""
|
|
685
|
+
|
|
579
686
|
def process_event(self, event):
|
|
580
687
|
if not isinstance(event, dict):
|
|
581
688
|
return self.process_text(event)
|
|
689
|
+
if isinstance(event.get("event"), str) and not event.get("type"):
|
|
690
|
+
return self._antigravity_event(event)
|
|
582
691
|
event_type = str(event.get("type") or "")
|
|
583
692
|
rendered = ""
|
|
584
693
|
|
|
@@ -795,6 +904,9 @@ class ProgressTracker:
|
|
|
795
904
|
self.codex_child_thread_ids = set()
|
|
796
905
|
self.cb_session_id = ""
|
|
797
906
|
self.cursor_session_id = ""
|
|
907
|
+
self.antigravity_session_id = ""
|
|
908
|
+
self._ag_seen_response_steps = set()
|
|
909
|
+
self._ag_seen_tool_steps = set()
|
|
798
910
|
self.result_subtype = ""
|
|
799
911
|
self.stop_reason = ""
|
|
800
912
|
self.has_usage = False
|
|
@@ -823,9 +935,9 @@ class ProgressTracker:
|
|
|
823
935
|
def process_event(self, event):
|
|
824
936
|
"""Process a single stream-json event and update state.
|
|
825
937
|
|
|
826
|
-
Supports Claude API/CLI, CodeBuddy, Codex JSONL,
|
|
938
|
+
Supports Claude API/CLI, CodeBuddy, Codex JSONL, Pi JSONL, Cursor, and Antigravity formats.
|
|
827
939
|
"""
|
|
828
|
-
event_type = event.get("type"
|
|
940
|
+
event_type = event.get("type") or event.get("event") or ""
|
|
829
941
|
if event_type:
|
|
830
942
|
self.event_type_counts[str(event_type)] += 1
|
|
831
943
|
self._detect_structured_terminal_fields(event)
|
|
@@ -847,6 +959,171 @@ class ProgressTracker:
|
|
|
847
959
|
|
|
848
960
|
self._record_structured_subagent_metadata(event)
|
|
849
961
|
|
|
962
|
+
# ── Antigravity agy --output-format stream-json ──────────────
|
|
963
|
+
is_antigravity_event = (
|
|
964
|
+
self.provider_hint == "antigravity"
|
|
965
|
+
or self.event_format == "antigravity-stream-json"
|
|
966
|
+
or (
|
|
967
|
+
not event.get("type")
|
|
968
|
+
and event.get("event") in {"init", "step_update", "result", "error"}
|
|
969
|
+
)
|
|
970
|
+
)
|
|
971
|
+
if is_antigravity_event:
|
|
972
|
+
self.event_format = "antigravity-stream-json"
|
|
973
|
+
for container in (event, event.get("init"), event.get("step_update"), event.get("result")):
|
|
974
|
+
if isinstance(container, dict):
|
|
975
|
+
conv_id = container.get("conversation_id")
|
|
976
|
+
if isinstance(conv_id, str) and conv_id.strip() and not self.antigravity_session_id:
|
|
977
|
+
self.antigravity_session_id = conv_id.strip()
|
|
978
|
+
break
|
|
979
|
+
if event_type == "init":
|
|
980
|
+
self.is_active = True
|
|
981
|
+
elif event_type == "step_update":
|
|
982
|
+
self.is_active = True
|
|
983
|
+
payload = event.get("step_update") if isinstance(event.get("step_update"), dict) else event
|
|
984
|
+
step_index = payload.get("step_index")
|
|
985
|
+
step_type = str(payload.get("step_type") or "")
|
|
986
|
+
state = str(payload.get("state") or "").upper()
|
|
987
|
+
if step_type == "agent_response" or payload.get("text_delta") or payload.get("text"):
|
|
988
|
+
if step_index is not None:
|
|
989
|
+
if step_index not in self._ag_seen_response_steps:
|
|
990
|
+
self._ag_seen_response_steps.add(step_index)
|
|
991
|
+
self.message_count += 1
|
|
992
|
+
else:
|
|
993
|
+
self.message_count += 1
|
|
994
|
+
text = str(payload.get("text") or payload.get("text_delta") or "")
|
|
995
|
+
if text.strip():
|
|
996
|
+
self.last_text_snippet = text.strip()[-120:]
|
|
997
|
+
self._detect_phase(text)
|
|
998
|
+
self._detect_terminal_error(text, require_error_context=True)
|
|
999
|
+
if step_type == "tool" or isinstance(payload.get("tool_info"), dict):
|
|
1000
|
+
info = payload.get("tool_info") if isinstance(payload.get("tool_info"), dict) else {}
|
|
1001
|
+
tool_name = str(info.get("name") or payload.get("tool_name") or "unknown")
|
|
1002
|
+
params = info.get("parameters") or info.get("args") or {}
|
|
1003
|
+
tool_key = (step_index, tool_name) if step_index is not None else None
|
|
1004
|
+
if tool_key is None or tool_key not in self._ag_seen_tool_steps:
|
|
1005
|
+
if tool_key is not None:
|
|
1006
|
+
self._ag_seen_tool_steps.add(tool_key)
|
|
1007
|
+
self.current_tool = tool_name
|
|
1008
|
+
self.tool_call_counts[tool_name] += 1
|
|
1009
|
+
self.total_tool_calls += 1
|
|
1010
|
+
if isinstance(params, dict):
|
|
1011
|
+
self._extract_tool_summary_from_dict(params)
|
|
1012
|
+
else:
|
|
1013
|
+
self._extract_tool_summary(str(params))
|
|
1014
|
+
self._detect_phase(_cursor_compact_value(params, 500))
|
|
1015
|
+
if tool_name == "invoke_subagent" and isinstance(params, dict):
|
|
1016
|
+
self._record_subagent_event(
|
|
1017
|
+
"antigravity",
|
|
1018
|
+
"step_update.tool",
|
|
1019
|
+
identifier=str(tool_key or f"ag-subagent-{self.total_tool_calls}"),
|
|
1020
|
+
status=(
|
|
1021
|
+
"error"
|
|
1022
|
+
if info.get("error")
|
|
1023
|
+
else ("completed" if state in {"DONE", "COMPLETED"} else "running")
|
|
1024
|
+
),
|
|
1025
|
+
active=state not in {"DONE", "COMPLETED", "ERROR", "FAILED"},
|
|
1026
|
+
spawn=True,
|
|
1027
|
+
metadata={
|
|
1028
|
+
"tool": tool_name,
|
|
1029
|
+
"subagent_type": params.get("TypeName", ""),
|
|
1030
|
+
"description": params.get("Role", ""),
|
|
1031
|
+
},
|
|
1032
|
+
)
|
|
1033
|
+
if state in {"DONE", "COMPLETED", "ERROR", "FAILED"}:
|
|
1034
|
+
self.current_tool = None
|
|
1035
|
+
if tool_name == "invoke_subagent":
|
|
1036
|
+
self._record_subagent_event(
|
|
1037
|
+
"antigravity",
|
|
1038
|
+
"step_update.tool",
|
|
1039
|
+
identifier=str(tool_key or f"ag-subagent-{self.total_tool_calls}"),
|
|
1040
|
+
status="error" if info.get("error") else "completed",
|
|
1041
|
+
active=False,
|
|
1042
|
+
spawn=True,
|
|
1043
|
+
)
|
|
1044
|
+
tool_err = info.get("error")
|
|
1045
|
+
if tool_err:
|
|
1046
|
+
error_text = _cursor_compact_value(tool_err, 500)
|
|
1047
|
+
self.errors.append(error_text)
|
|
1048
|
+
self._detect_terminal_error(error_text, require_error_context=False)
|
|
1049
|
+
step_err = payload.get("error")
|
|
1050
|
+
if step_err:
|
|
1051
|
+
error_text = _cursor_compact_value(step_err, 500)
|
|
1052
|
+
self.errors.append(error_text)
|
|
1053
|
+
self._detect_terminal_error(error_text, require_error_context=False)
|
|
1054
|
+
elif event_type == "result":
|
|
1055
|
+
self.current_tool = None
|
|
1056
|
+
self.is_active = False
|
|
1057
|
+
result_payload = event.get("result") if isinstance(event.get("result"), dict) else event
|
|
1058
|
+
raw_status = str(
|
|
1059
|
+
result_payload.get("status")
|
|
1060
|
+
or event.get("status")
|
|
1061
|
+
or result_payload.get("subtype")
|
|
1062
|
+
or event.get("subtype")
|
|
1063
|
+
or ""
|
|
1064
|
+
)
|
|
1065
|
+
error_obj = result_payload.get("error") if result_payload.get("error") is not None else event.get("error")
|
|
1066
|
+
normalized_status = raw_status.strip().lower()
|
|
1067
|
+
is_error = bool(
|
|
1068
|
+
event.get("is_error")
|
|
1069
|
+
or result_payload.get("is_error")
|
|
1070
|
+
or error_obj
|
|
1071
|
+
or normalized_status in {"error", "failed", "failure", "aborted", "cancelled", "canceled"}
|
|
1072
|
+
)
|
|
1073
|
+
if is_error:
|
|
1074
|
+
self.result_subtype = "error"
|
|
1075
|
+
elif normalized_status in {"", "success", "ok", "completed"}:
|
|
1076
|
+
self.result_subtype = "success"
|
|
1077
|
+
else:
|
|
1078
|
+
self.result_subtype = normalized_status
|
|
1079
|
+
resp_text = (
|
|
1080
|
+
result_payload.get("response")
|
|
1081
|
+
or result_payload.get("result")
|
|
1082
|
+
or result_payload.get("message")
|
|
1083
|
+
or event.get("response")
|
|
1084
|
+
or event.get("message")
|
|
1085
|
+
or ""
|
|
1086
|
+
)
|
|
1087
|
+
if isinstance(resp_text, dict):
|
|
1088
|
+
resp_text = ""
|
|
1089
|
+
err_code = str(
|
|
1090
|
+
result_payload.get("error_code")
|
|
1091
|
+
or event.get("error_code")
|
|
1092
|
+
or event.get("api_error_code")
|
|
1093
|
+
or ""
|
|
1094
|
+
)
|
|
1095
|
+
err_msg = ""
|
|
1096
|
+
if isinstance(error_obj, dict):
|
|
1097
|
+
if not err_code:
|
|
1098
|
+
err_code = str(error_obj.get("code") or error_obj.get("type") or "")
|
|
1099
|
+
err_msg = " ".join(
|
|
1100
|
+
str(error_obj.get(key) or "")
|
|
1101
|
+
for key in ("type", "code", "message")
|
|
1102
|
+
if error_obj.get(key)
|
|
1103
|
+
)
|
|
1104
|
+
elif error_obj:
|
|
1105
|
+
err_msg = str(error_obj)
|
|
1106
|
+
if err_msg:
|
|
1107
|
+
self.errors.append(err_msg[:500])
|
|
1108
|
+
combined_text = " ".join(part for part in (str(resp_text), err_msg) if part)
|
|
1109
|
+
self._record_terminal_result(
|
|
1110
|
+
text=combined_text,
|
|
1111
|
+
is_error=is_error,
|
|
1112
|
+
api_error_status=result_payload.get("api_error_status") or event.get("api_error_status"),
|
|
1113
|
+
api_error_code=err_code,
|
|
1114
|
+
stop_reason=str(result_payload.get("stop_reason") or event.get("stop_reason") or raw_status),
|
|
1115
|
+
)
|
|
1116
|
+
elif event_type == "error":
|
|
1117
|
+
err_obj = event.get("error")
|
|
1118
|
+
error_text = (
|
|
1119
|
+
err_obj.get("message")
|
|
1120
|
+
if isinstance(err_obj, dict)
|
|
1121
|
+
else (err_obj or event.get("message") or "Antigravity CLI error")
|
|
1122
|
+
)
|
|
1123
|
+
self.errors.append(str(error_text)[:500])
|
|
1124
|
+
self._detect_terminal_error(str(error_text), require_error_context=False)
|
|
1125
|
+
return
|
|
1126
|
+
|
|
850
1127
|
# ── Cursor Agent --output-format stream-json ─────────────────
|
|
851
1128
|
is_cursor_event = (
|
|
852
1129
|
self.provider_hint == "cursor"
|
|
@@ -1658,6 +1935,12 @@ class ProgressTracker:
|
|
|
1658
1935
|
return
|
|
1659
1936
|
if event.get("usage") not in (None, "", {}):
|
|
1660
1937
|
self.has_usage = True
|
|
1938
|
+
else:
|
|
1939
|
+
for container_key in ("result", "step_update"):
|
|
1940
|
+
container = event.get(container_key)
|
|
1941
|
+
if isinstance(container, dict) and container.get("usage") not in (None, "", {}):
|
|
1942
|
+
self.has_usage = True
|
|
1943
|
+
break
|
|
1661
1944
|
denial_text = json.dumps(event, ensure_ascii=False).lower()
|
|
1662
1945
|
if any(
|
|
1663
1946
|
marker in denial_text
|
|
@@ -1893,19 +2176,23 @@ class ProgressTracker:
|
|
|
1893
2176
|
def _extract_tool_summary_from_dict(self, data):
|
|
1894
2177
|
"""Extract a human-readable summary from tool input dict."""
|
|
1895
2178
|
if isinstance(data, dict):
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
2179
|
+
for key in (
|
|
2180
|
+
"description",
|
|
2181
|
+
"command",
|
|
2182
|
+
"CommandLine",
|
|
2183
|
+
"file_path",
|
|
2184
|
+
"Path",
|
|
2185
|
+
"AbsolutePath",
|
|
2186
|
+
"TargetFile",
|
|
2187
|
+
"pattern",
|
|
2188
|
+
"SearchPath",
|
|
2189
|
+
"query",
|
|
2190
|
+
"Query",
|
|
2191
|
+
"prompt",
|
|
2192
|
+
):
|
|
2193
|
+
if key in data and data[key] not in (None, ""):
|
|
2194
|
+
self.current_tool_input_summary = str(data[key])[:100]
|
|
2195
|
+
return
|
|
1909
2196
|
|
|
1910
2197
|
def _update_subagent_status_counts(self, agents_states):
|
|
1911
2198
|
"""Track Codex subagent state counts from session-log collab items."""
|
|
@@ -2275,6 +2562,7 @@ class ProgressTracker:
|
|
|
2275
2562
|
"result_subtype": self.result_subtype,
|
|
2276
2563
|
"stop_reason": self.stop_reason,
|
|
2277
2564
|
"cursor_session_id": self.cursor_session_id,
|
|
2565
|
+
"antigravity_session_id": self.antigravity_session_id,
|
|
2278
2566
|
"has_usage": self.has_usage,
|
|
2279
2567
|
"permission_denial_count": len(self.permission_denials),
|
|
2280
2568
|
"permission_denials": self.permission_denials[-10:],
|
|
@@ -914,8 +914,8 @@ def resolve_prompt_platform(project_root):
|
|
|
914
914
|
if resolution.platform:
|
|
915
915
|
return resolution.platform
|
|
916
916
|
raise RuntimeError(
|
|
917
|
-
"PrizmKit platform skills not found. None of .claude/commands/, .agents/skills/, .codebuddy/skills/, .pi/skills/, or .
|
|
918
|
-
"Run `npx prizmkit install` first, set .prizmkit/config.json ai_cli/platform, or set PRIZMKIT_PLATFORM=claude|codex|codebuddy|pi|cursor explicitly."
|
|
917
|
+
"PrizmKit platform skills not found. None of .claude/commands/, .agents/skills/, .codebuddy/skills/, .pi/skills/, .cursor/skills/, or .agents/plugins/prizmkit/skills/ exists. "
|
|
918
|
+
"Run `npx prizmkit install` first, set .prizmkit/config.json ai_cli/platform, or set PRIZMKIT_PLATFORM=claude|codex|codebuddy|pi|cursor|antigravity explicitly."
|
|
919
919
|
)
|
|
920
920
|
|
|
921
921
|
def read_platform_conventions(project_root):
|
|
@@ -934,6 +934,8 @@ def read_platform_conventions(project_root):
|
|
|
934
934
|
candidates = ["CODEBUDDY.md", "CLAUDE.md", "AGENTS.md"]
|
|
935
935
|
elif platform in {"codex", "cursor"}:
|
|
936
936
|
candidates = ["AGENTS.md", "CLAUDE.md", "CODEBUDDY.md"]
|
|
937
|
+
elif platform == "antigravity":
|
|
938
|
+
candidates = ["GEMINI.md", "AGENTS.md", "CLAUDE.md", "CODEBUDDY.md"]
|
|
937
939
|
else:
|
|
938
940
|
candidates = ["CLAUDE.md", "CODEBUDDY.md", "AGENTS.md"]
|
|
939
941
|
|
|
@@ -942,7 +944,7 @@ def read_platform_conventions(project_root):
|
|
|
942
944
|
if os.path.isfile(filepath):
|
|
943
945
|
return "`{}`".format(filename)
|
|
944
946
|
|
|
945
|
-
return "(No project conventions file found — AGENTS.md, CLAUDE.md, or CODEBUDDY.md)"
|
|
947
|
+
return "(No project conventions file found — AGENTS.md, GEMINI.md, CLAUDE.md, or CODEBUDDY.md)"
|
|
946
948
|
|
|
947
949
|
|
|
948
950
|
def read_checkpoint_cursor(checkpoint_path):
|
|
@@ -487,6 +487,47 @@ def test_python_env_resolution_scenarios_match_snapshot_contracts(tmp_path):
|
|
|
487
487
|
assert cursor_support.enabled is True
|
|
488
488
|
assert cursor_support.format == "cursor-stream-json"
|
|
489
489
|
|
|
490
|
+
agy = build_ai_session_command(
|
|
491
|
+
AISessionConfig(
|
|
492
|
+
cli_command="agy",
|
|
493
|
+
platform="antigravity",
|
|
494
|
+
model="gemini-model",
|
|
495
|
+
effort="xhigh",
|
|
496
|
+
prompt_path=prompt,
|
|
497
|
+
cwd=tmp_path,
|
|
498
|
+
use_stream_json=True,
|
|
499
|
+
)
|
|
500
|
+
)
|
|
501
|
+
assert agy.argv == (
|
|
502
|
+
"agy", "--dangerously-skip-permissions", "--input-format", "stream-json",
|
|
503
|
+
"--output-format", "stream-json", "--model", "gemini-model", "--effort", "xhigh",
|
|
504
|
+
)
|
|
505
|
+
assert json.loads(agy.stdin_text) == {"event": "user", "message": {"content": "hello"}}
|
|
506
|
+
assert agy.prompt_mode == "stdin"
|
|
507
|
+
assert "hello" not in agy.argv
|
|
508
|
+
|
|
509
|
+
agy_fallback = build_ai_session_command(
|
|
510
|
+
AISessionConfig(
|
|
511
|
+
cli_command="agy",
|
|
512
|
+
platform="antigravity",
|
|
513
|
+
model=None,
|
|
514
|
+
prompt_path=prompt,
|
|
515
|
+
cwd=tmp_path,
|
|
516
|
+
use_stream_json=False,
|
|
517
|
+
)
|
|
518
|
+
)
|
|
519
|
+
assert agy_fallback.argv == ("agy", "-p", "hello", "--dangerously-skip-permissions")
|
|
520
|
+
assert agy_fallback.stdin_text is None
|
|
521
|
+
assert agy_fallback.prompt_mode == "argument"
|
|
522
|
+
|
|
523
|
+
agy_support = detect_stream_json_support(
|
|
524
|
+
"agy",
|
|
525
|
+
"antigravity",
|
|
526
|
+
lambda command: "--print --dangerously-skip-permissions --input-format --output-format stream-json",
|
|
527
|
+
)
|
|
528
|
+
assert agy_support.enabled is True
|
|
529
|
+
assert agy_support.format == "antigravity-stream-json"
|
|
530
|
+
|
|
490
531
|
|
|
491
532
|
def test_windows_structural_paths_use_installed_python_runtime_layout(tmp_path):
|
|
492
533
|
from prizmkit_runtime.paths import resolve_runtime_paths
|
|
@@ -1896,6 +1937,100 @@ def test_outer_runner_routes_cursor_through_native_preflight_and_session_config(
|
|
|
1896
1937
|
assert launch.cwd == paths.project_root
|
|
1897
1938
|
|
|
1898
1939
|
|
|
1940
|
+
def test_outer_runner_routes_antigravity_through_native_preflight_and_session_config(monkeypatch, tmp_path):
|
|
1941
|
+
from prizmkit_runtime import runners
|
|
1942
|
+
from prizmkit_runtime.runner_models import family_for, parse_invocation
|
|
1943
|
+
|
|
1944
|
+
paths = _make_paths(tmp_path / "agy-outer-runtime")
|
|
1945
|
+
family = family_for("feature", paths)
|
|
1946
|
+
invocation = parse_invocation(family, "run", ())
|
|
1947
|
+
invocation = invocation.__class__(**{**invocation.__dict__, "list_path": paths.feature_plan})
|
|
1948
|
+
observed = _install_runner_session_fakes(
|
|
1949
|
+
monkeypatch,
|
|
1950
|
+
runners,
|
|
1951
|
+
statuses=("workflow_skipped",),
|
|
1952
|
+
update_status="completed",
|
|
1953
|
+
)
|
|
1954
|
+
monkeypatch.setattr(
|
|
1955
|
+
runners,
|
|
1956
|
+
"load_runtime_config",
|
|
1957
|
+
lambda _paths: SimpleNamespace(
|
|
1958
|
+
ai_client=SimpleNamespace(command="agy", platform="antigravity", launch_profile=None),
|
|
1959
|
+
model="agy-model",
|
|
1960
|
+
effort="xhigh",
|
|
1961
|
+
effort_validation=SimpleNamespace(valid=True, message=""),
|
|
1962
|
+
),
|
|
1963
|
+
)
|
|
1964
|
+
probes = []
|
|
1965
|
+
|
|
1966
|
+
def agy_preflight(command, platform):
|
|
1967
|
+
probes.append((command, platform))
|
|
1968
|
+
return SimpleNamespace(enabled=True, notes=())
|
|
1969
|
+
|
|
1970
|
+
monkeypatch.setattr(runners, "detect_stream_json_support", agy_preflight)
|
|
1971
|
+
monkeypatch.setattr(
|
|
1972
|
+
runners,
|
|
1973
|
+
"run_git_plan",
|
|
1974
|
+
lambda *args, **kwargs: SimpleNamespace(ok=True, reason="", results=()),
|
|
1975
|
+
)
|
|
1976
|
+
|
|
1977
|
+
status = runners._process_item(family, invocation, "F-001", paths, initial_metadata={})
|
|
1978
|
+
|
|
1979
|
+
assert status == "completed"
|
|
1980
|
+
assert probes == [("agy", "antigravity")]
|
|
1981
|
+
assert len(observed.launch_configs) == 1
|
|
1982
|
+
launch = observed.launch_configs[0]
|
|
1983
|
+
assert launch.platform == "antigravity"
|
|
1984
|
+
assert launch.cli_command == "agy"
|
|
1985
|
+
assert launch.use_stream_json is True
|
|
1986
|
+
assert launch.effort == "xhigh"
|
|
1987
|
+
assert launch.model == "per-item-model"
|
|
1988
|
+
assert launch.cwd == paths.project_root
|
|
1989
|
+
|
|
1990
|
+
monkeypatch.setattr(
|
|
1991
|
+
runners,
|
|
1992
|
+
"load_runtime_config",
|
|
1993
|
+
lambda _paths: SimpleNamespace(
|
|
1994
|
+
ai_client=SimpleNamespace(command="agy", platform="antigravity", launch_profile=None),
|
|
1995
|
+
model="agy-model",
|
|
1996
|
+
effort="invalid-effort",
|
|
1997
|
+
effort_validation=SimpleNamespace(valid=False, message="Unsupported Antigravity PRIZMKIT_EFFORT=invalid-effort"),
|
|
1998
|
+
),
|
|
1999
|
+
)
|
|
2000
|
+
with pytest.raises(RuntimeError, match="Unsupported Antigravity PRIZMKIT_EFFORT=invalid-effort"):
|
|
2001
|
+
runners._process_item(family, invocation, "F-001", paths, initial_metadata={})
|
|
2002
|
+
|
|
2003
|
+
incompatible_paths = _make_paths(tmp_path / "agy-outer-incompatible")
|
|
2004
|
+
incompatible_family = family_for("feature", incompatible_paths)
|
|
2005
|
+
incompatible_invocation = parse_invocation(incompatible_family, "run", ())
|
|
2006
|
+
incompatible_invocation = incompatible_invocation.__class__(
|
|
2007
|
+
**{**incompatible_invocation.__dict__, "list_path": incompatible_paths.feature_plan}
|
|
2008
|
+
)
|
|
2009
|
+
monkeypatch.setattr(
|
|
2010
|
+
runners,
|
|
2011
|
+
"load_runtime_config",
|
|
2012
|
+
lambda _paths: SimpleNamespace(
|
|
2013
|
+
ai_client=SimpleNamespace(command="agy", platform="antigravity", launch_profile=None),
|
|
2014
|
+
model="agy-model",
|
|
2015
|
+
effort="high",
|
|
2016
|
+
effort_validation=SimpleNamespace(valid=True, message=""),
|
|
2017
|
+
),
|
|
2018
|
+
)
|
|
2019
|
+
monkeypatch.setattr(
|
|
2020
|
+
runners,
|
|
2021
|
+
"detect_stream_json_support",
|
|
2022
|
+
lambda _cmd, _plat: SimpleNamespace(enabled=False, notes=("--input-format not found",)),
|
|
2023
|
+
)
|
|
2024
|
+
with pytest.raises(RuntimeError, match="Antigravity CLI is incompatible with PrizmKit headless execution"):
|
|
2025
|
+
runners._process_item(
|
|
2026
|
+
incompatible_family,
|
|
2027
|
+
incompatible_invocation,
|
|
2028
|
+
"F-001",
|
|
2029
|
+
incompatible_paths,
|
|
2030
|
+
initial_metadata={},
|
|
2031
|
+
)
|
|
2032
|
+
|
|
2033
|
+
|
|
1899
2034
|
def test_workflow_skipped_is_finalized_as_completed_with_one_warning(monkeypatch, tmp_path, capsys):
|
|
1900
2035
|
from prizmkit_runtime import runners
|
|
1901
2036
|
from prizmkit_runtime.runner_models import family_for, parse_invocation
|