Skip to content

API Reference parrot_tools.business_automation.store

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot_tools.business_automation.store

View source

PlanDirectoryStore — loads BusinessOperation/TemplatePlan/ScrapingFlow definitions from an external, private plans directory.

FEAT-453, Module 6 (Goal G4). Per the spec's public/private seam, this engine is public; the plans it drives (credentials, selectors, real business identifiers) are not — they live in a directory outside this repository, configured at runtime. This store is deliberately distinct from :class:~parrot_tools.scraping.registry.PlanRegistry, which is fingerprint-keyed and reads inside the repo tree for scraped/cached plans; this store is operation-keyed and reads an external directory of hand-authored definitions.

Directory contents are untrusted input (authored outside the repo, driving a browser against a financial system): any malformed file, or any .template.json carrying a literal authenticate password (TASK-2389's lint), rejects the whole directory — never silently skips one file.

Alias BusinessOperation

Re-exported from parrot_tools.business_automation.models.BusinessOperation.

Class PlanDirectoryStore

Loads and hot-reloads business-operation definitions from a directory.

Parameter Type Default Description
plans_dir Union[str, Path] External, private directory containing *.operation.json / *.template.json / *.flow.json files.

Attributes:

Attribute Type Description
operations Dict[str, BusinessOperation] Loaded :class:BusinessOperation\ s, keyed by name.
templates Dict[str, TemplatePlan] Loaded TemplatePlan\ s, keyed by name.
flows Dict[str, ScrapingFlow] Loaded ScrapingFlow\ s, keyed by name.

Method PlanDirectoryStore.load

(Re)load every definition file in plans_dir.

The directory is scanned and parsed into local (not-yet-committed) registries first; only once every file has been validated successfully are self.operations/self.templates/self.flows replaced atomically. A failed load therefore leaves any previously loaded (good) state untouched.

load() -> None

Raises:

  • ValueError — On the first malformed file or credential-lint violation, naming the offending filename and reason. Never silently skips a bad file — the whole directory is rejected.

Method PlanDirectoryStore.reload_if_changed

Hot-reload: re-scan and reload if any .json file's mtime changed, or a file was added/removed, since the last load.

reload_if_changed() -> bool

Returns: bool — True if a reload happened, False if nothing changed.

Raises:

  • ValueError — Propagated from :meth:load if the changed directory is now malformed — the previously loaded (good) state is left untouched (see :meth:load).

Alias ScrapingFlow

Re-exported from parrot_tools.scraping.ScrapingFlow.

Alias TemplatePlan

Re-exported from parrot_tools.scraping.TemplatePlan.

Alias lint_literal_credentials

Re-exported from parrot_tools.scraping.models.lint_literal_credentials.

Attribute logger

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally