things-api 0.19.2 → 0.19.3

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/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  A typed TypeScript library + CLI (`things`) for programmatic interaction with [Things 3](https://culturedcode.com/things/) by Cultured Code.
6
6
 
7
- **Status: read + write + MCP layers live and published to npm (v0.19.2 — see [CHANGELOG.md](CHANGELOG.md)).** Reads go straight to the local SQLite database (UI-exact Today ordering, sidebar-grouped Anytime/Someday with container-status cascade, decoded repeat rules, occurrence projections); writes run a verified pipeline over four write vectors — two lab-validated headless surfaces (the URL scheme + AppleScript) and two opt-in surfaces (Apple Shortcuts and an Accessibility-driven GUI vector) — with hazard guards, disruption-tier policy, a JSONL audit trail, batch mode, audit-replay undo (transactional across compound operations), full project lifecycle (complete/cancel/reopen/restore), heading rename/archive/unarchive with children policies, container detach, granular stateful checklists, tag hierarchy management incl. un-nesting, completion/creation backdating, Logbook imports, tiered fuzzy name resolution (uuid prefixes, `things:///show?id=` share links), and kind-neutral in-place reordering within any container or view (one `things reorder <refs…> [--start|--end|--before|--after] --in <target>` verb — Today/Evening, a project, an area, a heading's children, someday, inbox — plus `project move-heading` for the headings themselves and `area reorder` for the sidebar). The Apple Shortcuts surface is wired for the two headless capabilities nothing else can do: creating a heading in an existing project (`things project add-heading`) and clearing a reminder from a date-scheduled item (`things todo clear-reminder`). Both run through bundled proxy shortcuts (`things setup`) and are gated on their presence. The fourth vector — the Accessibility-driven GUI vector — is off by default and drives the local Things app to reach transforms that exist on no scriptable surface (repeat-rule editing on existing to-dos and projects, convert-to-project, sidebar area reorder); see [Accessibility GUI vector](#accessibility-gui-vector-optional-off-by-default) below. Single-item permanent delete stays interactive-only (its macOS consent has no always-allow) and is out of the headless pipeline. See [docs/design/](docs/design/) for the architecture and VM-lab design, [docs/lab/](docs/lab/harness.md) for the probe harness and campaign results the write layer is grounded in, and [docs/atlas/](docs/atlas/schema-v26.md) for the database↔UI map.
7
+ **Status: read + write + MCP layers live and published to npm (v0.19.3 — see [CHANGELOG.md](CHANGELOG.md)).** Reads go straight to the local SQLite database (UI-exact Today ordering, sidebar-grouped Anytime/Someday with container-status cascade, decoded repeat rules, occurrence projections); writes run a verified pipeline over four write vectors — two lab-validated headless surfaces (the URL scheme + AppleScript) and two opt-in surfaces (Apple Shortcuts and an Accessibility-driven GUI vector) — with hazard guards, disruption-tier policy, a JSONL audit trail, batch mode, audit-replay undo (transactional across compound operations), full project lifecycle (complete/cancel/reopen/restore), heading rename/archive/unarchive with children policies, container detach, granular stateful checklists, tag hierarchy management incl. un-nesting, completion/creation backdating, Logbook imports, tiered fuzzy name resolution (uuid prefixes, `things:///show?id=` share links), and kind-neutral in-place reordering within any container or view (one `things reorder <refs…> [--start|--end|--before|--after] --in <target>` verb — Today/Evening, a project, an area, a heading's children, someday, inbox — plus `project move-heading` for the headings themselves and `area reorder` for the sidebar). The Apple Shortcuts surface is wired for the two headless capabilities nothing else can do: creating a heading in an existing project (`things project add-heading`) and clearing a reminder from a date-scheduled item (`things todo clear-reminder`). Both run through bundled proxy shortcuts (`things setup`) and are gated on their presence. The fourth vector — the Accessibility-driven GUI vector — is off by default and drives the local Things app to reach transforms that exist on no scriptable surface (repeat-rule editing on existing to-dos and projects, convert-to-project, sidebar area reorder); see [Accessibility GUI vector](#accessibility-gui-vector-optional-off-by-default) below. Single-item permanent delete stays interactive-only (its macOS consent has no always-allow) and is out of the headless pipeline. See [docs/design/](docs/design/) for the architecture and VM-lab design, [docs/lab/](docs/lab/harness.md) for the probe harness and campaign results the write layer is grounded in, and [docs/atlas/](docs/atlas/schema-v26.md) for the database↔UI map.
8
8
 
9
9
  ```sh
10
10
  things today --json # read: your Today list, Evening split, UI order
@@ -14,7 +14,7 @@ export declare const API_VERSION = 1;
14
14
  * Package version, surfaced by `things --version` and the MCP serverInfo.
15
15
  * Kept in lockstep with package.json by a contract test.
16
16
  */
17
- export declare const PKG_VERSION = "0.19.2";
17
+ export declare const PKG_VERSION = "0.19.3";
18
18
  /**
19
19
  * Stable exit-code contract for the `things` CLI (mirrored by MCP error
20
20
  * codes). Part of the public API surface consumed by agents and scripts —
package/dist/contracts.js CHANGED
@@ -13,7 +13,7 @@ export const API_VERSION = 1;
13
13
  * Package version, surfaced by `things --version` and the MCP serverInfo.
14
14
  * Kept in lockstep with package.json by a contract test.
15
15
  */
16
- export const PKG_VERSION = "0.19.2";
16
+ export const PKG_VERSION = "0.19.3";
17
17
  /**
18
18
  * Stable exit-code contract for the `things` CLI (mirrored by MCP error
19
19
  * codes). Part of the public API surface consumed by agents and scripts —
package/dist/index.d.ts CHANGED
@@ -13,7 +13,7 @@ export { diagnose } from "./diagnose.ts";
13
13
  export type { DiagnoseOptions, DiagnoseReport, DiagnoseResult } from "./diagnose.ts";
14
14
  export { opResult } from "./op-result.ts";
15
15
  export { readUiStateReport, uiStateLines } from "./ui-state.ts";
16
- export type { UiFocusOwner, UiSheetForm, UiSheetKind, UiState, UiStateDeps, UiStateReport, } from "./ui-state.ts";
16
+ export type { UiFocusOwner, UiProbe, UiSheetForm, UiSheetKind, UiState, UiStateDeps, UiStateReport, } from "./ui-state.ts";
17
17
  export type { OpResultData, OpResultOptions, OpResultStatus } from "./op-result.ts";
18
18
  export { probeAutomation } from "./write/automation-probe.ts";
19
19
  export type { AutomationProbeDeps, AutomationProbeResult, AutomationProbeStatus, } from "./write/automation-probe.ts";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAmBzC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAUhE,O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OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AActD,4EAA4E;AAC5E,mEAAmE;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGhD,gEAAgE;AAChE,yCAAyC;AACzC,OAAO,EACL,UAAU,EACV,OAAO,EACP,eAAe,EACf,WAAW,EACX,cAAc,EACd,mBAAmB,EACnB,uBAAuB,EACvB,SAAS,EACT,SAAS,EACT,YAAY,EACZ,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,EAChB,mBAAmB,EACnB,wBAAwB,EACxB,YAAY,EACZ,eAAe,EACf,oBAAoB,EACpB,uBAAuB,EACvB,gBAAgB,GACjB,MAAM,iBAAiB,CAAC;AAgBzB,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACpF,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAWnF,+EAA+E;AAC/E,4EAA4E;AAC5E,4EAA4E;AAC5E,iFAAiF;AACjF,mEAAmE;AACnE,OAAO,EACL,aAAa,EACb,WAAW,EACX,eAAe,EACf,mBAAmB,EACnB,YAAY,EACZ,KAAK,EACL,WAAW,EACX,SAAS,GACV,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAWtC,MAAM,UAAU,aAAa;IAC3B,OAAO,MAAM,CAAC,iBAAiB,CAAC,CAAC;AACnC,CAAC"}
@@ -16,7 +16,7 @@
16
16
  */
17
17
  import { type UiCapability } from "./capability.ts";
18
18
  import { type UiState } from "./write/vectors/ui-state.ts";
19
- export type { UiFocusOwner, UiSheetForm, UiSheetKind, UiState } from "./write/vectors/ui-state.ts";
19
+ export type { UiFocusOwner, UiProbe, UiSheetForm, UiSheetKind, UiState, } from "./write/vectors/ui-state.ts";
20
20
  export interface UiStateReport {
21
21
  /** Could the screen be read at all on this machine? */
22
22
  available: boolean;
package/dist/ui-state.js CHANGED
@@ -15,7 +15,7 @@
15
15
  * surface may raise a consent dialog outside the two setup ceremonies.
16
16
  */
17
17
  import { uiAllowed, uiCapability as uiCapabilityDefault } from "./capability.js";
18
- import { describeUiState, SYNC_GATE_WARNING } from "./write/vectors/ui-state.js";
18
+ import { describeUiState, describeUnprovenProbes, SYNC_GATE_WARNING, } from "./write/vectors/ui-state.js";
19
19
  import { readLiveUiState } from "./write/vectors/ui.js";
20
20
  /**
21
21
  * Read the current window/focus state, gated on the prompt-free capability
@@ -45,7 +45,8 @@ export async function readUiStateReport(deps = {}) {
45
45
  warnings: [],
46
46
  };
47
47
  }
48
- if (!state.thingsRunning) {
48
+ const unproven = state.stalledProbes.length > 0 || state.failedProbes.length > 0;
49
+ if (!state.thingsRunning && !unproven) {
49
50
  return {
50
51
  available: true,
51
52
  detail: "Things is not running, so it has no window and no dialog open",
@@ -57,21 +58,45 @@ export async function readUiStateReport(deps = {}) {
57
58
  return {
58
59
  available: true,
59
60
  detail: describeUiState(state),
60
- remediation: [],
61
+ // #629: a probe that did not answer is REPORTED, with what to do about it —
62
+ // never swallowed into a confident-looking summary, and never collapsed
63
+ // into a bare "nothing could be read". Everything the other probes DID
64
+ // prove is in `state` and in the summary above.
65
+ remediation: unproven
66
+ ? [
67
+ "one or more of the screen reads did not answer; check that Things is responding, then " +
68
+ "run this again",
69
+ ]
70
+ : [],
61
71
  state,
62
72
  warnings: state.sheetOpen ? [SYNC_GATE_WARNING] : [],
63
73
  };
64
74
  }
75
+ /** Render the per-probe verdicts, or "" when every probe answered. */
76
+ function probeLine(state) {
77
+ const unprovenText = describeUnprovenProbes(state);
78
+ return unprovenText === "" ? [] : [`unproven: ${unprovenText}`];
79
+ }
65
80
  /** The human render, shared by `things ui-state` and `things doctor --ui-state`. */
66
81
  export function uiStateLines(report) {
67
82
  const lines = ["── Window state ──", `summary: ${report.detail}`];
68
83
  const state = report.state;
69
84
  if (state !== null) {
70
- lines.push(`frontmost: ${state.frontmostApp ?? "unknown"}${state.thingsFrontmost ? " (Things)" : ""}`, `dialog: ${state.sheetKind}${state.sheetKind === "none"
71
- ? ""
72
- : ` (${state.sheetForm}; ${state.sheetControls ?? "no census"})`}`, `focus: ${state.focusOwner === null
73
- ? "unknown"
74
- : `${state.focusOwner.app} · ${state.focusOwner.role || "no focused element"}${state.focusOwner.subrole === null ? "" : ` / ${state.focusOwner.subrole}`}`}`, `inspectable: ${state.inspectable ? "yes" : "no — a system dialog macOS does not expose"}`);
85
+ // #629: a row whose probe did not answer says so. Printing the field's
86
+ // unset default ("none", "unknown") next to rows that WERE measured is what
87
+ // made a stalled inspection read as a clean screen.
88
+ const unproven = (p) => state.stalledProbes.includes(p) || state.failedProbes.includes(p);
89
+ lines.push(`frontmost: ${unproven("frontmost")
90
+ ? "not established"
91
+ : `${state.frontmostApp ?? (unproven("frontapp") ? "not established" : "unknown")}${state.thingsFrontmost ? " (Things)" : ""}`}`, `dialog: ${unproven("dialog")
92
+ ? "not established"
93
+ : `${state.sheetKind}${state.sheetKind === "none"
94
+ ? ""
95
+ : ` (${state.sheetForm}; ${state.sheetControls ?? "no census"})`}`}`, `focus: ${unproven("focus")
96
+ ? "not established"
97
+ : state.focusOwner === null
98
+ ? "unknown"
99
+ : `${state.focusOwner.app} · ${state.focusOwner.role || "no focused element"}${state.focusOwner.subrole === null ? "" : ` / ${state.focusOwner.subrole}`}`}`, `inspectable: ${state.inspectable ? "yes" : "no — a system dialog macOS does not expose"}`, ...probeLine(state));
75
100
  }
76
101
  for (const warning of report.warnings)
77
102
  lines.push(` warning: ${warning}`);
@@ -1 +1 @@
1
- {"version":3,"file":"ui-state.js","sourceRoot":"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AC,KAAK,CAAC,CACpB,CAAC;IACJ,CAAC;IACD,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,QAAQ;QAAE,KAAK,CAAC,IAAI,CAAC,gBAAgB,OAAO,EAAE,CAAC,CAAC;IAC7E,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,WAAW;QAAE,KAAK,CAAC,IAAI,CAAC,gBAAgB,IAAI,EAAE,CAAC,CAAC;IAC1E,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -65,6 +65,39 @@ export type UiSheetForm = "none" | "attached" | "detached";
65
65
  * `missing value`), `sheetForm` and `sheetDepth` bound.
66
66
  */
67
67
  export declare const AX_DIALOG_SHELL_SNIPPET = "\t\tset shellRef to missing value\n\t\tset sheetForm to \"none\"\n\t\tset sheetDepth to 0\n\t\ttry\n\t\t\t-- positional-ok: the one attached sheet a window can present, which is\n\t\t\t-- the BOTTOM of any stack; the walk below climbs to the top.\n\t\t\tset shellRef to sheet 1 of (first window whose subrole is \"AXStandardWindow\")\n\t\t\tset sheetForm to \"attached\"\n\t\t\tset sheetDepth to 1\n\t\tend try\n\t\tif shellRef is missing value then\n\t\t\ttry\n\t\t\t\tset dws to (windows whose subrole is \"AXUnknown\" and size is not {40, 40})\n\t\t\t\tif (count of dws) > 0 then\n\t\t\t\t\tset shellRef to item 1 of dws\n\t\t\t\t\tset sheetForm to \"detached\"\n\t\t\t\t\tset sheetDepth to 1\n\t\t\t\tend if\n\t\t\tend try\n\t\tend if\n\t\tif shellRef is not missing value then\n\t\t\trepeat 6 times\n\t\t\t\tset nested to missing value\n\t\t\t\ttry\n\t\t\t\t\tif (exists sheet 1 of shellRef) then set nested to sheet 1 of shellRef\n\t\t\t\tend try\n\t\t\t\tif nested is missing value then exit repeat\n\t\t\t\tset shellRef to nested\n\t\t\t\tset sheetDepth to sheetDepth + 1\n\t\t\tend repeat\n\t\tend if";
68
+ /**
69
+ * The census's individually-budgeted probes, in the order they run. The first
70
+ * three are DECISION-CRITICAL — the guard, the drive preflight and the cleanup
71
+ * ladder all decide on them — and the last two are DECORATION for the refusal
72
+ * copy. That order is the point: everything a caller acts on is proven before a
73
+ * single unaddressed query is attempted.
74
+ *
75
+ * - `running` — is there a Things process at all (a name-keyed lookup);
76
+ * - `frontmost` — `frontmost of process "Things3"`, ADDRESSED: the one fact a
77
+ * keystroke guard actually needs;
78
+ * - `dialog` — the dialog shell, its form, its stack depth and its control
79
+ * census, all addressed inside `process "Things3"`;
80
+ * - `frontapp` — WHICH other application owns the screen. This is the whole
81
+ * process table enumerated (`first application process whose
82
+ * frontmost is true`), so it runs only when the addressed
83
+ * `frontmost` probe already said the answer is not Things, and
84
+ * only for the sentence that names the thief;
85
+ * - `focus` — the focused element's role, through
86
+ * `AXFocusedUIElement`. MEASURED at ~3.5x the cost of every
87
+ * addressed probe in this vector even on a bare clone
88
+ * (docs/lab/fgrd2-census-hardening.md §2), and it decides
89
+ * nothing — so it goes last, inside its own budget, and its
90
+ * absence costs a clause in a sentence.
91
+ */
92
+ export type UiProbe = "running" | "frontmost" | "dialog" | "frontapp" | "focus";
93
+ /**
94
+ * The transport deadline for one census hop — the backstop under the in-script
95
+ * budgets, not the mechanism. Deliberately far below the 15s step timeout that
96
+ * bounded the old single-shot script: nothing here may take this long, and if
97
+ * it does the caller must hear about it while the drive can still be aborted
98
+ * cleanly rather than after four of them have gone by.
99
+ */
100
+ export declare const CENSUS_TIMEOUT_MS = 12000;
68
101
  /** Who owns keyboard focus. Role only — never the element's value or title (see PRIVACY). */
69
102
  export interface UiFocusOwner {
70
103
  /** The frontmost application's process name (e.g. "Things3"). */
@@ -105,9 +138,30 @@ export interface UiState {
105
138
  * of a SECURE SYSTEM MODAL (a macOS privacy/consent dialog), which belongs to
106
139
  * no application's Accessibility tree. Everything else in the census is then
107
140
  * "what could still be proven", never a guess.
141
+ *
142
+ * A probe that TIMED OUT does not set this: "macOS refused to describe the
143
+ * screen" and "the screen did not answer in time" are different facts with
144
+ * different remediations, and #629 is what conflating them costs.
108
145
  */
109
146
  inspectable: boolean;
147
+ /**
148
+ * The probes that did not answer within their budget. Non-empty means the
149
+ * corresponding fields are UNPROVEN, not false — every caller reads them that
150
+ * way, and a critical probe here aborts a drive instead of being retried.
151
+ */
152
+ stalledProbes: UiProbe[];
153
+ /**
154
+ * The probes that answered with an error rather than a value (the surface is
155
+ * there but would not describe itself — a secure modal, a process that exited
156
+ * between two reads). Reported for the same reason: what could not be proven
157
+ * is named, never guessed at.
158
+ */
159
+ failedProbes: UiProbe[];
110
160
  }
161
+ /** Did a probe the caller has to DECIDE on fail to answer? */
162
+ export declare function censusUnverifiable(state: UiState | null): boolean;
163
+ /** Name the probes that did not answer, for a diagnostic someone has to act on. */
164
+ export declare function describeUnprovenProbes(state: UiState): string;
111
165
  /** A recognizable token in the script so a test runner can key off the ui-state command. */
112
166
  export declare const UI_STATE_MARKER = "-- ui-state census (read-only)";
113
167
  /** The label every ui-state dispatch carries (one stable command shape). */
@@ -115,10 +169,34 @@ export declare const UI_STATE_LABEL = "read the window and focus state";
115
169
  /** The Things application's process name — the frontmost value that means "us". */
116
170
  export declare const THINGS_PROCESS = "Things3";
117
171
  /**
118
- * The census script. Every read is wrapped: a surface that will not answer
119
- * degrades that ONE field rather than failing the whole census, because the
120
- * cases this exists for — a foreign modal, an AX-blind session — are exactly
121
- * the cases where half the tree is unreadable.
172
+ * The census script ADDRESSED probes, each on its own Apple-event budget
173
+ * (issue #629).
174
+ *
175
+ * WHAT CHANGED, AND WHY IT HAD TO. The 0.19.2 census was one unbounded script
176
+ * that opened with two UNADDRESSED queries: `first application process whose
177
+ * frontmost is true` (the entire process table enumerated) and `value of
178
+ * attribute "AXFocusedUIElement"` on whatever that returned (a system-wide
179
+ * focused-element resolution). Everything else the ui vector runs — every step
180
+ * the field incident's log shows succeeding, inside the very sheet the census
181
+ * could not describe — is addressed: `tell process "Things3" to …`. So the one
182
+ * script that stalled was the one script that left the addressed style, and it
183
+ * stalled on the critical path of BOTH the per-step guard and the cleanup that
184
+ * was supposed to recover from it. Rebuilt here so that:
185
+ *
186
+ * - the decision-critical facts are ADDRESSED and are proven FIRST;
187
+ * - every read carries `with timeout of ${PROBE_TIMEOUT_S} seconds`, so a
188
+ * surface that will not answer costs seconds, not the caller's whole
189
+ * deadline;
190
+ * - a critical probe that does not answer STOPS the census then and there —
191
+ * the remaining probes cannot change what the caller must now do (abort and
192
+ * clean up), so waiting for them is pure latency;
193
+ * - the two unaddressed queries survive only as DECORATION, last, skipped
194
+ * entirely when the addressed probes already answered the question they
195
+ * were there to answer.
196
+ *
197
+ * Every probe still degrades one field rather than failing the census, and what
198
+ * could not be proven is NAMED (`stalled=` / `failed=`) instead of silently
199
+ * reading as a clean "nothing is open".
122
200
  */
123
201
  export declare function axUiStateScript(): string;
124
202
  /**
@@ -131,8 +209,11 @@ export declare function parseUiState(stdout: string): UiState | null;
131
209
  * Read the census through the injected runner. Returns null on a transport
132
210
  * failure — an UNKNOWN state, which every caller treats fail-closed (the guard
133
211
  * refuses; the cleanup path does not send a blind Escape).
212
+ *
213
+ * `timeoutMs` defaults to {@link CENSUS_TIMEOUT_MS}: a census is not a drive
214
+ * step and must not borrow a drive step's patience (issue #629).
134
215
  */
135
- export declare function readUiState(run: (command: UiCommand, timeoutMs: number) => Promise<UiRunResult>, timeoutMs: number): Promise<UiState | null>;
216
+ export declare function readUiState(run: (command: UiCommand, timeoutMs: number) => Promise<UiRunResult>, timeoutMs?: number): Promise<UiState | null>;
136
217
  /**
137
218
  * How to name the surface that owns the screen, for a refusal someone has to
138
219
  * act on. Names the APPLICATION and the focused element's ROLE — never its
@@ -141,7 +222,14 @@ export declare function readUiState(run: (command: UiCommand, timeoutMs: number)
141
222
  * at the keyboard has to look at the screen themselves.
142
223
  */
143
224
  export declare function describeFocusOwner(state: UiState | null): string;
144
- /** A one-line human summary of the census, for a diagnostic line or a warning. */
225
+ /**
226
+ * A one-line human summary of the census, for a diagnostic line or a warning.
227
+ *
228
+ * Reports WHAT EACH PROBE PROVED. A stalled probe leaves its clause reading
229
+ * "could not be determined" and is named at the end — never omitted, and never
230
+ * rendered as its default (issue #629: a census that could not see the open
231
+ * Repeat sheet used to report a clean screen).
232
+ */
145
233
  export declare function describeUiState(state: UiState): string;
146
234
  /**
147
235
  * The warning an OPEN Things dialog earns, wherever it is reported.