@lotics/app-sdk 0.123.11 → 0.124.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +3 -3
- package/dist/{chunk-COWN73CO.js → chunk-BWMAO5IY.js} +33 -3
- package/dist/comments.d.ts +1 -1
- package/dist/index.d.ts +5 -6
- package/dist/index.js +2488 -1782
- package/dist/outside_link.d.ts +27 -0
- package/dist/router.js +1 -1
- package/dist/row.d.ts +9 -2
- package/dist/rpc.d.ts +17 -3
- package/dist/shared_types.d.ts +5 -4
- package/dist/viewer.d.ts +2 -1
- package/docs/ai.md +3 -29
- package/docs/data_fetching.md +1 -0
- package/docs/files.md +1 -1
- package/docs/members_and_options.md +12 -62
- package/docs/mutations.md +4 -3
- package/docs/recipes.md +4 -4
- package/docs/runtime.md +5 -1
- package/docs/security.md +0 -3
- package/docs/workflows.md +19 -46
- package/package.json +1 -1
- package/dist/activity.d.ts +0 -40
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A member's links to a record, for the record that draws an Outside (`record.outside` in the app's spec): who each was
|
|
3
|
+
* made for, until when, whether it was opened. Members of the app's organization only. The secret never crosses this
|
|
4
|
+
* bridge — the host draws the dialogs that make and withdraw a link and shows the address itself, so a frame can neither
|
|
5
|
+
* read nor mint one on its own.
|
|
6
|
+
*/
|
|
7
|
+
import type { ListOutsideLinksResult, OutsideLink } from "./shared_types.js";
|
|
8
|
+
export interface OutsideLinksState {
|
|
9
|
+
/** The record's name and each Outside's title, as the server states them; none until the first answer. */
|
|
10
|
+
links: ListOutsideLinksResult | undefined;
|
|
11
|
+
loading: boolean;
|
|
12
|
+
error: string | null;
|
|
13
|
+
/** A signed-in member of the app's organization; for anyone else nothing is asked and `links` stays empty. */
|
|
14
|
+
available: boolean;
|
|
15
|
+
/** The host asks who the link is for and for how long, then makes it and shows its address; resolves to the link made,
|
|
16
|
+
* or `null` when the member backed out. */
|
|
17
|
+
create: (outside: string) => Promise<OutsideLink | null>;
|
|
18
|
+
/** The host asks the member to confirm, then withdraws it; resolves to whether it did. */
|
|
19
|
+
revoke: (link: OutsideLink) => Promise<boolean>;
|
|
20
|
+
}
|
|
21
|
+
/** A link was made or withdrawn through a hook that was given no record. */
|
|
22
|
+
export declare class OutsideLinkRecordError extends Error {
|
|
23
|
+
constructor();
|
|
24
|
+
}
|
|
25
|
+
/** The links of one record, read again after each press of `create` and `revoke`. `null` is a record that draws no
|
|
26
|
+
* Outside: nothing is asked of the host, and `create` and `revoke` refuse. */
|
|
27
|
+
export declare function useOutsideLinks(record_id: string | null): OutsideLinksState;
|
package/dist/router.js
CHANGED
package/dist/row.d.ts
CHANGED
|
@@ -68,10 +68,17 @@ export interface PhotoPlace {
|
|
|
68
68
|
*/
|
|
69
69
|
export declare function readFiles(v: unknown): AppFile[];
|
|
70
70
|
/**
|
|
71
|
-
* Whether the row's record is locked (`__source_locked`)
|
|
72
|
-
*
|
|
71
|
+
* Whether the row's record is locked (`__source_locked`): its table refuses
|
|
72
|
+
* every write to it until a manager unlocks it, and an app reads it
|
|
73
|
+
* read-only. Pass the whole row; absent is unlocked.
|
|
73
74
|
*/
|
|
74
75
|
export declare function readLocked(rowValue: unknown): boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Who can change a locked row (`__source_locked_by`), by name: the members
|
|
78
|
+
* who review a change to its table's locked rows. `[]` where the host told
|
|
79
|
+
* no one — an unlocked row, or a reader from outside the organization.
|
|
80
|
+
*/
|
|
81
|
+
export declare function readLockedBy(rowValue: unknown): string[];
|
|
75
82
|
/** `__created_at` of the row's record; null on a grouped row. Pass the whole row. */
|
|
76
83
|
export declare function readCreatedAt(rowValue: unknown): Date | null;
|
|
77
84
|
/** `__updated_at`, as {@link readCreatedAt}. */
|
package/dist/rpc.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AppAbsence } from "./shared_types.js";
|
|
2
|
+
import type { AppFile } from "./shared_types.js";
|
|
2
3
|
import type { AskUserChoiceOutput } from "./agent_stream.js";
|
|
3
4
|
import { type UrlParams, type UrlParamsPatch } from "./url_params.js";
|
|
4
5
|
/**
|
|
@@ -12,7 +13,7 @@ import { type UrlParams, type UrlParamsPatch } from "./url_params.js";
|
|
|
12
13
|
* the app's first screen has its data
|
|
13
14
|
* host → app: { id, type: "result", data } | { id, type: "error", message }
|
|
14
15
|
*/
|
|
15
|
-
export type RpcOp = "query" | "export" | "field_options" | "workflow" | "agentRuns" | "agentRun.get" | "agentRun.cancel" | "upload" | "file.rename" | "members" | "context" | "write_model" | "prediction_miss" | "openExternal" | "openApp" | "peekApp" | "askAi" | "urlState.get" | "urlState.set" | "folder.get" | "folder.set" | "comments.list" | "comments.create" | "comments.update" | "comments.delete" | "comments.counts" | "
|
|
16
|
+
export type RpcOp = "query" | "export" | "field_options" | "workflow" | "agentRuns" | "agentRun.get" | "agentRun.cancel" | "upload" | "file.rename" | "members" | "context" | "spec" | "write_model" | "prediction_miss" | "openExternal" | "openApp" | "peekApp" | "askAi" | "urlState.get" | "urlState.set" | "folder.get" | "folder.set" | "comments.list" | "comments.create" | "comments.update" | "comments.delete" | "comments.counts" | "recording.start" | "recording.stop" | "outsideLink.list" | "outsideLink.create" | "outsideLink.revoke";
|
|
16
17
|
export interface AgentRunPayload {
|
|
17
18
|
alias: string;
|
|
18
19
|
session_id: string;
|
|
@@ -84,15 +85,28 @@ export interface AppContext {
|
|
|
84
85
|
/** Who in the organization is away, or will be, and who stands in — absent from an older host and for a visitor from
|
|
85
86
|
* outside the organization. */
|
|
86
87
|
absences?: AppAbsence[];
|
|
87
|
-
/** The apps of the workspace the viewer can open, each by its id and its name
|
|
88
|
-
* for a visitor and until the host has listed them. */
|
|
88
|
+
/** The apps of the workspace the viewer can open, each by its id and its name, and the table its register lists
|
|
89
|
+
* (`table_id`) where the host says — absent from an older host, for a visitor and until the host has listed them. */
|
|
89
90
|
openable_apps?: {
|
|
90
91
|
id: string;
|
|
91
92
|
name: string;
|
|
93
|
+
table_id?: string;
|
|
92
94
|
}[];
|
|
93
95
|
}
|
|
94
96
|
/** Whether a Lotics host embeds the app, rather than it standing alone on its own origin. */
|
|
95
97
|
export declare function isEmbedded(): boolean;
|
|
98
|
+
/**
|
|
99
|
+
* What answers every op of a page that has neither a bridging host nor an app origin of its own: the outside page's
|
|
100
|
+
* (`hosted/outside.tsx`), whose one credential is a link it holds in memory.
|
|
101
|
+
*/
|
|
102
|
+
export type RpcTransport = (op: RpcOp, payload: unknown) => Promise<unknown>;
|
|
103
|
+
/** Make `transport` the answer to every op, for a page that is never an app's. Module state, as the fixture is: the
|
|
104
|
+
* last install wins, and a page installs its own before it mounts. */
|
|
105
|
+
export declare function installRpcTransport(transport: RpcTransport): void;
|
|
106
|
+
/** What the host answers `spec`: the app's compiled spec itself, never the route's wrapper around it. */
|
|
107
|
+
export type HostSpec = AppFile;
|
|
108
|
+
/** The app's spec, as the host hands it over the bridge. */
|
|
109
|
+
export declare function hostSpec(): Promise<HostSpec>;
|
|
96
110
|
export declare function rpc<T = unknown>(op: RpcOp, payload: unknown): Promise<T>;
|
|
97
111
|
export declare function getUrlParams(): Promise<UrlParams>;
|
|
98
112
|
/** A key set to `undefined` is cleared; every other param is kept, and no history entry added. */
|
package/dist/shared_types.d.ts
CHANGED
|
@@ -3,9 +3,8 @@
|
|
|
3
3
|
* `scripts/build_sdk.mjs`, because that package is private and ships in no
|
|
4
4
|
* tarball. Written at every build, never edited.
|
|
5
5
|
*/
|
|
6
|
-
export type ActivityEntry = { undoable: boolean; changes: { field_id: string; label: string; before: string | number | boolean | { key: string; label: string; }[] | { id: string; display: string; }[] | { id: string; name: string | null; image?: string | undefined; }[] | { id: string; filename: string; mime_type: string; file_storage_key?: string | undefined; url?: string | undefined; thumbnail_url?: string | undefined; preview_url?: string | undefined; size?: number | null | undefined; created_at?: string | undefined; document_template_id?: string | undefined; }[] | null; after: string | number | boolean | { key: string; label: string; }[] | { id: string; display: string; }[] | { id: string; name: string | null; image?: string | undefined; }[] | { id: string; filename: string; mime_type: string; file_storage_key?: string | undefined; url?: string | undefined; thumbnail_url?: string | undefined; preview_url?: string | undefined; size?: number | null | undefined; created_at?: string | undefined; document_template_id?: string | undefined; }[] | null; removed?: true | undefined; }[]; id: string; actor: { kind: "member" | "agent" | "workflow" | "import"; id: string; name: string; image?: string | undefined; }; at: string; until: string; kind: "change"; created?: true | undefined; undo?: true | undefined; undone?: { by: { kind: "member" | "agent" | "workflow" | "import"; id: string; name: string; image?: string | undefined; }; at: string; } | undefined; } | { comment: { id: string; body: string; mentions: { id: string; name: string; }[]; files?: { id: string; filename: string; mime_type: string; file_storage_key?: string | undefined; url?: string | undefined; thumbnail_url?: string | undefined; preview_url?: string | undefined; size?: number | null | undefined; created_at?: string | undefined; document_template_id?: string | undefined; }[] | undefined; }; id: string; actor: { kind: "member" | "agent" | "workflow" | "import"; id: string; name: string; image?: string | undefined; }; at: string; until: string; kind: "comment"; };
|
|
7
|
-
export type ActivityUndoResult = { reverted: { field_id: string; label: string; }[]; kept: { field_id: string; label: string; reason: "changed_since" | "refused"; }[]; };
|
|
8
6
|
export type AppAbsence = { member: { id: string; name: string; }; stand_in: { id: string; name: string; }; starts_on: string; ends_on: string; group_ids: string[]; };
|
|
7
|
+
export type AppFile = { version: 28; app: { alias: string; label: string; locale: ReportLanguage; description?: string | undefined; }; entity: string; entities: Record<string, { alias: string; label: string; table: string; fields: Record<string, { alias: string; id: string; type: "number" | "boolean" | "date" | "text" | "select" | "select_member" | "select_record_link" | "files" | "formula" | "rollup" | "lookup" | "autonumber"; label: string; result?: "number" | "boolean" | "date" | "text" | "select" | "select_member" | "select_record_link" | "files" | "formula" | "rollup" | "lookup" | "autonumber" | undefined; description?: string | undefined; format?: "datetime" | "text" | "link" | "markdown" | undefined; multi?: true | undefined; required?: true | undefined; readonly?: true | undefined; notation?: { style: "decimal"; } | { style: "currency"; currency: string | { per_row: string; }; } | { style: "unit"; unit: string | { per_row: string; }; } | undefined; limit?: { field: string; } | { value: number; } | undefined; gate?: { field: string; } | { value: number; } | undefined; tolerance?: number | undefined; due?: true | undefined; frees?: true | undefined; summed?: true | undefined; accumulates?: true | undefined; whole?: true | undefined; restates?: string | undefined; starts?: "today" | "me" | undefined; default?: string | number | boolean | string[] | undefined; options?: { alias: string; label: string; id: string; color?: "red" | "orange" | "amber" | "yellow" | "lime" | "green" | "emerald" | "teal" | "cyan" | "sky" | "blue" | "indigo" | "violet" | "purple" | "fuchsia" | "pink" | "rose" | "slate" | "gray" | "zinc" | "neutral" | "stone" | undefined; mark?: { kind: string; name: string; } | undefined; }[] | undefined; link?: string | undefined; accept?: string | undefined; image?: string | undefined; party?: "person" | "organization" | undefined; pictures?: { query: string; param: string; } | undefined; face?: Record<string, string> | undefined; default_from?: { link: string; field: string; } | undefined; reads?: string[] | undefined; through?: { link: string; field: string; } | undefined; pick?: { query: string; param?: string | undefined; same?: { field: string; param: string; }[] | undefined; } | undefined; picks_only?: true | undefined; suggest?: { query: string; param: string; column: string; } | undefined; applies?: ({ field: string; options: string[]; } | { field: string; value: boolean; })[] | undefined; }>; title: string; list: { query: string; param?: string | undefined; }; singular?: string | undefined; subtitle?: string[] | undefined; image?: string | undefined; mark?: string | undefined; description?: string | undefined; party?: "person" | "organization" | undefined; mine?: string | undefined; status?: { field: string; closed?: string[] | undefined; history?: string | undefined; dates?: Record<string, string> | undefined; stages?: Record<string, { owner: { kind: "member"; column: string; label: string; } | { kind: "group"; group: string; label: string; }; within?: number | undefined; when?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; })[] | undefined; }> | undefined; maker?: string | undefined; moves?: { query: string; param: string; link: string; status: string; at: string; went: Record<string, string>; by?: string | undefined; } | undefined; } | undefined; settled?: string | undefined; task?: { close?: { to: string; act?: string | undefined; } | undefined; reopen?: { to: string; act?: string | undefined; } | undefined; member?: string | undefined; } | undefined; progress?: { entity: string; via: string; read: { query: string; param: string; }; passed?: string | undefined; }[] | undefined; figure?: string | undefined; scan?: { read: "text" | "iso6346"; agent: string; } | { read: "code"; } | undefined; place?: { address: string; latitude: string; longitude: string; accuracy?: string | undefined; } | undefined; on_site?: { photos: string[]; latitude: string; longitude: string; radius: number; place?: string | undefined; } | undefined; pin?: { on: string; x: string; y: string; } | undefined; size?: { across: string; along: string; up: string; } | undefined; listed?: string[] | undefined; one?: { query: string; param?: string | undefined; } | undefined; create?: { workflow: string; fields: string[]; picker?: string[] | undefined; } | undefined; update?: { workflow: string; fields?: string[] | undefined; } | undefined; remove?: { workflow: string; with?: string[] | undefined; } | undefined; }>; register: { columns: string[]; filters: (string | { field: string; tiers: number[]; })[]; layout: "table" | "cards" | "calendar" | "roster" | "lanes" | "gantt" | "plan"; book?: true | undefined; search?: string[] | undefined; sort?: { field: string; desc?: true | undefined; }[] | undefined; group?: string | undefined; tabs?: { tab: string; label: string; term?: { kind: "in"; field: string; } | { kind: "open"; from: string; to: string; } | undefined; totals?: { via: string; read: { query: string; }; columns: { alias: string; label: string; notation?: { style: "decimal"; } | { style: "currency"; currency: string | { per_row: string; }; } | { style: "unit"; unit: string | { per_row: string; }; } | undefined; }[]; } | undefined; where?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; member: "me"; })[] | undefined; sort?: { field: string; desc?: true | undefined; }[] | undefined; }[] | undefined; period?: "today" | "week" | "month" | "quarter" | "year" | { days: number; } | undefined; roster?: { entity: string; via: string; read: { query: string; param: string; }; day?: string | undefined; end?: string | undefined; expect?: string | undefined; of?: string | undefined; cadence?: { on: ("mon" | "tue" | "wed" | "thu" | "fri" | "sat" | "sun")[]; from?: string | undefined; until?: string | undefined; } | undefined; create?: string[] | undefined; } | undefined; lanes?: { field: string; start: string; end?: string | undefined; loads?: { value: string; against: string; }[] | undefined; read?: { query: string; param: string; } | undefined; } | undefined; gantt?: { start: string; end: string; milestones?: string[] | undefined; planned?: { start?: string | undefined; end?: string | undefined; } | undefined; progress?: string | undefined; after?: string | undefined; } | undefined; plan?: { at: string; across: string; up: string; place: { entity: string; kind: string; kinds: { bay: string; area: string; landmark: string; }; x: string; y: string; across: string; up: string; sheet?: string | undefined; scale?: string | undefined; width?: string | undefined; depth?: string | undefined; reach_from?: string | undefined; stacked?: string | undefined; reaches?: { first: string; last: string; both: string; } | undefined; size?: { across: string; along: string; up: string; } | undefined; }; fill?: string | undefined; mark?: { field: string; option: string; } | undefined; size?: { field: string; options: Record<string, { across: number; along: number; up: number; }>; } | undefined; load?: { query: string; param?: string | undefined; } | undefined; } | undefined; where?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; })[] | undefined; opens?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; member: "me"; })[] | undefined; remove?: false | undefined; create?: string[] | undefined; add_label?: string | undefined; heading?: string | undefined; export?: { query: string; label?: string | undefined; description?: string | undefined; template?: string | undefined; filename?: string | undefined; where?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; member: "me"; })[] | undefined; per?: string | undefined; per_row?: string[] | undefined; books?: string[] | undefined; }[] | undefined; readings?: ({ entity: string; label: string; read: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; }; kind: "metric"; value?: string | undefined; average?: true | undefined; over?: string | undefined; target?: number | undefined; better?: "up" | "down" | undefined; bound?: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; } | undefined; where?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; } | { field: string; member: "me"; })[] | undefined; tab?: string | undefined; } | { by: string | { field: string; tiers: number[]; }; entity: string; label: string; read: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; }; kind: "breakdown"; value?: string | undefined; over?: string | undefined; where?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; } | { field: string; member: "me"; })[] | undefined; tab?: string | undefined; } | { over: string; entity: string; label: string; read: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; }; kind: "trend"; value?: string | undefined; ahead?: true | undefined; where?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; } | { field: string; member: "me"; })[] | undefined; tab?: string | undefined; } | { rows: string | { field: string; tiers: number[]; }; columns: string | { field: string; tiers: number[]; }; entity: string; label: string; read: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; }; kind: "pivot"; value?: string | undefined; over?: string | undefined; where?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; } | { field: string; member: "me"; })[] | undefined; tab?: string | undefined; } | { by: string; on_hand: { entity: string; read: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; }; by: string; across?: string | undefined; value?: string | undefined; }; entity: string; label: string; read: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; }; kind: "shortfall"; across?: string | undefined; value?: string | undefined; where?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; } | { field: string; member: "me"; })[] | undefined; tab?: string | undefined; } | { planned: { start: string; end: string; }; done: string; entity: string; label: string; read: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; }; kind: "progress"; finished?: string | undefined; weight?: string | undefined; measured?: { via: string; read: { query: string; param: string; }; } | undefined; where?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; } | { field: string; member: "me"; })[] | undefined; tab?: string | undefined; } | { columns: string[]; entity: string; label: string; read: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; }; kind: "list"; app?: { id: string; } | undefined; where?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; } | { field: string; member: "me"; })[] | undefined; tab?: string | undefined; })[] | undefined; attention?: false | undefined; }; record: { door: "page" | "drawer" | "beside"; sections: { fields: string[]; blocks: ({ kind: "rows"; entity: string; via: string; read: { query: string; param?: string | undefined; }; title: string; columns: string[]; create?: string[] | undefined; add_label?: string | undefined; totals?: Record<string, string> | undefined; narrower?: string[] | undefined; soonest?: string[] | undefined; expect?: string | undefined; of?: string | undefined; where?: { field: string; options: string[]; }[] | undefined; filters?: (string | { field: string; tiers: number[]; })[] | undefined; search?: string[] | undefined; group?: string | undefined; sort?: { field: string; desc?: true | undefined; }[] | undefined; edits?: string[] | undefined; remove?: false | undefined; pick?: { read: { query: string; param?: string | undefined; }; back: string; same?: { field: string; param: string; }[] | undefined; admits?: { query: string; param?: string | undefined; } | undefined; } | undefined; checklist?: { photo?: string | undefined; clause?: string | undefined; words?: string[] | undefined; failed?: string[] | undefined; passed?: string | undefined; } | undefined; compare?: { before: string; after: string; } | undefined; current?: string | undefined; post?: { text: string; media: string; network: string; networks: Record<string, "x" | "facebook" | "instagram" | "threads" | "linkedin">; bodies?: string[] | undefined; compute?: { expression: string; reads: Record<string, { from: "row"; field: string; } | { from: "record"; field: string; } | { from: "place"; field: string; } | { from: "formula"; expression: string; }>; } | undefined; link?: string | undefined; group?: string | undefined; } | undefined; under?: { field: string; entity: string; via: string; back: string; read: { query: string; param?: string | undefined; }; where?: { field: string; options: string[]; }[] | undefined; } | undefined; when?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; })[] | undefined; } | { kind: "agenda"; entity: string; via: string; read: { query: string; param?: string | undefined; }; title: string; columns: string[]; day: string; time?: string | undefined; part?: string | undefined; start?: string | undefined; create?: string[] | undefined; add_label?: string | undefined; when?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; })[] | undefined; } | { kind: "timeline"; entity: string; via: string; read: { query: string; param?: string | undefined; }; title: string; at: string; by?: string | undefined; create?: string[] | undefined; add_label?: string | undefined; when?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; })[] | undefined; } | { kind: "files"; fields: string[]; title: string; add_label?: string | undefined; when?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; })[] | undefined; } | { kind: "text"; field: string; title: string; when?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; })[] | undefined; } | { kind: "figures"; fields: string[]; when?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; })[] | undefined; } | { kind: "statement"; title: string; lines: { field: string; op?: "plus" | "minus" | "times" | "equals" | undefined; rate?: string | undefined; parts?: { entity: string; read: { query: string; param: string; }; same: string; columns: string[]; figure: string; before?: { field: string; param: string; } | undefined; } | undefined; }[]; when?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; })[] | undefined; } | { kind: "reading"; reading: { entity: string; label: string; read: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; }; kind: "metric"; value?: string | undefined; average?: true | undefined; over?: string | undefined; target?: number | undefined; better?: "up" | "down" | undefined; bound?: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; } | undefined; where?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; } | { field: string; member: "me"; })[] | undefined; tab?: string | undefined; } | { by: string | { field: string; tiers: number[]; }; entity: string; label: string; read: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; }; kind: "breakdown"; value?: string | undefined; over?: string | undefined; where?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; } | { field: string; member: "me"; })[] | undefined; tab?: string | undefined; } | { over: string; entity: string; label: string; read: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; }; kind: "trend"; value?: string | undefined; ahead?: true | undefined; where?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; } | { field: string; member: "me"; })[] | undefined; tab?: string | undefined; } | { rows: string | { field: string; tiers: number[]; }; columns: string | { field: string; tiers: number[]; }; entity: string; label: string; read: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; }; kind: "pivot"; value?: string | undefined; over?: string | undefined; where?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; } | { field: string; member: "me"; })[] | undefined; tab?: string | undefined; } | { by: string; on_hand: { entity: string; read: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; }; by: string; across?: string | undefined; value?: string | undefined; }; entity: string; label: string; read: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; }; kind: "shortfall"; across?: string | undefined; value?: string | undefined; where?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; } | { field: string; member: "me"; })[] | undefined; tab?: string | undefined; } | { planned: { start: string; end: string; }; done: string; entity: string; label: string; read: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; }; kind: "progress"; finished?: string | undefined; weight?: string | undefined; measured?: { via: string; read: { query: string; param: string; }; } | undefined; where?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; } | { field: string; member: "me"; })[] | undefined; tab?: string | undefined; } | { columns: string[]; entity: string; label: string; read: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; }; kind: "list"; app?: { id: string; } | undefined; where?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; } | { field: string; member: "me"; })[] | undefined; tab?: string | undefined; }; via: string; when?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; })[] | undefined; } | { kind: "list"; reading: { columns: string[]; entity: string; label: string; read: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; }; kind: "list"; app?: { id: string; } | undefined; where?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; } | { field: string; member: "me"; })[] | undefined; tab?: string | undefined; }; via: string; same?: { field: string; param: string; } | undefined; bounds?: { field: string; param: string; of: "number" | "date"; lookup?: true | undefined; }[] | undefined; fields?: string[] | undefined; when?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; })[] | undefined; } | { kind: "funnel"; entity: string; read: { query: string; param?: string | undefined; }; label: string; steps: string[]; when?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; })[] | undefined; })[]; acts: string[]; title?: string | undefined; description?: string | undefined; at?: string[] | undefined; reads?: string[] | undefined; entry?: string[] | undefined; acts_last?: true | undefined; when?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; })[] | undefined; page?: string | undefined; side?: true | undefined; }[]; outside?: { key: string; entity: string; title: string; at: string[]; fields: string[]; one: { query: string; param: string; }; blocks: { kind: "list"; reading: { columns: string[]; entity: string; label: string; read: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; }; kind: "list"; app?: { id: string; } | undefined; where?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; } | { field: string; member: "me"; })[] | undefined; tab?: string | undefined; }; via: string; same?: { field: string; param: string; } | undefined; bounds?: { field: string; param: string; of: "number" | "date"; lookup?: true | undefined; }[] | undefined; fields?: string[] | undefined; when?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; })[] | undefined; }[]; acts: string[]; description?: string | undefined; }[] | undefined; comments?: true | undefined; moves?: { kind: "timeline"; entity: string; via: string; read: { query: string; param?: string | undefined; }; title: string; at: string; by?: string | undefined; create?: string[] | undefined; add_label?: string | undefined; when?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; })[] | undefined; } | undefined; compose?: { use: "Column"; children: ComposeNode[]; } | { use: "Bar"; children: ComposeNode[]; } | { use: "Group"; title: string; children: ComposeNode[]; } | { use: "Panel"; title: string; children: ComposeNode[]; } | { use: "Title"; } | { use: "Status"; } | { use: "Field"; field: string; } | { use: "Document"; field: string; } | { use: "Act"; act: string; } | { use: "Rows"; child: string; create?: false | undefined; remove?: true | undefined; } | { use: "Copy"; field: string; as: "plain" | "raw"; } | undefined; }; acts: { alias: string; label: string; on: "record" | "rows" | "view"; of?: string | undefined; workflow?: string | undefined; open?: { app: string; } | undefined; when?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; })[] | undefined; to?: string | undefined; writes?: true | undefined; into?: string | undefined; paper?: { entity: string; option: string; } | undefined; marks?: Record<string, boolean> | undefined; requires?: string[] | undefined; recommends?: string[] | undefined; asks?: (string | { input: string; label: string; type: "number" | "date" | "file" | "text" | "member" | "select" | "link" | "long_text"; options?: { alias: string; label: string; color?: "red" | "orange" | "amber" | "yellow" | "lime" | "green" | "emerald" | "teal" | "cyan" | "sky" | "blue" | "indigo" | "violet" | "purple" | "fuchsia" | "pink" | "rose" | "slate" | "gray" | "zinc" | "neutral" | "stone" | undefined; mark?: { kind: string; name: string; } | undefined; }[] | undefined; entity?: string | undefined; required?: true | undefined; default?: string | undefined; accept?: string | undefined; })[] | undefined; starts?: Record<string, "today" | "me"> | undefined; makes?: string | undefined; papers?: { template: string; label: string; when?: ({ field: string; options: string[]; } | { field: string; value: boolean; })[] | undefined; }[] | undefined; archive?: string | undefined; intake?: { agent: string; papers: { entity: string; kind: string; files: string; }; fields: string[]; parties?: { link: string; fields: string[]; }[] | undefined; rows?: { entity: string; fields: string[]; key?: string[] | undefined; }[] | undefined; } | undefined; recording?: { into: string; via: string; audio: string; transcript: string; video?: string | undefined; agent?: string | undefined; } | undefined; sign?: { into: string; by: string; at: string; witness?: string | undefined; } | undefined; review?: true | undefined; confirm?: string | true | undefined; danger?: true | undefined; }[]; checks: { field: string; of?: string | undefined; blocks?: string[] | "all" | undefined; resolve?: string | undefined; reads?: string[] | undefined; }[]; scope?: { field: string; entity: string; param: string; counts: { query: string; param?: string | undefined; }; } | undefined; books?: { entity: string; record: { door: "page" | "drawer" | "beside"; sections: { fields: string[]; blocks: ({ kind: "rows"; entity: string; via: string; read: { query: string; param?: string | undefined; }; title: string; columns: string[]; create?: string[] | undefined; add_label?: string | undefined; totals?: Record<string, string> | undefined; narrower?: string[] | undefined; soonest?: string[] | undefined; expect?: string | undefined; of?: string | undefined; where?: { field: string; options: string[]; }[] | undefined; filters?: (string | { field: string; tiers: number[]; })[] | undefined; search?: string[] | undefined; group?: string | undefined; sort?: { field: string; desc?: true | undefined; }[] | undefined; edits?: string[] | undefined; remove?: false | undefined; pick?: { read: { query: string; param?: string | undefined; }; back: string; same?: { field: string; param: string; }[] | undefined; admits?: { query: string; param?: string | undefined; } | undefined; } | undefined; checklist?: { photo?: string | undefined; clause?: string | undefined; words?: string[] | undefined; failed?: string[] | undefined; passed?: string | undefined; } | undefined; compare?: { before: string; after: string; } | undefined; current?: string | undefined; post?: { text: string; media: string; network: string; networks: Record<string, "x" | "facebook" | "instagram" | "threads" | "linkedin">; bodies?: string[] | undefined; compute?: { expression: string; reads: Record<string, { from: "row"; field: string; } | { from: "record"; field: string; } | { from: "place"; field: string; } | { from: "formula"; expression: string; }>; } | undefined; link?: string | undefined; group?: string | undefined; } | undefined; under?: { field: string; entity: string; via: string; back: string; read: { query: string; param?: string | undefined; }; where?: { field: string; options: string[]; }[] | undefined; } | undefined; when?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; })[] | undefined; } | { kind: "agenda"; entity: string; via: string; read: { query: string; param?: string | undefined; }; title: string; columns: string[]; day: string; time?: string | undefined; part?: string | undefined; start?: string | undefined; create?: string[] | undefined; add_label?: string | undefined; when?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; })[] | undefined; } | { kind: "timeline"; entity: string; via: string; read: { query: string; param?: string | undefined; }; title: string; at: string; by?: string | undefined; create?: string[] | undefined; add_label?: string | undefined; when?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; })[] | undefined; } | { kind: "files"; fields: string[]; title: string; add_label?: string | undefined; when?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; })[] | undefined; } | { kind: "text"; field: string; title: string; when?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; })[] | undefined; } | { kind: "figures"; fields: string[]; when?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; })[] | undefined; } | { kind: "statement"; title: string; lines: { field: string; op?: "plus" | "minus" | "times" | "equals" | undefined; rate?: string | undefined; parts?: { entity: string; read: { query: string; param: string; }; same: string; columns: string[]; figure: string; before?: { field: string; param: string; } | undefined; } | undefined; }[]; when?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; })[] | undefined; } | { kind: "reading"; reading: { entity: string; label: string; read: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; }; kind: "metric"; value?: string | undefined; average?: true | undefined; over?: string | undefined; target?: number | undefined; better?: "up" | "down" | undefined; bound?: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; } | undefined; where?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; } | { field: string; member: "me"; })[] | undefined; tab?: string | undefined; } | { by: string | { field: string; tiers: number[]; }; entity: string; label: string; read: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; }; kind: "breakdown"; value?: string | undefined; over?: string | undefined; where?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; } | { field: string; member: "me"; })[] | undefined; tab?: string | undefined; } | { over: string; entity: string; label: string; read: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; }; kind: "trend"; value?: string | undefined; ahead?: true | undefined; where?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; } | { field: string; member: "me"; })[] | undefined; tab?: string | undefined; } | { rows: string | { field: string; tiers: number[]; }; columns: string | { field: string; tiers: number[]; }; entity: string; label: string; read: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; }; kind: "pivot"; value?: string | undefined; over?: string | undefined; where?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; } | { field: string; member: "me"; })[] | undefined; tab?: string | undefined; } | { by: string; on_hand: { entity: string; read: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; }; by: string; across?: string | undefined; value?: string | undefined; }; entity: string; label: string; read: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; }; kind: "shortfall"; across?: string | undefined; value?: string | undefined; where?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; } | { field: string; member: "me"; })[] | undefined; tab?: string | undefined; } | { planned: { start: string; end: string; }; done: string; entity: string; label: string; read: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; }; kind: "progress"; finished?: string | undefined; weight?: string | undefined; measured?: { via: string; read: { query: string; param: string; }; } | undefined; where?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; } | { field: string; member: "me"; })[] | undefined; tab?: string | undefined; } | { columns: string[]; entity: string; label: string; read: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; }; kind: "list"; app?: { id: string; } | undefined; where?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; } | { field: string; member: "me"; })[] | undefined; tab?: string | undefined; }; via: string; when?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; })[] | undefined; } | { kind: "list"; reading: { columns: string[]; entity: string; label: string; read: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; }; kind: "list"; app?: { id: string; } | undefined; where?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; } | { field: string; member: "me"; })[] | undefined; tab?: string | undefined; }; via: string; same?: { field: string; param: string; } | undefined; bounds?: { field: string; param: string; of: "number" | "date"; lookup?: true | undefined; }[] | undefined; fields?: string[] | undefined; when?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; })[] | undefined; } | { kind: "funnel"; entity: string; read: { query: string; param?: string | undefined; }; label: string; steps: string[]; when?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; })[] | undefined; })[]; acts: string[]; title?: string | undefined; description?: string | undefined; at?: string[] | undefined; reads?: string[] | undefined; entry?: string[] | undefined; acts_last?: true | undefined; when?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; })[] | undefined; page?: string | undefined; side?: true | undefined; }[]; outside?: { key: string; entity: string; title: string; at: string[]; fields: string[]; one: { query: string; param: string; }; blocks: { kind: "list"; reading: { columns: string[]; entity: string; label: string; read: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; }; kind: "list"; app?: { id: string; } | undefined; where?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; } | { field: string; member: "me"; })[] | undefined; tab?: string | undefined; }; via: string; same?: { field: string; param: string; } | undefined; bounds?: { field: string; param: string; of: "number" | "date"; lookup?: true | undefined; }[] | undefined; fields?: string[] | undefined; when?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; })[] | undefined; }[]; acts: string[]; description?: string | undefined; }[] | undefined; comments?: true | undefined; moves?: { kind: "timeline"; entity: string; via: string; read: { query: string; param?: string | undefined; }; title: string; at: string; by?: string | undefined; create?: string[] | undefined; add_label?: string | undefined; when?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; })[] | undefined; } | undefined; compose?: { use: "Column"; children: ComposeNode[]; } | { use: "Bar"; children: ComposeNode[]; } | { use: "Group"; title: string; children: ComposeNode[]; } | { use: "Panel"; title: string; children: ComposeNode[]; } | { use: "Title"; } | { use: "Status"; } | { use: "Field"; field: string; } | { use: "Document"; field: string; } | { use: "Act"; act: string; } | { use: "Rows"; child: string; create?: false | undefined; remove?: true | undefined; } | { use: "Copy"; field: string; as: "plain" | "raw"; } | undefined; }; acts: { alias: string; label: string; on: "record" | "rows" | "view"; of?: string | undefined; workflow?: string | undefined; open?: { app: string; } | undefined; when?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; })[] | undefined; to?: string | undefined; writes?: true | undefined; into?: string | undefined; paper?: { entity: string; option: string; } | undefined; marks?: Record<string, boolean> | undefined; requires?: string[] | undefined; recommends?: string[] | undefined; asks?: (string | { input: string; label: string; type: "number" | "date" | "file" | "text" | "member" | "select" | "link" | "long_text"; options?: { alias: string; label: string; color?: "red" | "orange" | "amber" | "yellow" | "lime" | "green" | "emerald" | "teal" | "cyan" | "sky" | "blue" | "indigo" | "violet" | "purple" | "fuchsia" | "pink" | "rose" | "slate" | "gray" | "zinc" | "neutral" | "stone" | undefined; mark?: { kind: string; name: string; } | undefined; }[] | undefined; entity?: string | undefined; required?: true | undefined; default?: string | undefined; accept?: string | undefined; })[] | undefined; starts?: Record<string, "today" | "me"> | undefined; makes?: string | undefined; papers?: { template: string; label: string; when?: ({ field: string; options: string[]; } | { field: string; value: boolean; })[] | undefined; }[] | undefined; archive?: string | undefined; intake?: { agent: string; papers: { entity: string; kind: string; files: string; }; fields: string[]; parties?: { link: string; fields: string[]; }[] | undefined; rows?: { entity: string; fields: string[]; key?: string[] | undefined; }[] | undefined; } | undefined; recording?: { into: string; via: string; audio: string; transcript: string; video?: string | undefined; agent?: string | undefined; } | undefined; sign?: { into: string; by: string; at: string; witness?: string | undefined; } | undefined; review?: true | undefined; confirm?: string | true | undefined; danger?: true | undefined; }[]; checks: { field: string; of?: string | undefined; blocks?: string[] | "all" | undefined; resolve?: string | undefined; reads?: string[] | undefined; }[]; fields?: Record<string, string> | undefined; entities?: Record<string, { alias: string; label: string; table: string; fields: Record<string, { alias: string; id: string; type: "number" | "boolean" | "date" | "text" | "select" | "select_member" | "select_record_link" | "files" | "formula" | "rollup" | "lookup" | "autonumber"; label: string; result?: "number" | "boolean" | "date" | "text" | "select" | "select_member" | "select_record_link" | "files" | "formula" | "rollup" | "lookup" | "autonumber" | undefined; description?: string | undefined; format?: "datetime" | "text" | "link" | "markdown" | undefined; multi?: true | undefined; required?: true | undefined; readonly?: true | undefined; notation?: { style: "decimal"; } | { style: "currency"; currency: string | { per_row: string; }; } | { style: "unit"; unit: string | { per_row: string; }; } | undefined; limit?: { field: string; } | { value: number; } | undefined; gate?: { field: string; } | { value: number; } | undefined; tolerance?: number | undefined; due?: true | undefined; frees?: true | undefined; summed?: true | undefined; accumulates?: true | undefined; whole?: true | undefined; restates?: string | undefined; starts?: "today" | "me" | undefined; default?: string | number | boolean | string[] | undefined; options?: { alias: string; label: string; id: string; color?: "red" | "orange" | "amber" | "yellow" | "lime" | "green" | "emerald" | "teal" | "cyan" | "sky" | "blue" | "indigo" | "violet" | "purple" | "fuchsia" | "pink" | "rose" | "slate" | "gray" | "zinc" | "neutral" | "stone" | undefined; mark?: { kind: string; name: string; } | undefined; }[] | undefined; link?: string | undefined; accept?: string | undefined; image?: string | undefined; party?: "person" | "organization" | undefined; pictures?: { query: string; param: string; } | undefined; face?: Record<string, string> | undefined; default_from?: { link: string; field: string; } | undefined; reads?: string[] | undefined; through?: { link: string; field: string; } | undefined; pick?: { query: string; param?: string | undefined; same?: { field: string; param: string; }[] | undefined; } | undefined; picks_only?: true | undefined; suggest?: { query: string; param: string; column: string; } | undefined; applies?: ({ field: string; options: string[]; } | { field: string; value: boolean; })[] | undefined; }>; title: string; list: { query: string; param?: string | undefined; }; singular?: string | undefined; subtitle?: string[] | undefined; image?: string | undefined; mark?: string | undefined; description?: string | undefined; party?: "person" | "organization" | undefined; mine?: string | undefined; status?: { field: string; closed?: string[] | undefined; history?: string | undefined; dates?: Record<string, string> | undefined; stages?: Record<string, { owner: { kind: "member"; column: string; label: string; } | { kind: "group"; group: string; label: string; }; within?: number | undefined; when?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; })[] | undefined; }> | undefined; maker?: string | undefined; moves?: { query: string; param: string; link: string; status: string; at: string; went: Record<string, string>; by?: string | undefined; } | undefined; } | undefined; settled?: string | undefined; task?: { close?: { to: string; act?: string | undefined; } | undefined; reopen?: { to: string; act?: string | undefined; } | undefined; member?: string | undefined; } | undefined; progress?: { entity: string; via: string; read: { query: string; param: string; }; passed?: string | undefined; }[] | undefined; figure?: string | undefined; scan?: { read: "text" | "iso6346"; agent: string; } | { read: "code"; } | undefined; place?: { address: string; latitude: string; longitude: string; accuracy?: string | undefined; } | undefined; on_site?: { photos: string[]; latitude: string; longitude: string; radius: number; place?: string | undefined; } | undefined; pin?: { on: string; x: string; y: string; } | undefined; size?: { across: string; along: string; up: string; } | undefined; listed?: string[] | undefined; one?: { query: string; param?: string | undefined; } | undefined; create?: { workflow: string; fields: string[]; picker?: string[] | undefined; } | undefined; update?: { workflow: string; fields?: string[] | undefined; } | undefined; remove?: { workflow: string; with?: string[] | undefined; } | undefined; }> | undefined; where?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; })[] | undefined; create?: string[] | undefined; }[] | undefined; logs?: { alias: string; label: string; entity: string; register: { columns: string[]; filters: (string | { field: string; tiers: number[]; })[]; layout: "table" | "cards" | "calendar" | "roster" | "lanes" | "gantt" | "plan"; book?: true | undefined; search?: string[] | undefined; sort?: { field: string; desc?: true | undefined; }[] | undefined; group?: string | undefined; tabs?: { tab: string; label: string; term?: { kind: "in"; field: string; } | { kind: "open"; from: string; to: string; } | undefined; totals?: { via: string; read: { query: string; }; columns: { alias: string; label: string; notation?: { style: "decimal"; } | { style: "currency"; currency: string | { per_row: string; }; } | { style: "unit"; unit: string | { per_row: string; }; } | undefined; }[]; } | undefined; where?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; member: "me"; })[] | undefined; sort?: { field: string; desc?: true | undefined; }[] | undefined; }[] | undefined; period?: "today" | "week" | "month" | "quarter" | "year" | { days: number; } | undefined; roster?: { entity: string; via: string; read: { query: string; param: string; }; day?: string | undefined; end?: string | undefined; expect?: string | undefined; of?: string | undefined; cadence?: { on: ("mon" | "tue" | "wed" | "thu" | "fri" | "sat" | "sun")[]; from?: string | undefined; until?: string | undefined; } | undefined; create?: string[] | undefined; } | undefined; lanes?: { field: string; start: string; end?: string | undefined; loads?: { value: string; against: string; }[] | undefined; read?: { query: string; param: string; } | undefined; } | undefined; gantt?: { start: string; end: string; milestones?: string[] | undefined; planned?: { start?: string | undefined; end?: string | undefined; } | undefined; progress?: string | undefined; after?: string | undefined; } | undefined; plan?: { at: string; across: string; up: string; place: { entity: string; kind: string; kinds: { bay: string; area: string; landmark: string; }; x: string; y: string; across: string; up: string; sheet?: string | undefined; scale?: string | undefined; width?: string | undefined; depth?: string | undefined; reach_from?: string | undefined; stacked?: string | undefined; reaches?: { first: string; last: string; both: string; } | undefined; size?: { across: string; along: string; up: string; } | undefined; }; fill?: string | undefined; mark?: { field: string; option: string; } | undefined; size?: { field: string; options: Record<string, { across: number; along: number; up: number; }>; } | undefined; load?: { query: string; param?: string | undefined; } | undefined; } | undefined; where?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; })[] | undefined; opens?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; member: "me"; })[] | undefined; remove?: false | undefined; create?: string[] | undefined; add_label?: string | undefined; heading?: string | undefined; export?: { query: string; label?: string | undefined; description?: string | undefined; template?: string | undefined; filename?: string | undefined; where?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; member: "me"; })[] | undefined; per?: string | undefined; per_row?: string[] | undefined; books?: string[] | undefined; }[] | undefined; readings?: ({ entity: string; label: string; read: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; }; kind: "metric"; value?: string | undefined; average?: true | undefined; over?: string | undefined; target?: number | undefined; better?: "up" | "down" | undefined; bound?: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; } | undefined; where?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; } | { field: string; member: "me"; })[] | undefined; tab?: string | undefined; } | { by: string | { field: string; tiers: number[]; }; entity: string; label: string; read: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; }; kind: "breakdown"; value?: string | undefined; over?: string | undefined; where?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; } | { field: string; member: "me"; })[] | undefined; tab?: string | undefined; } | { over: string; entity: string; label: string; read: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; }; kind: "trend"; value?: string | undefined; ahead?: true | undefined; where?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; } | { field: string; member: "me"; })[] | undefined; tab?: string | undefined; } | { rows: string | { field: string; tiers: number[]; }; columns: string | { field: string; tiers: number[]; }; entity: string; label: string; read: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; }; kind: "pivot"; value?: string | undefined; over?: string | undefined; where?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; } | { field: string; member: "me"; })[] | undefined; tab?: string | undefined; } | { by: string; on_hand: { entity: string; read: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; }; by: string; across?: string | undefined; value?: string | undefined; }; entity: string; label: string; read: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; }; kind: "shortfall"; across?: string | undefined; value?: string | undefined; where?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; } | { field: string; member: "me"; })[] | undefined; tab?: string | undefined; } | { planned: { start: string; end: string; }; done: string; entity: string; label: string; read: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; }; kind: "progress"; finished?: string | undefined; weight?: string | undefined; measured?: { via: string; read: { query: string; param: string; }; } | undefined; where?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; } | { field: string; member: "me"; })[] | undefined; tab?: string | undefined; } | { columns: string[]; entity: string; label: string; read: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; }; kind: "list"; app?: { id: string; } | undefined; where?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; } | { field: string; member: "me"; })[] | undefined; tab?: string | undefined; })[] | undefined; attention?: false | undefined; }; record: { door: "page" | "drawer" | "beside"; sections: { fields: string[]; blocks: ({ kind: "rows"; entity: string; via: string; read: { query: string; param?: string | undefined; }; title: string; columns: string[]; create?: string[] | undefined; add_label?: string | undefined; totals?: Record<string, string> | undefined; narrower?: string[] | undefined; soonest?: string[] | undefined; expect?: string | undefined; of?: string | undefined; where?: { field: string; options: string[]; }[] | undefined; filters?: (string | { field: string; tiers: number[]; })[] | undefined; search?: string[] | undefined; group?: string | undefined; sort?: { field: string; desc?: true | undefined; }[] | undefined; edits?: string[] | undefined; remove?: false | undefined; pick?: { read: { query: string; param?: string | undefined; }; back: string; same?: { field: string; param: string; }[] | undefined; admits?: { query: string; param?: string | undefined; } | undefined; } | undefined; checklist?: { photo?: string | undefined; clause?: string | undefined; words?: string[] | undefined; failed?: string[] | undefined; passed?: string | undefined; } | undefined; compare?: { before: string; after: string; } | undefined; current?: string | undefined; post?: { text: string; media: string; network: string; networks: Record<string, "x" | "facebook" | "instagram" | "threads" | "linkedin">; bodies?: string[] | undefined; compute?: { expression: string; reads: Record<string, { from: "row"; field: string; } | { from: "record"; field: string; } | { from: "place"; field: string; } | { from: "formula"; expression: string; }>; } | undefined; link?: string | undefined; group?: string | undefined; } | undefined; under?: { field: string; entity: string; via: string; back: string; read: { query: string; param?: string | undefined; }; where?: { field: string; options: string[]; }[] | undefined; } | undefined; when?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; })[] | undefined; } | { kind: "agenda"; entity: string; via: string; read: { query: string; param?: string | undefined; }; title: string; columns: string[]; day: string; time?: string | undefined; part?: string | undefined; start?: string | undefined; create?: string[] | undefined; add_label?: string | undefined; when?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; })[] | undefined; } | { kind: "timeline"; entity: string; via: string; read: { query: string; param?: string | undefined; }; title: string; at: string; by?: string | undefined; create?: string[] | undefined; add_label?: string | undefined; when?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; })[] | undefined; } | { kind: "files"; fields: string[]; title: string; add_label?: string | undefined; when?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; })[] | undefined; } | { kind: "text"; field: string; title: string; when?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; })[] | undefined; } | { kind: "figures"; fields: string[]; when?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; })[] | undefined; } | { kind: "statement"; title: string; lines: { field: string; op?: "plus" | "minus" | "times" | "equals" | undefined; rate?: string | undefined; parts?: { entity: string; read: { query: string; param: string; }; same: string; columns: string[]; figure: string; before?: { field: string; param: string; } | undefined; } | undefined; }[]; when?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; })[] | undefined; } | { kind: "reading"; reading: { entity: string; label: string; read: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; }; kind: "metric"; value?: string | undefined; average?: true | undefined; over?: string | undefined; target?: number | undefined; better?: "up" | "down" | undefined; bound?: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; } | undefined; where?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; } | { field: string; member: "me"; })[] | undefined; tab?: string | undefined; } | { by: string | { field: string; tiers: number[]; }; entity: string; label: string; read: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; }; kind: "breakdown"; value?: string | undefined; over?: string | undefined; where?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; } | { field: string; member: "me"; })[] | undefined; tab?: string | undefined; } | { over: string; entity: string; label: string; read: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; }; kind: "trend"; value?: string | undefined; ahead?: true | undefined; where?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; } | { field: string; member: "me"; })[] | undefined; tab?: string | undefined; } | { rows: string | { field: string; tiers: number[]; }; columns: string | { field: string; tiers: number[]; }; entity: string; label: string; read: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; }; kind: "pivot"; value?: string | undefined; over?: string | undefined; where?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; } | { field: string; member: "me"; })[] | undefined; tab?: string | undefined; } | { by: string; on_hand: { entity: string; read: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; }; by: string; across?: string | undefined; value?: string | undefined; }; entity: string; label: string; read: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; }; kind: "shortfall"; across?: string | undefined; value?: string | undefined; where?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; } | { field: string; member: "me"; })[] | undefined; tab?: string | undefined; } | { planned: { start: string; end: string; }; done: string; entity: string; label: string; read: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; }; kind: "progress"; finished?: string | undefined; weight?: string | undefined; measured?: { via: string; read: { query: string; param: string; }; } | undefined; where?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; } | { field: string; member: "me"; })[] | undefined; tab?: string | undefined; } | { columns: string[]; entity: string; label: string; read: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; }; kind: "list"; app?: { id: string; } | undefined; where?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; } | { field: string; member: "me"; })[] | undefined; tab?: string | undefined; }; via: string; when?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; })[] | undefined; } | { kind: "list"; reading: { columns: string[]; entity: string; label: string; read: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; }; kind: "list"; app?: { id: string; } | undefined; where?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; } | { field: string; member: "me"; })[] | undefined; tab?: string | undefined; }; via: string; same?: { field: string; param: string; } | undefined; bounds?: { field: string; param: string; of: "number" | "date"; lookup?: true | undefined; }[] | undefined; fields?: string[] | undefined; when?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; })[] | undefined; } | { kind: "funnel"; entity: string; read: { query: string; param?: string | undefined; }; label: string; steps: string[]; when?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; })[] | undefined; })[]; acts: string[]; title?: string | undefined; description?: string | undefined; at?: string[] | undefined; reads?: string[] | undefined; entry?: string[] | undefined; acts_last?: true | undefined; when?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; })[] | undefined; page?: string | undefined; side?: true | undefined; }[]; outside?: { key: string; entity: string; title: string; at: string[]; fields: string[]; one: { query: string; param: string; }; blocks: { kind: "list"; reading: { columns: string[]; entity: string; label: string; read: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; }; kind: "list"; app?: { id: string; } | undefined; where?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; } | { field: string; member: "me"; })[] | undefined; tab?: string | undefined; }; via: string; same?: { field: string; param: string; } | undefined; bounds?: { field: string; param: string; of: "number" | "date"; lookup?: true | undefined; }[] | undefined; fields?: string[] | undefined; when?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; })[] | undefined; }[]; acts: string[]; description?: string | undefined; }[] | undefined; comments?: true | undefined; moves?: { kind: "timeline"; entity: string; via: string; read: { query: string; param?: string | undefined; }; title: string; at: string; by?: string | undefined; create?: string[] | undefined; add_label?: string | undefined; when?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; })[] | undefined; } | undefined; compose?: { use: "Column"; children: ComposeNode[]; } | { use: "Bar"; children: ComposeNode[]; } | { use: "Group"; title: string; children: ComposeNode[]; } | { use: "Panel"; title: string; children: ComposeNode[]; } | { use: "Title"; } | { use: "Status"; } | { use: "Field"; field: string; } | { use: "Document"; field: string; } | { use: "Act"; act: string; } | { use: "Rows"; child: string; create?: false | undefined; remove?: true | undefined; } | { use: "Copy"; field: string; as: "plain" | "raw"; } | undefined; }; acts: { alias: string; label: string; on: "record" | "rows" | "view"; of?: string | undefined; workflow?: string | undefined; open?: { app: string; } | undefined; when?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; })[] | undefined; to?: string | undefined; writes?: true | undefined; into?: string | undefined; paper?: { entity: string; option: string; } | undefined; marks?: Record<string, boolean> | undefined; requires?: string[] | undefined; recommends?: string[] | undefined; asks?: (string | { input: string; label: string; type: "number" | "date" | "file" | "text" | "member" | "select" | "link" | "long_text"; options?: { alias: string; label: string; color?: "red" | "orange" | "amber" | "yellow" | "lime" | "green" | "emerald" | "teal" | "cyan" | "sky" | "blue" | "indigo" | "violet" | "purple" | "fuchsia" | "pink" | "rose" | "slate" | "gray" | "zinc" | "neutral" | "stone" | undefined; mark?: { kind: string; name: string; } | undefined; }[] | undefined; entity?: string | undefined; required?: true | undefined; default?: string | undefined; accept?: string | undefined; })[] | undefined; starts?: Record<string, "today" | "me"> | undefined; makes?: string | undefined; papers?: { template: string; label: string; when?: ({ field: string; options: string[]; } | { field: string; value: boolean; })[] | undefined; }[] | undefined; archive?: string | undefined; intake?: { agent: string; papers: { entity: string; kind: string; files: string; }; fields: string[]; parties?: { link: string; fields: string[]; }[] | undefined; rows?: { entity: string; fields: string[]; key?: string[] | undefined; }[] | undefined; } | undefined; recording?: { into: string; via: string; audio: string; transcript: string; video?: string | undefined; agent?: string | undefined; } | undefined; sign?: { into: string; by: string; at: string; witness?: string | undefined; } | undefined; review?: true | undefined; confirm?: string | true | undefined; danger?: true | undefined; }[]; checks: { field: string; of?: string | undefined; blocks?: string[] | "all" | undefined; resolve?: string | undefined; reads?: string[] | undefined; }[]; owns: { queries: string[]; workflows: string[]; }; entities?: Record<string, { alias: string; label: string; table: string; fields: Record<string, { alias: string; id: string; type: "number" | "boolean" | "date" | "text" | "select" | "select_member" | "select_record_link" | "files" | "formula" | "rollup" | "lookup" | "autonumber"; label: string; result?: "number" | "boolean" | "date" | "text" | "select" | "select_member" | "select_record_link" | "files" | "formula" | "rollup" | "lookup" | "autonumber" | undefined; description?: string | undefined; format?: "datetime" | "text" | "link" | "markdown" | undefined; multi?: true | undefined; required?: true | undefined; readonly?: true | undefined; notation?: { style: "decimal"; } | { style: "currency"; currency: string | { per_row: string; }; } | { style: "unit"; unit: string | { per_row: string; }; } | undefined; limit?: { field: string; } | { value: number; } | undefined; gate?: { field: string; } | { value: number; } | undefined; tolerance?: number | undefined; due?: true | undefined; frees?: true | undefined; summed?: true | undefined; accumulates?: true | undefined; whole?: true | undefined; restates?: string | undefined; starts?: "today" | "me" | undefined; default?: string | number | boolean | string[] | undefined; options?: { alias: string; label: string; id: string; color?: "red" | "orange" | "amber" | "yellow" | "lime" | "green" | "emerald" | "teal" | "cyan" | "sky" | "blue" | "indigo" | "violet" | "purple" | "fuchsia" | "pink" | "rose" | "slate" | "gray" | "zinc" | "neutral" | "stone" | undefined; mark?: { kind: string; name: string; } | undefined; }[] | undefined; link?: string | undefined; accept?: string | undefined; image?: string | undefined; party?: "person" | "organization" | undefined; pictures?: { query: string; param: string; } | undefined; face?: Record<string, string> | undefined; default_from?: { link: string; field: string; } | undefined; reads?: string[] | undefined; through?: { link: string; field: string; } | undefined; pick?: { query: string; param?: string | undefined; same?: { field: string; param: string; }[] | undefined; } | undefined; picks_only?: true | undefined; suggest?: { query: string; param: string; column: string; } | undefined; applies?: ({ field: string; options: string[]; } | { field: string; value: boolean; })[] | undefined; }>; title: string; list: { query: string; param?: string | undefined; }; singular?: string | undefined; subtitle?: string[] | undefined; image?: string | undefined; mark?: string | undefined; description?: string | undefined; party?: "person" | "organization" | undefined; mine?: string | undefined; status?: { field: string; closed?: string[] | undefined; history?: string | undefined; dates?: Record<string, string> | undefined; stages?: Record<string, { owner: { kind: "member"; column: string; label: string; } | { kind: "group"; group: string; label: string; }; within?: number | undefined; when?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; })[] | undefined; }> | undefined; maker?: string | undefined; moves?: { query: string; param: string; link: string; status: string; at: string; went: Record<string, string>; by?: string | undefined; } | undefined; } | undefined; settled?: string | undefined; task?: { close?: { to: string; act?: string | undefined; } | undefined; reopen?: { to: string; act?: string | undefined; } | undefined; member?: string | undefined; } | undefined; progress?: { entity: string; via: string; read: { query: string; param: string; }; passed?: string | undefined; }[] | undefined; figure?: string | undefined; scan?: { read: "text" | "iso6346"; agent: string; } | { read: "code"; } | undefined; place?: { address: string; latitude: string; longitude: string; accuracy?: string | undefined; } | undefined; on_site?: { photos: string[]; latitude: string; longitude: string; radius: number; place?: string | undefined; } | undefined; pin?: { on: string; x: string; y: string; } | undefined; size?: { across: string; along: string; up: string; } | undefined; listed?: string[] | undefined; one?: { query: string; param?: string | undefined; } | undefined; create?: { workflow: string; fields: string[]; picker?: string[] | undefined; } | undefined; update?: { workflow: string; fields?: string[] | undefined; } | undefined; remove?: { workflow: string; with?: string[] | undefined; } | undefined; }> | undefined; }[] | undefined; } | { version: 28; app: { alias: string; label: string; locale: ReportLanguage; description?: string | undefined; }; dashboard: ({ entity: string; label: string; read: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; }; kind: "metric"; value?: string | undefined; average?: true | undefined; over?: string | undefined; target?: number | undefined; better?: "up" | "down" | undefined; bound?: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; } | undefined; where?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; } | { field: string; member: "me"; })[] | undefined; tab?: string | undefined; } | { by: string | { field: string; tiers: number[]; }; entity: string; label: string; read: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; }; kind: "breakdown"; value?: string | undefined; over?: string | undefined; where?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; } | { field: string; member: "me"; })[] | undefined; tab?: string | undefined; } | { over: string; entity: string; label: string; read: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; }; kind: "trend"; value?: string | undefined; ahead?: true | undefined; where?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; } | { field: string; member: "me"; })[] | undefined; tab?: string | undefined; } | { rows: string | { field: string; tiers: number[]; }; columns: string | { field: string; tiers: number[]; }; entity: string; label: string; read: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; }; kind: "pivot"; value?: string | undefined; over?: string | undefined; where?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; } | { field: string; member: "me"; })[] | undefined; tab?: string | undefined; } | { by: string; on_hand: { entity: string; read: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; }; by: string; across?: string | undefined; value?: string | undefined; }; entity: string; label: string; read: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; }; kind: "shortfall"; across?: string | undefined; value?: string | undefined; where?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; } | { field: string; member: "me"; })[] | undefined; tab?: string | undefined; } | { columns: string[]; entity: string; label: string; read: { query: string; param?: string | undefined; aggregate?: { by?: string[] | undefined; bands?: Record<string, number[]> | undefined; day?: string | undefined; sum?: string | undefined; } | undefined; }; kind: "list"; app?: { id: string; } | undefined; where?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; } | { field: string; member: "me"; })[] | undefined; tab?: string | undefined; })[]; entities: Record<string, { alias: string; label: string; table: string; fields: Record<string, { alias: string; id: string; type: "number" | "boolean" | "date" | "text" | "select" | "select_member" | "select_record_link" | "files" | "formula" | "rollup" | "lookup" | "autonumber"; label: string; result?: "number" | "boolean" | "date" | "text" | "select" | "select_member" | "select_record_link" | "files" | "formula" | "rollup" | "lookup" | "autonumber" | undefined; description?: string | undefined; format?: "datetime" | "text" | "link" | "markdown" | undefined; multi?: true | undefined; required?: true | undefined; readonly?: true | undefined; notation?: { style: "decimal"; } | { style: "currency"; currency: string | { per_row: string; }; } | { style: "unit"; unit: string | { per_row: string; }; } | undefined; limit?: { field: string; } | { value: number; } | undefined; gate?: { field: string; } | { value: number; } | undefined; tolerance?: number | undefined; due?: true | undefined; frees?: true | undefined; summed?: true | undefined; accumulates?: true | undefined; whole?: true | undefined; restates?: string | undefined; starts?: "today" | "me" | undefined; default?: string | number | boolean | string[] | undefined; options?: { alias: string; label: string; id: string; color?: "red" | "orange" | "amber" | "yellow" | "lime" | "green" | "emerald" | "teal" | "cyan" | "sky" | "blue" | "indigo" | "violet" | "purple" | "fuchsia" | "pink" | "rose" | "slate" | "gray" | "zinc" | "neutral" | "stone" | undefined; mark?: { kind: string; name: string; } | undefined; }[] | undefined; link?: string | undefined; accept?: string | undefined; image?: string | undefined; party?: "person" | "organization" | undefined; pictures?: { query: string; param: string; } | undefined; face?: Record<string, string> | undefined; default_from?: { link: string; field: string; } | undefined; reads?: string[] | undefined; through?: { link: string; field: string; } | undefined; pick?: { query: string; param?: string | undefined; same?: { field: string; param: string; }[] | undefined; } | undefined; picks_only?: true | undefined; suggest?: { query: string; param: string; column: string; } | undefined; applies?: ({ field: string; options: string[]; } | { field: string; value: boolean; })[] | undefined; }>; title: string; list: { query: string; param?: string | undefined; }; singular?: string | undefined; subtitle?: string[] | undefined; image?: string | undefined; mark?: string | undefined; description?: string | undefined; party?: "person" | "organization" | undefined; mine?: string | undefined; status?: { field: string; closed?: string[] | undefined; history?: string | undefined; dates?: Record<string, string> | undefined; stages?: Record<string, { owner: { kind: "member"; column: string; label: string; } | { kind: "group"; group: string; label: string; }; within?: number | undefined; when?: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; compare: Compared; of: "number" | "date" | "datetime"; zone?: string | undefined; } | { field: string; empty: boolean; })[] | undefined; }> | undefined; maker?: string | undefined; moves?: { query: string; param: string; link: string; status: string; at: string; went: Record<string, string>; by?: string | undefined; } | undefined; } | undefined; settled?: string | undefined; task?: { close?: { to: string; act?: string | undefined; } | undefined; reopen?: { to: string; act?: string | undefined; } | undefined; member?: string | undefined; } | undefined; progress?: { entity: string; via: string; read: { query: string; param: string; }; passed?: string | undefined; }[] | undefined; figure?: string | undefined; scan?: { read: "text" | "iso6346"; agent: string; } | { read: "code"; } | undefined; place?: { address: string; latitude: string; longitude: string; accuracy?: string | undefined; } | undefined; on_site?: { photos: string[]; latitude: string; longitude: string; radius: number; place?: string | undefined; } | undefined; pin?: { on: string; x: string; y: string; } | undefined; size?: { across: string; along: string; up: string; } | undefined; listed?: string[] | undefined; one?: { query: string; param?: string | undefined; } | undefined; create?: { workflow: string; fields: string[]; picker?: string[] | undefined; } | undefined; update?: { workflow: string; fields?: string[] | undefined; } | undefined; remove?: { workflow: string; with?: string[] | undefined; } | undefined; }>; tabs?: { tab: string; label: string; }[] | undefined; period?: "month" | "quarter" | "year" | { days: 30; } | undefined; };
|
|
9
8
|
export type AppLoadTiming = { page_connect_ms?: number | undefined; page_ttfb_ms?: number | undefined; page_download_ms?: number | undefined; page_bytes?: number | undefined; page_decoded_bytes?: number | undefined; boot_ms?: number | undefined; };
|
|
10
9
|
/** The file an app export made, as a link to download it: no workspace file, so no id, and kept a day. */
|
|
11
10
|
export type ExportedFile = {
|
|
@@ -18,6 +17,8 @@ export type ExportedFile = {
|
|
|
18
17
|
/** When the server made it, ISO 8601. */
|
|
19
18
|
created_at: string;
|
|
20
19
|
};
|
|
20
|
+
export type ListOutsideLinksResult = { record_title: string; outside: { key: string; title: string; live: OutsideLink | null; last_closed: OutsideLink | null; }[]; };
|
|
21
|
+
export type OutsideLink = { id: string; outside_key: string; record_id: string; recipient: string; issued_by_member_id: string; created_at: string; expires_at: string; opened_at: string | null; revoked_at: string | null; revoked_reason: "revoked" | "replaced" | "used" | "left_stage" | "record_deleted" | "owner_changed" | "issuer_left" | null; };
|
|
21
22
|
/** What an aggregate asks: output columns to group by, an output date grouped by its day, an output number summed. */
|
|
22
23
|
export type QueryAggregate = {
|
|
23
24
|
by?: readonly string[];
|
|
@@ -29,7 +30,7 @@ export type QueryAggregate = {
|
|
|
29
30
|
day?: string;
|
|
30
31
|
sum?: string;
|
|
31
32
|
};
|
|
32
|
-
export type QueryWriteShape = { columns: Record<string, { table_id: string; field_key: string; } | { table_id: string; via: string; target_table_id: string; field_key: string; } | null>; rows?: { table_id: string; closed: boolean; sort: { field_key: string; order: "
|
|
33
|
+
export type QueryWriteShape = { columns: Record<string, { table_id: string; field_key: string; } | { table_id: string; via: string; target_table_id: string; field_key: string; } | null>; rows?: { table_id: string; closed: boolean; sort: { field_key: string; order: "desc" | "asc"; }[]; filter?: TableRecordFilters | undefined; } | undefined; totals?: { table_id: string; by: { output: string; field_key: string; }[]; aggregates: { output: string; operation: "min" | "empty" | "sum" | "unique" | "date_range" | "count" | "filled" | "percent_empty" | "percent_filled" | "percent_unique" | "avg" | "median" | "max" | "range" | "earliest" | "latest" | "selected" | "checked" | "unchecked" | "percent_checked" | "percent_unchecked" | "string_agg"; field_key?: string | undefined; }[]; filter?: TableRecordFilters | undefined; } | undefined; };
|
|
33
34
|
export type ReportColumn = {
|
|
34
35
|
/** Each row's cell by it. */
|
|
35
36
|
key: string;
|
|
@@ -77,7 +78,7 @@ export type ReportReadingHead = {
|
|
|
77
78
|
/** The read behind it was cut: its figures stand, every total over them is left out (`null`). */
|
|
78
79
|
truncated: boolean;
|
|
79
80
|
};
|
|
80
|
-
export type TableField = { key: string; name: string; description: string; type: "number"; format: "number" | "currency" | "percentage"; confirm_before_update?: boolean | undefined; required?: boolean | undefined; notation?: { style: "decimal"; } | { style: "currency"; currency: string | { per_row: string; }; } | { style: "unit"; unit: string | { per_row: string; }; } | undefined; currency?: string | null | undefined; unit?: string | null | undefined; unit_field?: string | null | undefined; currency_field?: string | null | undefined; default_value?: number | null | undefined; default_from?: { link_field_key: string; field_key: string; options?: Record<string, string> | undefined; } | null | undefined; } | { key: string; name: string; description: string; type: "text"; confirm_before_update?: boolean | undefined; required?: boolean | undefined; unique?: boolean | undefined; format?: "text" | "link" | "markdown" | undefined; default_value?: string | null | undefined; default_from?: { link_field_key: string; field_key: string; options?: Record<string, string> | undefined; } | null | undefined; } | { key: string; name: string; description: string; type: "date"; confirm_before_update?: boolean | undefined; required?: boolean | undefined; format?: "date" | "datetime" | "date_range" | "datetime_range" | undefined; timezone?: string | undefined; derive_from?: "created_at" | "updated_at" | undefined; default_value?: string | null | undefined; default_from?: { link_field_key: string; field_key: string; options?: Record<string, string> | undefined; } | null | undefined; } | { key: string; name: string; description: string; type: "boolean"; confirm_before_update?: boolean | undefined; required?: boolean | undefined; default_value?: boolean | null | undefined; default_from?: { link_field_key: string; field_key: string; options?: Record<string, string> | undefined; } | null | undefined; } | { key: string; name: string; description: string; type: "select"; options: { key: string; name: string; color: "red" | "orange" | "amber" | "yellow" | "lime" | "green" | "emerald" | "teal" | "cyan" | "sky" | "blue" | "indigo" | "violet" | "purple" | "fuchsia" | "pink" | "rose" | "slate" | "gray" | "zinc" | "neutral" | "stone"; mark?: { kind: string; name: string; } | undefined; }[]; confirm_before_update?: boolean | undefined; required?: boolean | undefined; multi?: boolean | undefined; default_value?: string[] | null | undefined; default_from?: { link_field_key: string; field_key: string; options?: Record<string, string> | undefined; } | null | undefined; } | { key: string; name: string; description: string; type: "select_member"; confirm_before_update?: boolean | undefined; required?: boolean | undefined; multi?: boolean | undefined; default_value?: string[] | null | undefined; default_from?: { link_field_key: string; field_key: string; options?: Record<string, string> | undefined; } | null | undefined; } | { key: string; name: string; description: string; type: "select_record_link"; table_id: string; confirm_before_update?: boolean | undefined; required?: boolean | undefined; paired_field_key?: string | undefined; cardinality?: "one" | "many" | undefined; default_from?: { link_field_key: string; field_key: string; options?: Record<string, string> | undefined; } | null | undefined; } | { key: string; name: string; description: string; type: "rollup"; source_field_key: string; aggregate_option: { operation: "count"; field_key?: string | undefined; } | { operation: "
|
|
81
|
+
export type TableField = { key: string; name: string; description: string; type: "number"; format: "number" | "currency" | "percentage"; alias?: string | undefined; confirm_before_update?: boolean | undefined; required?: boolean | undefined; notation?: { style: "decimal"; } | { style: "currency"; currency: string | { per_row: string; }; } | { style: "unit"; unit: string | { per_row: string; }; } | undefined; currency?: string | null | undefined; unit?: string | null | undefined; unit_field?: string | null | undefined; currency_field?: string | null | undefined; default_value?: number | null | undefined; default_from?: { link_field_key: string; field_key: string; through?: string[] | undefined; options?: Record<string, string> | undefined; } | null | undefined; } | { key: string; name: string; description: string; type: "text"; alias?: string | undefined; confirm_before_update?: boolean | undefined; required?: boolean | undefined; unique?: boolean | undefined; format?: "text" | "link" | "markdown" | undefined; default_value?: string | null | undefined; default_from?: { link_field_key: string; field_key: string; through?: string[] | undefined; options?: Record<string, string> | undefined; } | null | undefined; } | { key: string; name: string; description: string; type: "date"; alias?: string | undefined; confirm_before_update?: boolean | undefined; required?: boolean | undefined; format?: "date" | "datetime" | "date_range" | "datetime_range" | undefined; timezone?: string | undefined; derive_from?: "created_at" | "updated_at" | undefined; default_value?: string | null | undefined; default_from?: { link_field_key: string; field_key: string; through?: string[] | undefined; options?: Record<string, string> | undefined; } | null | undefined; } | { key: string; name: string; description: string; type: "boolean"; alias?: string | undefined; confirm_before_update?: boolean | undefined; required?: boolean | undefined; default_value?: boolean | null | undefined; default_from?: { link_field_key: string; field_key: string; through?: string[] | undefined; options?: Record<string, string> | undefined; } | null | undefined; } | { key: string; name: string; description: string; type: "select"; options: { key: string; name: string; color: "red" | "orange" | "amber" | "yellow" | "lime" | "green" | "emerald" | "teal" | "cyan" | "sky" | "blue" | "indigo" | "violet" | "purple" | "fuchsia" | "pink" | "rose" | "slate" | "gray" | "zinc" | "neutral" | "stone"; alias?: string | undefined; mark?: { kind: string; name: string; } | undefined; }[]; alias?: string | undefined; confirm_before_update?: boolean | undefined; required?: boolean | undefined; multi?: boolean | undefined; default_value?: string[] | null | undefined; default_from?: { link_field_key: string; field_key: string; through?: string[] | undefined; options?: Record<string, string> | undefined; } | null | undefined; } | { key: string; name: string; description: string; type: "select_member"; alias?: string | undefined; confirm_before_update?: boolean | undefined; required?: boolean | undefined; multi?: boolean | undefined; default_value?: string[] | null | undefined; default_from?: { link_field_key: string; field_key: string; through?: string[] | undefined; options?: Record<string, string> | undefined; } | null | undefined; } | { key: string; name: string; description: string; type: "select_record_link"; table_id: string; alias?: string | undefined; confirm_before_update?: boolean | undefined; required?: boolean | undefined; paired_field_key?: string | undefined; cardinality?: "one" | "many" | undefined; default_from?: { link_field_key: string; field_key: string; through?: string[] | undefined; options?: Record<string, string> | undefined; } | null | undefined; } | { key: string; name: string; description: string; type: "rollup"; source_field_key: string; aggregate_option: { operation: "count"; field_key?: string | undefined; } | { operation: "empty" | "unique" | "filled" | "percent_empty" | "percent_filled" | "percent_unique"; field_key: string; } | { operation: "min" | "empty" | "sum" | "unique" | "filled" | "percent_empty" | "percent_filled" | "percent_unique" | "avg" | "median" | "max" | "range"; field_key: string; } | { operation: "empty" | "unique" | "date_range" | "filled" | "percent_empty" | "percent_filled" | "percent_unique" | "earliest" | "latest"; field_key: string; } | { operation: "empty" | "unique" | "filled" | "percent_empty" | "percent_filled" | "percent_unique" | "selected"; field_key: string; } | { operation: "empty" | "filled" | "percent_empty" | "percent_filled" | "selected"; field_key: string; } | { operation: "checked" | "unchecked" | "percent_checked" | "percent_unchecked"; field_key: string; } | { operation: "min" | "empty" | "sum" | "unique" | "date_range" | "filled" | "percent_empty" | "percent_filled" | "percent_unique" | "avg" | "median" | "max" | "range" | "earliest" | "latest" | "checked" | "unchecked" | "percent_checked" | "percent_unchecked"; field_key: string; } | { operation: "min" | "empty" | "sum" | "unique" | "date_range" | "filled" | "percent_empty" | "percent_filled" | "percent_unique" | "avg" | "median" | "max" | "range" | "earliest" | "latest"; field_key: string; }; alias?: string | undefined; confirm_before_update?: boolean | undefined; required?: boolean | undefined; filter?: TableRecordFiltersGroupNode | undefined; aggregate_field_type?: "number" | "boolean" | "date" | "text" | "select" | "select_member" | "select_record_link" | "files" | "formula" | "rollup" | "lookup" | "autonumber" | "button" | undefined; aggregate_field_notation?: { style: "decimal"; } | { style: "currency"; currency: string | { per_row: string; }; } | { style: "unit"; unit: string | { per_row: string; }; } | undefined; aggregate_field_format?: string | undefined; aggregate_field_currency?: string | undefined; aggregate_field_unit?: string | undefined; aggregate_field_unit_field?: string | undefined; aggregate_field_currency_field?: string | undefined; } | { key: string; name: string; description: string; type: "lookup"; source_field_key: string; lookup_field_key: string; alias?: string | undefined; confirm_before_update?: boolean | undefined; required?: boolean | undefined; lookup_field_type?: "number" | "boolean" | "date" | "text" | "select" | "select_member" | "select_record_link" | "files" | "formula" | "rollup" | "lookup" | "autonumber" | "button" | undefined; lookup_field_notation?: { style: "decimal"; } | { style: "currency"; currency: string | { per_row: string; }; } | { style: "unit"; unit: string | { per_row: string; }; } | undefined; lookup_field_format?: string | undefined; lookup_field_currency?: string | undefined; lookup_field_unit?: string | undefined; lookup_field_options?: { key: string; name: string; color?: string | undefined; mark?: { kind: string; name: string; } | undefined; }[] | undefined; lookup_field_autonumber?: boolean | undefined; order_by?: { field_key: string; direction: "desc" | "asc"; } | undefined; } | { key: string; name: string; description: string; type: "files"; alias?: string | undefined; confirm_before_update?: boolean | undefined; required?: boolean | undefined; } | { key: string; name: string; description: string; type: "formula"; formula: { expression: string; notation?: { style: "decimal"; } | { style: "currency"; currency: string | { per_row: string; }; } | { style: "unit"; unit: string | { per_row: string; }; } | undefined; link?: true | undefined; format?: "number" | "link" | "currency" | "percentage" | undefined; currency?: string | undefined; unit?: string | undefined; unit_field?: string | undefined; currency_field?: string | undefined; options?: { key: string; name: string; color: "red" | "orange" | "amber" | "yellow" | "lime" | "green" | "emerald" | "teal" | "cyan" | "sky" | "blue" | "indigo" | "violet" | "purple" | "fuchsia" | "pink" | "rose" | "slate" | "gray" | "zinc" | "neutral" | "stone"; alias?: string | undefined; mark?: { kind: string; name: string; } | undefined; }[] | undefined; output_type?: "number" | "boolean" | "date" | "datetime" | "text" | "select" | undefined; volatile?: boolean | undefined; }; alias?: string | undefined; confirm_before_update?: boolean | undefined; required?: boolean | undefined; } | { key: string; name: string; description: string; type: "button"; text: string; alias?: string | undefined; confirm_before_update?: boolean | undefined; required?: boolean | undefined; workflow_id?: string | null | undefined; } | { key: string; name: string; description: string; type: "autonumber"; alias?: string | undefined; confirm_before_update?: boolean | undefined; required?: boolean | undefined; prefix?: string | undefined; padding?: number | undefined; template?: string | undefined; };
|
|
81
82
|
export type TableRecordFilters = TableRecordFiltersConditionNode | TableRecordFiltersTraversalNode | TableRecordFiltersGroupNode;
|
|
82
83
|
export type TableRecordFiltersConditionNode = { node_type: "condition"; field_key?: string | undefined; type?: string | undefined; operator: string; value?: unknown; unit_option?: string | undefined; };
|
|
83
84
|
export type TableRecordFiltersGroupNode = { node_type: "group"; logic: "and" | "or"; children: (TableRecordFilters)[]; };
|
package/dist/viewer.d.ts
CHANGED
|
@@ -16,10 +16,11 @@ export declare function useAppContext(): {
|
|
|
16
16
|
groupIds: readonly string[] | null;
|
|
17
17
|
/** Who in the organization is away, or will be, and who stands in; `null` where the host did not say. */
|
|
18
18
|
absences: readonly AppAbsence[] | null;
|
|
19
|
-
/** The apps the viewer can open, by id and name; `null` where the host did not say. */
|
|
19
|
+
/** The apps the viewer can open, by id and name, with the table each one's register lists where the host says; `null` where the host did not say. */
|
|
20
20
|
openableApps: readonly {
|
|
21
21
|
id: string;
|
|
22
22
|
name: string;
|
|
23
|
+
table_id?: string;
|
|
23
24
|
}[] | null;
|
|
24
25
|
commentsEnabled: boolean;
|
|
25
26
|
recordingEnabled: boolean;
|
package/docs/ai.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# AI in apps
|
|
2
2
|
|
|
3
|
-
An app has two AI surfaces, and they answer different questions. **`useAgentRun(alias)`** runs an agent *
|
|
3
|
+
An app has two AI surfaces, and they answer different questions. **`useAgentRun(alias)`** runs an agent *already bound to the app* — a streaming, tool-looping run whose result lands back **in the app** (a typed structured output, or free-text prose) for the app to review and commit through its own [workflows](./mutations.md). **`askAi(args)`** is a *handoff* — it opens the Lotics chat messenger seeded with files, records, and a prefilled prompt, and the outcome lands **in chat**, under the signed-in member's control. **`useAiContext(slot, context)`** feeds the member's *ambient* chat agent a snapshot of what the current screen is showing. The authority model agent runs execute under is [security](./security.md). Exact signatures: `dist/hooks.d.ts` (`useAgentRun`, `useAgentRuns`, `useAiContext`), `dist/agent_stream.d.ts` (`AgentRunState`, `AgentUIPart`), `dist/ask_ai.d.ts` (`AskAiArgs`).
|
|
4
4
|
|
|
5
5
|
## Choosing the surface — the fields-vs-file razor
|
|
6
6
|
|
|
@@ -13,33 +13,7 @@ Don't run a structured extraction through `askAi` (the result is stranded in a c
|
|
|
13
13
|
|
|
14
14
|
## Declared agents — what `useAgentRun` runs
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
A declaration carries:
|
|
19
|
-
|
|
20
|
-
| Field | Meaning |
|
|
21
|
-
|---|---|
|
|
22
|
-
| `instructions` | System instructions — the task the agent performs per run |
|
|
23
|
-
| `tool_names` | The tools the agent may call, resolved against the platform's automation tool registry. The capability boundary for everything EXCEPT workspace data — the run can use nothing else. May be empty — including for an agent that reads documents, since a [`file` input carries its own content](#file-inputs--what-the-agent-can-actually-see) |
|
|
24
|
-
| `knowledge_doc_ids` | The knowledge docs the agent may read, and the whole set it can reach — a doc absent from this list is unreadable even if the agent names its id. Declare `grep_knowledge` / `read_knowledge` in `tool_names` to read them. There is no size limit and nothing is inlined, so a multi-megabyte reference corpus (a full tariff, a regulation set) is a normal declaration. Reach for `code_exec` only to COMPUTE across the corpus — counting, cross-referencing — never merely to read it |
|
|
25
|
-
| `query_aliases` | The app's own named queries the agent may run via `run_app_query` — its **entire read surface** over records. You list them; there is no "all of them" shorthand, and adding a query to the app never widens an existing agent. Omitted means the agent reads nothing |
|
|
26
|
-
| `workflow_aliases` | The app's own workflows the agent may invoke via `run_app_workflow` — its **entire write surface** |
|
|
27
|
-
| `model_tier` | Optional model tier — `haiku` \| `sonnet` \| `opus`. Omit (preferred) to follow the platform default tier, resolved at run time. A tier names capability, not a version, so the agent tracks model generations with no rewrite. Pin only a deliberate, tested choice |
|
|
28
|
-
| `effort_level` | Optional reasoning depth for adaptive-thinking tiers. Requires an explicit `model_tier` pin — effort is tuned per tier |
|
|
29
|
-
| `prefix_cache_ttl` | Optional prompt-cache window for the agent's stable prefix (tools + system). **Omit it** — the default `"5m"` is right for essentially every agent. `"1h"` writes at 2x the input rate (against 1.25x) to buy only the five-minute-to-one-hour band; set it only with measured cadence showing runs land there, such as a scheduled sweep |
|
|
30
|
-
| `inputs` | Optional typed input schema for one run — the same vocabulary as workflow inputs (`text`, `number`, `file`, `member`, `record_link`, `select`, …). The server validates every run payload against it. **Every field defaults to `required: true`**, exactly as `outputs` does — the two extend the same base — so an input the caller may legitimately omit needs `"required": false`, or the run is rejected before the agent sees it |
|
|
31
|
-
| `outputs` | Optional typed output schema — the declaration vocabulary, including the two ways a `select` names its option set, is [mutations](./mutations.md#structured-results-return-data). Declared → **structured agent** (the run must emit a matching result); omitted → **free-text agent** (the answer is the final prose). **Every field defaults to `required: true`** (the same base schema as `inputs` above) — mark `"required": false` on anything the source may legitimately not carry. It matters most for `number`, which has no blank: text can answer `""`, but a required number leaves only a wrong value or a rejected submission |
|
|
32
|
-
| `writes` | Optional — where the result lands: `{ table_id, row, fields }`. `row` is a single `record_link` input to `table_id`; `fields` maps each output to a field key of that table. Once a run's result validates, each output it carries is written to that row under the app's authority, with the table's locks and hooks applied; an output the result omits is left alone. A write that fails fails the run. Requires `outputs` |
|
|
33
|
-
|
|
34
|
-
**Structured vs free-text is the load-bearing split.** A structured agent's result arrives in `run.output` (the server strictly validates the submitted result against the declared schema — see the `output` typing section for the exact guarantee); a free-text agent's answer is the transcript's prose (`run.text`) and its `output` stays `undefined` — never a stray string, so a consumer reading `output.<field>` can't crash on a free-text answer.
|
|
35
|
-
|
|
36
|
-
**Input validation and tenant bounds.** Run inputs get the same server-side enforcement as workflow inputs: `record_link` ids must live in the declared table, `member` ids in the declared group, `file` ids in the app's workspace (see [the caller boundary](./security.md)). The run executes under the **app owner's** authority in the app's own workspace.
|
|
37
|
-
|
|
38
|
-
**Record data is reached only through declared aliases.** Every tool that reads or writes record VALUES by table id is rejected in `tool_names` — there is no `query_records`, `get_record`, `create_records`, or `update_records` for an agent. The agent reads with `run_app_query(alias, params)` and writes with `run_app_workflow(alias, inputs)`, both refused for any alias outside `query_aliases` / `workflow_aliases`. A query template fixes its own tables, joins, filters AND projection, so it bounds which **rows and columns** the agent sees; writes travel the app's declared mutation path, so workflow validation and table hooks apply. `is_current_member` inside a declared query resolves to the **invoking** member, so a self-scoped query scopes to the person using the agent, exactly as it does in the app's UI.
|
|
39
|
-
|
|
40
|
-
So an agent that reads or writes records needs a named query or workflow for each thing it touches — the same declaration the app's own UI uses. Declare only what that agent needs; a second agent in the same app can declare a narrower set.
|
|
41
|
-
|
|
42
|
-
**Typing.** `.lotics/app_agents.d.ts`, generated from the app's live bindings by `lotics app create --custom` and `lotics app deploy`, augments the SDK's `AppAgents` (alias → input shape) and `AppAgentResults` (alias → declared output shape) interfaces — `useAgentRun("recognize")` then types both `run(input)` and `output`. An alias it does not carry falls back to `Record<string, unknown>` input / `unknown` output.
|
|
16
|
+
`useAgentRun` runs an agent already bound to the app; none can be added or changed any more, and `remove_app_binding` with `kind: "agent"` unbinds one. A new job for an agent is a declared Query or Workflow node of the app, which an outside agent runs with `run_app_query` and `run_app_workflow`. `.lotics/app_agents.d.ts`, generated from the app's live bindings by `lotics app create --custom` and `lotics app deploy`, types `useAgentRun("<alias>")` by the agent's input and output shapes.
|
|
43
17
|
|
|
44
18
|
---
|
|
45
19
|
|
|
@@ -337,7 +311,7 @@ This hook is a **one-way push of data the app already showed this member**. (Cha
|
|
|
337
311
|
### The chat can also USE the app, not just be told about it
|
|
338
312
|
|
|
339
313
|
A member's chat agent can also **call the declared aliases of any app that member
|
|
340
|
-
can use** (
|
|
314
|
+
can use** (a call names its app by `app_id`; the open one is in `<app_context>`): named queries via `run_app_query`, workflows via
|
|
341
315
|
`run_app_workflow`. This adds no exposure: every declared alias is already
|
|
342
316
|
callable by that member ([the devtools test](./security.md#the-devtools-test)).
|
|
343
317
|
It is gated on `app:use` when the call is made, and runs under the app's OWNER authority with
|
package/docs/data_fetching.md
CHANGED
|
@@ -410,6 +410,7 @@ the server's answer is the only check — the rule the filter keys follow too.
|
|
|
410
410
|
| `readMembers(cell)` | member cell → `ResolvedMember[]` | `{ id, name, email?, image?, groups? }[]` (`[]` when empty) |
|
|
411
411
|
| `readFiles(cell)` | files cell → `AppFile[]` | attached files with presigned URLs (`[]` when empty), a LOOKUP of a files field included |
|
|
412
412
|
| `readLocked(rowObj)` | the whole **row** → `boolean` | the record's lock state from `__source_locked` |
|
|
413
|
+
| `readLockedBy(rowObj)` | the whole **row** → `string[]` | who can change a locked record, by name, from `__source_locked_by` (`[]` for an outsider) |
|
|
413
414
|
| `readCreatedAt(rowObj)` | the whole **row** → `Date \| null` | when the record was created, from `__created_at` |
|
|
414
415
|
| `readUpdatedAt(rowObj)` | the whole **row** → `Date \| null` | when the record was last updated, from `__updated_at` |
|
|
415
416
|
|
package/docs/files.md
CHANGED
|
@@ -57,7 +57,7 @@ Signature: `dist/hooks.d.ts`. Returns `{ upload, uploading, error }`:
|
|
|
57
57
|
- `place` — a photo's `{ latitude, longitude, accuracy }` (`PhotoPlace`): where the device stood as it took it, read
|
|
58
58
|
as the shot comes back (`requestGeofencedLocation`, `highAccuracy: true`) — the optimizer strips EXIF, so the photo
|
|
59
59
|
carries none of its own. Kept with the file, never echoed by the upload; refused on a file that is no image. A
|
|
60
|
-
person's whereabouts, so a read carries it only where the app declares `capabilities.photo_places` (`
|
|
60
|
+
person's whereabouts, so a read carries it only where the app declares `capabilities.photo_places` (`set_app`; a
|
|
61
61
|
JSON app stating `on_site` declares it), and only to a member of the app's organization.
|
|
62
62
|
- `fidelity` — **how faithful the stored image must be**; the platform owns the pixels behind
|
|
63
63
|
each step. `useAttachments().add` and `.attach` take it too.
|