Manta Developers
GitHub
Menu

@manta-eu/horns/render

Reference for @manta-eu/horns/render in @manta-eu/horns 0.2.3.

Classes

HornSnapshotError

Extends

  • Error

Constructors

Constructor

new HornSnapshotError(message): HornSnapshotError

Parameters
message

string

Returns

HornSnapshotError

Overrides

Error.constructor

Properties

cause?

optional cause?: unknown

Inherited from

Error.cause

message

message: string

Inherited from

Error.message

name

name: string

Inherited from

Error.name

stack?

optional stack?: string

Inherited from

Error.stack

Type Aliases

BuildHornSnapshotOptions

BuildHornSnapshotOptions = object

Properties

focus?

optional focus?: readonly string[]

horn

horn: Horn

labels?

optional labels?: boolean

Name the IRIs the views show. On unless the caller knows none of its views draws one — a shape’s zoo, whose cards are barred from showing an IRI as text, and which would otherwise pay five lookup passes per shape for names nothing reads.

now?

optional now?: () => Date

Returns

Date

plans?

optional plans?: boolean

Look up the action plans behind each view. On unless a caller only wants rows, like a shape’s zoo.

resolveDerivation?

optional resolveDerivation?: (ref) => HornDerivation | undefined

Parameters
ref

LibraryRef

Returns

HornDerivation | undefined

resolveQuery?

optional resolveQuery?: CompileInput["resolveQuery"]

resolveView?

optional resolveView?: (ref) => HornView | undefined

Parameters
ref

LibraryRef

Returns

HornView | undefined

rowLimit?

optional rowLimit?: number

select

select: SparqlSelect

signal?

optional signal?: AbortSignal

variables?

optional variables?: Readonly<Record<string, unknown>>

viewIds?

optional viewIds?: readonly string[]


ColumnSource

ColumnSource = object

Where a column’s values come from: the property, and the variable of the entity that holds them.

Properties

property

property: string

subject?

optional subject?: string


HornSnapshot

HornSnapshot = z.infer<typeof hornSnapshotSchema>


PlanChange

PlanChange = z.infer<typeof planChangeSchema>


PlanReason

PlanReason = z.infer<typeof planReasonSchema>


PlanState

PlanState = typeof planStates[number]


PlanStatus

PlanStatus = Pick<SnapshotPlan, "state" | "lastRun" | "name">


PropertyUnit

PropertyUnit = object

Properties

scale?

optional scale?: number

unit?

optional unit?: ValueUnit


RecordCard

RecordCard = object

Properties

badges

badges: RecordSlot[]

entity

entity: string | undefined

fields

fields: RecordSlot[]

key

key: string

optional link?: RecordSlot

subtitle?

optional subtitle?: RecordSlot

title

title: RecordSlot


RecordChart

RecordChart = HornRecordCard


RecordRow

RecordRow = Readonly<Record<string, SnapshotCell>>


RecordSlot

RecordSlot = object

Properties

name

name: string

values

values: SnapshotCell[]


ResolvedPlans

ResolvedPlans = object

Properties

iris

iris: string[]

The things and properties the plans name, for the snapshot’s labels.

plans

plans: SnapshotPlan[]

views

views: Map<string, ViewPlan[]>

By view: the plans behind it.


ReviewState

ReviewState = { state: "reviewed"; } | { state: "unread"; } | { state: "stale"; }

Union Members

Type Literal

{ state: "reviewed"; }


Type Literal

{ state: "unread"; }

Nobody has read this source.


Type Literal

{ state: "stale"; }

Someone read a different source: the view was changed after it was accepted.


SnapshotCell

SnapshotCell = z.infer<typeof snapshotCellSchema>


SnapshotPlan

SnapshotPlan = z.infer<typeof snapshotPlanSchema>


SnapshotView

SnapshotView = z.infer<typeof snapshotViewSchema>


SurfaceEntry

SurfaceEntry = object

Properties

call?

optional call?: string

How to call it, where the name does not say. Checked against the SDK by surface-calls.test.ts.

export

export: string

The exported name, as it is imported.

use

use: string

What it is for, in the words the Studio should think in.


SurfaceModule

SurfaceModule = object

Properties

entries

entries: readonly SurfaceEntry[]

module

module: string

purpose

purpose: string

Groups the prompt renders under one heading.


UnreviewedView

UnreviewedView = object

Properties

state

state: Exclude<ReviewState["state"], "reviewed">

title

title: string

viewId

viewId: string


ValueUnit

ValueUnit = "currency" | "ratio" | "percent"


ViewPlan

ViewPlan = object

A plan behind a view: the plan, and which of the things it changes are, or belong to, what the view draws.

Properties

entities

entities: string[]

plan

plan: string

Variables

allowedReactHooks

const allowedReactHooks: readonly ["useState", "useMemo", "useCallback", "useId"]


captureDeviceScaleFactor

const captureDeviceScaleFactor: 2 = 2


captureWidth

const captureWidth: 640 = 640


hornEmbedAttribute

const hornEmbedAttribute: "data-horn-embed" = "data-horn-embed"


hornReadyAttribute

const hornReadyAttribute: "data-horn-ready" = "data-horn-ready"


hornSnapshotAttribute

const hornSnapshotAttribute: "data-horn-snapshot" = "data-horn-snapshot"


hornSnapshotSchema

const hornSnapshotSchema: z.ZodObject<{ generatedAt: z.ZodISODateTime; horn: z.ZodObject<{ datastoreId: z.ZodString; iri: z.ZodURL; realm: z.ZodEnum<{ hiremanta-com: "hiremanta-com"; journey-travel: "journey-travel"; }>; revision: z.ZodNumber; slug: z.ZodString; title: z.ZodString; }, z.core.$strip>; labels: z.ZodRecord<z.ZodString, z.ZodString>; layout: z.ZodObject<{ columns: z.ZodLiteral<12>; items: z.ZodArray<z.ZodObject<{ h: z.ZodNumber; viewId: z.ZodString; w: z.ZodNumber; x: z.ZodNumber; y: z.ZodNumber; }, z.core.$strip>>; kind: z.ZodLiteral<"grid">; }, z.core.$strip>; links: z.ZodRecord<z.ZodString, z.ZodString>; plans: z.ZodArray<z.ZodObject<{ changes: z.ZodArray<z.ZodObject<{ currency: z.ZodOptional<z.ZodString>; entity: z.ZodURL; from: z.ZodUnion<readonly […, …, …, …]>; property: z.ZodURL; to: z.ZodUnion<readonly […, …, …, …]>; unit: z.ZodOptional<z.ZodEnum<{ currency: …; percent: …; ratio: …; }>>; }, z.core.$strip>>; iri: z.ZodURL; kinds: z.ZodArray<z.ZodObject<{ count: z.ZodNumber; type: z.ZodOptional<z.ZodURL>; }, z.core.$strip>>; lastRun: z.ZodOptional<z.ZodObject<{ endedAt: z.ZodOptional<z.ZodString>; error: z.ZodOptional<z.ZodString>; preview: z.ZodBoolean; startedAt: z.ZodString; }, z.core.$strip>>; name: z.ZodOptional<z.ZodString>; reasons: z.ZodArray<z.ZodObject<{ entity: z.ZodURL; property: z.ZodURL; text: z.ZodString; }, z.core.$strip>>; state: z.ZodEnum<{ completed: "completed"; draft: "draft"; failed: "failed"; running: "running"; timed-out: "timed-out"; }>; }, z.core.$strip>>; snapshotVersion: z.ZodLiteral<1>; style: z.ZodObject<{ accent: z.ZodOptional<z.ZodEnum<{ amber: "amber"; blue: "blue"; forest: "forest"; green: "green"; indigo: "indigo"; orange: "orange"; pink: "pink"; red: "red"; }>>; density: z.ZodOptional<z.ZodEnum<{ comfortable: "comfortable"; compact: "compact"; }>>; radius: z.ZodOptional<z.ZodEnum<{ round: "round"; sharp: "sharp"; soft: "soft"; }>>; theme: z.ZodOptional<z.ZodEnum<{ dark: "dark"; light: "light"; }>>; }, z.core.$strict>; variables: z.ZodArray<z.ZodObject<{ id: z.ZodString; label: z.ZodString; settable: z.ZodOptional<z.ZodBoolean>; value: z.ZodJSONSchema; }, z.core.$strip>>; views: z.ZodArray<z.ZodObject<{ content: z.ZodDiscriminatedUnion<[z.ZodObject<{ component: z.ZodString; iris: z.ZodArray<z.ZodURL>; lane: z.ZodLiteral<"component">; truncated: z.ZodBoolean; }, z.core.$strip>, z.ZodObject<{ columns: z.ZodArray<z.ZodObject<…, …>>; currency: z.ZodOptional<z.ZodString>; lane: z.ZodLiteral<"sandbox">; plans: z.ZodOptional<z.ZodArray<…>>; render: z.ZodLiteral<"tsx">; rows: z.ZodArray<z.ZodRecord<…, …>>; source: z.ZodString; truncated: z.ZodBoolean; units: z.ZodOptional<z.ZodRecord<…, …>>; }, z.core.$strip>, z.ZodObject<{ lane: z.ZodLiteral<"error">; message: z.ZodString; }, z.core.$strip>], "lane">; id: z.ZodString; title: z.ZodString; }, z.core.$strip>>; }, z.core.$strip>


hornSnapshotVersion

const hornSnapshotVersion: 1 = 1


hornViewAttribute

const hornViewAttribute: "data-horn-view" = "data-horn-view"


maxLabelledIris

const maxLabelledIris: 500 = 500


maxLinkedIris

const maxLinkedIris: 500 = 500


maxListedPlans

const maxListedPlans: 100 = 100

How many plans a list asks for. A datastore accumulates them; a page shows the first of them.


maxPlanChanges

const maxPlanChanges: 50 = 50


maxPlanEntities

const maxPlanEntities: 50 = 50

How many of a plan’s things a Horn built for it draws.


maxRelatedPlans

const maxRelatedPlans: 5 = 5


maxSnapshotRows

const maxSnapshotRows: 1000 = 1000


planChangeSchema

const planChangeSchema: z.ZodObject<{ currency: z.ZodOptional<z.ZodString>; entity: z.ZodURL; from: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>; property: z.ZodURL; to: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>; unit: z.ZodOptional<z.ZodEnum<{ currency: "currency"; percent: "percent"; ratio: "ratio"; }>>; }, z.core.$strip>


planReasonSchema

const planReasonSchema: z.ZodObject<{ entity: z.ZodURL; property: z.ZodURL; text: z.ZodString; }, z.core.$strip>


planStates

const planStates: readonly ["draft", "running", "completed", "failed", "timed-out"]


reactModule

const reactModule: "react" = "react"


recordCardLimits

const recordCardLimits: object

Type Declaration

badge

badge: number

cards

cards: number

field

field: number

subtitle

subtitle: number

title

title: number


sdkModules

const sdkModules: readonly string[]

The modules whose typings are the design system’s. The rest of the surface is the kit’s own.


snapshotCellSchema

const snapshotCellSchema: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>


snapshotPlanSchema

const snapshotPlanSchema: z.ZodObject<{ changes: z.ZodArray<z.ZodObject<{ currency: z.ZodOptional<z.ZodString>; entity: z.ZodURL; from: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>; property: z.ZodURL; to: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>; unit: z.ZodOptional<z.ZodEnum<{ currency: "currency"; percent: "percent"; ratio: "ratio"; }>>; }, z.core.$strip>>; iri: z.ZodURL; kinds: z.ZodArray<z.ZodObject<{ count: z.ZodNumber; type: z.ZodOptional<z.ZodURL>; }, z.core.$strip>>; lastRun: z.ZodOptional<z.ZodObject<{ endedAt: z.ZodOptional<z.ZodString>; error: z.ZodOptional<z.ZodString>; preview: z.ZodBoolean; startedAt: z.ZodString; }, z.core.$strip>>; name: z.ZodOptional<z.ZodString>; reasons: z.ZodArray<z.ZodObject<{ entity: z.ZodURL; property: z.ZodURL; text: z.ZodString; }, z.core.$strip>>; state: z.ZodEnum<{ completed: "completed"; draft: "draft"; failed: "failed"; running: "running"; timed-out: "timed-out"; }>; }, z.core.$strip>


snapshotViewSchema

const snapshotViewSchema: z.ZodObject<{ content: z.ZodDiscriminatedUnion<[z.ZodObject<{ component: z.ZodString; iris: z.ZodArray<z.ZodURL>; lane: z.ZodLiteral<"component">; truncated: z.ZodBoolean; }, z.core.$strip>, z.ZodObject<{ columns: z.ZodArray<z.ZodObject<{ name: z.ZodString; type: z.ZodEnum<{ boolean: …; date: …; iri: …; number: …; string: …; }>; }, z.core.$strip>>; currency: z.ZodOptional<z.ZodString>; lane: z.ZodLiteral<"sandbox">; plans: z.ZodOptional<z.ZodArray<z.ZodObject<{ entities: z.ZodArray<…>; plan: z.ZodURL; }, z.core.$strip>>>; render: z.ZodLiteral<"tsx">; rows: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnion<readonly […, …, …, …]>>>; source: z.ZodString; truncated: z.ZodBoolean; units: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<{ currency: "currency"; percent: "percent"; ratio: "ratio"; }>>>; }, z.core.$strip>, z.ZodObject<{ lane: z.ZodLiteral<"error">; message: z.ZodString; }, z.core.$strip>], "lane">; id: z.ZodString; title: z.ZodString; }, z.core.$strip>


surfaceModules

const surfaceModules: readonly string[]

Every module specifier a written view may import from.


tsxSurface

const tsxSurface: readonly SurfaceModule[]


viewPowersModule

const viewPowersModule: "@manta-eu/horns-kit/view" = "@manta-eu/horns-kit/view"

What a view may do to the page it is on: say why a value is what it is, and narrow the Horn.

The kit draws the mark and the host opens the proof tree, because drawing one needs @manta-eu/react and a modal, and the kit has neither. A view therefore reaches for one component and not seven.

Functions

actionShapePredicate()

actionShapePredicate(realm): string

The predicate that marks a thing a plan would change, which is what makes a query about a plan.

Parameters

realm

"hiremanta-com" | "journey-travel"

Returns

string


base64Of()

base64Of(bytes): string

Parameters

bytes

Uint8Array

Returns

string


buildHornSnapshot()

buildHornSnapshot(options): Promise<{ generatedAt: string; horn: { datastoreId: string; iri: string; realm: "hiremanta-com" | "journey-travel"; revision: number; slug: string; title: string; }; labels: z.ZodRecord<z.ZodString, z.ZodString>; layout: { columns: 12; items: object[]; kind: "grid"; }; links: z.ZodRecord<z.ZodString, z.ZodString>; plans: object[]; snapshotVersion: 1; style: { accent?: "blue" | "orange" | "green" | "amber" | "pink" | "forest" | "indigo" | "red"; density?: "compact" | "comfortable"; radius?: "sharp" | "soft" | "round"; theme?: "light" | "dark"; }; variables: object[]; views: object[]; }>

Parameters

options

BuildHornSnapshotOptions

Returns

Promise<{ generatedAt: string; horn: { datastoreId: string; iri: string; realm: "hiremanta-com" | "journey-travel"; revision: number; slug: string; title: string; }; labels: z.ZodRecord<z.ZodString, z.ZodString>; layout: { columns: 12; items: object[]; kind: "grid"; }; links: z.ZodRecord<z.ZodString, z.ZodString>; plans: object[]; snapshotVersion: 1; style: { accent?: "blue" | "orange" | "green" | "amber" | "pink" | "forest" | "indigo" | "red"; density?: "compact" | "comfortable"; radius?: "sharp" | "soft" | "round"; theme?: "light" | "dark"; }; variables: object[]; views: object[]; }>


columnSources()

columnSources(query): Map<string, ColumnSource>

Which property each column of a SELECT is the value of, and on which entity, when it is one: a variable bound as a triple’s object, or an aggregate over one that keeps its unit (a sum of millionths is millionths; a count is not). A column computed any other way maps to nothing, which is the safe answer — a model that already divided an amount must not have it divided again.

Parameters

query

string

Returns

Map<string, ColumnSource>


currenciesQuery()

currenciesQuery(realm, entities): string

Parameters

realm

"hiremanta-com" | "journey-travel"

entities

readonly string[]

Returns

string


currencyQuery()

currencyQuery(realm, query, subject): string | undefined

The currencies of the entities a view’s amounts belong to, asked inside the view’s own pattern. Manta’s rules copy the ad account’s currency onto everything under it as :currency (Meta, Google and LinkedIn entities), so an amount’s currency is on the entity that holds it — which is the only honest answer in a datastore that also holds Attio deals in dollars and exchange rates in every currency. The account itself says it in schema:currency, which is what an account-level amount (its last 30 days’ spend) is in.

Parameters

realm

"hiremanta-com" | "journey-travel"

query

string

subject

string

Returns

string | undefined


entityLinkPath()

entityLinkPath(datastoreId, iri): string

Where a row links to show the thing it is about: agents’ /redirect, which reads the entity’s type and schema:identifier and sends the viewer to its page in the platform it came from. The same path on the Horns site and on agents, so a Horn links the same way wherever it is embedded. The IRI is passed, never read.

Parameters

datastoreId

string

iri

string

Returns

string


entityRows()

entityRows(rows): Readonly<Record<string, string | number | boolean | null>>[]

Parameters

rows

readonly Readonly<Record<string, string | number | boolean | null>>[]

Returns

Readonly<Record<string, string | number | boolean | null>>[]


inPlanUnits()

inPlanUnits(change, units, currencies): object

A stored amount in the unit a person reads, the way a chart’s columns are.

Parameters

change

RawChange

units

ReadonlyMap<string, PropertyUnit>

currencies

ReadonlyMap<string, string>

Returns

object

currency?

optional currency?: string

entity

entity: string

from

from: string | number | boolean | null

property

property: string

to

to: string | number | boolean | null

unit?

optional unit?: "currency" | "percent" | "ratio"


isPlanQuery()

isPlanQuery(realm, plan): string

Whether a graph is a plan a viewer may run: it holds things to change, and is not a run’s copy of one.

Parameters

realm

"hiremanta-com" | "journey-travel"

plan

string

Returns

string


isSurfaceModule()

isSurfaceModule(module): boolean

Parameters

module

string

Returns

boolean


labelPredicates()

labelPredicates(realm): string[]

Parameters

realm

"hiremanta-com" | "journey-travel"

Returns

string[]


labelsQuery()

labelsQuery(predicate, iris): string

One query per predicate, for the entities still unnamed. A VALUES over the entities rather than a join: the rows already know which IRIs they show, and asking for exactly those keeps the answer small.

Parameters

predicate

string

iris

readonly string[]

Returns

string


linkableTypes()

linkableTypes(realm): Map<string, string>

Each linkable type in this realm, and what its link says.

Parameters

realm

"hiremanta-com" | "journey-travel"

Returns

Map<string, string>


linksQuery()

linksQuery(iris, types): string

Parameters

iris

readonly string[]

types

Iterable<string>

Returns

string


moduleOfExport()

moduleOfExport(name): string | undefined

Where an export lives, for telling the model it imported from the wrong module.

Parameters

name

string

Returns

string | undefined


nameishQuery()

nameishQuery(iris): string

The last pass: a literal in a property whose name reads like a name, best first for each entity, so the first row readLabels keeps is the one to show.

Parameters

iris

readonly string[]

Returns

string


ontologyLabelsQuery()

ontologyLabelsQuery(realm, iris): string

Properties and classes are named in the ontology’s own graph: a plan’s “Daily budget”, a “Campaign”.

Parameters

realm

"hiremanta-com" | "journey-travel"

iris

readonly string[]

Returns

string


parseHornSnapshot()

parseHornSnapshot(text): object

Parameters

text

string

Returns

object

generatedAt

generatedAt: string

horn

horn: object

horn.datastoreId

datastoreId: string

horn.iri

iri: string

horn.realm

realm: "hiremanta-com" | "journey-travel"

horn.revision

revision: number

horn.slug

slug: string

horn.title

title: string

labels

labels: z.ZodRecord<z.ZodString, z.ZodString>

layout

layout: object

layout.columns

columns: 12

layout.items

items: object[]

layout.kind

kind: "grid"

links: z.ZodRecord<z.ZodString, z.ZodString>

plans

plans: object[]

snapshotVersion

snapshotVersion: 1

style

style: object

style.accent?

optional accent?: "blue" | "orange" | "green" | "amber" | "pink" | "forest" | "indigo" | "red"

style.density?

optional density?: "compact" | "comfortable"

style.radius?

optional radius?: "sharp" | "soft" | "round"

style.theme?

optional theme?: "light" | "dark"

variables

variables: object[]

views

views: object[]


planEntitiesQuery()

planEntitiesQuery(realm, plan, limit?): string

The things one plan would change.

What isPlanQuery confirms of a graph, listed: the entities carrying an action shape, which is what a plan concerns whether or not any of its rows survives readPlanValues — a value that already holds, or one pointing at another thing, is dropped there and the plan is still about the thing it names. The report filter is the same one, so a run’s copy of a plan answers with nothing rather than with the plan’s things.

Parameters

realm

"hiremanta-com" | "journey-travel"

plan

string

limit?

number

Returns

string


planKindsQuery()

planKindsQuery(realm, plans): string

Parameters

realm

"hiremanta-com" | "journey-travel"

plans

readonly string[]

Returns

string


planNameFromIri()

planNameFromIri(iri): string | undefined

What a plan is called when the graph does not say.

Almost never, in practice. Measured against hiremanta-com on 2026-09-29, 29 of its 30 plans carry no label, name or description on the graph IRI. schema:HowTo was where a plan’s name used to live and is deprecated — no graph holds one — so agents’ own plan.howTo?.name never fires either and it names a plan by humanizing the IRI’s last segment (extractPlanName in manta/packages/client/src/shared/agent-mode.ts, over splitIdentifierWords in manta/packages/lib). That is therefore the naming, not a fallback, and a Horn beside agents has to say the same words.

This is the one place a name is read out of an IRI, and it is read out of Manta’s own vocabulary rather than a customer’s data — the same licence ruleTitle takes for a rule. Kept in step with agents by plans.test.ts, which pins the examples that datastore actually holds.

Parameters

iri

string

Returns

string | undefined


plansQuery()

plansQuery(realm, limit?): string

The action plans this datastore holds.

A plan is a named graph whose entities carry an action shape — isPlanQuery asks that of one graph, and this asks it of all of them. A graph holding a validation report is a rejected draft and not offered.

Ordered because there is a limit: without one the store may answer with a different hundred each time, and a plan a person saw a moment ago would be gone when they looked again.

Parameters

realm

"hiremanta-com" | "journey-travel"

limit?

number

Returns

string


planStatusQuery()

planStatusQuery(realm, plans): string

Parameters

realm

"hiremanta-com" | "journey-travel"

plans

readonly string[]

Returns

string


planValuesQuery()

planValuesQuery(realm, plan, entities?): string

Every value a plan holds for the things it changes, with what the default graph holds for the same property now, and whether the thing’s shape lets the property be set — which is what tells a change (a status, a budget) from the rule’s note on why (:pauseReason), since both sit in the plan graph.

Parameters

realm

"hiremanta-com" | "journey-travel"

plan

string

entities?

readonly string[]

Returns

string


pngSize()

pngSize(bytes): object

Parameters

bytes

Uint8Array

Returns

object

height

height: number

width

width: number


readCurrencies()

readCurrencies(results): Set<string>

Parameters

results

SparqlResults

Returns

Set<string>


readEntityCurrencies()

readEntityCurrencies(results): Map<string, string>

Parameters

results

SparqlResults

Returns

Map<string, string>


readLabels()

readLabels(results): Map<string, string>

What one pass answered, keyed by the entity it names.

Parameters

results

SparqlResults

Returns

Map<string, string>


readLinks(results, types): Record<string, string>

Parameters

results

SparqlResults

types

ReadonlyMap<string, string>

Returns

Record<string, string>


readPlanEntities()

readPlanEntities(results): string[]

The things a planEntitiesQuery answered with. Only IRIs that can be written back into a query.

Parameters

results

SparqlResults

Returns

string[]


readPlanKinds()

readPlanKinds(results): Map<string, object[]>

Parameters

results

SparqlResults

Returns

Map<string, object[]>


readPlans()

readPlans(results): string[]

The plan IRIs a plansQuery answered with, each once.

Parameters

results

SparqlResults

Returns

string[]


readPlanStatus()

readPlanStatus(results): Map<string, PlanStatus>

How each plan’s latest run went. A plan that has never run has no state in the graph, and is a draft.

Parameters

results

SparqlResults

Returns

Map<string, PlanStatus>


readPlanValues()

readPlanValues(results): object

The plan’s changes — settable values that differ from now — and its notes on why, in the order they came.

Parameters

results

SparqlResults

Returns

object

changes

changes: RawChange[]

reasons

reasons: object[]


readRelatedPlans()

readRelatedPlans(results): Map<string, Map<string, Set<string>>>

Parameters

results

SparqlResults

Returns

Map<string, Map<string, Set<string>>>


readUnits()

readUnits(results): Map<string, PropertyUnit>

Parameters

results

SparqlResults

Returns

Map<string, PropertyUnit>


recordCards()

recordCards(chart, rows): RecordCard[]

Parameters

chart
badges?

string[]

currency?

string

fields

string[]

format?

"number" | "percent" | "integer" | "compact"

string

subtitle?

string

title

string

type

"record"

rows

readonly Readonly<Record<string, string | number | boolean | null>>[]

Returns

RecordCard[]


recordLinkHref()

recordLinkHref(cell): string | undefined

Parameters

cell

string | number | boolean | null | undefined

Returns

string | undefined


relatedPlansQuery()

relatedPlansQuery(realm, drawn): string

The plans holding :actionShape on a thing a view draws, or on a thing it links to: a campaign’s own pause, and the budget it points at being doubled. A run copies its plan into a graph of its own with the validation report beside it; that copy is a record of a run, not a plan, so a graph holding a report is left out.

Parameters

realm

"hiremanta-com" | "journey-travel"

drawn

readonly string[]

Returns

string


resolveLabels()

resolveLabels(args): Promise<Record<string, string>>

The display name of every IRI a snapshot shows. select is the same read the bindings used, so a name costs one query per predicate the datastore actually answers.

Parameters

args
iris

readonly string[]

realm

"hiremanta-com" | "journey-travel"

select

SparqlSelect

signal?

AbortSignal

Returns

Promise<Record<string, string>>


resolveLinks(args): Promise<Record<string, string>>

Which of the IRIs a snapshot shows have a page to open, and what their link says. One query; a datastore that will not answer is a Horn without links, not a Horn that fails.

Parameters

args
iris

readonly string[]

realm

"hiremanta-com" | "journey-travel"

select

SparqlSelect

signal?

AbortSignal

Returns

Promise<Record<string, string>>


resolvePlans()

resolvePlans(args): Promise<ResolvedPlans>

The action plans behind each view, from the things each view draws. Plans are extra: a datastore that will not answer is a Horn without plans, never a Horn that fails.

Parameters

args
drawn

ReadonlyMap<string, readonly string[]>

realm

"hiremanta-com" | "journey-travel"

select

SparqlSelect

signal?

AbortSignal

Returns

Promise<ResolvedPlans>


resolveUnits()

resolveUnits(args): Promise<Map<string, PropertyUnit>>

The units of these properties, in one query. A datastore that will not say is a Horn with raw numbers.

Parameters

args
properties

readonly string[]

realm

"hiremanta-com" | "journey-travel"

select

SparqlSelect

signal?

AbortSignal

Returns

Promise<Map<string, PropertyUnit>>


resolveViewCurrency()

resolveViewCurrency(args): Promise<string | undefined>

The one currency a view’s amounts are in, or nothing when they are in several or it cannot be told.

Parameters

args
query

string

realm

"hiremanta-com" | "journey-travel"

select

SparqlSelect

signal?

AbortSignal

subjects

readonly string[]

Returns

Promise<string | undefined>


reviewOf()

reviewOf(source, now): Promise<{ at: string; hash: string; }>

The review a person’s acceptance writes onto a view.

Parameters

source

string

now

Date

Returns

Promise<{ at: string; hash: string; }>


reviewStateOf()

reviewStateOf(render): Promise<ReviewState>

Parameters

render
reviewed?

{ hash: string; }

reviewed.hash

string

source

string

Returns

Promise<ReviewState>


searchFromVariables()

searchFromVariables(horn, values): string

The query string a set of variable values makes, so a viewer can write the bus back to the URL.

Parameters

horn
about?

string[]

actions

({ id: string; ref: { hash: string; item: string; revision: string; }; } | { allowedClasses: string[]; allowedPredicates: string[]; confirm: true; criteria?: { ask: string; }; delete?: string; id: string; insert: string; kind: "kg-update"; label: string; params: object[]; where?: string; } | { actionShapeIri: string; confirm: true; criteria?: { ask: string; }; id: string; kind: "action-shape"; label: string; mapping: z.ZodRecord<z.ZodString, z.ZodString>; operation: "addition" | "update"; params: object[]; })[]

audience?

string

baseRevision?

number

datastoreId

string

dependencies

object[]

derivations

({ id: string; ref: { hash: string; item: string; revision: string; }; } | { appliesTo: string; datatype: string; id: string; pattern: string; predicateIri: string; promotedRuleIri?: string; status: "query" | "staged" | "materialized"; })[]

iri

string

layout

{ columns: 12; items: object[]; kind: "grid"; }

layout.columns

12

layout.items

object[]

layout.kind

"grid"

lock

{ entries: object[]; lockVersion: 1; }

lock.entries

object[]

lock.lockVersion

1

realm

"hiremanta-com" | "journey-travel"

revision

number

runtime

{ kit: string; }

runtime.kit

string

schemaVersion

1

slug

string

style?

{ accent?: "blue" | "orange" | "green" | "amber" | "pink" | "forest" | "indigo" | "red"; density?: "compact" | "comfortable"; radius?: "sharp" | "soft" | "round"; theme?: "light" | "dark"; }

style.accent?

"blue" | "orange" | "green" | "amber" | "pink" | "forest" | "indigo" | "red"

style.density?

"compact" | "comfortable"

style.radius?

"sharp" | "soft" | "round"

style.theme?

"light" | "dark"

summary?

string

title

string

variables

object[]

views

({ id: string; ref: { hash: string; item: string; revision: string; }; } | { binding: { columns: object[]; derivations: string[]; kind: "select"; limit: number; params: string[]; sparql: string; } | { classIri: string; derivations: string[]; fields: object[]; kind: "lens"; limit: number; rows?: "entity" | "value"; } | { kind: "query"; limit: number; params: string[]; query: { hash: string; item: string; revision: string; }; }; emits?: object[]; id: string; render: { component: { hash: string; item: string; revision: string; }; kind: "component"; props: JSONType; } | { kind: "tsx"; reviewed?: { at: string; hash: string; }; source: string; }; title: string; })[]

values

Readonly<Record<string, VariableValue>>

Returns

string


serializeHornSnapshot()

serializeHornSnapshot(snapshot): string

Parameters

snapshot
generatedAt

string

horn

{ datastoreId: string; iri: string; realm: "hiremanta-com" | "journey-travel"; revision: number; slug: string; title: string; }

horn.datastoreId

string

horn.iri

string

horn.realm

"hiremanta-com" | "journey-travel"

horn.revision

number

horn.slug

string

horn.title

string

labels

z.ZodRecord<z.ZodString, z.ZodString>

layout

{ columns: 12; items: object[]; kind: "grid"; }

layout.columns

12

layout.items

object[]

layout.kind

"grid"

z.ZodRecord<z.ZodString, z.ZodString>

plans

object[]

snapshotVersion

1

style

{ accent?: "blue" | "orange" | "green" | "amber" | "pink" | "forest" | "indigo" | "red"; density?: "compact" | "comfortable"; radius?: "sharp" | "soft" | "round"; theme?: "light" | "dark"; }

style.accent?

"blue" | "orange" | "green" | "amber" | "pink" | "forest" | "indigo" | "red"

style.density?

"compact" | "comfortable"

style.radius?

"sharp" | "soft" | "round"

style.theme?

"light" | "dark"

variables

object[]

views

object[]

Returns

string


slotText()

slotText(slot): string

Parameters

slot

RecordSlot | undefined

Returns

string


summarizeView()

summarizeView(view, maxLines?): string[]

A view’s data as short lines of text: alt text for a picture of it, or the message body where pictures do not render.

Every column, in the order the binding returned them. A view is source now, so nothing here can know which of its columns it chose to draw — and a summary that guessed would describe a view that does not exist.

Parameters

view
content

{ component: string; iris: string[]; lane: "component"; truncated: boolean; } | { columns: object[]; currency?: string; lane: "sandbox"; plans?: object[]; render: "tsx"; rows: Record<string, string | number | boolean | null>[]; source: string; truncated: boolean; units?: Record<string, "currency" | "percent" | "ratio">; } | { lane: "error"; message: string; }

id

string

title

string

maxLines?

number

Returns

string[]


surfaceContextLines()

surfaceContextLines(): string[]

Returns

string[]


surfaceEntry()

surfaceEntry(name): SurfaceEntry | undefined

The surface’s own entry for an export: what it is for, and how to call it where that is written down.

Parameters

name

string

Returns

SurfaceEntry | undefined


surfaceExports()

surfaceExports(module): ReadonlySet<string> | undefined

Parameters

module

string

Returns

ReadonlySet<string> | undefined


surfacePrompt()

surfacePrompt(): string

Returns

string


unitsQuery()

unitsQuery(realm, properties): string

Parameters

realm

"hiremanta-com" | "journey-travel"

properties

readonly string[]

Returns

string


unreviewedMessage()

unreviewedMessage(views): string

What a save route tells someone who has not read what they are about to keep.

Parameters

views

readonly UnreviewedView[]

Returns

string


unreviewedWrittenViews()

unreviewedWrittenViews(horn): Promise<UnreviewedView[]>

Every written view in this Horn that no person has accepted as it now stands.

A library view is not checked here: it was reviewed where it was published, and its content is pinned by hash, so re-reading it on every Horn that uses it would be asking the same question twice.

Parameters

horn
about?

string[]

actions

({ id: string; ref: { hash: string; item: string; revision: string; }; } | { allowedClasses: string[]; allowedPredicates: string[]; confirm: true; criteria?: { ask: string; }; delete?: string; id: string; insert: string; kind: "kg-update"; label: string; params: object[]; where?: string; } | { actionShapeIri: string; confirm: true; criteria?: { ask: string; }; id: string; kind: "action-shape"; label: string; mapping: z.ZodRecord<z.ZodString, z.ZodString>; operation: "addition" | "update"; params: object[]; })[]

audience?

string

baseRevision?

number

datastoreId

string

dependencies

object[]

derivations

({ id: string; ref: { hash: string; item: string; revision: string; }; } | { appliesTo: string; datatype: string; id: string; pattern: string; predicateIri: string; promotedRuleIri?: string; status: "query" | "staged" | "materialized"; })[]

iri

string

layout

{ columns: 12; items: object[]; kind: "grid"; }

layout.columns

12

layout.items

object[]

layout.kind

"grid"

lock

{ entries: object[]; lockVersion: 1; }

lock.entries

object[]

lock.lockVersion

1

realm

"hiremanta-com" | "journey-travel"

revision

number

runtime

{ kit: string; }

runtime.kit

string

schemaVersion

1

slug

string

style?

{ accent?: "blue" | "orange" | "green" | "amber" | "pink" | "forest" | "indigo" | "red"; density?: "compact" | "comfortable"; radius?: "sharp" | "soft" | "round"; theme?: "light" | "dark"; }

style.accent?

"blue" | "orange" | "green" | "amber" | "pink" | "forest" | "indigo" | "red"

style.density?

"compact" | "comfortable"

style.radius?

"sharp" | "soft" | "round"

style.theme?

"light" | "dark"

summary?

string

title

string

variables

object[]

views

({ id: string; ref: { hash: string; item: string; revision: string; }; } | { binding: { columns: object[]; derivations: string[]; kind: "select"; limit: number; params: string[]; sparql: string; } | { classIri: string; derivations: string[]; fields: object[]; kind: "lens"; limit: number; rows?: "entity" | "value"; } | { kind: "query"; limit: number; params: string[]; query: { hash: string; item: string; revision: string; }; }; emits?: object[]; id: string; render: { component: { hash: string; item: string; revision: string; }; kind: "component"; props: JSONType; } | { kind: "tsx"; reviewed?: { at: string; hash: string; }; source: string; }; title: string; })[]

Returns

Promise<UnreviewedView[]>


variablesFromSearch()

variablesFromSearch(horn, search): Record<string, VariableValue>

The variables a query string sets, keyed by variable id. Only what the URL names: a caller merges this over the Horn’s own defaults, which is what buildHornSnapshot does with an absent key.

Parameters

horn
about?

string[]

actions

({ id: string; ref: { hash: string; item: string; revision: string; }; } | { allowedClasses: string[]; allowedPredicates: string[]; confirm: true; criteria?: { ask: string; }; delete?: string; id: string; insert: string; kind: "kg-update"; label: string; params: object[]; where?: string; } | { actionShapeIri: string; confirm: true; criteria?: { ask: string; }; id: string; kind: "action-shape"; label: string; mapping: z.ZodRecord<z.ZodString, z.ZodString>; operation: "addition" | "update"; params: object[]; })[]

audience?

string

baseRevision?

number

datastoreId

string

dependencies

object[]

derivations

({ id: string; ref: { hash: string; item: string; revision: string; }; } | { appliesTo: string; datatype: string; id: string; pattern: string; predicateIri: string; promotedRuleIri?: string; status: "query" | "staged" | "materialized"; })[]

iri

string

layout

{ columns: 12; items: object[]; kind: "grid"; }

layout.columns

12

layout.items

object[]

layout.kind

"grid"

lock

{ entries: object[]; lockVersion: 1; }

lock.entries

object[]

lock.lockVersion

1

realm

"hiremanta-com" | "journey-travel"

revision

number

runtime

{ kit: string; }

runtime.kit

string

schemaVersion

1

slug

string

style?

{ accent?: "blue" | "orange" | "green" | "amber" | "pink" | "forest" | "indigo" | "red"; density?: "compact" | "comfortable"; radius?: "sharp" | "soft" | "round"; theme?: "light" | "dark"; }

style.accent?

"blue" | "orange" | "green" | "amber" | "pink" | "forest" | "indigo" | "red"

style.density?

"compact" | "comfortable"

style.radius?

"sharp" | "soft" | "round"

style.theme?

"light" | "dark"

summary?

string

title

string

variables

object[]

views

({ id: string; ref: { hash: string; item: string; revision: string; }; } | { binding: { columns: object[]; derivations: string[]; kind: "select"; limit: number; params: string[]; sparql: string; } | { classIri: string; derivations: string[]; fields: object[]; kind: "lens"; limit: number; rows?: "entity" | "value"; } | { kind: "query"; limit: number; params: string[]; query: { hash: string; item: string; revision: string; }; }; emits?: object[]; id: string; render: { component: { hash: string; item: string; revision: string; }; kind: "component"; props: JSONType; } | { kind: "tsx"; reviewed?: { at: string; hash: string; }; source: string; }; title: string; })[]

string

Returns

Record<string, VariableValue>


writtenSourceHash()

writtenSourceHash(source): Promise<string>

The hash a review records. Web Crypto, because this is reachable from the browser bundle.

Parameters

source

string

Returns

Promise<string>