code editor: Agent Studio improvement iteration 3 for contract-clock-studio-v1. Goa

This commit is contained in:
a2a-code-editor
2026-07-18 07:53:34 +00:00
parent 49625d9d3a
commit e88577c90d
2 changed files with 7 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
name: contract-clock-studio-v1
version: 0.1.3
version: 0.1.4
entrypoint: agent:ContractClockStudioV1
expose:
public: false

View File

@@ -43,6 +43,11 @@ ALLOWED_BROWSER_MEDIA_TYPES = (
"application/octet-stream",
)
DATE_RE = re.compile(r"\b(20\d{2}-\d{2}-\d{2})\b")
RENEWAL_DATE_RE = re.compile(
r"\brenew(?:s|al|ed|ing)?\b[^.\n;]{0,160}\b(?:on|as\s+of|effective|date|until|through)\s+"
r"(20\d{2}-\d{2}-\d{2})\b",
re.IGNORECASE,
)
RENEWAL_RE = re.compile(r"\brenew(?:s|al|ed|ing)?\b", re.IGNORECASE)
NOTICE_RE = re.compile(
r"(?:at\s+least\s+)?(?P<days>\d{1,3})\s+days?\s+(?:written\s+)?notice",
@@ -71,7 +76,7 @@ class ContractClockStudioV1(A2AAgent[ContractClockStudioV1Config, PlatformUserAu
"contracts, saves user-scoped timelines, and reopens them in a packed "
"one-page studio."
)
version = "0.1.3"
version = "0.1.4"
config_model = ContractClockStudioV1Config
auth_model = PlatformUserAuth
@@ -230,13 +235,10 @@ def _tenant_key(ctx: RunContext[PlatformUserAuth]) -> str | None:
auth = getattr(ctx, "auth", None)
user_id = getattr(auth, "user_id", None)
sub = (getattr(auth, "sub", None) or "").strip()
email = (getattr(auth, "email", None) or "").strip().lower()
if user_id is not None:
return f"user:{user_id}"
if sub:
return f"user:{sub}"
if email:
return f"user:{email}"
return None