Skip to Content
Modules

Modules

A module finds bids or companies for a Tommos workspace. You write one function; Tommos runs it, checks it and keeps a log of it.

A module is a small package that finds records of one kind at a source: the open tenders of a public register, the companies in a feed of news. Tommos runs it on the schedule the workspace sets, in a sandbox of its own, and takes only the records that pass the contract of their kind.

KindWhat a record isWhere it goes in Tommos
bidAn open tender of a public buyerThe door of bids: a deal on the board Bids, after the triage of Tommo Bids
prospectA company, by the domain of its websiteA card on the board Prospecting

What you write, and what Tommos does

You write the manifest and the function find. Tommos does the rest:

  1. It runs find when the schedule of the scout comes, never before.
  2. It gives find the cursor of the last good run, and keeps the new cursor only when the run worked.
  3. It checks each record against the contract of its kind, refuses the ones that fail with the reason, and takes the others.
  4. It keeps one record per source and key: a record that comes again changes the record it is.
  5. It keeps a log of each run, each record and each line your module writes.

Your module never sees the database. It sees its own secrets and the hosts its manifest names, nothing else.

Quick start

  1. Fork the reference module on GitHub. Its bid example reads a fictional register, a small file in the repository itself (data/fictional-notices.json); no notice in it is real. Its prospect example reads Hacker News.
  2. Install the tools: npm install and pip install -r requirements.txt.
  3. Run the check: npx tommos-module check . --entry find.ts. It passes.
  4. Fill the manifest: a name, the kind, the hosts, the secrets.
  5. Write find in TypeScript or in Python. Use the tools for every call and every record.
  6. Record an example in examples/: what the source answered, and the records find gives for it.
  7. Run the check until it passes. Push. The GitHub workflow runs the same check.
  8. Push a tag, such as v0.1.0, and give the link to the owner.

A new scout starts in Trial

A module the owner adds is a scout in Trial. Its records go to a trial lane only: no deal, no card. After its first runs, the owner reads its trial report and moves it to Live. Only a person does that.

The repositories

Both are public on GitHub, at the tag v0.2.0.

On this page