Skip to content

core/charts/external.ts ​

Generated from the exports of core/charts/external.ts · npm run docs:gen

What a chart needs outside the machine (docs/standards/alta-chart-0.1.md §8, "External services and locality"): locality, one word a person can filter on, and external.services, the online services behind it, each with its hosts, phase, account and the data that leaves the machine. Lint cannot see everything (a skill's text may send an agent anywhere). From the closed lists it computes a floor (localityFloor): what the chart names that reaches the network. A chart may not say it is more local than its floor, and every network use lint can see must be covered by a declared service. Nothing here enforces anything at run time: OpenClaw's own sandbox and tool policy are the boundary. Pure: no disk, no network.

Standards that cite this file: alta.chart/0.1: the Agent Chart

Exports ​

Locality type ​

ts
type Locality = "local" | "local-first" | "cloud";

LOCALITIES const ​

From the most local to the least.

ts
const LOCALITIES: readonly Locality[]

ServicePhase type ​

ts
type ServicePhase = "install" | "run";

SERVICE_PHASES const ​

ts
const SERVICE_PHASES: readonly ServicePhase[]

ServiceAccount type ​

ts
type ServiceAccount = "none" | "free" | "paid";

SERVICE_ACCOUNTS const ​

ts
const SERVICE_ACCOUNTS: readonly ServiceAccount[]

EXTERNAL_DATA_KINDS const ​

What leaves the machine at run time (closed). Named apart from the data chart kinds of chart.ts.

ts
const EXTERNAL_DATA_KINDS = ["none", "prompts", "files", "messages", "contacts", "calendar", "audio", "images", "location", "identifiers", "usage"] as const

ExternalDataKind type ​

ts
type ExternalDataKind = (typeof EXTERNAL_DATA_KINDS)[number];

ExternalService interface ​

ts
interface ExternalService {
  id: string;
  name: string;
  purpose: Text;
  homepage?: string;
  hosts: string[];
  phase: ServicePhase[];
  required?: boolean;
  account?: ServiceAccount;
  signin?: string;
  data?: ExternalDataKind[];
  when?: When;
}

External interface ​

ts
interface External { services: ExternalService[] }

MAX_SERVICES const ​

ts
const MAX_SERVICES = 24

MAX_HOSTS const ​

ts
const MAX_HOSTS = 16

LOCAL_PROVIDERS const ​

Model providers that run on the machine.

ts
const LOCAL_PROVIDERS: readonly string[]

MODEL_WORDS const ​

The words a value may use to pick a mind (the engine's --model local|claude|codex), and their provider.

ts
const MODEL_WORDS: Readonly<Record<string, string>>

PROVIDER_HOSTS const ​

The hosts of a model provider, when the code knows them.

ts
const PROVIDER_HOSTS: Readonly<Record<string, readonly string[]>>

CHANNEL_HOSTS const ​

The hosts of a chat channel.

ts
const CHANNEL_HOSTS: Readonly<Record<string, readonly string[]>>

NET_TOOLS const ​

OpenClaw tools that reach the network: the agent chooses where, so no service can cover them and a chart that allows one cannot be local. message sends through the Gateway's chat channels.

ts
const NET_TOOLS: readonly string[]

NET_BY_ARG const ​

What an executor reaches, refined by its arguments (the executor's own net/hosts are the widest case). A row whose net is null: with this value it stays on the machine. A row of the same net replaces the hosts; a row of another net adds a use (the mind of alta-os reaches Claude at run time, on top of the install downloads); an executor whose hosts are unknown is replaced by the row. Read from server/exec/*.mjs and the module scripts.

ts
const NET_BY_ARG: Readonly<Record<string, readonly { arg: string; values: Readonly<Record<string, NetRow>> }[]>>

LOCALITY_WORDS const ​

Words for the three levels, and for "not declared" (the consent step, alta template, a market page).

ts
const LOCALITY_WORDS: Readonly<Record<Locality | "undeclared", Text>>

DATA_WORDS const ​

Words for what leaves the machine.

ts
const DATA_WORDS: Readonly<Record<ExternalDataKind, Text>>

hostProblems function ​

Problems of one host name of a service (empty: fine).

ts
function hostProblems(host: unknown): string[]

hostCovers function ​

Does a declared host cover a host lint found? Equal, or a wildcard over it (".googleapis.com" covers "oauth2.googleapis.com" and ".googleapis.com").

ts
function hostCovers(declared: string, found: string): boolean

NetUse interface ​

One use of the network that the chart names.

ts
interface NetUse {
  /** The field that names it. */
  field: string;
  /** Why it reaches the network, in plain words (an executor, a sign-in tool, a model, a channel, a tool). */
  why: string;
  phase: ServicePhase;
  /** The hosts, when the code knows them. */
  hosts?: readonly string[];
  /** Its effect on the floor. */
  level: Locality;
  /** Must a declared service cover it? (false for a network tool: the agent chooses the hosts.) */
  covered: boolean;
  /** The sign-in it comes from. */
  signin?: string;
}

providerOf const ​

The provider of a model reference (an id "provider/model", or a word of MODEL_WORDS), or undefined.

ts
const providerOf = (m: unknown): string | undefined => …

MIND_EXECUTORS const ​

Executors whose network use is the agent's mind (a model call), counted by a mind need when the chart has one.

ts
const MIND_EXECUTORS: readonly string[]

netUses function ​

Every network use the chart names, for these values (defaults filled by the caller).

ts
function netUses(c: ChartLike, chosen: Record<string, unknown>, executors: readonly ExecutorInfo[] = EXECUTORS): NetUse[]

needServices function ​

The services the bound providers of the needs add (generated from the provider table, never declared).

ts
function needServices(c: ChartLike, chosen: Record<string, unknown>): (ExternalService & { need: string })[]

servicesLevel function ​

The level the declared services give, for these values.

ts
function servicesLevel(services: readonly ExternalService[]): Locality

localityFloor function ​

The floor of a chart for these values: the least local level what it names allows, and why.

ts
function localityFloor(c: ChartLike, o: { values?: Record<string, unknown>; executors?: readonly ExecutorInfo[] } = {}): { level: Locality; reasons: { field: string; why: string; hosts?: readonly string[] }[] }

localityOf function ​

The level of one release, from the values its owner chose: its floor, and the declared services that apply.

ts
function localityOf(c: ChartLike, values: Record<string, unknown> = {}, executors?: readonly ExecutorInfo[]): Locality

valueCombos function ​

Every set of values worth trying: each choice and boolean, and "nothing chosen" when that is possible; with needs: true, each provider a need may be bound to too ("need:<id>"). Capped.

ts
function valueCombos(c: ChartLike, cap = 64, o: { needs?: boolean } = {}): Record<string, unknown>[]

localityRange function ​

The best and the worst level over every choice of values and every provider the needs may be bound to (a market page shows "can run 100% local" when the best is local: no fixed run service, and each need has a local provider).

ts
function localityRange(c: ChartLike, executors?: readonly ExecutorInfo[]): { best: Locality; worst: Locality }

ExternalProblem interface ​

ts
interface ExternalProblem { rule: string; field: string; msg: string; level?: "warning" }

httpsUrlProblem const ​

ts
const httpsUrlProblem = (u: unknown): string | undefined => …

externalProblems function ​

The problems of locality and external (rules chart.locality*, external.*). dataKind: the chart is a data chart (computed by the caller, which owns the list of kinds).

ts
function externalProblems(c: ChartLike, o: { dataKind: boolean; mustDeclare: boolean; executors?: readonly ExecutorInfo[] }): ExternalProblem[]

externalWidenings function ​

What a new version adds to what the chart reaches: each line is a widening (the consent screen again).

ts
function externalWidenings(old: ChartLike, next: ChartLike): string[]

servicesFor const ​

The services that apply to these values and bindings, for a renderer (the consent step, alta template): the chart's own, then those its bound needs add.

ts
const servicesFor = (c: ChartLike, chosen: Record<string, unknown>): ExternalService[] => …

The standard, the SDK and the CLI are Apache-2.0; Alta System OS and Alta World are FSL-1.1-ALv2.