request_approval (approvals.py)

JIGGA · auth

File-first approval queue (Milestone B, slice B6). When an agent action needs human approval (medium/high-risk capability, agent not in `autonomous` mode), the runtime parks a pending approval here and asks on the originating channel. The user replies `approve <code>` / `deny <co

"""File-first approval queue (Milestone B, slice B6).

When an agent action needs human approval (medium/high-risk capability, agent
not in `autonomous` mode), the runtime parks a pending approval here and asks on
the originating channel. The user replies `approve <code>` / `deny <code>`; the
channel gateway resolves it and re-queues the held task. On the re-run the gate
finds the approval and lets that one action through (consumed once).

Mirrors ClawRecipes' `approval.json`: durable, inspectable, code-gated. Records
live under `~/.jigga/approvals/queue/<id>.json`.
"""

from __future__ import annotations

import re
from pathlib import Path
from typing import Any

from jigga.core.io import ensure_dir, read_json, write_json
from jigga.core.models import now_iso
from jigga.runtime.audit impo

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search 40K more like it.

Get a free API key