@remnic/capture-screen 10.0.107 → 10.0.109
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 +3 -1
- package/dist/chunk-DVPJWEIH.js +22019 -0
- package/dist/cli-bin.js +1 -1
- package/dist/index.d.ts +49 -6
- package/dist/index.js +1 -1
- package/package.json +10 -5
- package/dist/chunk-IBOZT56J.js +0 -2180
package/dist/cli-bin.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -415,7 +415,7 @@ type CaptureDecision = {
|
|
|
415
415
|
rule: string;
|
|
416
416
|
} | {
|
|
417
417
|
action: "skipped";
|
|
418
|
-
reason: "ocr-unavailable" | "dedup";
|
|
418
|
+
reason: "ocr-unavailable" | "dedup" | "identity-changed" | "url-policy-unavailable";
|
|
419
419
|
} | {
|
|
420
420
|
action: "store";
|
|
421
421
|
snapshot: SnapshotInput;
|
|
@@ -487,7 +487,10 @@ interface HelperResolution {
|
|
|
487
487
|
/** Operator-facing install hint when unavailable, else null. */
|
|
488
488
|
hint: string | null;
|
|
489
489
|
}
|
|
490
|
-
/**
|
|
490
|
+
/**
|
|
491
|
+
* The npm package that would provide the helper for this platform/arch. Linux has one package for every
|
|
492
|
+
* arch: its helper is a script that runs on any CPU.
|
|
493
|
+
*/
|
|
491
494
|
declare function helperPackageName(platform?: string, arch?: string): string;
|
|
492
495
|
/**
|
|
493
496
|
* Resolve the helper binary path. Order: explicit env override, then the
|
|
@@ -500,8 +503,24 @@ declare function runHelperCommand(binaryPath: string, args: string[], timeoutMs?
|
|
|
500
503
|
interface AxSnapshotOptions {
|
|
501
504
|
frontmost?: boolean;
|
|
502
505
|
pid?: number;
|
|
506
|
+
/** Read this window (the id an earlier call returned) and not whichever is in front now. */
|
|
507
|
+
windowId?: string;
|
|
508
|
+
/** Read the tree only while the window still has this title (the one the caller checked); a retitled window gets no tree. */
|
|
509
|
+
expectTitle?: string;
|
|
503
510
|
maxNodes?: number;
|
|
504
511
|
}
|
|
512
|
+
/**
|
|
513
|
+
* What the helper says about a window without reading its content: who owns it, its title, its id and the
|
|
514
|
+
* address a browser shows. `snapshot` is set only when the helper is too old to answer without reading the
|
|
515
|
+
* tree; it then holds the tree that was read to get these facts.
|
|
516
|
+
*/
|
|
517
|
+
interface WindowContext {
|
|
518
|
+
app: string;
|
|
519
|
+
windowTitle: string;
|
|
520
|
+
windowId?: string;
|
|
521
|
+
browserUrl?: string | null;
|
|
522
|
+
snapshot?: AxSnapshot;
|
|
523
|
+
}
|
|
505
524
|
/**
|
|
506
525
|
* The helper's `ax-snapshot` payload: the frontmost window's context (app,
|
|
507
526
|
* title, optional browser URL) plus its accessibility tree. The tree is
|
|
@@ -520,21 +539,45 @@ interface AxSnapshot {
|
|
|
520
539
|
interface OcrWindowOptions {
|
|
521
540
|
frontmost?: boolean;
|
|
522
541
|
windowId?: string;
|
|
542
|
+
/** Read the pixels only while the window still has this title (the one the caller checked); a retitled window gives no text. */
|
|
543
|
+
expectTitle?: string;
|
|
523
544
|
}
|
|
524
545
|
/** Thin wrapper over a resolved helper binary. */
|
|
525
546
|
declare class NativeHelper {
|
|
547
|
+
#private;
|
|
526
548
|
readonly binaryPath: string;
|
|
527
549
|
constructor(binaryPath: string);
|
|
528
|
-
/**
|
|
550
|
+
/**
|
|
551
|
+
* `<helper> ax-snapshot [--frontmost|--pid N] --window-only` -> the window's facts and no tree, so a caller
|
|
552
|
+
* can apply its deny list before any content is read. A helper that exits with status 2 does not know the
|
|
553
|
+
* flag (the macOS helper today): this method then reads the snapshot under the given `maxNodes` (the facts
|
|
554
|
+
* call reads no tree), returns it in `snapshot`, and remembers not to ask again. Any other failure throws.
|
|
555
|
+
*/
|
|
556
|
+
windowContext(opts?: {
|
|
557
|
+
frontmost?: boolean;
|
|
558
|
+
pid?: number;
|
|
559
|
+
maxNodes?: number;
|
|
560
|
+
}): Promise<WindowContext>;
|
|
561
|
+
/**
|
|
562
|
+
* `<helper> ax-snapshot [--frontmost|--pid N|--window ID] [--max-nodes N] [--title T]` -> window + AX tree JSON.
|
|
563
|
+
* `--title T` makes a helper that knows it read the tree only while the window still has the title T. A helper
|
|
564
|
+
* that exits with status 2 does not know the flag (the macOS helper today): the read then goes without it, and
|
|
565
|
+
* the refusal is remembered. Any other failure throws.
|
|
566
|
+
*/
|
|
529
567
|
axSnapshot(opts?: AxSnapshotOptions): Promise<AxSnapshot>;
|
|
530
|
-
/** `<helper> ocr-window [--frontmost|--window ID]` -> `{ text }` JSON. */
|
|
568
|
+
/** `<helper> ocr-window [--frontmost|--window ID] [--title T]` -> `{ text }` JSON; a window retitled since T gives empty text. */
|
|
531
569
|
ocrWindow(opts?: OcrWindowOptions): Promise<string>;
|
|
532
570
|
}
|
|
533
571
|
|
|
534
572
|
/**
|
|
535
|
-
* Live capture cycle: one
|
|
573
|
+
* Live capture cycle: one window captured through the native helper and run
|
|
536
574
|
* through the processing pipeline. Shared by `test-snapshot` (which prints the
|
|
537
|
-
* decision without storing) and
|
|
575
|
+
* decision without storing) and the capture scheduler.
|
|
576
|
+
*
|
|
577
|
+
* Order matters for privacy: the helper is first asked for the window's facts
|
|
578
|
+
* only (app, title, id, address), the deny list is applied to those, and the
|
|
579
|
+
* tree or the pixels of a window are read only when it passes. A denied
|
|
580
|
+
* window's content is never read, not just never stored.
|
|
538
581
|
*
|
|
539
582
|
* The routing (AX vs OCR) happens here because the native OCR call is async
|
|
540
583
|
* while the processor's OCR seam is sync: a terminal-class or AX-empty window
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remnic/capture-screen",
|
|
3
|
-
"version": "10.0.
|
|
3
|
+
"version": "10.0.109",
|
|
4
4
|
"description": "Desktop screen-activity capture daemon for Remnic — local spool, loopback HTTP API, and replay ingestion for the activity source `screen` (à-la-carte)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -25,8 +25,9 @@
|
|
|
25
25
|
"node": ">=22.13.0"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
|
-
"@remnic/capture-native-darwin-arm64": "^10.0.
|
|
29
|
-
"@remnic/capture-native-darwin-x64": "^10.0.
|
|
28
|
+
"@remnic/capture-native-darwin-arm64": "^10.0.109",
|
|
29
|
+
"@remnic/capture-native-darwin-x64": "^10.0.109",
|
|
30
|
+
"@remnic/capture-native-linux": "^10.0.109"
|
|
30
31
|
},
|
|
31
32
|
"peerDependenciesMeta": {
|
|
32
33
|
"@remnic/capture-native-darwin-arm64": {
|
|
@@ -34,6 +35,9 @@
|
|
|
34
35
|
},
|
|
35
36
|
"@remnic/capture-native-darwin-x64": {
|
|
36
37
|
"optional": true
|
|
38
|
+
},
|
|
39
|
+
"@remnic/capture-native-linux": {
|
|
40
|
+
"optional": true
|
|
37
41
|
}
|
|
38
42
|
},
|
|
39
43
|
"devDependencies": {
|
|
@@ -41,7 +45,8 @@
|
|
|
41
45
|
"tsup": "^8.0.0",
|
|
42
46
|
"typescript": "^5.7.0",
|
|
43
47
|
"tsx": "^4.0.0",
|
|
44
|
-
"
|
|
48
|
+
"zod": "^4.6.6",
|
|
49
|
+
"@remnic/core": "10.0.109"
|
|
45
50
|
},
|
|
46
51
|
"license": "MIT",
|
|
47
52
|
"repository": {
|
|
@@ -63,6 +68,6 @@
|
|
|
63
68
|
"build": "tsup --config tsup.config.ts",
|
|
64
69
|
"precheck-types": "node ../../scripts/ensure-core-build-deps.mjs",
|
|
65
70
|
"check-types": "tsc --noEmit",
|
|
66
|
-
"test": "NODE_OPTIONS=\"${NODE_OPTIONS:+$NODE_OPTIONS }--conditions=remnic-source\" tsx --test src/simhash.test.ts src/dedup.test.ts src/daywindow.test.ts src/denylist.test.ts src/axtree.test.ts src/redact.test.ts src/config.test.ts src/validate.test.ts src/util.test.ts src/token.test.ts src/spool.test.ts src/capture.test.ts src/helper.test.ts src/live.test.ts src/replay.test.ts src/scheduler.test.ts src/daemon.test.ts src/cli.test.ts src/package.test.ts src/dist.test.ts"
|
|
71
|
+
"test": "NODE_OPTIONS=\"${NODE_OPTIONS:+$NODE_OPTIONS }--conditions=remnic-source\" tsx --test src/simhash.test.ts src/dedup.test.ts src/daywindow.test.ts src/denylist.test.ts src/axtree.test.ts src/redact.test.ts src/config.test.ts src/validate.test.ts src/util.test.ts src/token.test.ts src/spool.test.ts src/capture.test.ts src/helper.test.ts src/live.test.ts src/native-linux.test.ts src/replay.test.ts src/scheduler.test.ts src/daemon.test.ts src/cli.test.ts src/package.test.ts src/dist.test.ts"
|
|
67
72
|
}
|
|
68
73
|
}
|