Skip to content

web-lines

Web sites (resources.web.<name>, declared in the app's settings, with the app's secret, links).

On this page 7
TypeScript
import { webLines } from "copilotz/plugins/interfaces";

What it keeps

It keeps 2 collections, 1 of them on the record.

CollectionKept asFields
contact_ratein memory, gone on restartuntil, count, spent, holds, closed, v
contact_visitordocumentsline, thread, tags, spoke, ended, expires, at

Its named queries read for callers, as the rules let them:

QueryWho outside runs it
contact_visitor.actorthe app's code

What it lets callers do

Only the app's own code calls its 5 Actions, contact.arrive, contact.budget, contact.prune, contact.sending and contact.spent: its plugins, its schedules and the system. Nobody outside does.

It answers 1 route over HTTP:

MethodPath
POST/web/:name

It also says who a request is (who) and adds rules every read and write keeps to (guard).

Where it shows

It has no Views: it shows nowhere on its own.

  • What it adds to resources: contactSend (web), modelUse (webLines).

What it needs

You set it in resources.web: 1 setting is required.

SettingTypeRequiredWhat it is
web.<name>.instringyesThe space its visitors' chats live in: one the app declares too (the spaces plugin's spaces resource) is made and kept with the site.
web.<name>.agentstringnoWho answers its visitors (an agent's name); else whoever answers new chats in the space.
web.<name>.titlestringnoWhat its visitors' chats are called, as the space's people see them (the site's name).
web.<name>.daysnumbernoHow long a visitor stays the same one (their browser's cookie), in days: 30.
web.<name>.limitsPartial<WebLimits>noHow long a visitor stays the same one (their browser's cookie), in days: 30.
web.<name>.filesWebFilesnoFiles its visitors may send (none unless said): {} for one of 5 MB a message, or how many and how large.
web.<name>.transcribebooleannoWhether what visitors' audio files say is transcribed for the agent (a model's call, paid): not unless said.
web.<name>.budgetnumbernoWhat its visitors' model use may be charged a day (UTC), in the usage ledger's prices (the app's currency): what the turns working for them cost, as the usage plugin rates it.
web.<name>.challengestringnoAn Action of the app's that a newcomer must pass to be let in (a CAPTCHA's check: Turnstile's, hCaptcha's): asked as the system with { line, answer }, where answer is what the page sent coming in (web({ arrive: { name, challenge } })'s challenge), it answers true to let them in.

It also reads agents, caller and org, resource kinds the app and other plugins fill.

What it requires

The runtime doesn't start without contacts: add it too.

It ships with copilotz@1.0.0-rc.34.

What it does on its own

Some of its work starts without a caller: an event, or the time.

  • web.forget runs on contact.deleted.
  • contact.prune calls contact.prune, every 10m. Drops web visitors' counters and records that are past, and contacts never heard.

Listing

It breaks 1 listing rule as it is:

  • Route "/web/:name" isn't under /web-lines.