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
Rules
resources/rules/invoice-style/resource.ts
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
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}.
Skills
resources/skills/invoice-checks/resource.ts
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
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 aspolicy, 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. UsenextOffsetto 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, returningfileIdandname.
/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.