Download the PHP package ferdiunal/larapanda without Composer
On this page you can find all versions of the php package ferdiunal/larapanda. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ferdiunal/larapanda
More information about ferdiunal/larapanda
Files in ferdiunal/larapanda
Package larapanda
Short Description This is my package larapanda
License MIT
Homepage https://github.com/ferdiunal/larapanda
Informations about the package larapanda
Larapanda
Language versions: Türkçe
Larapanda is a type-safe Lightpanda SDK for Laravel and plain PHP applications. It provides named instance profiles, runtime resolution (auto, cli, docker), and immutable method-scoped option objects for fetch, serve, and mcp.
Installation
Prerequisites
Larapanda uses a runtime resolver (auto, cli, docker). CLI execution (and auto mode when CLI is selected) requires a valid Lightpanda binary. Install Lightpanda from the official source: lightpanda.io.
Install the Larapanda SDK package:
For Laravel applications, publish the package configuration:
Optional integration dependencies:
Configuration
Configuration is profile-based. Each client resolves an instance profile by name, and each profile may override the global defaults.
default_instanceselects the instance profile used when no explicit profile name is provided.defaultsdefines baseline runtime settings shared by all instances unless overridden.instances.<name>contains per-profile overrides for runtime mode, binary path, Docker parameters, and process options.- In
autoruntime mode, Larapanda prefers CLI execution whenbinary_pathis available and executable; otherwise it falls back to Docker. integrations.aiconfigures AI SDK tool adapters (instance,tool_prefix,exposed_tools, session settings).integrations.mcpconfigures Laravel MCP server tool adapters (instance,exposed_tools, session settings).
Usage
Scenario 1: Quickstart Fetch
Resolve the manager, select an instance profile, and execute a markdown fetch.
Scenario 2: Output Modes
Use strict typed accessors based on the selected dump format.
FetchResult throws UnexpectedFetchOutputFormatException when a strict accessor does not match the selected dump format.
Scenario 3: Named Instance Profiles
Select the profile according to runtime intent:
default: baseline fetch workloads.crawler: stricter crawl profile (for example, dedicated CLI runtime settings).mcp: MCP-oriented profile for long-running interactive sessions.
Scenario 4: Proxy-Aware Fetch
Use request-level proxy settings for one fetch operation:
Use integration-level proxy settings for AI SDK and MCP server tool sessions:
Scenario 5: Long-Running Serve and MCP Modes
Use RunningInstanceHandle lifecycle methods for process-safe execution:
Common Patterns
Laravel AI SDK Tools
Install optional dependencies before using adapter features:
Larapanda exposes AI SDK-compatible tools via LarapandaAiTools. The adapter is MCP-backed, session-aware, and config-driven.
Scenario 1: Full Tool Catalog
Tool naming uses the configured prefix (default lightpanda_), for example: lightpanda_markdown, lightpanda_semantic_tree, lightpanda_click.
Scenario 2: Restrict Exposed AI Tools
Limit model access to a subset of tool surfaces:
Scenario 3: Session-Aware AI Tool Continuity
For multi-step browsing tasks, guide the model to reuse a stable session_id across tool calls.
Laravel MCP Server (Optional / Advanced)
Use this layer when you want Laravel-managed MCP registration, container wiring, config-based tool filtering, and shared session/proxy policies.
If you only need a standalone MCP binary host, native lightpanda mcp can be used directly without Larapanda adapter classes.
Native vs Adapter Decision Matrix
| Use case | Recommended path |
|---|---|
| Lowest-level MCP host integration over stdio | Native lightpanda mcp |
| Laravel container wiring + profile-based runtime resolution | Larapanda MCP adapter |
Config-driven tool exposure (integrations.mcp.exposed_tools) |
Larapanda MCP adapter |
| Shared session pool and proxy policy reused by AI SDK tools | Larapanda MCP adapter |
| Direct protocol troubleshooting against Lightpanda itself | Native lightpanda mcp |
Scenario 1: Register MCP Tools in routes/ai.php
Scenario 2: Restrict MCP Tool Exposure
By default, all Lightpanda MCP tools are exposed. To reduce tool surface:
Scenario 3: Session and Proxy Policy for MCP Adapter
Session and proxy behavior are controlled from config:
- Each integration path (AI and MCP server) maintains an isolated in-memory session pool.
- Sessions map to long-running
lightpanda mcpprocesses. - Sessions expire using
session_ttl_secondsand are capped bymax_sessions. session_idcan be passed in tool arguments to preserve page context across calls.
Scenario 4: Interactive MCP Argument Model (Native-Aligned)
Interactive tools use backend-node-driven arguments. The typical flow is:
- Navigate and discover target nodes (
goto+waitForSelectororinteractiveElements). - Extract
backendNodeIdfrom the response payload. - Execute interaction tools with that node id on the same
session_id.
Testing
Run the full test suite:
Run opt-in live CLI + MCP smoke tests (native MCP and Larapanda bridge):
Run MCP-focused live smoke tests only:
Live suite policy:
- Live tests are opt-in and are not required in the default CI pipeline.
- In constrained environments, DNS/port limitations result in deterministic
skip, not flakyfail. - Real protocol and argument contract mismatches continue to fail.
Prerequisites for live tests:
LIGHTPANDA_BINARY_PATHpoints to a valid executable Lightpanda binary.- The environment permits internet access and local port binding.
- Optional proxy smoke test requires
LIGHTPANDA_HTTP_PROXY(and optionalLIGHTPANDA_PROXY_BEARER_TOKEN).
Optional proxy smoke run:
Credits
License
This package is licensed under the MIT License. See LICENSE.md for details.
All versions of larapanda with dependencies
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^11.0||^12.0||^13.0