@lavitre/apps 1.60.0 → 1.60.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/README.md CHANGED
@@ -174,12 +174,12 @@ const stop = watchNfcTags(
174
174
  },
175
175
  {
176
176
  reader: (name) => name.includes('PICC'), // optional: by PC/SC reader name
177
- onUnavailable: () => console.log('no NFC here'), // web/PWA, companion, no `nfc` authorization, Vitre older than 26.11
177
+ onUnavailable: () => console.log('no NFC here'), // web/PWA, companion, no `nfc` authorization, native Vitre 26.11.0 or older
178
178
  },
179
179
  )
180
180
  ```
181
181
 
182
- It waits for `laVitreNative.nfc` (the host adds it shortly after load), reports a tag already on a reader as `tagPresent`, and drops a repeated `tagPresent` for the same tag. Events also include `readerAdded` / `readerRemoved`. Read-only: the UID and the ATR (the tag type), never a channel to send commands to the card; contact smart cards and virtual ones (Windows Hello) are not reported. `laVitreNative.nfc` (`getReaders`, `addTagHandler`, `removeTagHandler`) is there for apps that want the raw bridge. There is no NFC on web/PWA or the companion: no browser API reaches these readers.
182
+ It waits for `laVitreNative.nfc` (the host adds it shortly after load), reports a tag already on a reader as `tagPresent`, and drops a repeated `tagPresent` for the same tag. The handler only runs once `watchNfcTags` has returned, and an exception it throws is logged without stopping the watch (1.60.1). Events also include `readerAdded` / `readerRemoved`. Read-only: the UID and the ATR (the tag type), never a channel to send commands to the card; contact smart cards and virtual ones (Windows Hello) are not reported. `laVitreNative.nfc` (`getReaders`, `addTagHandler`, `removeTagHandler`) is there for apps that want the raw bridge. There is no NFC on web/PWA or the companion: no browser API reaches these readers.
183
183
 
184
184
  ### Native or web host — `isNativeHost`
185
185
 
@@ -163,8 +163,8 @@ export type NfcEvent = ({
163
163
  reader: string;
164
164
  };
165
165
  /**
166
- * NFC bridge exposed to apps at `window.laVitreNative.nfc` (added in the native
167
- * Vitre 26.11). It reports badges and tags put on a USB NFC reader (any PC/SC
166
+ * NFC bridge exposed to apps at `window.laVitreNative.nfc`, on a native Vitre
167
+ * released after 26.11.0 (26.11.0 and older do not have it). It reports badges and tags put on a USB NFC reader (any PC/SC
168
168
  * contactless reader: ACS ACR122U / ACR1252U, Identiv, HID Omnikey…).
169
169
  *
170
170
  * ⚠️ **Conditioned on the app manifest.** Injected **only** when the app
@@ -201,7 +201,7 @@ export type LaVitreNative = {
201
201
  serialport?: SerialPortBridge;
202
202
  /**
203
203
  * NFC tags on a USB reader. Present **only** when the app holds the `nfc`
204
- * authorization, on a native Vitre 26.11 or later — otherwise `undefined`.
204
+ * authorization, on a native Vitre released after 26.11.0 — otherwise `undefined`.
205
205
  * See {@link NfcBridge} and {@link watchNfcTags}.
206
206
  */
207
207
  nfc?: NfcBridge;
@@ -247,7 +247,8 @@ export type WatchNfcTagsOptions = {
247
247
  waitMs?: number;
248
248
  /**
249
249
  * Called once when the bridge never showed up: not a native Vitre, no `nfc`
250
- * authorization in the manifest, or a Vitre older than 26.11.
250
+ * authorization in the manifest, or a native Vitre without the bridge (26.11.0
251
+ * and older).
251
252
  */
252
253
  onUnavailable?: () => void;
253
254
  };
@@ -257,6 +258,9 @@ export type WatchNfcTagsOptions = {
257
258
  * - Waits for `laVitreNative.nfc` (see {@link WatchNfcTagsOptions.waitMs}).
258
259
  * - A tag already on a reader when watching starts is reported as `tagPresent`.
259
260
  * - A `tagPresent` repeated for a tag already reported is dropped.
261
+ * - The handler is never called before `watchNfcTags` has returned, so it can
262
+ * always call the returned `stop()`. An exception it throws is logged with
263
+ * `console.error` and does not stop the watch (since 1.60.1).
260
264
  *
261
265
  * ```ts
262
266
  * import { watchNfcTags } from '@lavitre/apps/Native'
@@ -30,6 +30,9 @@ const nfcBridgeNow = () => typeof window === 'undefined'
30
30
  * - Waits for `laVitreNative.nfc` (see {@link WatchNfcTagsOptions.waitMs}).
31
31
  * - A tag already on a reader when watching starts is reported as `tagPresent`.
32
32
  * - A `tagPresent` repeated for a tag already reported is dropped.
33
+ * - The handler is never called before `watchNfcTags` has returned, so it can
34
+ * always call the returned `stop()`. An exception it throws is logged with
35
+ * `console.error` and does not stop the watch (since 1.60.1).
33
36
  *
34
37
  * ```ts
35
38
  * import { watchNfcTags } from '@lavitre/apps/Native'
@@ -62,7 +65,12 @@ export const watchNfcTags = (handler, options = {}) => {
62
65
  return;
63
66
  tagOn.delete(event.reader);
64
67
  }
65
- handler(event);
68
+ try {
69
+ handler(event);
70
+ }
71
+ catch (error) {
72
+ console.error('[@lavitre/apps] watchNfcTags handler threw', error);
73
+ }
66
74
  };
67
75
  const attach = (nfc) => {
68
76
  // Handler first: the replay below cannot miss an arrival in between, and
@@ -89,7 +97,9 @@ export const watchNfcTags = (handler, options = {}) => {
89
97
  timer = setTimeout(poll, 200);
90
98
  }
91
99
  };
92
- poll();
100
+ // Not synchronously: with the bridge already there and a tag on a reader,
101
+ // the replay would call the handler before the caller holds `stop`.
102
+ queueMicrotask(poll);
93
103
  return () => {
94
104
  stopped = true;
95
105
  if (timer !== undefined)
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../Native/index.ts"],"names":[],"mappings":"AA+NA,yFAAyF;AACzF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAE,MAAc,CAAC,aAAa;IACzD,IAAI,CAAyB,CAAA;AAY/B,wFAAwF;AACxF,MAAM,CAAC,MAAM,YAAY,GAAG,GAAY,EAAE,CACxC,OAAO,MAAM,KAAK,WAAW,IAAK,MAAc,CAAC,aAAa,IAAI,IAAI,CAAA;AAExE,4GAA4G;AAC5G,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAoB,EAAE,CACtD,YAAY,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAA;AAEnC,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,KAAa,EAAE,YAAoB,EAAE,EAAE,CAC3E,WAAW,KAAK,uBAAuB,YAAY,EAAE,CAAA;AAEvD;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAA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;YAC5C,OAAO,CAAC,aAAa,EAAE,EAAE,CAAA;QAC3B,CAAC;aAAM,CAAC;YACN,KAAK,GAAG,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;QAC/B,CAAC;IACH,CAAC,CAAA;IACD,IAAI,EAAE,CAAA;IAEN,OAAO,GAAG,EAAE;QACV,OAAO,GAAG,IAAI,CAAA;QACd,IAAI,KAAK,KAAK,SAAS;YAAE,YAAY,CAAC,KAAK,CAAC,CAAA;QAC5C,MAAM,EAAE,EAAE,CAAA;QACV,MAAM,GAAG,SAAS,CAAA;IACpB,CAAC,CAAA;AACH,CAAC,CAAA","sourcesContent":["export type StartProcessArgs = {\n path: string\n args: string[]\n ignoreFormatPath?: boolean\n hidden?: boolean\n}\n\nexport type Capture = {\n startCapture: (options: {\n outputFile: string\n audioInput: string\n }) => Promise<void>\n stopCurrentCapture: () => void\n}\n\nexport type ReadBinaryArgs = {\n path: string\n bufferSize?: number\n position?: number\n}\n\nexport type BinaryChunkResult = {\n buffer: ArrayBufferLike\n read: number\n fileSize: number\n position: number\n}\n\nexport type DownloadProgress = {\n /** Bytes written to disk so far. */\n received: number\n /** Total bytes, when the server advertises a `Content-Length`. */\n total?: number\n}\n\nexport type DownloadFileArgs = {\n /** Source URL to fetch. */\n url: string\n /**\n * Destination path inside the app sandbox (e.g. `~/media/cover.png`). The\n * native bridge resolves it through the app path formatter, so it is scoped\n * to `<vitre-data>/apps/<appId>/...` — it cannot escape the app storage.\n */\n path: string\n /** Optional extra request headers. */\n headers?: Record<string, string>\n /** Optional progress callback fired as bytes are streamed to disk. */\n progress?: (progress: DownloadProgress) => void\n}\n\nexport type FileInfoType = 'file' | 'directory'\n\nexport type FileInfo = {\n name: string\n path: string\n type: FileInfoType\n}\nexport type Process = {\n startProcess: (args: StartProcessArgs) => void\n}\n\n/**\n * Native file I/O for the app, exposed at `window.laVitreNative.io`.\n *\n * ⚠️ **Conditioned on the app manifest.** This bridge is injected **only** when\n * the app declares a storage authorization:\n * - **`appsStorage`** — paths are confined to the app's own storage folder\n * (absolute paths, the `~~/` parent escape and `../` traversal are rejected).\n * This is what most apps want.\n * - **`fullStorage`** — unrestricted filesystem access. Use only when strictly\n * necessary.\n *\n * With neither authorization, `laVitreNative.io` is `undefined` — always\n * feature-detect (`laVitreNative?.io`) before use. It is also `undefined` off a\n * native Vitre (`laVitreNative` itself is `null` on web/PWA and the companion,\n * see {@link isNativeHost}). The host adds it shortly after the page starts\n * (an authorization round trip), so a check at load time can miss it.\n *\n * Paths use a `~/` prefix for the app's sandbox root, e.g. `~/data/x.json`; the\n * file written there is served by the Vitre's local web server at\n * {@link getLocalAppStorageUrl}`(appId, 'data/x.json')`.\n */\nexport type IO = {\n readFile: (path: string) => string\n /** True if a file exists at `path` (resolved inside the app sandbox). */\n fileExists: (path: string) => boolean\n /**\n * Write a file to the app sandbox.\n *\n * - Pass a `string` for text content (written as UTF-8).\n * - Pass an `ArrayBuffer` (or any `ArrayBufferLike`) for binary content — the\n * raw bytes are written as-is. Do **not** base64-encode binary data. For a\n * typed array, pass its `.buffer` (e.g. `new Uint8Array(...).buffer`, or\n * `await blob.arrayBuffer()`).\n */\n writeFile: (path: string, content: string | ArrayBufferLike) => void\n list: (path: string) => FileInfo[]\n createFolder: (path: string) => void\n formatPath: (path: string) => string\n deleteFile: (path: string) => void\n readBinaryFileBuffer: (args: ReadBinaryArgs) => Promise<BinaryChunkResult>\n /**\n * Download a URL straight into a file in the app sandbox. Binary-safe: the\n * response body is streamed to disk natively, so nothing is buffered in JS\n * (ideal for large media). Node-style callback `(error, bytesWritten)`.\n *\n * Prefer {@link downloadFileToAppStorage} for a promise-based API.\n */\n downloadFile: (\n args: DownloadFileArgs,\n callback: (error: string | null, bytesWritten: number | null) => void,\n ) => void\n}\n\n/** A serial port as enumerated by `serialport.getSerialPortsWithDescription()`. */\nexport type SerialPortInfo = {\n /** OS port name, e.g. `\"COM3\"`. */\n port: string\n /** Human-readable device caption reported by the OS. */\n description: string\n /**\n * USB vendor id (decimal), or `null` for non-USB ports (e.g. a built-in\n * motherboard serial). Same shape as `navigator.serial` `getInfo()`, so it\n * can be matched against `requestSerialPortAccess` / `requestPort` filters.\n */\n usbVendorId: number | null\n /** USB product id (decimal), or `null` for non-USB ports. */\n usbProductId: number | null\n}\n\n/**\n * Serial-port bridge exposed to apps at `window.laVitreNative.serialport`.\n *\n * ⚠️ **Conditioned on the app manifest.** This bridge is injected **only** when\n * the app declares the `webSerial` authorization in its manifest. For apps it\n * is intentionally read-only: it exposes **only** `getSerialPortsWithDescription`\n * (port enumeration). Opening / reading / writing a port is done through the\n * standard `navigator.serial` Web Serial API (gated by the same authorization),\n * not through this bridge.\n *\n * Always feature-detect before use — the whole object is `undefined` when the\n * app is not authorized:\n *\n * ```ts\n * const sp = laVitreNative?.serialport\n * if (!sp) return // app lacks the `webSerial` authorization\n * const ports = sp.getSerialPortsWithDescription()\n * ```\n */\nexport type SerialPortBridge = {\n getSerialPortsWithDescription: () => SerialPortInfo[]\n}\n\n/** A tag on an NFC reader. Both values are upper-case hex, no separator. */\nexport type NfcTag = {\n /**\n * The tag's UID (4, 7 or 10 bytes: `\"AD9B6846\"`), or `null` when the reader\n * would not give it.\n */\n uid: string | null\n /** The ATR the reader built for the tag (identifies its type: MIFARE, NTAG, DESFire…). */\n atr: string\n}\n\n/** A PC/SC reader as listed by `nfc.getReaders()`. */\nexport type NfcReader = {\n /** PC/SC reader name, e.g. `\"ACS ACR122U PICC Interface 0\"`. */\n name: string\n /** The tag on it right now, `null` if none. */\n tag: NfcTag | null\n}\n\n/** What `nfc.addTagHandler` reports. */\nexport type NfcEvent =\n | ({ type: 'tagPresent'; reader: string } & NfcTag)\n | { type: 'tagRemoved' | 'readerAdded' | 'readerRemoved'; reader: string }\n\n/**\n * NFC bridge exposed to apps at `window.laVitreNative.nfc` (added in the native\n * Vitre 26.11). It reports badges and tags put on a USB NFC reader (any PC/SC\n * contactless reader: ACS ACR122U / ACR1252U, Identiv, HID Omnikey…).\n *\n * ⚠️ **Conditioned on the app manifest.** Injected **only** when the app\n * declares the `nfc` authorization, and only on a native (Windows) Vitre: no\n * browser API reaches these readers, so there is none on web/PWA or the\n * companion. It arrives shortly after load (an authorization round trip):\n * prefer {@link watchNfcTags}, which waits for it.\n *\n * Read-only: the UID and the ATR, never a channel to send commands to the\n * card. Contact smart cards and virtual ones (Windows Hello) are not reported.\n * Every reader of the machine is listed; pick yours by name if there are\n * several.\n */\nexport type NfcBridge = {\n getReaders: () => NfcReader[]\n /** Returns an id for {@link NfcBridge.removeTagHandler}. */\n addTagHandler: (handler: (event: NfcEvent) => void) => string\n removeTagHandler: (id: string) => void\n}\n\nexport type LaVitreNative = {\n process: Process\n /**\n * File I/O. Present **only** when the app holds the `appsStorage` (sandboxed)\n * or `fullStorage` (unrestricted) authorization — otherwise `undefined`.\n * Feature-detect before calling. See {@link IO}.\n */\n io?: IO\n capture: Capture\n /**\n * Serial-port enumeration. Present **only** when the app holds the\n * `webSerial` authorization in its manifest — otherwise `undefined`.\n * Feature-detect before calling. See {@link SerialPortBridge}.\n */\n serialport?: SerialPortBridge\n /**\n * NFC tags on a USB reader. Present **only** when the app holds the `nfc`\n * authorization, on a native Vitre 26.11 or later — otherwise `undefined`.\n * See {@link NfcBridge} and {@link watchNfcTags}.\n */\n nfc?: NfcBridge\n}\n\n/** The native bridge, `null` off a native Vitre (the host leaves the property unset). */\nexport const laVitreNative = ((window as any).laVitreNative ??\n null) as LaVitreNative | null\n\n/**\n * Where the app runs:\n * - `native`: the desktop Vitre (CEF shell). It injects `window.laVitreNative`\n * into every app frame before any script runs, whatever the app manifest —\n * only its members depend on the platform and on the authorizations.\n * - `web`: a Vitre in a browser or installed as a PWA, the companion, or any\n * page outside la Vitre. No native bridge.\n */\nexport type HostEnvironment = 'native' | 'web'\n\n/** True on a native (desktop) Vitre, where `laVitreNative` is available. Added 1.53. */\nexport const isNativeHost = (): boolean =>\n typeof window !== 'undefined' && (window as any).laVitreNative != null\n\n/** `native` on a native (desktop) Vitre, `web` everywhere else. See {@link HostEnvironment}. Added 1.53. */\nexport const getHostEnvironment = (): HostEnvironment =>\n isNativeHost() ? 'native' : 'web'\n\nexport const getLocalAppStorageUrl = (appId: string, relativePath: string) =>\n `https://${appId}.local.app.lavit.re/${relativePath}`\n\n/**\n * Promise wrapper around {@link IO.downloadFile}. Resolves to the number of\n * bytes written, rejects with the native error.\n *\n * ```ts\n * import { laVitreNative, downloadFileToAppStorage } from '@lavitre/apps/Native'\n * if (laVitreNative)\n * await downloadFileToAppStorage(laVitreNative.io, {\n * url: 'https://storage.lavit.re/apps/my-app/cover.png',\n * path: '~/media/cover.png',\n * progress: ({ received, total }) => console.log(received, total),\n * })\n * ```\n */\nexport const downloadFileToAppStorage = (\n io: IO,\n args: DownloadFileArgs,\n): Promise<number> =>\n new Promise<number>((resolve, reject) =>\n io.downloadFile(args, (error, bytesWritten) =>\n error ? reject(new Error(error)) : resolve(bytesWritten ?? 0),\n ),\n )\n\nexport type WatchNfcTagsOptions = {\n /** Keep only the readers this accepts (by PC/SC name). Default: every reader. */\n reader?: (name: string) => boolean\n /**\n * How long to wait for `laVitreNative.nfc`, which the host adds shortly after\n * load. Default 10 000 ms.\n */\n waitMs?: number\n /**\n * Called once when the bridge never showed up: not a native Vitre, no `nfc`\n * authorization in the manifest, or a Vitre older than 26.11.\n */\n onUnavailable?: () => void\n}\n\nconst nfcBridgeNow = (): NfcBridge | undefined =>\n typeof window === 'undefined'\n ? undefined\n : ((window as any).laVitreNative?.nfc ?? undefined)\n\n/**\n * Follow the tags put on and lifted from the NFC readers. Added 1.60.\n *\n * - Waits for `laVitreNative.nfc` (see {@link WatchNfcTagsOptions.waitMs}).\n * - A tag already on a reader when watching starts is reported as `tagPresent`.\n * - A `tagPresent` repeated for a tag already reported is dropped.\n *\n * ```ts\n * import { watchNfcTags } from '@lavitre/apps/Native'\n * const stop = watchNfcTags(\n * (e) => { if (e.type === 'tagPresent') console.log('badge', e.uid) },\n * { onUnavailable: () => console.log('no NFC on this Vitre') },\n * )\n * // later: stop()\n * ```\n *\n * Returns a function that stops watching (and stops waiting).\n */\nexport const watchNfcTags = (\n handler: (event: NfcEvent) => void,\n options: WatchNfcTagsOptions = {},\n): (() => void) => {\n const accepts = options.reader ?? (() => true)\n const waitMs = options.waitMs ?? 10_000\n const tagOn = new Map<string, string | null>() // reader → uid of the tag reported on it\n let stopped = false\n let detach: (() => void) | undefined\n let timer: ReturnType<typeof setTimeout> | undefined\n\n const deliver = (event: NfcEvent) => {\n if (stopped || !accepts(event.reader)) return\n if (event.type === 'tagPresent') {\n if (tagOn.has(event.reader) && tagOn.get(event.reader) === event.uid)\n return\n tagOn.set(event.reader, event.uid)\n } else if (event.type === 'tagRemoved' || event.type === 'readerRemoved') {\n if (event.type === 'tagRemoved' && !tagOn.has(event.reader)) return\n tagOn.delete(event.reader)\n }\n handler(event)\n }\n\n const attach = (nfc: NfcBridge) => {\n // Handler first: the replay below cannot miss an arrival in between, and\n // `deliver` drops the duplicate if both see the same tag.\n const id = nfc.addTagHandler(deliver)\n detach = () => nfc.removeTagHandler(id)\n for (const reader of nfc.getReaders()) {\n if (reader.tag)\n deliver({ type: 'tagPresent', reader: reader.name, ...reader.tag })\n }\n }\n\n const startedAt = Date.now()\n const poll = () => {\n if (stopped) return\n const nfc = nfcBridgeNow()\n if (nfc) {\n attach(nfc)\n } else if (Date.now() - startedAt >= waitMs) {\n options.onUnavailable?.()\n } else {\n timer = setTimeout(poll, 200)\n }\n }\n poll()\n\n return () => {\n stopped = true\n if (timer !== undefined) clearTimeout(timer)\n detach?.()\n detach = undefined\n }\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../Native/index.ts"],"names":[],"mappings":"AA+NA,yFAAyF;AACzF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAE,MAAc,CAAC,aAAa;IACzD,IAAI,CAAyB,CAAA;AAY/B,wFAAwF;AACxF,MAAM,CAAC,MAAM,YAAY,GAAG,GAAY,EAAE,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GAAG,CAAC,UAAU,EAAE,EAAE,CAAC;YACtC,IAAI,MAAM,CAAC,GAAG;gBACZ,OAAO,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,CAAC,IAAI,EAAE,GAAG,MAAM,CAAC,GAAG,EAAE,CAAC,CAAA;QACvE,CAAC;IACH,CAAC,CAAA;IAED,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;IAC5B,MAAM,IAAI,GAAG,GAAG,EAAE;QAChB,IAAI,OAAO;YAAE,OAAM;QACnB,MAAM,GAAG,GAAG,YAAY,EAAE,CAAA;QAC1B,IAAI,GAAG,EAAE,CAAC;YACR,MAAM,CAAC,GAAG,CAAC,CAAA;QACb,CAAC;aAAM,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,IAAI,MAAM,EAAE,CAAC;YAC5C,OAAO,CAAC,aAAa,EAAE,EAAE,CAAA;QAC3B,CAAC;aAAM,CAAC;YACN,KAAK,GAAG,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;QAC/B,CAAC;IACH,CAAC,CAAA;IACD,0EAA0E;IAC1E,oEAAoE;IACpE,cAAc,CAAC,IAAI,CAAC,CAAA;IAEpB,OAAO,GAAG,EAAE;QACV,OAAO,GAAG,IAAI,CAAA;QACd,IAAI,KAAK,KAAK,SAAS;YAAE,YAAY,CAAC,KAAK,CAAC,CAAA;QAC5C,MAAM,EAAE,EAAE,CAAA;QACV,MAAM,GAAG,SAAS,CAAA;IACpB,CAAC,CAAA;AACH,CAAC,CAAA","sourcesContent":["export type StartProcessArgs = {\n path: string\n args: string[]\n ignoreFormatPath?: boolean\n hidden?: boolean\n}\n\nexport type Capture = {\n startCapture: (options: {\n outputFile: string\n audioInput: string\n }) => Promise<void>\n stopCurrentCapture: () => void\n}\n\nexport type ReadBinaryArgs = {\n path: string\n bufferSize?: number\n position?: number\n}\n\nexport type BinaryChunkResult = {\n buffer: ArrayBufferLike\n read: number\n fileSize: number\n position: number\n}\n\nexport type DownloadProgress = {\n /** Bytes written to disk so far. */\n received: number\n /** Total bytes, when the server advertises a `Content-Length`. */\n total?: number\n}\n\nexport type DownloadFileArgs = {\n /** Source URL to fetch. */\n url: string\n /**\n * Destination path inside the app sandbox (e.g. `~/media/cover.png`). The\n * native bridge resolves it through the app path formatter, so it is scoped\n * to `<vitre-data>/apps/<appId>/...` — it cannot escape the app storage.\n */\n path: string\n /** Optional extra request headers. */\n headers?: Record<string, string>\n /** Optional progress callback fired as bytes are streamed to disk. */\n progress?: (progress: DownloadProgress) => void\n}\n\nexport type FileInfoType = 'file' | 'directory'\n\nexport type FileInfo = {\n name: string\n path: string\n type: FileInfoType\n}\nexport type Process = {\n startProcess: (args: StartProcessArgs) => void\n}\n\n/**\n * Native file I/O for the app, exposed at `window.laVitreNative.io`.\n *\n * ⚠️ **Conditioned on the app manifest.** This bridge is injected **only** when\n * the app declares a storage authorization:\n * - **`appsStorage`** — paths are confined to the app's own storage folder\n * (absolute paths, the `~~/` parent escape and `../` traversal are rejected).\n * This is what most apps want.\n * - **`fullStorage`** — unrestricted filesystem access. Use only when strictly\n * necessary.\n *\n * With neither authorization, `laVitreNative.io` is `undefined` — always\n * feature-detect (`laVitreNative?.io`) before use. It is also `undefined` off a\n * native Vitre (`laVitreNative` itself is `null` on web/PWA and the companion,\n * see {@link isNativeHost}). The host adds it shortly after the page starts\n * (an authorization round trip), so a check at load time can miss it.\n *\n * Paths use a `~/` prefix for the app's sandbox root, e.g. `~/data/x.json`; the\n * file written there is served by the Vitre's local web server at\n * {@link getLocalAppStorageUrl}`(appId, 'data/x.json')`.\n */\nexport type IO = {\n readFile: (path: string) => string\n /** True if a file exists at `path` (resolved inside the app sandbox). */\n fileExists: (path: string) => boolean\n /**\n * Write a file to the app sandbox.\n *\n * - Pass a `string` for text content (written as UTF-8).\n * - Pass an `ArrayBuffer` (or any `ArrayBufferLike`) for binary content — the\n * raw bytes are written as-is. Do **not** base64-encode binary data. For a\n * typed array, pass its `.buffer` (e.g. `new Uint8Array(...).buffer`, or\n * `await blob.arrayBuffer()`).\n */\n writeFile: (path: string, content: string | ArrayBufferLike) => void\n list: (path: string) => FileInfo[]\n createFolder: (path: string) => void\n formatPath: (path: string) => string\n deleteFile: (path: string) => void\n readBinaryFileBuffer: (args: ReadBinaryArgs) => Promise<BinaryChunkResult>\n /**\n * Download a URL straight into a file in the app sandbox. Binary-safe: the\n * response body is streamed to disk natively, so nothing is buffered in JS\n * (ideal for large media). Node-style callback `(error, bytesWritten)`.\n *\n * Prefer {@link downloadFileToAppStorage} for a promise-based API.\n */\n downloadFile: (\n args: DownloadFileArgs,\n callback: (error: string | null, bytesWritten: number | null) => void,\n ) => void\n}\n\n/** A serial port as enumerated by `serialport.getSerialPortsWithDescription()`. */\nexport type SerialPortInfo = {\n /** OS port name, e.g. `\"COM3\"`. */\n port: string\n /** Human-readable device caption reported by the OS. */\n description: string\n /**\n * USB vendor id (decimal), or `null` for non-USB ports (e.g. a built-in\n * motherboard serial). Same shape as `navigator.serial` `getInfo()`, so it\n * can be matched against `requestSerialPortAccess` / `requestPort` filters.\n */\n usbVendorId: number | null\n /** USB product id (decimal), or `null` for non-USB ports. */\n usbProductId: number | null\n}\n\n/**\n * Serial-port bridge exposed to apps at `window.laVitreNative.serialport`.\n *\n * ⚠️ **Conditioned on the app manifest.** This bridge is injected **only** when\n * the app declares the `webSerial` authorization in its manifest. For apps it\n * is intentionally read-only: it exposes **only** `getSerialPortsWithDescription`\n * (port enumeration). Opening / reading / writing a port is done through the\n * standard `navigator.serial` Web Serial API (gated by the same authorization),\n * not through this bridge.\n *\n * Always feature-detect before use — the whole object is `undefined` when the\n * app is not authorized:\n *\n * ```ts\n * const sp = laVitreNative?.serialport\n * if (!sp) return // app lacks the `webSerial` authorization\n * const ports = sp.getSerialPortsWithDescription()\n * ```\n */\nexport type SerialPortBridge = {\n getSerialPortsWithDescription: () => SerialPortInfo[]\n}\n\n/** A tag on an NFC reader. Both values are upper-case hex, no separator. */\nexport type NfcTag = {\n /**\n * The tag's UID (4, 7 or 10 bytes: `\"AD9B6846\"`), or `null` when the reader\n * would not give it.\n */\n uid: string | null\n /** The ATR the reader built for the tag (identifies its type: MIFARE, NTAG, DESFire…). */\n atr: string\n}\n\n/** A PC/SC reader as listed by `nfc.getReaders()`. */\nexport type NfcReader = {\n /** PC/SC reader name, e.g. `\"ACS ACR122U PICC Interface 0\"`. */\n name: string\n /** The tag on it right now, `null` if none. */\n tag: NfcTag | null\n}\n\n/** What `nfc.addTagHandler` reports. */\nexport type NfcEvent =\n | ({ type: 'tagPresent'; reader: string } & NfcTag)\n | { type: 'tagRemoved' | 'readerAdded' | 'readerRemoved'; reader: string }\n\n/**\n * NFC bridge exposed to apps at `window.laVitreNative.nfc`, on a native Vitre\n * released after 26.11.0 (26.11.0 and older do not have it). It reports badges and tags put on a USB NFC reader (any PC/SC\n * contactless reader: ACS ACR122U / ACR1252U, Identiv, HID Omnikey…).\n *\n * ⚠️ **Conditioned on the app manifest.** Injected **only** when the app\n * declares the `nfc` authorization, and only on a native (Windows) Vitre: no\n * browser API reaches these readers, so there is none on web/PWA or the\n * companion. It arrives shortly after load (an authorization round trip):\n * prefer {@link watchNfcTags}, which waits for it.\n *\n * Read-only: the UID and the ATR, never a channel to send commands to the\n * card. Contact smart cards and virtual ones (Windows Hello) are not reported.\n * Every reader of the machine is listed; pick yours by name if there are\n * several.\n */\nexport type NfcBridge = {\n getReaders: () => NfcReader[]\n /** Returns an id for {@link NfcBridge.removeTagHandler}. */\n addTagHandler: (handler: (event: NfcEvent) => void) => string\n removeTagHandler: (id: string) => void\n}\n\nexport type LaVitreNative = {\n process: Process\n /**\n * File I/O. Present **only** when the app holds the `appsStorage` (sandboxed)\n * or `fullStorage` (unrestricted) authorization — otherwise `undefined`.\n * Feature-detect before calling. See {@link IO}.\n */\n io?: IO\n capture: Capture\n /**\n * Serial-port enumeration. Present **only** when the app holds the\n * `webSerial` authorization in its manifest — otherwise `undefined`.\n * Feature-detect before calling. See {@link SerialPortBridge}.\n */\n serialport?: SerialPortBridge\n /**\n * NFC tags on a USB reader. Present **only** when the app holds the `nfc`\n * authorization, on a native Vitre released after 26.11.0 — otherwise `undefined`.\n * See {@link NfcBridge} and {@link watchNfcTags}.\n */\n nfc?: NfcBridge\n}\n\n/** The native bridge, `null` off a native Vitre (the host leaves the property unset). */\nexport const laVitreNative = ((window as any).laVitreNative ??\n null) as LaVitreNative | null\n\n/**\n * Where the app runs:\n * - `native`: the desktop Vitre (CEF shell). It injects `window.laVitreNative`\n * into every app frame before any script runs, whatever the app manifest —\n * only its members depend on the platform and on the authorizations.\n * - `web`: a Vitre in a browser or installed as a PWA, the companion, or any\n * page outside la Vitre. No native bridge.\n */\nexport type HostEnvironment = 'native' | 'web'\n\n/** True on a native (desktop) Vitre, where `laVitreNative` is available. Added 1.53. */\nexport const isNativeHost = (): boolean =>\n typeof window !== 'undefined' && (window as any).laVitreNative != null\n\n/** `native` on a native (desktop) Vitre, `web` everywhere else. See {@link HostEnvironment}. Added 1.53. */\nexport const getHostEnvironment = (): HostEnvironment =>\n isNativeHost() ? 'native' : 'web'\n\nexport const getLocalAppStorageUrl = (appId: string, relativePath: string) =>\n `https://${appId}.local.app.lavit.re/${relativePath}`\n\n/**\n * Promise wrapper around {@link IO.downloadFile}. Resolves to the number of\n * bytes written, rejects with the native error.\n *\n * ```ts\n * import { laVitreNative, downloadFileToAppStorage } from '@lavitre/apps/Native'\n * if (laVitreNative)\n * await downloadFileToAppStorage(laVitreNative.io, {\n * url: 'https://storage.lavit.re/apps/my-app/cover.png',\n * path: '~/media/cover.png',\n * progress: ({ received, total }) => console.log(received, total),\n * })\n * ```\n */\nexport const downloadFileToAppStorage = (\n io: IO,\n args: DownloadFileArgs,\n): Promise<number> =>\n new Promise<number>((resolve, reject) =>\n io.downloadFile(args, (error, bytesWritten) =>\n error ? reject(new Error(error)) : resolve(bytesWritten ?? 0),\n ),\n )\n\nexport type WatchNfcTagsOptions = {\n /** Keep only the readers this accepts (by PC/SC name). Default: every reader. */\n reader?: (name: string) => boolean\n /**\n * How long to wait for `laVitreNative.nfc`, which the host adds shortly after\n * load. Default 10 000 ms.\n */\n waitMs?: number\n /**\n * Called once when the bridge never showed up: not a native Vitre, no `nfc`\n * authorization in the manifest, or a native Vitre without the bridge (26.11.0\n * and older).\n */\n onUnavailable?: () => void\n}\n\nconst nfcBridgeNow = (): NfcBridge | undefined =>\n typeof window === 'undefined'\n ? undefined\n : ((window as any).laVitreNative?.nfc ?? undefined)\n\n/**\n * Follow the tags put on and lifted from the NFC readers. Added 1.60.\n *\n * - Waits for `laVitreNative.nfc` (see {@link WatchNfcTagsOptions.waitMs}).\n * - A tag already on a reader when watching starts is reported as `tagPresent`.\n * - A `tagPresent` repeated for a tag already reported is dropped.\n * - The handler is never called before `watchNfcTags` has returned, so it can\n * always call the returned `stop()`. An exception it throws is logged with\n * `console.error` and does not stop the watch (since 1.60.1).\n *\n * ```ts\n * import { watchNfcTags } from '@lavitre/apps/Native'\n * const stop = watchNfcTags(\n * (e) => { if (e.type === 'tagPresent') console.log('badge', e.uid) },\n * { onUnavailable: () => console.log('no NFC on this Vitre') },\n * )\n * // later: stop()\n * ```\n *\n * Returns a function that stops watching (and stops waiting).\n */\nexport const watchNfcTags = (\n handler: (event: NfcEvent) => void,\n options: WatchNfcTagsOptions = {},\n): (() => void) => {\n const accepts = options.reader ?? (() => true)\n const waitMs = options.waitMs ?? 10_000\n const tagOn = new Map<string, string | null>() // reader → uid of the tag reported on it\n let stopped = false\n let detach: (() => void) | undefined\n let timer: ReturnType<typeof setTimeout> | undefined\n\n const deliver = (event: NfcEvent) => {\n if (stopped || !accepts(event.reader)) return\n if (event.type === 'tagPresent') {\n if (tagOn.has(event.reader) && tagOn.get(event.reader) === event.uid)\n return\n tagOn.set(event.reader, event.uid)\n } else if (event.type === 'tagRemoved' || event.type === 'readerRemoved') {\n if (event.type === 'tagRemoved' && !tagOn.has(event.reader)) return\n tagOn.delete(event.reader)\n }\n try {\n handler(event)\n } catch (error) {\n console.error('[@lavitre/apps] watchNfcTags handler threw', error)\n }\n }\n\n const attach = (nfc: NfcBridge) => {\n // Handler first: the replay below cannot miss an arrival in between, and\n // `deliver` drops the duplicate if both see the same tag.\n const id = nfc.addTagHandler(deliver)\n detach = () => nfc.removeTagHandler(id)\n for (const reader of nfc.getReaders()) {\n if (reader.tag)\n deliver({ type: 'tagPresent', reader: reader.name, ...reader.tag })\n }\n }\n\n const startedAt = Date.now()\n const poll = () => {\n if (stopped) return\n const nfc = nfcBridgeNow()\n if (nfc) {\n attach(nfc)\n } else if (Date.now() - startedAt >= waitMs) {\n options.onUnavailable?.()\n } else {\n timer = setTimeout(poll, 200)\n }\n }\n // Not synchronously: with the bridge already there and a tag on a reader,\n // the replay would call the handler before the caller holds `stop`.\n queueMicrotask(poll)\n\n return () => {\n stopped = true\n if (timer !== undefined) clearTimeout(timer)\n detach?.()\n detach = undefined\n }\n}\n"]}
package/dist/Version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const apiVersion = "1.60.0";
1
+ export declare const apiVersion = "1.60.1";
package/dist/Version.js CHANGED
@@ -1,2 +1,2 @@
1
- export const apiVersion = '1.60.0';
1
+ export const apiVersion = '1.60.1';
2
2
  //# sourceMappingURL=Version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Version.js","sourceRoot":"","sources":["../Version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,UAAU,GAAG,QAAQ,CAAA","sourcesContent":["export const apiVersion = '1.60.0'"]}
1
+ {"version":3,"file":"Version.js","sourceRoot":"","sources":["../Version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,UAAU,GAAG,QAAQ,CAAA","sourcesContent":["export const apiVersion = '1.60.1'"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lavitre/apps",
3
- "version": "1.60.0",
3
+ "version": "1.60.1",
4
4
  "description": "TypeScript SDK for building la Vitre apps (connector, frames, companion, CRDT sync)",
5
5
  "license": "MIT",
6
6
  "type": "module",