Skip to content
Source
Sign inSign up

Keep agents in the repository

Software factory / Custom agents

Keep custom agents in the repository

You want your custom agents in git, next to your code. Keep the factory file as .source/factory.ts on the default branch, where it can also import your own files and packages.

2 min read

You need:

1. Pick the repository file as the source

  1. In the factory settings, set Custom agents come from to .source/factory.ts on the default branch.
  2. Click Save rules.

With this source, the files in the vault do not run.

2. Commit the file

Commit the file as .source/factory.ts to the default branch.

The forge reads this file from the tip of the default branch only. A pull request cannot change the agents that run on it.

3. See the agents load

Open Agents, then go to Custom agents under Software factory. The Custom agents card shows the agents that loaded from .source/factory.ts, or its errors.

Done

Your agents come from git. To change an agent, commit a change of .source/factory.ts to the default branch. If the card shows an error, see Fix an error in the factory file.

Import your own files and packages

This file can also import the other files and the packages of your repository. The forge bundles it in a checkout of the default branch, and installs the packages from your lockfile first. See The bundle of the repository file.

A private package registry

The install can read packages from a private registry, such as GitHub Packages:

  1. Add a CI secret with the token of the registry. Bind the secret to the hosts of the registry, for example npm.pkg.github.com. See Trust and secrets.
  2. In your .npmrc, use the secret as an environment variable, for example //npm.pkg.github.com/:_authToken=${NPM_TOKEN}.
  3. In the factory settings, put the name of the secret in Secrets for the package install.

The install gets a placeholder that starts with tss_ph_, not the value. The forge puts the value in place of the placeholder only in the headers of a request to the hosts of the secret.

The forge reads the value from the development environment when the install first sends the placeholder. It checks the environment's rules again first, and never stores the value. The install can only read packages: it sends nothing.