@lotics/app-sdk 0.100.1 → 0.101.1

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.
Files changed (108) hide show
  1. package/AGENTS.md +32 -47
  2. package/dist/agent_stream.d.ts +131 -0
  3. package/dist/ask_ai.d.ts +27 -0
  4. package/dist/attachments.d.ts +58 -0
  5. package/dist/chunk-ARV5FAU5.js +1132 -0
  6. package/dist/comments.d.ts +89 -0
  7. package/dist/error_report.d.ts +9 -0
  8. package/dist/folder_pick.d.ts +8 -0
  9. package/dist/geolocation.d.ts +42 -0
  10. package/dist/hooks.d.ts +251 -0
  11. package/dist/{src/index.d.ts → index.d.ts} +13 -22
  12. package/dist/index.js +31331 -0
  13. package/dist/index.js.LEGAL.txt +11 -0
  14. package/dist/members.d.ts +32 -0
  15. package/dist/mock.d.ts +37 -0
  16. package/dist/mount.d.ts +19 -0
  17. package/dist/new_record.d.ts +37 -0
  18. package/dist/open_app.d.ts +12 -0
  19. package/dist/open_external.d.ts +10 -0
  20. package/dist/overlay.d.ts +25 -0
  21. package/dist/queries.d.ts +231 -0
  22. package/dist/recording.d.ts +47 -0
  23. package/dist/recording_state.d.ts +43 -0
  24. package/dist/rename_file.d.ts +13 -0
  25. package/dist/router.d.ts +10 -0
  26. package/dist/router.js +97 -0
  27. package/dist/row.d.ts +87 -0
  28. package/dist/rpc.d.ts +114 -0
  29. package/dist/select.d.ts +24 -0
  30. package/dist/shared_types.d.ts +8 -0
  31. package/dist/store.d.ts +43 -0
  32. package/dist/types.d.ts +36 -0
  33. package/dist/upload/optimize.d.ts +30 -0
  34. package/dist/upload/pipeline.d.ts +36 -0
  35. package/dist/upload/transport.d.ts +19 -0
  36. package/dist/url_params.d.ts +55 -0
  37. package/dist/use_recents.d.ts +15 -0
  38. package/dist/{src/use_url_state.d.ts → use_url_state.d.ts} +0 -2
  39. package/dist/viewer.d.ts +41 -0
  40. package/dist/written.d.ts +79 -0
  41. package/docs/ai.md +74 -133
  42. package/docs/data_fetching.md +209 -290
  43. package/docs/files.md +61 -51
  44. package/docs/members_and_options.md +92 -62
  45. package/docs/mutations.md +136 -205
  46. package/docs/navigation_and_state.md +26 -35
  47. package/docs/queries.md +144 -207
  48. package/docs/recipes.md +21 -45
  49. package/docs/runtime.md +74 -137
  50. package/docs/security.md +8 -11
  51. package/docs/workflows.md +189 -174
  52. package/package.json +27 -28
  53. package/dist/src/agent_stream.d.ts +0 -200
  54. package/dist/src/agent_stream.js +0 -314
  55. package/dist/src/ask_ai.d.ts +0 -40
  56. package/dist/src/ask_ai.js +0 -35
  57. package/dist/src/attachments.d.ts +0 -68
  58. package/dist/src/attachments.js +0 -93
  59. package/dist/src/comments.d.ts +0 -127
  60. package/dist/src/comments.js +0 -192
  61. package/dist/src/download.js +0 -54
  62. package/dist/src/geolocation.d.ts +0 -64
  63. package/dist/src/geolocation.js +0 -96
  64. package/dist/src/hooks.d.ts +0 -781
  65. package/dist/src/hooks.js +0 -860
  66. package/dist/src/index.js +0 -34
  67. package/dist/src/members.d.ts +0 -105
  68. package/dist/src/members.js +0 -62
  69. package/dist/src/mock.d.ts +0 -118
  70. package/dist/src/mock.js +0 -124
  71. package/dist/src/mount.d.ts +0 -47
  72. package/dist/src/mount.js +0 -34
  73. package/dist/src/new_record.d.ts +0 -74
  74. package/dist/src/new_record.js +0 -117
  75. package/dist/src/open_app.d.ts +0 -15
  76. package/dist/src/open_app.js +0 -18
  77. package/dist/src/open_external.d.ts +0 -16
  78. package/dist/src/open_external.js +0 -19
  79. package/dist/src/recording.d.ts +0 -59
  80. package/dist/src/recording.js +0 -30
  81. package/dist/src/recording_state.d.ts +0 -59
  82. package/dist/src/recording_state.js +0 -94
  83. package/dist/src/router.d.ts +0 -17
  84. package/dist/src/router.js +0 -144
  85. package/dist/src/row.d.ts +0 -159
  86. package/dist/src/row.js +0 -254
  87. package/dist/src/rpc.d.ts +0 -207
  88. package/dist/src/rpc.js +0 -904
  89. package/dist/src/select.d.ts +0 -48
  90. package/dist/src/select.js +0 -40
  91. package/dist/src/types.d.ts +0 -115
  92. package/dist/src/types.js +0 -1
  93. package/dist/src/upload/optimize.d.ts +0 -54
  94. package/dist/src/upload/optimize.js +0 -207
  95. package/dist/src/upload/pipeline.d.ts +0 -55
  96. package/dist/src/upload/pipeline.js +0 -52
  97. package/dist/src/upload/transport.d.ts +0 -42
  98. package/dist/src/upload/transport.js +0 -128
  99. package/dist/src/url_params.d.ts +0 -93
  100. package/dist/src/url_params.js +0 -215
  101. package/dist/src/use_optimistic.d.ts +0 -27
  102. package/dist/src/use_optimistic.js +0 -27
  103. package/dist/src/use_recents.d.ts +0 -19
  104. package/dist/src/use_recents.js +0 -71
  105. package/dist/src/use_url_state.js +0 -73
  106. package/dist/src/viewer.d.ts +0 -26
  107. package/dist/src/viewer.js +0 -47
  108. /package/dist/{src/download.d.ts → download.d.ts} +0 -0
@@ -1,26 +0,0 @@
1
- /**
2
- * Read the app's context once, shared across every hook via a stable SWR key.
3
- * The host (the product iframe, or `lotics app dev`) supplies the signed-in
4
- * member and the app's declared capabilities.
5
- */
6
- export declare function useAppContext(): {
7
- memberId: string | null;
8
- commentsEnabled: boolean;
9
- recordingEnabled: boolean;
10
- resolved: boolean;
11
- };
12
- /**
13
- * The signed-in member currently viewing the app — the **view-as target** under
14
- * an admin's "View as" (product UI or `lotics app dev --view-as`), the
15
- * authenticated member otherwise, and `null` for a public/standalone visitor or
16
- * until the context resolves (gate viewer-dependent UI on `loading`).
17
- *
18
- * Use it to personalize (greet the member, default an assignment to them) or to
19
- * pass the viewer into a workflow that must attribute to them. **Per-row data
20
- * scoping does NOT need this** — put an `is_current_member` filter in the query
21
- * template and the server resolves it to the same member (honoring view-as).
22
- */
23
- export declare function useViewer(): {
24
- memberId: string | null;
25
- loading: boolean;
26
- };
@@ -1,47 +0,0 @@
1
- import useSWR from "swr";
2
- import { rpc } from "./rpc.js";
3
- import { readRecordingSnapshot, replaceRecordings } from "./recording_state.js";
4
- /**
5
- * The context, with its recording snapshot applied in the same task the
6
- * answer arrived in — before any later host push is handled, so the snapshot
7
- * can never overwrite a newer push.
8
- */
9
- async function fetchContext() {
10
- const context = await rpc("context", {});
11
- replaceRecordings(readRecordingSnapshot(context.recordings));
12
- return context;
13
- }
14
- /**
15
- * Read the app's context once, shared across every hook via a stable SWR key.
16
- * The host (the product iframe, or `lotics app dev`) supplies the signed-in
17
- * member and the app's declared capabilities.
18
- */
19
- export function useAppContext() {
20
- const { data } = useSWR("app-context", fetchContext, {
21
- revalidateOnFocus: false,
22
- revalidateIfStale: false,
23
- revalidateOnReconnect: false,
24
- shouldRetryOnError: false,
25
- });
26
- return {
27
- memberId: data?.member_id ?? null,
28
- commentsEnabled: data?.comments_enabled ?? false,
29
- recordingEnabled: data?.recording_enabled === true,
30
- resolved: data !== undefined,
31
- };
32
- }
33
- /**
34
- * The signed-in member currently viewing the app — the **view-as target** under
35
- * an admin's "View as" (product UI or `lotics app dev --view-as`), the
36
- * authenticated member otherwise, and `null` for a public/standalone visitor or
37
- * until the context resolves (gate viewer-dependent UI on `loading`).
38
- *
39
- * Use it to personalize (greet the member, default an assignment to them) or to
40
- * pass the viewer into a workflow that must attribute to them. **Per-row data
41
- * scoping does NOT need this** — put an `is_current_member` filter in the query
42
- * template and the server resolves it to the same member (honoring view-as).
43
- */
44
- export function useViewer() {
45
- const ctx = useAppContext();
46
- return { memberId: ctx.memberId, loading: !ctx.resolved };
47
- }
File without changes