@freeappstore/sdk 0.21.6 → 0.21.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/README.md CHANGED
@@ -6,8 +6,11 @@ PWA lifecycle APIs live at `@freeappstore/sdk/pwa`, with Vite options at
6
6
  `@freeappstore/sdk/pwa-config`. See [safe updates and offline capabilities](https://github.com/freeappstore-online/platform/blob/main/docs/pwa-lifecycle.md).
7
7
 
8
8
  Device-local preferences, IndexedDB, and large-file metadata live at
9
- `@freeappstore/sdk/persist`. That data is not the signed-in account. Account
10
- keys remain `fas.kv`. A failed save returns a status instead of throwing a
9
+ `@freeappstore/sdk/persist`. This is where app data lives: FreeAppStore stores
10
+ no application data on the server ([ADR-004](https://github.com/freeappstore-online/platform/blob/main/docs/adr/004-no-server-app-data.md)).
11
+ `fas.kv`, `fas.collections`, data rooms and `fas.photos` are deprecated for app
12
+ data and kept only for existing apps; multi-user or server-backed data belongs on
13
+ [ProAppStore](https://proappstore.online). A failed save returns a status instead of throwing a
11
14
  success path, and corrupt values are left in place. See
12
15
  [device-local persistence](https://github.com/freeappstore-online/platform/blob/main/docs/sdk.md#device-local-persistence-freeappstoresdkpersist).
13
16
 
@@ -65,15 +68,15 @@ await fas.auth.init(); // capture callback, must be called once
65
68
  | Model | Service | Guarantee |
66
69
  | --- | --- | --- |
67
70
  | Device-local | `@freeappstore/sdk/persist` | This browser profile and origin only; not account sync. |
68
- | Private per-account | `fas.kv` | Server-side `(appId, userId)` isolation; authentication required. |
69
- | Shared documents | `fas.collections` | Owner-only until the app owner shares the collection (`fas db share`); then public reads, owner-only writes. A shared collection is public even when a query filters by owner. |
70
- | Room-restricted | Backend data-room HTTP API | Authenticated endpoints enforce room membership. They are separate from public collections and realtime room broadcasts; the SDK does not yet provide a wrapper. See the [data-room API](../../docs/data-rooms.md). |
71
+ | Private per-account (deprecated, ADR-004) | `fas.kv` | Server-side `(appId, userId)` isolation; authentication required. |
72
+ | Shared documents (deprecated, ADR-004) | `fas.collections` | Owner-only until the app owner shares the collection (`fas db share`); then public reads, owner-only writes. A shared collection is public even when a query filters by owner. |
73
+ | Room-restricted (deprecated, ADR-004) | Backend data-room HTTP API | Authenticated endpoints enforce room membership. They are separate from public collections and realtime room broadcasts; the SDK does not yet provide a wrapper. See the [data-room API](../../docs/data-rooms.md). |
71
74
 
72
75
  A collection is `'private'` (owner-only) by default. `fas.collections.collection(name, { visibility: 'public-read' })` declares in code that the collection is shared; the server enforces what the app owner set with `fas db share`. Any other visibility is rejected by the SDK type and runtime.
73
76
 
74
77
  ### Per-user KV
75
78
 
76
- Private per-account cloud storage scoped to `(appId, userId)` server-side. Use it for data that follows a signed-in user across devices. Requests require the account; do not gate unrelated public screens behind sign-in.
79
+ **Deprecated for app data (ADR-004); existing apps only.** Private per-account cloud storage scoped to `(appId, userId)` server-side. Use it for data that follows a signed-in user across devices. Requests require the account; do not gate unrelated public screens behind sign-in.
77
80
 
78
81
  ```ts
79
82
  await fas.kv.set('theme', { color: 'plum' });
@@ -129,7 +132,7 @@ Rooms provide ephemeral realtime broadcast, not durable storage. Rooms are open
129
132
 
130
133
  ### Collections (document database)
131
134
 
132
- Document store for queryable data. Documents are private to their owner by default; `fas db share <collection>` lets everyone read a collection (authenticated owners still write only their own). `owner` can only be your own id, and `_owner` is hidden from other users. No SQL required — just JSON in, JSON out.
135
+ **Deprecated for app data (ADR-004); existing apps only.** Document store for queryable data. Documents are private to their owner by default; `fas db share <collection>` lets everyone read a collection (authenticated owners still write only their own). `owner` can only be your own id, and `_owner` is hidden from other users. No SQL required — just JSON in, JSON out.
133
136
 
134
137
  ```ts
135
138
  const posts = fas.collections.collection('posts', { visibility: 'public-read' });
@@ -332,6 +335,8 @@ The connected draft hook and example are a supported SDK recipe. The canonical g
332
335
 
333
336
  ## Temporary photos (`fas.photos`)
334
337
 
338
+ **Deprecated for app data (ADR-004); existing apps only.** Keep new photos on the device (`openFileStore` / `putFile`).
339
+
335
340
  ```ts
336
341
  const photo = await fas.photos.upload(file, { visibility: 'public' });
337
342
  // photo.url works in <img>; photo.expiresAt is an epoch timestamp in milliseconds.
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Local AI bridge (`@freeappstore/sdk/bridge`): lets an AI client on the user's
3
+ * machine (Claude Code, Claude Desktop) call tools this app defines, through the
4
+ * FreeAppStore desktop app's local MCP server. The tools run here, in the tab, on
5
+ * the app's local data; nothing goes to a server.
6
+ *
7
+ * Inside a FreeAppStore desktop window the bridge uses the window's IPC channel.
8
+ * In a normal browser tab it connects to the desktop app over
9
+ * `ws://127.0.0.1:47821/bridge`, and reconnects quietly while enabled.
10
+ */
11
+ /** JSON Schema describing a tool's arguments (an object schema). */
12
+ export type JsonSchema = {
13
+ type?: string;
14
+ } & Record<string, unknown>;
15
+ export interface AppTool {
16
+ /** Tool name, unique within the app, e.g. `read_range`. */
17
+ name: string;
18
+ /** What the tool does and when to use it; the AI reads this. */
19
+ description: string;
20
+ /** JSON Schema for the arguments object. */
21
+ inputSchema: JsonSchema;
22
+ /** Runs the tool. Return any JSON-serialisable value; throw to report an error. */
23
+ handler: (args: Record<string, any>) => unknown;
24
+ }
25
+ /** `connected`: the desktop app can call the tools. `rejected`: it refused this app (no retry). */
26
+ export type BridgeStatus = 'off' | 'connecting' | 'connected' | 'rejected';
27
+ export interface ExposeToolsOptions {
28
+ tools: AppTool[];
29
+ /** Whether the AI may call the tools now, e.g. an "Allow AI access" toggle. Default true. */
30
+ enabled?: boolean;
31
+ /** Defaults to the `<id>` of `<id>.freeappstore.online`; required on other hosts (local dev). */
32
+ appId?: string;
33
+ onStatus?: (status: BridgeStatus) => void;
34
+ /** Desktop bridge URL. Default `ws://127.0.0.1:47821/bridge`. */
35
+ url?: string;
36
+ }
37
+ export interface ToolBridge {
38
+ readonly status: BridgeStatus;
39
+ /** Turn AI access on or off without recreating the bridge. */
40
+ setEnabled(enabled: boolean): void;
41
+ /** Stop for good: disconnects and stops reconnecting. */
42
+ close(): void;
43
+ }
44
+ /** The IPC channel the desktop app's preload exposes to its app windows. */
45
+ export interface DesktopBridgeChannel {
46
+ send(message: string): void;
47
+ onMessage(listener: (message: string) => void): void;
48
+ }
49
+ export declare const BRIDGE_URL = "ws://127.0.0.1:47821/bridge";
50
+ /** Largest message either side sends or accepts, in bytes. */
51
+ export declare const BRIDGE_MAX_MESSAGE_BYTES: number;
52
+ /**
53
+ * Offer `tools` to a local AI client through the FreeAppStore desktop app.
54
+ *
55
+ * ```ts
56
+ * const bridge = exposeTools({
57
+ * enabled: allowAi,
58
+ * tools: [{
59
+ * name: 'sum_range',
60
+ * description: 'Sum the numbers in a range such as A1:A10.',
61
+ * inputSchema: { type: 'object', properties: { range: { type: 'string' } }, required: ['range'] },
62
+ * handler: ({ range }) => sheet.sum(range),
63
+ * }],
64
+ * });
65
+ * bridge.setEnabled(false);
66
+ * ```
67
+ */
68
+ export declare function exposeTools(options: ExposeToolsOptions): ToolBridge;
69
+ //# sourceMappingURL=bridge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bridge.d.ts","sourceRoot":"","sources":["../src/bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,oEAAoE;AACpE,MAAM,MAAM,UAAU,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAErE,MAAM,WAAW,OAAO;IACtB,2DAA2D;IAC3D,IAAI,EAAE,MAAM,CAAC;IACb,gEAAgE;IAChE,WAAW,EAAE,MAAM,CAAC;IACpB,4CAA4C;IAC5C,WAAW,EAAE,UAAU,CAAC;IACxB,mFAAmF;IAEnF,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,OAAO,CAAC;CACjD;AAED,mGAAmG;AACnG,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG,YAAY,GAAG,WAAW,GAAG,UAAU,CAAC;AAE3E,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,OAAO,EAAE,CAAC;IACjB,6FAA6F;IAC7F,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,iGAAiG;IACjG,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,CAAC;IAC1C,iEAAiE;IACjE,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,8DAA8D;IAC9D,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IACnC,yDAAyD;IACzD,KAAK,IAAI,IAAI,CAAC;CACf;AAED,4EAA4E;AAC5E,MAAM,WAAW,oBAAoB;IACnC,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,SAAS,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI,CAAC;CACtD;AAED,eAAO,MAAM,UAAU,gCAAgC,CAAC;AACxD,8DAA8D;AAC9D,eAAO,MAAM,wBAAwB,QAAc,CAAC;AAepD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,UAAU,CAsKnE"}
package/dist/bridge.js ADDED
@@ -0,0 +1,212 @@
1
+ /**
2
+ * Local AI bridge (`@freeappstore/sdk/bridge`): lets an AI client on the user's
3
+ * machine (Claude Code, Claude Desktop) call tools this app defines, through the
4
+ * FreeAppStore desktop app's local MCP server. The tools run here, in the tab, on
5
+ * the app's local data; nothing goes to a server.
6
+ *
7
+ * Inside a FreeAppStore desktop window the bridge uses the window's IPC channel.
8
+ * In a normal browser tab it connects to the desktop app over
9
+ * `ws://127.0.0.1:47821/bridge`, and reconnects quietly while enabled.
10
+ */
11
+ export const BRIDGE_URL = 'ws://127.0.0.1:47821/bridge';
12
+ /** Largest message either side sends or accepts, in bytes. */
13
+ export const BRIDGE_MAX_MESSAGE_BYTES = 1024 * 1024;
14
+ /** WebSocket close code the desktop app uses when it refuses an app. */
15
+ const POLICY_VIOLATION = 1008;
16
+ const RETRY_MIN_MS = 1000;
17
+ const RETRY_MAX_MS = 30_000;
18
+ const byteLength = (text) => new TextEncoder().encode(text).length;
19
+ function defaultAppId() {
20
+ const host = typeof location === 'undefined' ? '' : location.hostname;
21
+ return /^([a-z0-9][a-z0-9-]*)\.freeappstore\.online$/.exec(host)?.[1];
22
+ }
23
+ /**
24
+ * Offer `tools` to a local AI client through the FreeAppStore desktop app.
25
+ *
26
+ * ```ts
27
+ * const bridge = exposeTools({
28
+ * enabled: allowAi,
29
+ * tools: [{
30
+ * name: 'sum_range',
31
+ * description: 'Sum the numbers in a range such as A1:A10.',
32
+ * inputSchema: { type: 'object', properties: { range: { type: 'string' } }, required: ['range'] },
33
+ * handler: ({ range }) => sheet.sum(range),
34
+ * }],
35
+ * });
36
+ * bridge.setEnabled(false);
37
+ * ```
38
+ */
39
+ export function exposeTools(options) {
40
+ const channel = globalThis.fasDesktopBridge;
41
+ const appId = options.appId ?? defaultAppId();
42
+ if (!channel && !appId) {
43
+ throw new Error('exposeTools: pass appId when the app is not served from <id>.freeappstore.online');
44
+ }
45
+ const tools = new Map(options.tools.map((tool) => [tool.name, tool]));
46
+ let enabled = options.enabled ?? true;
47
+ let closed = false;
48
+ let status = 'off';
49
+ let socket;
50
+ let retryDelay = RETRY_MIN_MS;
51
+ let retryTimer;
52
+ const setStatus = (next) => {
53
+ if (next === status)
54
+ return;
55
+ status = next;
56
+ options.onStatus?.(next);
57
+ };
58
+ const registration = () => JSON.stringify({
59
+ type: 'register',
60
+ ...(appId ? { appId } : {}),
61
+ title: typeof document === 'undefined' ? '' : document.title,
62
+ tools: options.tools.map(({ name, description, inputSchema }) => ({
63
+ name,
64
+ description,
65
+ inputSchema,
66
+ })),
67
+ });
68
+ async function reply(message) {
69
+ const tool = tools.get(message.tool);
70
+ if (!tool) {
71
+ const names = [...tools.keys()].join(', ') || 'none';
72
+ return JSON.stringify({
73
+ type: 'result',
74
+ id: message.id,
75
+ ok: false,
76
+ error: `Unknown tool "${message.tool}". Tools: ${names}.`,
77
+ });
78
+ }
79
+ try {
80
+ const result = await tool.handler(message.args ?? {});
81
+ const text = JSON.stringify({
82
+ type: 'result',
83
+ id: message.id,
84
+ ok: true,
85
+ result: result ?? null,
86
+ });
87
+ if (byteLength(text) <= BRIDGE_MAX_MESSAGE_BYTES)
88
+ return text;
89
+ return JSON.stringify({
90
+ type: 'result',
91
+ id: message.id,
92
+ ok: false,
93
+ error: `${message.tool} returned more than 1 MB. Ask for less data, e.g. a smaller range.`,
94
+ });
95
+ }
96
+ catch (error) {
97
+ return JSON.stringify({
98
+ type: 'result',
99
+ id: message.id,
100
+ ok: false,
101
+ error: error instanceof Error ? error.message : String(error),
102
+ });
103
+ }
104
+ }
105
+ async function receive(text, send) {
106
+ if (!enabled || byteLength(text) > BRIDGE_MAX_MESSAGE_BYTES)
107
+ return;
108
+ let message;
109
+ try {
110
+ message = JSON.parse(text);
111
+ }
112
+ catch {
113
+ return;
114
+ }
115
+ if (message?.type !== 'call' || typeof message.id !== 'string')
116
+ return;
117
+ send(await reply(message));
118
+ }
119
+ // ── Desktop window: IPC, no network ──────────────────────────
120
+ if (channel) {
121
+ channel.onMessage((text) => void receive(text, (out) => channel.send(out)));
122
+ const apply = () => {
123
+ if (closed)
124
+ return;
125
+ channel.send(enabled ? registration() : JSON.stringify({ type: 'unregister' }));
126
+ setStatus(enabled ? 'connected' : 'off');
127
+ };
128
+ if (enabled)
129
+ apply();
130
+ return {
131
+ get status() {
132
+ return status;
133
+ },
134
+ setEnabled(next) {
135
+ if (closed || next === enabled)
136
+ return;
137
+ enabled = next;
138
+ apply();
139
+ },
140
+ close() {
141
+ if (closed)
142
+ return;
143
+ if (enabled)
144
+ channel.send(JSON.stringify({ type: 'unregister' }));
145
+ closed = true;
146
+ setStatus('off');
147
+ },
148
+ };
149
+ }
150
+ // ── Browser tab: WebSocket to the desktop app ────────────────
151
+ const url = options.url ?? BRIDGE_URL;
152
+ function connect() {
153
+ if (closed || !enabled || socket || typeof WebSocket === 'undefined')
154
+ return;
155
+ setStatus('connecting');
156
+ const ws = new WebSocket(url);
157
+ socket = ws;
158
+ ws.onopen = () => {
159
+ retryDelay = RETRY_MIN_MS;
160
+ ws.send(registration());
161
+ setStatus('connected');
162
+ };
163
+ ws.onmessage = (event) => {
164
+ if (typeof event.data === 'string')
165
+ void receive(event.data, (out) => ws.send(out));
166
+ };
167
+ ws.onclose = (event) => {
168
+ if (socket !== ws)
169
+ return;
170
+ socket = undefined;
171
+ if (event.code === POLICY_VIOLATION) {
172
+ setStatus('rejected');
173
+ return;
174
+ }
175
+ if (closed || !enabled)
176
+ return setStatus('off');
177
+ setStatus('connecting');
178
+ retryTimer = setTimeout(connect, retryDelay);
179
+ retryDelay = Math.min(retryDelay * 2, RETRY_MAX_MS);
180
+ };
181
+ }
182
+ function disconnect() {
183
+ clearTimeout(retryTimer);
184
+ retryTimer = undefined;
185
+ const ws = socket;
186
+ socket = undefined;
187
+ ws?.close();
188
+ setStatus('off');
189
+ }
190
+ connect();
191
+ return {
192
+ get status() {
193
+ return status;
194
+ },
195
+ setEnabled(next) {
196
+ if (closed || next === enabled)
197
+ return;
198
+ enabled = next;
199
+ if (enabled) {
200
+ retryDelay = RETRY_MIN_MS;
201
+ connect();
202
+ }
203
+ else
204
+ disconnect();
205
+ },
206
+ close() {
207
+ closed = true;
208
+ disconnect();
209
+ },
210
+ };
211
+ }
212
+ //# sourceMappingURL=bridge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bridge.js","sourceRoot":"","sources":["../src/bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AA6CH,MAAM,CAAC,MAAM,UAAU,GAAG,6BAA6B,CAAC;AACxD,8DAA8D;AAC9D,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI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GAAG,SAAS,CAAC;QACnB,EAAE,EAAE,KAAK,EAAE,CAAC;QACZ,SAAS,CAAC,KAAK,CAAC,CAAC;IACnB,CAAC;IAED,OAAO,EAAE,CAAC;IACV,OAAO;QACL,IAAI,MAAM;YACR,OAAO,MAAM,CAAC;QAChB,CAAC;QACD,UAAU,CAAC,IAAI;YACb,IAAI,MAAM,IAAI,IAAI,KAAK,OAAO;gBAAE,OAAO;YACvC,OAAO,GAAG,IAAI,CAAC;YACf,IAAI,OAAO,EAAE,CAAC;gBACZ,UAAU,GAAG,YAAY,CAAC;gBAC1B,OAAO,EAAE,CAAC;YACZ,CAAC;;gBAAM,UAAU,EAAE,CAAC;QACtB,CAAC;QACD,KAAK;YACH,MAAM,GAAG,IAAI,CAAC;YACd,UAAU,EAAE,CAAC;QACf,CAAC;KACF,CAAC;AACJ,CAAC"}
package/dist/logger.d.ts CHANGED
@@ -35,7 +35,7 @@ export interface BuildMeta {
35
35
  viewport: string;
36
36
  theme?: string | undefined;
37
37
  }
38
- export declare const SDK_VERSION = "0.21.6";
38
+ export declare const SDK_VERSION = "0.21.8";
39
39
  export declare class Logger {
40
40
  private readonly appId;
41
41
  private readonly apiBase;
package/dist/logger.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { authedFetch } from './authed-fetch.js';
2
2
  // Must track package.json version — bumped on release. Guarded by version.test.ts
3
3
  // so a forgotten bump fails CI instead of silently misattributing telemetry.
4
- export const SDK_VERSION = '0.21.6';
4
+ export const SDK_VERSION = '0.21.8';
5
5
  const MEMORY_LIMIT = 200;
6
6
  const STORAGE_LIMIT = 500;
7
7
  const STORAGE_KEY_PREFIX = 'fas_logs:';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@freeappstore/sdk",
3
- "version": "0.21.6",
3
+ "version": "0.21.8",
4
4
  "description": "Browser SDK for FreeAppStore — auth, KV, collections, counters, rooms, proxy, encrypted user keys, roles, friends, email, push reminders, device-local persistence, validated backup and file export, React hooks, and UI components.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -50,6 +50,10 @@
50
50
  "./generation-kokoro/worker": {
51
51
  "types": "./dist/generation-kokoro/worker.d.ts",
52
52
  "import": "./dist/generation-kokoro/worker.js"
53
+ },
54
+ "./bridge": {
55
+ "types": "./dist/bridge.d.ts",
56
+ "import": "./dist/bridge.js"
53
57
  }
54
58
  },
55
59
  "homepage": "https://github.com/freeappstore-online/platform#readme",