Commit Graph
201 Commits
Author SHA1 Message Date
MervinPraison 0b5eb93bb6 fix: update docs/docs.json path for Mintlify subpath hosting
Generator looked for docs.json at repo root; PraisonAIDocs uses
docs/docs.json so nav was never updated after auto-gen. Also run
sync_sdk_reference_nav.py after generation as a safety net.
2026-08-25 21:49:23 +01:00
MervinPraisonandMervin Praison 8da1746df8 fix(docs): report actual docs.json page count after legacy filtering
Legacy layout strips /index and /__init__ before writing package_group['pages'],
so logging len(unique_pages) overstated the count. Count the final navigation
entries instead (granular sums sub-group pages).

Co-authored-by: Mervin Praison <[email protected]>
2026-08-19 21:04:13 +00:00
MervinPraison 8928ed870a fix: stop swallowing docs.json nav update failures
Auto-generate was writing MDX without updating docs.json when update_docs_json failed silently, breaking nav-check on every docs PR.
2026-08-19 21:48:01 +01:00
MervinPraison 3819b3d51d fix(docs): serialize generate-docs pushes and rebase before push
Prevent parallel workflow runs from racing on PraisonAIDocs main; pull
--rebase before push when SDK reference pages were regenerated.
2026-08-16 07:22:18 +01:00
MervinPraison fe205e3b77 fix(docs): use CI docs-root in generator path tracking
Track generated MDX paths relative to the passed --docs-root instead of a
hardcoded local PraisonAIDocs path so generate-docs runs in GitHub Actions
can commit navigation updates.
2026-08-16 07:21:15 +01:00
Mervin Praison 193bd05793 Merge pull request #86 from MervinPraison/claude/issue-85-20260816-0512
fix: unwrap describe envelope and structured cost in registry_proxy
2026-08-16 07:18:11 +01:00
MervinPraisonandMervin Praison 7e23cddd9b fix: reject non-finite/negative prices in registry_proxy spend guard
NaN/inf prices passed float() but made both per-call and session-spend
comparisons evaluate false, bypassing the configured guard and poisoning
_session_spend. Fail closed on non-finite/negative prices in _check_budget
and validate the response charge in spend recording so a malformed response
cannot corrupt cumulative spend.

Co-authored-by: Mervin Praison <[email protected]>
2026-08-16 05:31:42 +00:00
MervinPraisonandMervin Praison 96b7a2f8e4 fix: unwrap describe envelope and structured cost in registry_proxy (fixes #85)
Both _extract_method and _extract_price now unwrap the live registry's
`endpoint` envelope before reading fields, and _extract_price prefers the
structured cost object's `usd` value (guard budgets are USD). Flat forms
and fail-closed behaviour are preserved. Fixtures mirror the live schema.

Co-authored-by: Mervin Praison <[email protected]>
2026-08-16 05:14:11 +00:00
praisonai-triage-agent[bot] 0d3e97a6b1 Merge pull request #84 from MervinPraison/claude/issue-83-20260815-1921
fix: registry_proxy describe path + HTTP method support
2026-08-15 20:30:27 +00:00
MervinPraisonandMervin Praison 23e3a88eb0 fix(registry_proxy): validate describe_path, encode tool_id, normalize+whitelist method
Address reviewer findings on PR #84:
- describe_path template validated (must contain {tool_id}; malformed templates
  return a tool-result error instead of raising, honoring the error contract)
- tool_id URL-encoded on both describe and /call routes (prevents path escape)
- explicit method stripped/upper-cased and validated against an allowed set
- deny-path spend-guard tests assert client.request (not client.post) not called

Co-authored-by: Mervin Praison <[email protected]>
2026-08-15 19:45:24 +00:00
MervinPraisonandMervin Praison 923425b443 fix: registry_proxy describe path + HTTP method support (fixes #83)
- describe now uses /catalog/endpoints/{tool_id} (configurable via
  TOOL_PROXY_DESCRIBE_PATH); fixes 404s that also broke spend-guarded calls
- registry_call derives the endpoint's HTTP method from describe (reusing the
  guard's describe fetch); GET sends query params, POST/PUT send a JSON body;
  method can be passed explicitly to skip the lookup
- docs: describe-path env var, HTTP-method behaviour, passthrough-URL/SSRF note

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2026-08-15 19:26:59 +00:00
praisonai-triage-agent[bot] 310f15d6eb Merge pull request #72 from MervinPraison/claude/issue-63-20260727-0909
fix: mock langextract in test_agent_usage_pattern
2026-08-15 12:35:50 +00:00
MervinPraison 893cfea6e7 fix(docs): use GH_TOKEN fallback for PraisonAIDocs checkout/push
DOCS_GITHUB_TOKEN was never synced to this repo; fall back to GH_TOKEN so
generate-docs can checkout and push reference docs after main merges.
2026-08-15 13:34:30 +01:00
MervinPraison 0605eec551 fix(ci): unblock auto-merge after conflict rebase and sync PraisonAIDocs
Recognise MervinPraison Claude finished replies in stale-FINAL detection,
re-post FINAL immediately after conflict rebase pushes, broaden generate-docs
triggers to all praisonai_tools changes plus post-main CI, and sync pipeline
labels on push/PR events.
2026-08-15 13:33:24 +01:00
praisonai-triage-agent[bot] 2098ab469d Merge pull request #53 from MervinPraison/claude/issue-52-20260713-2242
feat: automatic tool discovery (fixes #52)
2026-08-15 12:21:22 +00:00
MervinPraisonandMervin Praison 1424ce7769 test: isolate langextract test output to temp dirs (fixes #63)
Address Greptile finding: langextract integration/render tests wrote
generated HTML into the working directory. Pass temporary output_path
in test_agent_usage_pattern, test_contract_analysis_scenario, and
test_render_file_success so tests no longer modify the checkout or
collide across runs.

Also remove committed test artifacts (contract-001.html,
financial-analysis.html, tmpc8_hvm6m.html) that leaked from these
CWD writes in the original langextract PR.

Co-authored-by: Mervin Praison <[email protected]>
2026-08-15 11:41:09 +00:00
MervinPraisonandMervin Praison 3a67c9bc59 test: run tool-discovery parse guard inside CI-covered path
CI runs `pytest tests/unit --ignore=tests/unit/video`, so the parse-failure
and collision guards in tests/test_tool_discovery.py (at tests/ root) never
executed in CI. Adds a thin bridge under tests/unit/tools/ so a syntactically
broken shipped tool module fails loudly at CI time instead of silently
dropping out of discovery and surfacing later as an AttributeError.

Closes the remaining Greptile P1 (parse test misses CI).

Co-authored-by: Mervin Praison <[email protected]>
2026-08-15 11:40:59 +00:00
MervinPraisonandMervin Praison 5a233cb3b5 test: account for top-level catalogue exports after rebase onto main
Main (#74) added ToolCatalogueEntry/list_tools/get_tool_names to the
top-level __all__. The top-level surface now equals the tools-package
surface plus those catalogue helpers, so test_all_matches_manifest is
updated accordingly.

Co-authored-by: Mervin Praison <[email protected]>
2026-08-15 11:40:59 +00:00
MervinPraisonandMervin Praison 44cbefe9b7 test: fail loudly if a shipped tool module cannot be parsed
Discovery intentionally swallows a per-module SyntaxError so one broken
module cannot break the whole package import, but that meant a broken
shipped module silently dropped from the manifest (resolving as
AttributeError instead of the real parse error). The existing coverage
test shared the same swallowing helper, so it could not catch it.

Add test_every_shipped_module_parses which ast.parse()s each module
directly, surfacing the pointing SyntaxError at CI time. Addresses the
re-raised Greptile P1.

Co-authored-by: Mervin Praison <[email protected]>
2026-08-15 11:40:59 +00:00
MervinPraisonandMervin Praison 5c302e2acc fix: respect __all__, skip private modules, cache discovery scan
Address reviewer feedback on PR #53:
- Honour an explicit module-level __all__ (CodeRabbit/Gemini): modules that
  expose tools via aliases can opt them in; bare aliases are otherwise not
  auto-exported to avoid cross-module name collisions.
- Skip underscore-prefixed modules so internal code cannot leak into the
  public surface (Greptile).
- Warn instead of silently dropping tools when a module fails to parse
  (Greptile).
- Guard the drop-in test for read-only installs and use a non-underscore
  probe module (Gemini); add an n8n external-symbol resolution test
  (CodeRabbit) and an explicit-__all__ test.
- Memoise the AST scan in a fingerprinted on-disk cache, cutting import
  time from ~260ms to ~70ms (AGENTS.md <200ms budget) while keeping
  discovery automatic; add cache round-trip/corruption tests and gitignore.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2026-08-15 11:40:59 +00:00
MervinPraisonandMervin Praison 517a3b8bcb feat: replace hand-maintained tool import map with automatic discovery (fixes #52)
Adding a tool now means adding one file under praisonai_tools/tools/.
An AST-based scan builds the name->module manifest without importing any
tool module, preserving per-symbol lazy import. __all__ at both package
levels is derived from the same manifest so they cannot drift, and
collisions are detected at discovery time. README now documents that this
package uses in-package discovery while external packages use the
praisonaiagents.tools entry-point group.

Co-authored-by: Mervin Praison <[email protected]>
2026-08-15 11:40:59 +00:00
Mervin Praison 6d6330087e Merge pull request #67 from MervinPraison/claude/issue-58-20260727-0903
fix(tests): mock langextract in agent usage integration test
2026-08-15 12:39:39 +01:00
Mervin Praison ea56295eac Merge pull request #71 from MervinPraison/claude/issue-61-20260727-0908
fix: sync marketplace tool wrapper docstrings with signature tests
2026-08-15 12:38:52 +01:00
Mervin Praison 251ed8b800 Merge pull request #73 from MervinPraison/claude/issue-60-20260727-0907
fix(docs): repair MDX escaping utilities (fixes #60)
2026-08-15 12:38:06 +01:00
Mervin Praison 2720359927 Merge pull request #77 from MervinPraison/claude/issue-76-20260806-0854
feat: source-derive the tool catalogue (fixes #76)
2026-08-15 12:37:37 +01:00
Mervin Praison 6087b47bf8 Merge pull request #81 from MervinPraison/claude/issue-80-20260814-1422
fix: silence benign 'Registry is None' WARNING spam on bare import
2026-08-15 12:36:53 +01:00
praisonai-triage-agent[bot] b7d3a4a178 Merge pull request #82 from MervinPraison/claude/issue-79-20260814-1422
feat: registry_proxy wire-compatibility — configurable auth header and price-field tolerance
2026-08-14 15:33:01 +00:00
MervinPraisonandpraisonai-triage-agent[bot] 5011f3311c fix: add noqa E402 for intentional post-code imports in decorator
The logging-suppression filter must run before the @tool re-exports are
imported, requiring those imports to sit after module-level code. Mark them
with noqa: E402 to satisfy ruff while preserving the required ordering.

Co-authored-by: praisonai-triage-agent[bot] <praisonai-triage-agent[bot]@users.noreply.github.com>
2026-08-14 14:47:07 +00:00
MervinPraisonandMervin Praison 9699ff1513 feat: registry_proxy wire-compat — configurable auth header and price-field tolerance (fixes #79)
- Add TOOL_PROXY_AUTH_HEADER / auth_header param: default Authorization sends
  Bearer, a custom header name (e.g. X-Treg-Token) sends the raw token.
- Harmonise budget check to accept price_per_call -> price -> cost (same
  tolerance as spend recording); keep fail-closed when none parse.

Co-authored-by: Mervin Praison <[email protected]>
2026-08-14 14:25:39 +00:00
MervinPraisonandMervin Praison dfd2d18357 fix: silence benign 'Registry is None' WARNING spam on bare import (fixes #80)
Importing praisonai_tools tools (e.g. registry_proxy) outside a running
agent context emitted one WARNING per @tool-decorated function from
praisonaiagents.tools.decorator ("Registry is None for tool …"). On a bare
import that is the normal state, not an anomaly, so it polluted logs/CI for
every library consumer and scaled with the tool catalogue.

Attach a targeted logging.Filter (to the root logger and its handlers, where
praisonaiagents routes the record) that drops only that specific message and
passes all other logging through untouched. Registration behaviour is
unchanged; the root fix (defer/downgrade) belongs in praisonaiagents core.

Co-authored-by: Mervin Praison <[email protected]>
2026-08-14 14:25:32 +00:00
MervinPraison f10936de79 Release v0.2.37 v0.2.37 2026-08-14 14:16:18 +00:00
Mervin Praison 49b717ecfe Merge pull request #78 from MervinPraison/claude/issue-3937-20260814
feat: optional tool-registry proxy connector
2026-08-14 15:15:24 +01:00
MervinPraisonandMervin Praison 6acddaaa95 fix(registry-proxy): bind token to trusted config, persist session spend, fail-closed budget
Addresses reviewer findings on PR #78:
- Do not attach the ambient TOOL_PROXY_TOKEN when an explicit proxy_url is
  supplied without a matching token, preventing token exfiltration to an
  attacker-controlled endpoint (Critical).
- Persist cumulative spend per (proxy_url, token) via a module-level store so
  max_session_spend enforces across separate registry_call invocations (Major).
- Fail closed in _check_budget when a guard is configured but price cannot be
  validated; record spend deterministically from the quoted price (Major).
- Add regression tests + autouse spend-state reset fixture; update docs.

Co-authored-by: Mervin Praison <[email protected]>
2026-08-14 14:05:23 +00:00
MervinPraisonandMervinPraison ed07dfc6a5 feat: optional tool-registry proxy connector (fixes MervinPraison/PraisonAI#3937)
Add a bring-your-own-account connector mirroring PraisonAI's deferred
tool-search bridge: registry_search / registry_describe / registry_call
over a registry's plain-HTTP proxy (token header, configurable base URL).
Credentials are injected server-side by the registry, never held by the
agent. Connector is disabled unless TOOL_PROXY_URL is set; httpx is
lazy-imported; errors surface as {"error": ...} tool results. Includes
optional per-call/per-session spend guards, docs (Tiers 0/1/2) and mocked
HTTP unit tests plus a skills-dir compatibility test.

Co-authored-by: MervinPraison <[email protected]>
2026-08-14 13:45:49 +00:00
MervinPraisonandMervin Praison ce9cbe08e6 fix: read annotated tool descriptions and scope catalogue fallback to nested tools
Address reviewer findings on PR #77:
- _scan_module now also reads annotated `description: str = "..."` class
  attributes (AnnAssign), so CapsuleTool/NexusPredictionMarketTool surface
  their real descriptions instead of name-synthesised summaries.
- Restrict the _TOOL_MAP catalogue fallback to nested (absolute-module) tools
  only; flat *_tool.py classes stay fully source-derived, preserving the
  no-hand-maintained-bookkeeping guarantee.
- Fix phantom-guard test to resolve absolute tool modules correctly so a
  missing nested first-party module is flagged as a phantom, not tolerated as
  an optional dependency.
- Tighten CalculatorTool summary assertion and add regression coverage for
  annotated descriptions.

Co-authored-by: Mervin Praison <[email protected]>
2026-08-06 09:18:35 +00:00
MervinPraisonandMervin Praison 9d17d0e7a1 feat: source-derive the tool catalogue to eliminate hand-maintained bookkeeping (fixes #76)
Derive the first-party tool catalogue from the source tree instead of the
hand-maintained _TOOL_MAP, so adding a tool becomes a single-file change and
phantom names (advertised tools with no file) are impossible by construction.

- catalogue.py: AST-scan praisonai_tools/tools/*_tool.py for *Tool classes and
  their literal description (cheap, import-free, no optional deps). Summaries now
  come from each tool's real description rather than name-synthesis.
- tools/__init__.py: extend lazy __getattr__ to fall back to the source-derived
  scan, so dropping a *_tool.py makes its class importable with no _TOOL_MAP edit.
  Auto-discovers previously-unmapped ClaudeMemoryTool/CrowPayTool/NightmarketTool.
- tests/test_catalogue_no_phantoms.py: CI guard asserting every catalogue name
  resolves (tolerating only missing optional deps), maps to a real file, and that
  auto-discovery + real-description summaries work.

Lazy-import behaviour and cheap `import praisonai_tools` are preserved; existing
public import names remain stable.

Co-authored-by: Mervin Praison <[email protected]>
2026-08-06 08:59:52 +00:00
MervinPraison 8e1fe1d860 Release v0.2.36 v0.2.36 2026-08-04 11:41:31 +00:00
praisonai-triage-agent[bot] 0629d18a4e Merge pull request #75 from MervinPraison/claude/issue-74-20260804-0919
feat: add tool discovery/catalogue contract
2026-08-04 11:40:29 +00:00
MervinPraisonandMervin Praison 1950368530 feat: add tool discovery/catalogue contract (fixes #74)
Expose a programmatic catalogue of shipped tools plus a `praisonai.tools`
entry-point discovery contract so validators/CLI/docs/third-party packages
resolve against the live catalogue instead of a hand-maintained allowlist
that drifts.

- praisonai_tools.catalogue: ToolCatalogueEntry, list_tools(), get_tool_names()
- Derive catalogue from the existing _TOOL_MAP source of truth (no optional deps)
- Discover third-party tools via `praisonai.tools` entry points
- Add `praisonai-tools list [--extras]` CLI subcommand
- Document the entry-point group in pyproject.toml
- Tests in tests/test_catalogue.py

Co-authored-by: Mervin Praison <[email protected]>
2026-08-04 09:24:51 +00:00
MervinPraison ea270f747a Release v0.2.35 v0.2.35 2026-07-31 02:37:35 +00:00
praisonai-triage-agent[bot] d06254fc68 Merge pull request #66 from MervinPraison/claude/issue-57-20260727-0902
fix(video): align motion graphics team tests with hierarchical API
2026-07-27 14:58:54 +00:00
MervinPraisonandMervin Praison e0b164c530 fix(video): use hierarchical coordinator in motion graphics example
Replace stale team.leader.name access with team.agents[0].name to match
the hierarchical AgentTeam API (no static leader in this mode).

Co-authored-by: Mervin Praison <[email protected]>
2026-07-27 14:14:49 +00:00
MervinPraisonandMervin Praison a8627e295e fix(video): align motion graphics team tests with hierarchical API (fixes #57)
The integration tests asserted `team.leader` and an exact `kwargs` dict,
but the preset uses `process="hierarchical"` where the coordinator is the
first agent (`team.agents[0]`) and `process`/`manager_llm` are forwarded.
Update tests to the hierarchical semantics and document the pattern in the
`motion_graphics_team` docstring.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-27 14:14:49 +00:00
praisonai-triage-agent[bot] 2b159d8816 Merge pull request #70 from MervinPraison/claude/issue-62-20260727-0908
fix: align motion graphics team tests with hierarchical AgentTeam API
2026-07-27 14:12:05 +00:00
praisonai-triage-agent[bot] 27b0f5e7a3 Merge pull request #65 from MervinPraison/claude/issue-54-20260727-0859
fix: add video-motion deps to dev extra; skip video tests when missing
2026-07-27 14:06:18 +00:00
MervinPraisonandMervin Praison f44138e6d9 fix(docs): make Mintlify JSX components case-sensitive in MDX escaping
HTML tags stay case-insensitive (<div>/<DIV>) but JSX components are now
matched exactly, so a mis-cased component such as <badge> is escaped as
prose instead of being emitted as a broken component. escape_mdx and
validate_mdx share a single _is_valid_mdx_tag helper so they stay in
lockstep. Resolves the outstanding Greptile P1 tag-casing finding.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-27 12:06:09 +00:00
MervinPraisonandMervin Praison ea9407b34b style(video-tests): fix ruff I001/SIM117 in video test files
Clears this PR's lint contribution (video dir 13 -> 0 ruff errors):
sort imports and combine nested `with` statements. No behaviour change;
video tests still pass (54 passed with deps). Repo-wide ruff debt in
praisonai_tools/ (~5321 pre-existing errors) is out of scope for this
video-test-deps PR.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-27 12:03:57 +00:00
MervinPraisonandMervin Praison ae16e3eebb test(video): narrow video-dep guards to backend-constructing tests
Replace the directory-wide pytest.importorskip in tests/unit/video/conftest.py
with per-test skipif guards on only the tests that build a real
HtmlRenderBackend. Dependency-independent protocol, mock-backend and retry
tests now run on a minimal `pip install -e '.[dev]'` (40 passed / 14 skipped
without video-motion; 54 passed with it), addressing Greptile's feedback that
the broad skip dropped useful coverage.

Also make test_import_error_handling deterministic by patching async_playwright
so the imageio-ffmpeg guard is what's under test regardless of installed deps.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2026-07-27 12:03:57 +00:00
MervinPraisonandMervin Praison 803f2b219e fix: add video-motion deps to dev extra and skip video tests when missing (fixes #54)
- Add playwright and imageio-ffmpeg to the [dev] extra so the full pytest
  suite runs after `pip install -e ".[dev]"` (Option A).
- Add tests/unit/video/conftest.py with pytest.importorskip guards so
  minimal installs skip video tests gracefully instead of erroring (Option C).
- Document the video-motion render deps and `playwright install chromium`
  step in README Testing section.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-27 12:03:42 +00:00
MervinPraisonandMervin Praison 7b36689195 fix(ci): pin ruff to E/F rule families to unblock CI lint
The CI `ruff check praisonai_tools tests` step had no ruff config, so a
newer ruff release pulled in strict opinionated defaults (UP/I/W/SIM/RUF)
flagging 5000+ pre-existing, non-functional findings across untouched
files. This pre-dated PR #62 (failing on main at b96bfbc).

Add [tool.ruff.lint] selecting the historical E/F baseline that the
existing `--ignore E…,F…` CI flags already imply, restoring green
without editing unrelated files or weakening any tests.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-27 12:02:27 +00:00