@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.
- package/AGENTS.md +32 -47
- package/dist/agent_stream.d.ts +131 -0
- package/dist/ask_ai.d.ts +27 -0
- package/dist/attachments.d.ts +58 -0
- package/dist/chunk-ARV5FAU5.js +1132 -0
- package/dist/comments.d.ts +89 -0
- package/dist/error_report.d.ts +9 -0
- package/dist/folder_pick.d.ts +8 -0
- package/dist/geolocation.d.ts +42 -0
- package/dist/hooks.d.ts +251 -0
- package/dist/{src/index.d.ts → index.d.ts} +13 -22
- package/dist/index.js +31331 -0
- package/dist/index.js.LEGAL.txt +11 -0
- package/dist/members.d.ts +32 -0
- package/dist/mock.d.ts +37 -0
- package/dist/mount.d.ts +19 -0
- package/dist/new_record.d.ts +37 -0
- package/dist/open_app.d.ts +12 -0
- package/dist/open_external.d.ts +10 -0
- package/dist/overlay.d.ts +25 -0
- package/dist/queries.d.ts +231 -0
- package/dist/recording.d.ts +47 -0
- package/dist/recording_state.d.ts +43 -0
- package/dist/rename_file.d.ts +13 -0
- package/dist/router.d.ts +10 -0
- package/dist/router.js +97 -0
- package/dist/row.d.ts +87 -0
- package/dist/rpc.d.ts +114 -0
- package/dist/select.d.ts +24 -0
- package/dist/shared_types.d.ts +8 -0
- package/dist/store.d.ts +43 -0
- package/dist/types.d.ts +36 -0
- package/dist/upload/optimize.d.ts +30 -0
- package/dist/upload/pipeline.d.ts +36 -0
- package/dist/upload/transport.d.ts +19 -0
- package/dist/url_params.d.ts +55 -0
- package/dist/use_recents.d.ts +15 -0
- package/dist/{src/use_url_state.d.ts → use_url_state.d.ts} +0 -2
- package/dist/viewer.d.ts +41 -0
- package/dist/written.d.ts +79 -0
- package/docs/ai.md +74 -133
- package/docs/data_fetching.md +209 -290
- package/docs/files.md +61 -51
- package/docs/members_and_options.md +92 -62
- package/docs/mutations.md +136 -205
- package/docs/navigation_and_state.md +26 -35
- package/docs/queries.md +144 -207
- package/docs/recipes.md +21 -45
- package/docs/runtime.md +74 -137
- package/docs/security.md +8 -11
- package/docs/workflows.md +189 -174
- package/package.json +27 -28
- package/dist/src/agent_stream.d.ts +0 -200
- package/dist/src/agent_stream.js +0 -314
- package/dist/src/ask_ai.d.ts +0 -40
- package/dist/src/ask_ai.js +0 -35
- package/dist/src/attachments.d.ts +0 -68
- package/dist/src/attachments.js +0 -93
- package/dist/src/comments.d.ts +0 -127
- package/dist/src/comments.js +0 -192
- package/dist/src/download.js +0 -54
- package/dist/src/geolocation.d.ts +0 -64
- package/dist/src/geolocation.js +0 -96
- package/dist/src/hooks.d.ts +0 -781
- package/dist/src/hooks.js +0 -860
- package/dist/src/index.js +0 -34
- package/dist/src/members.d.ts +0 -105
- package/dist/src/members.js +0 -62
- package/dist/src/mock.d.ts +0 -118
- package/dist/src/mock.js +0 -124
- package/dist/src/mount.d.ts +0 -47
- package/dist/src/mount.js +0 -34
- package/dist/src/new_record.d.ts +0 -74
- package/dist/src/new_record.js +0 -117
- package/dist/src/open_app.d.ts +0 -15
- package/dist/src/open_app.js +0 -18
- package/dist/src/open_external.d.ts +0 -16
- package/dist/src/open_external.js +0 -19
- package/dist/src/recording.d.ts +0 -59
- package/dist/src/recording.js +0 -30
- package/dist/src/recording_state.d.ts +0 -59
- package/dist/src/recording_state.js +0 -94
- package/dist/src/router.d.ts +0 -17
- package/dist/src/router.js +0 -144
- package/dist/src/row.d.ts +0 -159
- package/dist/src/row.js +0 -254
- package/dist/src/rpc.d.ts +0 -207
- package/dist/src/rpc.js +0 -904
- package/dist/src/select.d.ts +0 -48
- package/dist/src/select.js +0 -40
- package/dist/src/types.d.ts +0 -115
- package/dist/src/types.js +0 -1
- package/dist/src/upload/optimize.d.ts +0 -54
- package/dist/src/upload/optimize.js +0 -207
- package/dist/src/upload/pipeline.d.ts +0 -55
- package/dist/src/upload/pipeline.js +0 -52
- package/dist/src/upload/transport.d.ts +0 -42
- package/dist/src/upload/transport.js +0 -128
- package/dist/src/url_params.d.ts +0 -93
- package/dist/src/url_params.js +0 -215
- package/dist/src/use_optimistic.d.ts +0 -27
- package/dist/src/use_optimistic.js +0 -27
- package/dist/src/use_recents.d.ts +0 -19
- package/dist/src/use_recents.js +0 -71
- package/dist/src/use_url_state.js +0 -73
- package/dist/src/viewer.d.ts +0 -26
- package/dist/src/viewer.js +0 -47
- /package/dist/{src/download.d.ts → download.d.ts} +0 -0
package/dist/src/viewer.d.ts
DELETED
|
@@ -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
|
-
};
|
package/dist/src/viewer.js
DELETED
|
@@ -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
|