Skip to main content
Define a shared resource in resource.ts and import it into an agent. EigenPal captures the accompanying files from the agent’s Git commit. You do not need to import each document or maintain a version-string dependency map.

Resource directories

resource.ts is a required filename, with a default export. Directory names and import aliases are your choice. Factories accept name and optional description; createTemplate also accepts an optional file.

Knowledge

resources/knowledge/tax-policy/resource.ts
Put reference files beside the declaration, including nested directories. Knowledge supports Markdown, UTF-8 text, CSV, JSON, PDF, DOCX and XLSX. PDF reading requires a text layer and the deployment’s text extractor; scanned-only documents need OCR before you add them. Documents are reference data, not extra instructions.

Rules

resources/rules/invoice-style/resource.ts
Put reusable instructions in RULE.md. EigenPal adds them to the agent’s prompt in both execution modes. Companion files remain available through resource tools.

Templates

resources/templates/invoice-summary/resource.ts
Provide exactly one conventional template.md, template.docx or template.xlsx. For another filename, set file: 'summary.docx'. The file must remain inside the resource directory. Missing or ambiguous template entries fail validation. Markdown templates use {{supplier}} and nested {{customer.name}} fields; Liquid control tags are unsupported. Office templates use single braces:
  • DOCX scalar: {supplier}. Loop: {#items}{name}: {amount}{/items}. Conditional: {#approved}Approved{/approved}.
  • XLSX scalar: {supplier}. Table columns: {table:items.name} and {table:items.amount}.
Template tools do not support raw XML insertion or XLSX image placeholders. Filling creates a run artifact; it does not overwrite the original template.

Skills

resources/skills/invoice-checks/resource.ts
Keep SKILL.md and its scripts, references and helper assets in the directory. Skills require .withFilesystem({ skills }). The agent receives a catalog and reads the skill instructions as needed. Helpers run only when the agent invokes them inside the filesystem sandbox; attaching a skill does not execute its scripts.

Example companion files

For a minimal working resource set, add these beside the declarations above:
resources/knowledge/tax-policy/README.md
resources/rules/invoice-style/RULE.md
resources/templates/invoice-summary/template.md
resources/skills/invoice-checks/SKILL.md

Attach resources

agents/invoice/agent.ts
The normal reviewer uses knowledge, rules and templates without a filesystem. The default filesystem variant also receives their original directories and the checks skill. Skills cannot go in the normal agent’s resources property.

Built-in resource tools

The model uses the imported alias, such as policy, as the resource argument:
  • resource_list({ resource }): list captured paths.
  • resource_search({ resource, query }): case-insensitive literal search, up to ten excerpts with paths and character offsets.
  • resource_read({ resource, path, offset?, limit? }): read extracted text, up to 12,000 characters per call. Use nextOffset to page through long files. Binary companion files can produce downloadable artifacts.
  • template_inspect({ resource }): inspect placeholders.
  • template_fill({ resource, data, filename? }): fill the template and register a downloadable artifact, returning fileId and name.
EigenPal restricts aliases in these tool schemas to attached resources. Templates and rules also expose companion files through browse tools. Model context contains a small catalog rather than all knowledge text. Both agent modes get the tools. These are platform operations; custom callbacks cannot call them as JavaScript functions. Filesystem copies live under /workspace/agent/.eigenpal-resources/<alias>/ even when cwd changes or is null. They do not overwrite the agent’s working files.

Capture and release

Capture recursively excludes hidden files/directories, dependency folders, resource.ts, package manifests/locks and private-key extensions. It preserves asset bytes and executable flags. The compiler allows at most 128 captured files and 2 MiB of source, with additional bounded compiled resource data. Resource maps allow up to 32 aliases. Use an external source for larger collections. Validate with eigenpal agents validate from the agent package. Resource factories do not read your host disk; the deployment’s source capture resolves their directories. The public low-level compileAgent function expects already captured resource data. An agent release pins resource content. Releasing a changed resource alone does not update existing agent releases; release the agent again to capture the change. Historical runs and supported resumes retain their resource snapshot.