#!/usr/bin/env python3
from __future__ import annotations

import json
import sys


def main() -> int:
    prompt = ""
    if "-p" in sys.argv:
        prompt = sys.argv[sys.argv.index("-p") + 1]

    if "identify GAPS in coverage" in prompt:
        result = "- MAS issued fresh guidance on agentic AI governance\n- IBM announced a new banking AI partnership"
    elif "Research these gaps in AI landscape coverage" in prompt:
        result = """## MAS guidance
- What happened: MAS published an update on AI governance for agentic use cases.
- Source URL: https://example.com/mas
- Banking and financial services implication: Banks now face tighter expectations on approval and monitoring loops.

## IBM partnership
- What happened: IBM announced a banking deployment with an APAC institution.
- Source URL: https://example.com/ibm
- Banking and financial services implication: Governance-led transformation remains a live consulting wedge.
"""
    else:
        result = """**Top developments:**

1. **MAS updates governance guidance for agentic AI.** Banks now have a clearer supervisory signal on approval and monitoring loops. So what for banks: governance design needs to move ahead of deployment. Source URL: https://example.com/mas
2. **IBM lands another APAC banking AI engagement.** The pattern is governance-first transformation, not isolated pilots. So what for banks: buyers will look for operating model support, not just models. Source URL: https://example.com/ibm
3. **Model vendors keep pushing cost-aware packaging.** Enterprises are being given more explicit controls over reasoning spend. So what for banks: cost governance is becoming a procurement issue. Source URL: https://example.com/cost
4. **Chinese ecosystem momentum remains strong.** Open and semi-open releases continue to compress the capability gap. So what for banks: HK institutions need dual-ecosystem evaluation muscle. Source URL: https://example.com/china
5. **Agentic infrastructure is moving into regulated environments.** Vendors are now packaging compliance and auditability as product features. So what for banks: the next wave of buying criteria is governance-native architecture. Source URL: https://example.com/infra

**Also notable:**
- Accenture and the Big Four continue repositioning around agentic operating model work. Source URL: https://example.com/consulting
- Infrastructure announcements keep focusing on price-performance for inference-heavy workloads. Source URL: https://example.com/inference
- Banking buyers are being pushed toward platform choices, not just model choices. Source URL: https://example.com/platform

**Pattern watch:** Governance is shifting from a control function to a product selection criterion for banks. Source URL: https://example.com/pattern

**Worth reading in full:**
- https://example.com/mas
- https://example.com/ibm

**Sources line:** 12 items from feed, 2 from research
"""

    print(json.dumps({"type": "result", "subtype": "success", "result": result}))
    return 0


if __name__ == "__main__":
    raise SystemExit(main())
