Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
agent_request_queue.hpp File Reference
#include <optional>
#include <string>
#include <string_view>
#include <utility>
#include <vector>

Go to the source code of this file.

Classes

struct  pulp::inspect::AgentRequest
 One queued request from the human, with the context the agent needs to act without guessing which design/screen/state it refers to. More...

Namespaces

namespace  pulp
namespace  pulp::inspect

Functions

std::string_view pulp::inspect::queue_filename ()
 The canonical queue filename (beside .pulp-design-meta.json).
std::string pulp::inspect::requests_to_json (const std::vector< AgentRequest > &requests)
 Serialize a request list to the canonical, stable JSON document.
std::optional< std::vector< AgentRequest > > pulp::inspect::requests_from_json (std::string_view queue_json)
 Parse a queue document.
std::optional< std::string > pulp::inspect::append_request (std::string_view queue_json, AgentRequest request)
 Append request to the queue encoded in queue_json, assigning a fresh id when request.id is empty (one greater than the largest numeric id present, starting at "1").
std::vector< AgentRequest > pulp::inspect::pending_requests (std::string_view queue_json)
 The not-yet-consumed requests in queue_json, in order.
std::optional< std::pair< std::string, bool > > pulp::inspect::ack_request (std::string_view queue_json, std::string_view id)
 Mark the request whose id is id consumed in queue_json.
std::string pulp::inspect::queue_path (std::string_view project_dir)
 The queue file path inside project_dir.
std::optional< std::string > pulp::inspect::enqueue_to_file (const std::string &path, AgentRequest request)
 Read + append + atomically rewrite the queue at path.
std::vector< AgentRequest > pulp::inspect::read_pending_file (const std::string &path)
 The pending requests in the queue file at path (empty when the file is absent or unreadable).
bool pulp::inspect::ack_in_file (const std::string &path, std::string_view id)
 Ack id in the queue file at path, rewriting atomically.