@lotics/app-sdk 0.124.6 → 0.124.8

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 CHANGED
@@ -14,7 +14,7 @@ This file is the index. The **exact type** of anything is its shipped declaratio
14
14
 
15
15
  | Doc | Read it for |
16
16
  |---|---|
17
- | [docs/data_fetching.md](./docs/data_fetching.md) | The reads: `useQuery(alias, params, opts)` — its rows (`limit`), numbered pages (`page`), a keyset feed (`more`), its `total` or the total alone, with `total: { by }` a count per value of one column and `total: { where }` a count per named filter, from one scan — `useQueries` for reads known only at render, `queryAll` outside React, `exportQuery` for a file of them the server makes; every hook answers one `QueryState`. The ROW type (`RowOf` — the alias's projected columns and nothing else), runtime `sort`/`filter` keys, cell readers (`row.*`, `readSelect`, `readMembers`, `readLinks`, `readFiles`, `readLocked`/`readLockedBy`, `readCreatedAt`/`readUpdatedAt`), the SDK's own cache — **arrival revalidates** — **realtime push** and `answeredAt` (the server answering again what a screen drew), a write drawn on every read from the press, a count as its own full scan, and the search-as-you-type and record-picker patterns. |
17
+ | [docs/data_fetching.md](./docs/data_fetching.md) | The reads: `useQuery(alias, params, opts)` — its rows (`limit`), numbered pages (`page`), a keyset feed (`more`), its `total` or the total alone, with `total: { by }` a count per value of one column and `total: { where }` a count per named filter, from one scan — `useQueries` for reads known only at render, `queryAll` outside React, `exportQuery` for a file of them the server makes, `exportApp` for the file of an Export of a JSON app; every hook answers one `QueryState`. The ROW type (`RowOf` — the alias's projected columns and nothing else), runtime `sort`/`filter` keys, cell readers (`row.*`, `readSelect`, `readMembers`, `readLinks`, `readFiles`, `readLocked`/`readLockedBy`, `readCreatedAt`/`readUpdatedAt`), the SDK's own cache — **arrival revalidates** — **realtime push** and `answeredAt` (the server answering again what a screen drew), a write drawn on every read from the press, a count as its own full scan, and the search-as-you-type and record-picker patterns. |
18
18
  | [docs/queries.md](./docs/queries.md) | **The query engine reference** — AST node kinds, per-field-type operators, filters/params/pruning, free-text search, combining tables, shaping (aggregates, date buckets, windows), runtime refinement bounds, limits and the efficiency playbook. |
19
19
  | [docs/mutations.md](./docs/mutations.md) | `useWorkflow` (the ONLY write path; `useWorkflows` for writes that are data), the `WorkflowResult` resolve-never-throw contract (`field_errors`), typed inputs, every write drawn on every read from the press — predicted from the workflow's own steps, taken back on a refusal, `pending` meanwhile — the re-read a successful write triggers over the tables its body names, diff-before-update, locked records, `useNewRecord`, read-after-write ordering (`writesSettled()`), `useRecording`, `useRecordings` over several aliases. |
20
20
  | [docs/workflows.md](./docs/workflows.md) | **The workflow-BODY reference** — the JS subset a body may use, opaque `fld_*`/`opt_*` keys, every step form, the accepted sugar, helpers, record-write surfaces, the traps and the verify loop. |
@@ -241,6 +241,7 @@ var TABLE_ID_PATTERN = new RegExp(
241
241
  "i"
242
242
  );
243
243
  var PREFIXED_ID_PATTERN = new RegExp(`^[a-z]{3}_[${ID_ALPHABET}]{${ID_LENGTH}}$`);
244
+ var MEMBER_ID_PATTERN = new RegExp(`^[${ID_ALPHABET}]{${ID_LENGTH},}$`);
244
245
 
245
246
  // ../shared/src/table_field_keys.ts
246
247
  var nanoid2 = customAlphabet(ID_ALPHABET, 6);
package/dist/hooks.d.ts CHANGED
@@ -3,8 +3,7 @@ import { type AttachmentPiles, type AttachmentPilesOptions, type AttachmentsOpti
3
3
  import { type AiContextValue } from "./rpc.js";
4
4
  import { type AgentUIPart, type PendingChoice, type AgentRunLanding } from "./agent_stream.js";
5
5
  import type { AppWorkflows, AppWorkflowResults, AppAgents, AppAgentResults } from "./types.js";
6
- import type { ResolvedMember } from "./shared_types.js";
7
- import type { PhotoPlace } from "./row.js";
6
+ import type { PhotoPlace, ResolvedMember } from "./shared_types.js";
8
7
  export type { AgentRunState, AgentUIPart, PendingChoice, ChoiceQuestion, ChoiceOption, AskUserChoiceOutput, AgentRunLanding } from "./agent_stream.js";
9
8
  export { buildChoiceOutput } from "./agent_stream.js";
10
9
  /**
package/dist/index.d.ts CHANGED
@@ -5,10 +5,11 @@ export { reportAppError } from "./error_report.js";
5
5
  export type { AppErrorKind } from "./error_report.js";
6
6
  export { useWorkflow, useWorkflows, writesSettled, useFileUpload, useAttachments, useAttachmentPiles, useMembers, useAgentRun, useAgentRuns, useAiContext, buildChoiceOutput, } from "./hooks.js";
7
7
  export type { UploadedFile, WorkflowResult, MembersOptions, AgentRunOptions, UseAgentRun, AgentRunLanding, AgentRunRecord, AgentRunState, AgentUIPart, PendingChoice, ChoiceQuestion, ChoiceOption, AskUserChoiceOutput, } from "./hooks.js";
8
- export { useQuery, useQueries, queryAll, exportQuery, useFieldOptions } from "./queries.js";
8
+ export { useQuery, useQueries, queryAll, exportQuery, exportApp, useFieldOptions } from "./queries.js";
9
9
  export type { QueryCall, QueryState, RowOf, QueryOptions, ColumnKeyOf, FieldOptions, FieldOptionsState, FieldOptionsOptions, FigureUnits, } from "./queries.js";
10
10
  export type { QueryRow, QuerySortKey, QueryFieldSortKey, QueryFirstSortKey, QueryFilter, QueryFilterCondition, QueryFilterFieldCondition, QueryFilterRecordIdCondition, QueryFilterGroup, ExportCall, ExportFile, ExportReport, ExportTab, } from "./shared_types.js";
11
11
  export type { ExportedFile } from "./shared_types.js";
12
+ export type { ExportNarrowing } from "./shared_types.js";
12
13
  export type { AttachedFile, AttachmentPiles, AttachmentPilesOptions, AttachmentsOptions, AttachmentsState } from "./attachments.js";
13
14
  export { useComments, useCommentCounts } from "./comments.js";
14
15
  export type { AppComment, AppCommentAuthor, AppCommentFile, CommentsState, UseCommentsArgs, CommentCountsState, UseCommentCountsArgs, } from "./comments.js";
@@ -28,15 +29,14 @@ export { openApp, peekApp } from "./open_app.js";
28
29
  export { askAi, type AskAiArgs } from "./ask_ai.js";
29
30
  export { downloadFile } from "./download.js";
30
31
  export { renameFile } from "./rename_file.js";
31
- export { readMembers, readSelect } from "./shared_types.js";
32
- export type { ResolvedMember, ResolvedOption } from "./shared_types.js";
33
- export type { AppFixture, MockExport, MockQuery, MockQueryCall, MockWorkflow } from "./mock.js";
32
+ export { readFiles, readMembers, readSelect } from "./shared_types.js";
33
+ export type { AppFile, PhotoPlace, ResolvedMember, ResolvedOption } from "./shared_types.js";
34
+ export type { AppFixture, MockExport, MockExportApp, MockQuery, MockQueryCall, MockWorkflow } from "./mock.js";
34
35
  export type { MockAgent, MockAgentRun } from "./mock_agent_run.js";
35
36
  export type { AppWorkflows, AppWorkflowResults, AppQueries, AppQueryColumns, AppAgents, AppAgentResults } from "./types.js";
36
37
  export { row, readLinks } from "./shared_types.js";
37
38
  export type { ResolvedLink } from "./shared_types.js";
38
- export { readFiles, readLocked, readLockedBy, readCreatedAt, readUpdatedAt, PENDING } from "./row.js";
39
- export type { AppFile, PhotoPlace } from "./row.js";
39
+ export { readLocked, readLockedBy, readCreatedAt, readUpdatedAt, PENDING } from "./row.js";
40
40
  export { useNewRecord, newRecordId } from "./new_record.js";
41
41
  export type { NewRecordApi } from "./new_record.js";
42
42
  export { useRecents } from "./use_recents.js";
package/dist/index.js CHANGED
@@ -49,7 +49,7 @@ import {
49
49
  subtractDecimal,
50
50
  sumDecimal,
51
51
  urlParam
52
- } from "./chunk-BWMAO5IY.js";
52
+ } from "./chunk-YONY7UPS.js";
53
53
 
54
54
  // src/mount.tsx
55
55
  import { createRoot } from "react-dom/client";
@@ -95,6 +95,10 @@ function getMockExport(alias) {
95
95
  if (!isMockMode()) return null;
96
96
  return registeredFixture?.exports?.[alias] ?? null;
97
97
  }
98
+ function getMockExportApp(key) {
99
+ if (!isMockMode()) return null;
100
+ return registeredFixture?.exportApps?.[key] ?? null;
101
+ }
98
102
  function getMockRecordings() {
99
103
  if (!isMockMode()) return null;
100
104
  return registeredFixture?.recordings ?? null;
@@ -712,7 +716,7 @@ function useKey(key, fetcher, opts = {}) {
712
716
  if (slot === null) return;
713
717
  const answered2 = slot.askedAt > 0;
714
718
  slot.mounts.set(id, { focus });
715
- if (!answered2 || arrival && seeded.current !== key || slot.outdated) void ask(slot, slot.outdated);
719
+ if (slot.outdated || slot.error === null && (!answered2 || arrival && seeded.current !== key)) void ask(slot, slot.outdated);
716
720
  return () => {
717
721
  slot.mounts.delete(id);
718
722
  };
@@ -10876,9 +10880,6 @@ function readMembers(value) {
10876
10880
  }
10877
10881
  return out;
10878
10882
  }
10879
-
10880
- // src/row.ts
10881
- var PENDING = "__pending";
10882
10883
  function placeOf(value) {
10883
10884
  if (typeof value !== "object" || value === null) return void 0;
10884
10885
  const latitude = Reflect.get(value, "latitude");
@@ -10920,6 +10921,9 @@ function readFiles(v) {
10920
10921
  }
10921
10922
  return out;
10922
10923
  }
10924
+
10925
+ // src/row.ts
10926
+ var PENDING = "__pending";
10923
10927
  function readLocked(rowValue) {
10924
10928
  if (!rowValue || typeof rowValue !== "object") return false;
10925
10929
  return row.bool(rowValue["__source_locked"]) === true;
@@ -13922,6 +13926,20 @@ function overlayAsked(alias, params, narrowing, askedAt, totalsOf, rows, back, a
13922
13926
  return { rows: back(overlaid.rows), pending: overlaid.pending };
13923
13927
  }
13924
13928
 
13929
+ // ../shared/src/app_screen/read_criteria.ts
13930
+ function statedSort(sort2) {
13931
+ return sort2 === void 0 || sort2.length === 0 ? void 0 : [...sort2];
13932
+ }
13933
+ function readCriteria(read2) {
13934
+ const sort2 = statedSort(read2.sort);
13935
+ return {
13936
+ params: { ...read2.params },
13937
+ ...read2.filter === void 0 ? {} : { filter: read2.filter },
13938
+ ...sort2 === void 0 ? {} : { sort: sort2 },
13939
+ ...read2.aggregate === void 0 ? {} : { aggregate: read2.aggregate }
13940
+ };
13941
+ }
13942
+
13925
13943
  // src/queries.ts
13926
13944
  function pageOf(mocked, call) {
13927
13945
  const start = call.keyset === true ? Number(call.cursor ?? 0) : call.offset ?? 0;
@@ -13963,10 +13981,8 @@ async function askRows(key, alias, askedAt, call, since = askedAt) {
13963
13981
  if (mocked !== null) return pageOf(await mocked, call);
13964
13982
  const answer = await rpc("query", {
13965
13983
  alias,
13966
- params: call.params,
13984
+ ...readCriteria(call),
13967
13985
  ...call.limit === void 0 ? {} : { limit: call.limit },
13968
- ...call.sort === void 0 ? {} : { sort: call.sort },
13969
- ...call.filter === void 0 ? {} : { filter: call.filter },
13970
13986
  ...call.keyset === true ? { keyset: true, ...call.cursor == null ? {} : { cursor: call.cursor } } : { offset: call.offset ?? 0 }
13971
13987
  });
13972
13988
  noteAnswer(key, alias, askedAt, answer.rows, since);
@@ -14000,7 +14016,7 @@ function useQuery(alias, params = {}, opts = {}) {
14000
14016
  const live = opts.revalidateOnChange ?? true;
14001
14017
  const aliases = live ? [alias] : [];
14002
14018
  const apart = live ? [] : ["held"];
14003
- const sort2 = opts.sort !== void 0 && opts.sort.length > 0 ? opts.sort : void 0;
14019
+ const sort2 = statedSort(opts.sort);
14004
14020
  const filter2 = opts.filter;
14005
14021
  const wantsRows = opts.rows ?? true;
14006
14022
  const totalAsked = opts.total ?? opts.page !== void 0;
@@ -14119,9 +14135,6 @@ function useQuery(alias, params = {}, opts = {}) {
14119
14135
  }
14120
14136
  };
14121
14137
  }
14122
- function sortOf(call) {
14123
- return call.sort === void 0 || call.sort.length === 0 ? void 0 : [...call.sort];
14124
- }
14125
14138
  async function settle(read2) {
14126
14139
  try {
14127
14140
  return { answer: await read2, error: null };
@@ -14132,13 +14145,13 @@ async function settle(read2) {
14132
14145
  async function askGroups(key, alias, askedAt, aggregate, call) {
14133
14146
  const mocked = getMockRows(alias, { ...call, aggregate });
14134
14147
  if (mocked !== null) return { rows: aggregateRows(await mocked, aggregate), truncated: false };
14135
- const answer = await rpc("query", { alias, params: call.params, aggregate, filter: call.filter, sort: call.sort });
14148
+ const answer = await rpc("query", { alias, ...readCriteria({ ...call, aggregate }) });
14136
14149
  noteAnswer(key, alias, askedAt, []);
14137
14150
  return answer;
14138
14151
  }
14139
14152
  async function askCall(key, call, askedAt) {
14140
14153
  const params = call.params ?? {};
14141
- const sort2 = sortOf(call);
14154
+ const sort2 = statedSort(call.sort);
14142
14155
  const rows = call.rows === false ? null : settle(
14143
14156
  call.aggregate !== void 0 ? askGroups(key, call.alias, askedAt, call.aggregate, { params, filter: call.filter, sort: sort2 }) : askRows(key, call.alias, askedAt, { params, filter: call.filter, sort: sort2 })
14144
14157
  );
@@ -14147,7 +14160,7 @@ async function askCall(key, call, askedAt) {
14147
14160
  }
14148
14161
  function useQueries(calls, opts = {}) {
14149
14162
  const enabled = opts.enabled ?? true;
14150
- const shape = JSON.stringify(calls.map((call) => [call.alias, call.params ?? {}, call.filter ?? null, sortOf(call) ?? null, call.aggregate ?? null, call.total ?? false, call.rows ?? true]));
14163
+ const shape = JSON.stringify(calls.map((call) => [call.alias, call.params ?? {}, call.filter ?? null, statedSort(call.sort) ?? null, call.aggregate ?? null, call.total ?? false, call.rows ?? true]));
14151
14164
  const key = !enabled || calls.length === 0 ? null : JSON.stringify(["calls", shape]);
14152
14165
  const answers = useKey(key, (askedAt) => Promise.all(calls.map((call) => askCall(key ?? "", call, askedAt))), {
14153
14166
  focus: opts.revalidateOnFocus ?? true,
@@ -14158,7 +14171,7 @@ function useQueries(calls, opts = {}) {
14158
14171
  () => calls.map((call, at2) => {
14159
14172
  const answer = answers.data?.[at2];
14160
14173
  const rows = answer?.rows?.answer;
14161
- const drawn2 = rows === void 0 ? { rows: [], pending: pendingRead(call.alias) } : call.aggregate !== void 0 ? overlayGroups(call.alias, call.params ?? {}, call.filter, call.aggregate, answers.askedAt, rows.rows) : overlayRead(call.alias, call.params ?? {}, call.filter, sortOf(call), answers.askedAt, rows.rows, true);
14174
+ const drawn2 = rows === void 0 ? { rows: [], pending: pendingRead(call.alias) } : call.aggregate !== void 0 ? overlayGroups(call.alias, call.params ?? {}, call.filter, call.aggregate, answers.askedAt, rows.rows) : overlayRead(call.alias, call.params ?? {}, call.filter, statedSort(call.sort), answers.askedAt, rows.rows, true);
14162
14175
  const count = answer?.count?.answer;
14163
14176
  const overlaid = count === void 0 ? void 0 : overlayCount(call.alias, call.params ?? {}, call.filter, answers.askedAt, count.total);
14164
14177
  const counted = overlaid === void 0 ? void 0 : { total: overlaid.rows, pending: overlaid.pending };
@@ -14190,25 +14203,29 @@ function useQueries(calls, opts = {}) {
14190
14203
  }
14191
14204
  var QUERY_ALL_PAGE = 1e3;
14192
14205
  async function queryAll(alias, params = {}, opts = {}) {
14193
- const sort2 = opts.sort === void 0 || opts.sort.length === 0 ? void 0 : [...opts.sort];
14194
- const mocked = getMockRows(alias, { params, filter: opts.filter, sort: sort2 });
14206
+ const criteria = readCriteria({ params, filter: opts.filter, sort: opts.sort });
14207
+ const mocked = getMockRows(alias, criteria);
14195
14208
  if (mocked !== null) return mocked;
14196
14209
  const pages = [];
14197
14210
  for (let offset = 0; ; ) {
14198
- const page = await rpc("query", { alias, params, limit: QUERY_ALL_PAGE, offset, sort: sort2, filter: opts.filter });
14211
+ const page = await rpc("query", { alias, ...criteria, limit: QUERY_ALL_PAGE, offset });
14199
14212
  pages.push(page.rows);
14200
14213
  offset += page.rows.length;
14201
14214
  if (!page.truncated || page.rows.length === 0) return pages.flat();
14202
14215
  }
14203
14216
  }
14204
14217
  async function exportQuery(alias, call) {
14205
- const sort2 = call.sort === void 0 || call.sort.length === 0 ? void 0 : [...call.sort];
14206
- const tabs = call.tabs?.map((tab) => ({ ...tab, sort: tab.sort === void 0 || tab.sort.length === 0 ? void 0 : [...tab.sort] }));
14207
- const body = { alias, params: call.params ?? {}, filter: call.filter, sort: sort2, ...tabs === void 0 ? {} : { tabs }, report: call.report, file: call.file, ...call.labels === void 0 ? {} : { labels: call.labels } };
14218
+ const tabs = call.tabs?.map((tab) => ({ ...tab, sort: statedSort(tab.sort) }));
14219
+ const body = { alias, params: call.params ?? {}, filter: call.filter, sort: statedSort(call.sort), ...tabs === void 0 ? {} : { tabs }, report: call.report, file: call.file, ...call.labels === void 0 ? {} : { labels: call.labels } };
14208
14220
  const mocked = getMockExport(alias);
14209
14221
  if (mocked !== null) return mocked(body);
14210
14222
  return (await rpc("export", body)).file;
14211
14223
  }
14224
+ async function exportApp(key, narrowing) {
14225
+ const mocked = getMockExportApp(key);
14226
+ if (mocked !== null) return mocked(narrowing);
14227
+ return (await rpc("export", { export: { key, ...narrowing } })).file;
14228
+ }
14212
14229
  var NO_UNITS = {};
14213
14230
  function useFieldOptions(alias, opts) {
14214
14231
  const enabled = opts?.enabled ?? true;
@@ -14648,6 +14665,7 @@ export {
14648
14665
  askAi,
14649
14666
  buildChoiceOutput,
14650
14667
  downloadFile,
14668
+ exportApp,
14651
14669
  exportQuery,
14652
14670
  hostSpec,
14653
14671
  installRpcTransport,
package/dist/mock.d.ts CHANGED
@@ -10,6 +10,7 @@ import type { QueryAggregate } from "./shared_types.js";
10
10
  import type { WorkflowResult } from "./hooks.js";
11
11
  import type { MockAgent } from "./mock_agent_run.js";
12
12
  import type { ExportedFile } from "./shared_types.js";
13
+ import type { ExportNarrowing } from "./shared_types.js";
13
14
  import type { ExportCall, QuerySortKey } from "./shared_types.js";
14
15
  import type { RecordingState } from "./recording_state.js";
15
16
  /** A result, or a function of the inputs — return a slow promise to review the pending state. */
@@ -29,6 +30,8 @@ export type MockQuery = Array<Record<string, unknown>> | ((call: MockQueryCall)
29
30
  export type MockExport = (call: ExportCall & {
30
31
  alias: string;
31
32
  }) => ExportedFile | Promise<ExportedFile>;
33
+ /** The file an Export of the app makes of its narrowing, as a function of the call — return a slow promise to review the pending state. */
34
+ export type MockExportApp = (narrowing: ExportNarrowing) => ExportedFile | Promise<ExportedFile>;
32
35
  export interface AppFixture {
33
36
  queries?: Record<string, MockQuery>;
34
37
  workflows?: Record<string, MockWorkflow>;
@@ -36,6 +39,8 @@ export interface AppFixture {
36
39
  agents?: Record<string, MockAgent>;
37
40
  /** By the query exported. */
38
41
  exports?: Record<string, MockExport>;
42
+ /** By the key of the Export made. */
43
+ exportApps?: Record<string, MockExportApp>;
39
44
  /** `useRecording(alias)` reads as available; `start`/`stop` change nothing. */
40
45
  recordings?: Record<string, RecordingState>;
41
46
  }
@@ -50,4 +55,6 @@ export declare function getMockWorkflow(alias: string): MockWorkflow | null;
50
55
  export declare function getMockAgent(alias: string): MockAgent | null;
51
56
  /** Null for an unmocked alias, which the server exports. */
52
57
  export declare function getMockExport(alias: string): MockExport | null;
58
+ /** Null for an unmocked key, which the server exports. */
59
+ export declare function getMockExportApp(key: string): MockExportApp | null;
53
60
  export declare function getMockRecordings(): Record<string, RecordingState> | null;
package/dist/queries.d.ts CHANGED
@@ -2,6 +2,7 @@ import type { QueryAggregate } from "./shared_types.js";
2
2
  import type { AppQueries, AppQueryColumns } from "./types.js";
3
3
  import type { ResolvedOption } from "./shared_types.js";
4
4
  import type { ExportedFile } from "./shared_types.js";
5
+ import type { ExportNarrowing } from "./shared_types.js";
5
6
  import type { ExportCall, QueryFilter, QueryRow, QuerySortKey } from "./shared_types.js";
6
7
  /**
7
8
  * The row type of alias `K`: its projected columns plus the two addressing
@@ -152,6 +153,13 @@ export declare function queryAll(alias: string, params?: Record<string, unknown>
152
153
  * Resolves a link to download the file, signed for at most an hour.
153
154
  */
154
155
  export declare function exportQuery(alias: string, call: ExportCall): Promise<ExportedFile>;
156
+ /**
157
+ * The file the server makes of one Export of the app — named by its `key` — over the register as `narrowing` states it
158
+ * (the tab, status, chips, search, period, window, order, grouping and folder; `per` the value a report of one is made
159
+ * for). The server reads the rows, the band's readings and the names, under the caller's own access. Resolves a link to
160
+ * download the file, signed for at most an hour.
161
+ */
162
+ export declare function exportApp(key: string, narrowing: ExportNarrowing): Promise<ExportedFile>;
155
163
  /** One select column's full option set. */
156
164
  export interface FieldOptions {
157
165
  /** The source field's display name. */
@@ -1,4 +1,4 @@
1
- import type { AppFile } from "./row.js";
1
+ import type { AppFile } from "./shared_types.js";
2
2
  /**
3
3
  * A file under another name: a NEW file over the same bytes, its extension kept exactly (`"scan.pdf"` →
4
4
  * `"Invoice 9.pdf"`, never `.html`). Nothing holds it until a save puts it in the old one's place — a files field's
package/dist/router.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  isEmbedded,
3
3
  postHostNotification,
4
4
  setUrlParams
5
- } from "./chunk-BWMAO5IY.js";
5
+ } from "./chunk-YONY7UPS.js";
6
6
 
7
7
  // src/router.tsx
8
8
  import { useEffect } from "react";
package/dist/row.d.ts CHANGED
@@ -5,34 +5,6 @@
5
5
  */
6
6
  /** The column a predicted row carries, so no surface opens a row the server has not answered for. */
7
7
  export declare const PENDING = "__pending";
8
- /** A files cell entry; `url`/`thumbnail_url` are presigned (24h) and load from the sandboxed frame. */
9
- export interface AppFile {
10
- id: string;
11
- filename: string;
12
- mime_type: string;
13
- url: string;
14
- thumbnail_url?: string;
15
- /** Bytes; absent on older files — sort by the raw number, format at display. */
16
- size?: number | null;
17
- /** ISO upload timestamp. */
18
- created_at?: string;
19
- /** The document template the file was generated from (`dtl_…`); absent on a file a person brought. */
20
- document_template_id?: string;
21
- /** Where the device that took the photo stood as it took it, as it reported; absent on a file uploaded with none, and
22
- * on every read of an app not declaring `capabilities.photo_places` or by a caller outside its organization. */
23
- place?: PhotoPlace;
24
- }
25
- /** Where a device stood: degrees north and east, and how many metres off it said it may be. */
26
- export interface PhotoPlace {
27
- latitude: number;
28
- longitude: number;
29
- accuracy: number;
30
- }
31
- /**
32
- * The presigned files, skipping any without a `url`. A lookup arrives one
33
- * level deeper, flattened as in {@link readLinks}.
34
- */
35
- export declare function readFiles(v: unknown): AppFile[];
36
8
  /**
37
9
  * Whether the row's record is locked (`__source_locked`): its table refuses
38
10
  * every write to it until a manager unlocks it, and an app reads it
package/dist/rpc.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { AppAbsence } from "./shared_types.js";
2
- import type { AppFile } from "./shared_types.js";
2
+ import type { SpecFile } from "./shared_types.js";
3
3
  import type { AskUserChoiceOutput } from "./agent_stream.js";
4
4
  import { type UrlParams, type UrlParamsPatch } from "./url_params.js";
5
5
  /**
@@ -104,7 +104,7 @@ export type RpcTransport = (op: RpcOp, payload: unknown) => Promise<unknown>;
104
104
  * last install wins, and a page installs its own before it mounts. */
105
105
  export declare function installRpcTransport(transport: RpcTransport): void;
106
106
  /** What the host answers `spec`: the app's compiled spec itself, never the route's wrapper around it. */
107
- export type HostSpec = AppFile;
107
+ export type HostSpec = SpecFile;
108
108
  /** The app's spec, as the host hands it over the bridge. */
109
109
  export declare function hostSpec(): Promise<HostSpec>;
110
110
  export declare function rpc<T = unknown>(op: RpcOp, payload: unknown): Promise<T>;