---
title: "Scripts & Dependencies"
id: "1857"
type: "page"
slug: "scripts"
published_at: "2026-09-21T00:23:50+00:00"
modified_at: "2026-10-22T16:38:23+00:00"
url: "https://xedant.com/agents/portal/docs/scripts/"
markdown_url: "https://xedant.com/agents/portal/docs/scripts.md"
excerpt: "Calculation scripts are ordinary files among the portal’s content. They are visible, they move together…"
---

# Scripts & Dependencies

[https://xedant.com/agents/portal/docs/scripts/.md](https://xedant.com/agents/portal/docs/scripts/.md)

Calculation scripts are ordinary files among the portal’s content. They are visible, they move together with the portal, and their edit history is kept by the same version history. Below is where they live, how to add libraries to them, and how the agent debugs them.

## Where scripts live

- **The shared folder** — a folder at the portal’s root. Scripts needed by several pages live here: a query to your system, or a shared summary calculation.
- **The page’s folder** — right next to the page itself. Scripts only it needs are kept here: small and narrow in purpose.

When a block references a script, the portal looks for it in the page’s folder first, and in the shared folder if not found. That way the same script can be temporarily “overridden” for one page without touching the shared one. Absolute paths and climbs up the folder tree are forbidden: a script cannot escape the portal’s bounds.

A script does more than compute data for a single block. It can also be a data source: when the numbers have to be collected from an external service that has no database, the agent describes a source that runs such a script, and pages take ready rows from it (see the [Data Sources & Visualisations](/agents/portal/docs/sources)
 section).

## Libraries

The portal already has everything simple scripts need. When a script requires an extra library, its name is written into a separate file, and the agent installs everything listed with one command. Without the install, the new library will not work — the script will honestly say the needed set is missing.

```
httpx
pandas
requests
```

The install takes a few minutes and ends with a report of the result. It happens once — after that the script uses the library at once.

## A working folder for its own files

When a script needs to save a result — a file to download, or intermediate data — there is a separate working folder outside the content tree. That, and only that, is where a script may write files. The portal’s content stays free of service files, and the edit history stays clean.

## Debugging

The agent can run any script by hand and see what it printed and what the errors were. Readers do not see this “draft” work: the page shows only a readable message. When a script fails, for example, the reader reads that the calculation did not work out, while the agent sees the full error text and fixes the script.

## Work limits

- Computing content — up to 60 seconds.
- Running an action — up to 120 seconds.
- Four scripts compute at once; the rest wait in line.
- Input data — up to 64 kilobytes.

When a script runs out of time, the portal stops it together with every process it started — nothing stays hanging in the background.

## Readable error codes

Script errors are not “raw” but carry a readable meaning: script not found, wrong answer format, time ran out, Python unavailable. In every case the reader sees a human message, and the agent the details. A breakdown of the errors is in the [Dynamic Python Blocks](/agents/portal/docs/python)
 section.

## Examples in the demonstration portal

The demonstration portal collects working examples for every case: a service status table, a chart, a services table, a subscription form and a news feed. They are convenient to open and study — to see how a script connects to a block — before asking the agent to write your own.

Next: how charts are drawn — in the [Charts](/agents/portal/docs/charts)
 section; how forms work — in [Forms](/agents/portal/docs/forms)
; how the agent runs scripts — in [Agent Management](/agents/portal/docs/management)
.

[← Back to the documentation index](/agents/portal/docs)
