ToolPeriod
Interface: ToolPeriod
Defined in: src/tools/declare.ts:126
Which arguments set the period a tool's answer covers, how their values are
spelled, and the facts about the source. The one period shape's TOOL half;
the result half (DeclaredPeriod: what a read queried and what the store
holds) belongs to the result doors.
Two ways to name the shape, never both: today's single argument
(argument + spelling, or accepts for several spellings, and
zoneArgument beside a wall-range), which is sugar over the general
forms — every shape the tool accepts, in preference order.
Example
period: { argument: 'window', spelling: 'lookback' } // '2h', '24h', '7d'
period: {
forms: [{ kind: 'bounds',
from: { argument: 'start_time', as: 'epoch-ms' },
to: { argument: 'end_time', as: 'epoch-ms', edge: 'exclusive' } }],
direction: 'past', retention: '30d',
}Properties
accepts?
readonlyoptionalaccepts?: readonlyPeriodSpelling[]
Defined in: src/tools/declare.ts:131
Every single-argument spelling the argument takes, in preference order.
argument?
readonlyoptionalargument?:string
Defined in: src/tools/declare.ts:128
direction?
readonlyoptionaldirection?:PeriodDirection
Defined in: src/tools/declare.ts:140
Which side of now the source can hold; absent: not checked.
filtersToAsked?
readonlyoptionalfiltersToAsked?:boolean
Defined in: src/tools/declare.ts:148
The tool reads ctx.time.asked and drops rows outside it.
forms?
readonlyoptionalforms?: readonlyPeriodForm[]
Defined in: src/tools/declare.ts:135
granularity?
readonlyoptionalgranularity?:string
Defined in: src/tools/declare.ts:146
The source's smallest step (1m).
maxRange?
readonlyoptionalmaxRange?:string
Defined in: src/tools/declare.ts:144
The widest window the tool accepts at once (24h).
retention?
readonlyoptionalretention?:string
Defined in: src/tools/declare.ts:142
The oldest data the source keeps (30d).
spelling?
readonlyoptionalspelling?:PeriodSpelling
Defined in: src/tools/declare.ts:129
wallZone?
readonlyoptionalwallZone?:"app"
Defined in: src/tools/declare.ts:137
A wall / date / day form with no zone argument reads in the app's .time({ zone }) — explicit, never implied.
zoneArgument?
readonlyoptionalzoneArgument?:string
Defined in: src/tools/declare.ts:133
The argument that carries the zone of a wall-range.
