@hasna/recordings 0.2.14 → 0.3.2

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 (123) hide show
  1. package/Dockerfile.package +4 -5
  2. package/README.md +113 -8
  3. package/bun.lock +2 -2
  4. package/dist/__tests__/helpers/installer-guard-execution.d.ts +22 -0
  5. package/dist/__tests__/helpers/installer-guard-execution.d.ts.map +1 -0
  6. package/dist/__tests__/helpers/installer-preflight.d.ts +22 -0
  7. package/dist/__tests__/helpers/installer-preflight.d.ts.map +1 -0
  8. package/dist/__tests__/helpers/native-fs-guard.d.ts.map +1 -1
  9. package/dist/__tests__/helpers/source-assertions.d.ts +169 -0
  10. package/dist/__tests__/helpers/source-assertions.d.ts.map +1 -0
  11. package/dist/__tests__/preload.d.ts +1 -4
  12. package/dist/__tests__/preload.d.ts.map +1 -1
  13. package/dist/cli/desktop-snapshot.d.ts +20 -0
  14. package/dist/cli/desktop-snapshot.d.ts.map +1 -0
  15. package/dist/cli/index.js +2094 -280
  16. package/dist/cli/macos-permissions.d.ts +72 -0
  17. package/dist/cli/macos-permissions.d.ts.map +1 -1
  18. package/dist/cli/macos-shortcut.d.ts +139 -0
  19. package/dist/cli/macos-shortcut.d.ts.map +1 -0
  20. package/dist/cli/trigger-probe.d.ts +172 -0
  21. package/dist/cli/trigger-probe.d.ts.map +1 -0
  22. package/dist/db/database.d.ts +9 -0
  23. package/dist/db/database.d.ts.map +1 -1
  24. package/dist/http/client.d.ts +19 -7
  25. package/dist/http/client.d.ts.map +1 -1
  26. package/dist/index.d.ts +3 -1
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +635 -50
  29. package/dist/lib/capture-probe.d.ts +216 -0
  30. package/dist/lib/capture-probe.d.ts.map +1 -0
  31. package/dist/lib/config.d.ts.map +1 -1
  32. package/dist/lib/macos-bundle.d.ts +50 -0
  33. package/dist/lib/macos-bundle.d.ts.map +1 -0
  34. package/dist/lib/persistence-probe.d.ts +208 -0
  35. package/dist/lib/persistence-probe.d.ts.map +1 -0
  36. package/dist/lib/recorder.d.ts.map +1 -1
  37. package/dist/lib/retired-deployment-modes.d.ts +24 -0
  38. package/dist/lib/retired-deployment-modes.d.ts.map +1 -0
  39. package/dist/lib/transcriber.d.ts +60 -0
  40. package/dist/lib/transcriber.d.ts.map +1 -1
  41. package/dist/mcp/index.js +141 -57
  42. package/dist/server/cloud-config.d.ts +25 -3
  43. package/dist/server/cloud-config.d.ts.map +1 -1
  44. package/dist/server/cloud-readiness.d.ts.map +1 -1
  45. package/dist/server/cloud.d.ts +8 -7
  46. package/dist/server/cloud.d.ts.map +1 -1
  47. package/dist/server/index.js +188 -80
  48. package/dist/server/migrate-command.d.ts.map +1 -1
  49. package/dist/server/serve.d.ts.map +1 -1
  50. package/dist/storage.d.ts +2 -2
  51. package/dist/storage.d.ts.map +1 -1
  52. package/dist/storage.js +109 -50
  53. package/dist/store.d.ts +1 -1
  54. package/dist/store.d.ts.map +1 -1
  55. package/dist/version.d.ts +1 -1
  56. package/dist/version.d.ts.map +1 -1
  57. package/package.json +25 -6
  58. package/scripts/ci-linux-suite.ts +403 -0
  59. package/scripts/ci-native-build.ts +402 -0
  60. package/scripts/enforce_identity_migration.sh +110 -0
  61. package/scripts/generate-sdk.ts +1 -1
  62. package/scripts/install_macos_app.sh +192 -31
  63. package/scripts/macos_artifact.ts +323 -43
  64. package/scripts/native/realtime-settle-probe/README.md +39 -0
  65. package/scripts/native/realtime-settle-probe/main.swift +135 -0
  66. package/scripts/policy/local-only-approved-targets.txt +21 -0
  67. package/scripts/read_local_only_targets.sh +203 -0
  68. package/scripts/scan-artifact.ts +40 -0
  69. package/scripts/set-version.ts +145 -0
  70. package/scripts/smoke_macos_app.sh +62 -16
  71. package/scripts/vacuity-manifest-gen.ts +96 -0
  72. package/scripts/vacuity-manifests/enhancement-screen-mirror.tsv +44 -0
  73. package/scripts/vacuity-manifests/install-chain.tsv +13 -0
  74. package/scripts/vacuity-manifests/must-survive-controls.tsv +10 -0
  75. package/scripts/vacuity-manifests/reorder.tsv +4 -0
  76. package/scripts/vacuity-manifests/source-side.tsv +15 -0
  77. package/scripts/vacuity-manifests/variable-operands.tsv +16 -0
  78. package/scripts/vacuity-manifests/version-sites.tsv +61 -0
  79. package/scripts/vacuity-mutation-battery.ts +266 -0
  80. package/src/native/Recordings/App/MenuBarStatusView.swift +23 -11
  81. package/src/native/Recordings/App/RecordingsApp.swift +37 -1
  82. package/src/native/Recordings/App/RuntimeSmoke.swift +5 -1
  83. package/src/native/Recordings/App/SidebarView.swift +1 -1
  84. package/src/native/Recordings/Package.swift +24 -5
  85. package/src/native/Recordings/RecordingsLib/EnhancementScreen.swift +91 -0
  86. package/src/native/Recordings/RecordingsLib/FnKeyMonitor.swift +27 -4
  87. package/src/native/Recordings/RecordingsLib/Info.plist +2 -2
  88. package/src/native/Recordings/RecordingsLib/MenuBarPresentation.swift +56 -3
  89. package/src/native/Recordings/RecordingsLib/NativePCMRecorder.swift +13 -0
  90. package/src/native/Recordings/RecordingsLib/PasteDeliveryVerification.swift +460 -0
  91. package/src/native/Recordings/RecordingsLib/PermissionRequestLaunchPlan.swift +21 -1
  92. package/src/native/Recordings/RecordingsLib/RealtimeTranscriptionClient.swift +41 -7
  93. package/src/native/Recordings/RecordingsLib/RecordingAttemptAlert.swift +36 -0
  94. package/src/native/Recordings/RecordingsLib/RecordingEngine.swift +1071 -75
  95. package/src/native/Recordings/RecordingsLib/SettingsView.swift +47 -3
  96. package/src/native/Recordings/RecordingsLib/VoiceShortcuts.swift +11 -6
  97. package/src/native/Recordings/RecordingsTests/BarOnlyLaunchPlanTests.swift +99 -0
  98. package/src/native/Recordings/RecordingsTests/CLIRunnerTests.swift +3 -3
  99. package/src/native/Recordings/RecordingsTests/EnhancementScreenTests.swift +191 -0
  100. package/src/native/Recordings/RecordingsTests/MenuBarPresentationTests.swift +144 -4
  101. package/src/native/Recordings/RecordingsTests/PasteDeliveryVerificationTests.swift +463 -0
  102. package/src/native/Recordings/RecordingsTests/PasteTargetTests.swift +33 -20
  103. package/src/native/Recordings/RecordingsTests/ProjectStoreTests.swift +1 -1
  104. package/src/native/Recordings/RecordingsTests/RealtimeSettleBenchmark.swift +200 -0
  105. package/src/native/Recordings/RecordingsTests/RealtimeSettleBudgetTests.swift +80 -0
  106. package/src/native/Recordings/RecordingsTests/RealtimeTranscriptionTests.swift +22 -4
  107. package/src/native/Recordings/RecordingsTests/RecordingEngineDeliveryTests.swift +12 -6
  108. package/src/native/Recordings/RecordingsTests/RecordingEngineHomeIsolationTests.swift +67 -0
  109. package/src/native/Recordings/RecordingsTests/RecordingStartGateTests.swift +12 -3
  110. package/src/native/Recordings/RecordingsTests/RecordingStartTimingTests.swift +207 -11
  111. package/src/native/Recordings/RecordingsTests/SpeechIntentTests.swift +17 -6
  112. package/src/native/Recordings/RecordingsTests/TestHomeDirectory.swift +23 -0
  113. package/src/native/Recordings/Updater/Broker/ApplicationProcessQuiescence.swift +7 -1
  114. package/src/native/Recordings/Updater/Broker/AtomicActivation.swift +10 -10
  115. package/src/native/Recordings/Updater/Broker/BrokerMain.swift +5 -1
  116. package/src/native/Recordings/Updater/Broker/HostOSProductVersion.swift +1 -0
  117. package/src/native/Recordings/Updater/Broker/PeerIdentity.swift +59 -3
  118. package/src/native/Recordings/Updater/Protocol/UpdateProtocol.swift +21 -2
  119. package/src/native/Recordings/Updater/ProtocolTests/ExpectationIntegrityTests.swift +60 -0
  120. package/src/native/Recordings/Updater/ProtocolTests/UpdateXPCInterfaceTests.swift +113 -0
  121. package/src/native/Recordings/Updater/VerifierLauncher/RecordingsVerifierLauncher.c +106 -5
  122. package/src/native/Recordings/build.sh +226 -20
  123. package/scripts/native/prebuilds/darwin-universal/recordings_fs_guard.node +0 -0
@@ -1,3 +1,5 @@
1
+ import { RECORDINGS_BUNDLE_IDENTIFIER, TCC_DATABASE_UNREADABLE_STATE } from "../lib/macos-bundle.js";
2
+ export { RECORDINGS_BUNDLE_IDENTIFIER, TCC_DATABASE_UNREADABLE_STATE };
1
3
  export interface PermissionHelperProcessResult {
2
4
  status: number | null;
3
5
  error?: Error;
@@ -10,4 +12,74 @@ export interface PermissionHelperResult {
10
12
  errorMessage?: string;
11
13
  }
12
14
  export declare function runMacOSPermissionRequest(appPath: string, runner?: PermissionHelperRunner): PermissionHelperResult;
15
+ export interface TccAccessRow {
16
+ authValue: string;
17
+ csreqHex: string;
18
+ }
19
+ export type TccAccessLookup = {
20
+ kind: "row";
21
+ row: TccAccessRow;
22
+ } | {
23
+ kind: "absent";
24
+ } | {
25
+ kind: "unreadable";
26
+ detail: string;
27
+ };
28
+ export type TccIdentityVerification = "satisfied" | "unsatisfied" | "unverifiable";
29
+ export type TccAuthorizationState = "allowed" | "stale_allowed_for_previous_app_build" | "allowed_identity_unverified" | "unverified_no_installed_bundle" | "denied" | "unknown" | "limited" | "not_determined" | "undetermined_tcc_database_unreadable" | "unsupported" | `unknown(${string})`;
30
+ export type CodesignRequirementRunner = (requirementPath: string, appPath: string) => PermissionHelperProcessResult;
31
+ export interface TccPermissionProbe {
32
+ /**
33
+ * Three-valued, and it has to be. This was `databaseExists: (dbPath) => boolean` backed by
34
+ * `existsSync`, which returns `false` for ANY `stat` error rather than just `ENOENT`. When
35
+ * `stat()` on the TCC path is itself refused, the caller took the "no database here" branch,
36
+ * never recorded a refusal, and returned `not_determined` — which
37
+ * `classifyPermissionState` maps to `never_requested`, producing the operator-facing claim
38
+ * "the app has never requested microphone access (no TCC entry exists)" on a machine whose
39
+ * grant row demonstrably exists. That is the exact flagship lie this module was written to kill,
40
+ * reached through the one path that looked too boring to check.
41
+ *
42
+ * Demonstrated on real macOS: a file present but `open()`-refused (`/etc/master.passwd`) gives
43
+ * `existsSync=true` and was handled correctly, while a path whose `stat()` is refused
44
+ * (`/private/var/db/dslocal/nodes/Default/users/root.plist`) gives `existsSync=false` and
45
+ * bypassed the fix entirely.
46
+ *
47
+ * `indeterminate` must be treated as unreadable, never as absent.
48
+ */
49
+ databasePresence: (dbPath: string) => "present" | "absent" | "indeterminate";
50
+ readAccessRow: (dbPath: string, service: string) => TccAccessLookup;
51
+ verifyStoredRequirement: (csreqHex: string, appPath: string) => TccIdentityVerification;
52
+ describeStoredRequirement?: (csreqHex: string) => string | null;
53
+ }
54
+ export declare function tccDatabasePaths(home: string): string[];
55
+ export declare function tccAuthValueLabel(value: string): string;
56
+ export declare function verifyStoredRequirementWithCodesign(csreqHex: string, appPath: string, runner?: CodesignRequirementRunner, bundleExists?: (path: string) => boolean): TccIdentityVerification;
57
+ export declare function describeStoredRequirementWithCsreq(csreqHex: string, runner?: (requirementPath: string) => {
58
+ status: number | null;
59
+ stdout?: string;
60
+ error?: Error;
61
+ }): string | null;
62
+ export declare function resolveTccPermission(options: {
63
+ service: string;
64
+ home: string;
65
+ appPath: string | null;
66
+ probe?: TccPermissionProbe;
67
+ }): TccAuthorizationState;
68
+ export interface TccGrantReport {
69
+ state: TccAuthorizationState;
70
+ storedRequirement: string | null;
71
+ durability: TccGrantDurability;
72
+ }
73
+ export declare function resolveTccGrant(options: {
74
+ service: string;
75
+ home: string;
76
+ appPath: string | null;
77
+ probe?: TccPermissionProbe;
78
+ }): TccGrantReport;
79
+ export type TccGrantDurability = "survives_rebuild_developer_id" | "survives_rebuild_certificate_anchored" | "dies_on_rebuild_cdhash_pinned" | "unknown";
80
+ export declare function classifyTccGrantDurability(options: {
81
+ designatedRequirement: string | null;
82
+ adHocSigned: boolean;
83
+ }): TccGrantDurability;
84
+ export declare function describeTccAuthorizationSubject(appPath: string | null): string;
13
85
  //# sourceMappingURL=macos-permissions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"macos-permissions.d.ts","sourceRoot":"","sources":["../../src/cli/macos-permissions.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,6BAA6B;IAC5C,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AAED,MAAM,MAAM,sBAAsB,G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,CAAC,eAAe,EAAE,MAAM,KAAK;IAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAA;CAMxF,GACH,MAAM,GAAG,IAAI,CAwBf;AAMD,wBAAgB,oBAAoB,CAAC,OAAO,EAAE;IAC5C,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,KAAK,CAAC,EAAE,kBAAkB,CAAC;CAC5B,GAAG,qBAAqB,CAExB;AAMD,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,qBAAqB,CAAC;IAC7B,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,UAAU,EAAE,kBAAkB,CAAC;CAChC;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,KAAK,CAAC,EAAE,kBAAkB,CAAC;CAC5B,GAAG,cAAc,CA6DjB;AAeD,MAAM,MAAM,kBAAkB,GAC1B,+BAA+B,GAC/B,uCAAuC,GACvC,+BAA+B,GAC/B,SAAS,CAAC;AAEd,wBAAgB,0BAA0B,CAAC,OAAO,EAAE;IAClD,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,WAAW,EAAE,OAAO,CAAC;CACtB,GAAG,kBAAkB,CAsBrB;AASD,wBAAgB,+BAA+B,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAK9E"}
@@ -0,0 +1,139 @@
1
+ /**
2
+ * Read and write the native macOS app's global recording trigger.
3
+ *
4
+ * The app registers its global hotkey through sindresorhus/KeyboardShortcuts (pinned
5
+ * 1.12.0 in src/native/Recordings/Package.swift), which persists the binding in the
6
+ * app's own UserDefaults domain. This module is the CLI-side mirror of that storage
7
+ * contract, so the trigger can be inspected and changed without opening the app's
8
+ * Settings window — the only place it was previously reachable.
9
+ *
10
+ * Storage contract, as implemented by KeyboardShortcuts 1.12.0:
11
+ * key = "KeyboardShortcuts_" + Name.rawValue (KeyboardShortcuts.swift)
12
+ * value = a JSON *string* (not a dict) encoding (Shortcut.swift)
13
+ * { "carbonKeyCode": Int, "carbonModifiers": Int }
14
+ * `carbonModifiers` is the OR of the classic Carbon modifier constants, per
15
+ * NSEvent.ModifierFlags.carbon in KeyboardShortcuts/Utilities.swift.
16
+ *
17
+ * The Swift side owns the shortcut *name* and its default; both are pinned against
18
+ * the Swift source by src/__tests__/macos-shortcut-contract.test.ts so the two
19
+ * languages cannot drift silently.
20
+ */
21
+ /**
22
+ * The `defaults` binary every read and write below goes through, or null when this machine
23
+ * has no app UserDefaults to reach at all.
24
+ *
25
+ * Pinned absolutely on macOS, so PATH cannot redirect the read that decides whether a
26
+ * trigger is armed — the same rule `scripts/macos_artifact.ts` applies to codesign
27
+ * (`CODESIGN_EXECUTABLE`, macos_artifact.ts:46-48, pinned by
28
+ * src/__tests__/macos-artifact-command-pinning.test.ts). Production macOS never consults
29
+ * the environment override.
30
+ *
31
+ * `null` off macOS is the load-bearing part. There is no `defaults` and no app there, and
32
+ * the previous code spawned `/usr/bin/defaults` anyway: `spawnSync` set `error` with a null
33
+ * status, `readDefault` mapped that to null, and the caller could not tell "this key is
34
+ * not set" from "there is nothing here to ask". A null executable makes the difference
35
+ * explicit, so a non-macOS `check` can say nothing about the trigger instead of reporting
36
+ * a machine with no app as one whose fn key is switched off.
37
+ *
38
+ * The off-macOS override is what lets a Linux host exercise this module's real code paths —
39
+ * including `recordings check`'s exit code — against a stand-in `defaults`, which is
40
+ * otherwise untestable anywhere in this fleet: the only Mac is the owner's production
41
+ * machine and it is observation-only.
42
+ */
43
+ export declare const TRIGGER_DEFAULTS_EXECUTABLE: string | null;
44
+ /**
45
+ * Blocker 3, discharged on rebase.
46
+ *
47
+ * This was `export const RECORDINGS_BUNDLE_ID = "com.hasna.recordings"` — a second definition of
48
+ * the identifier `macos-permissions.ts` already owns. The duplication was not carelessness: the
49
+ * canonical constant arrives with #24 and does not exist on this branch's base, so importing it
50
+ * before the rebase would have left the branch uncompilable rather than merely duplicated. The
51
+ * review ruling was recorded as a TODO(rebase) and is now honoured instead of carried forward.
52
+ *
53
+ * Kept as a re-export under the old name so the UserDefaults call sites below and the contract
54
+ * test keep reading, while there is exactly one definition. The identifier is the same value TCC
55
+ * keys grants to and the same domain the app writes its own preferences under — that is precisely
56
+ * why one owner matters: a bundle that does not carry it is not this app, whatever it is named.
57
+ *
58
+ * The same TODO also required reconciling `showGrantTargets()` here with #24's
59
+ * `describeTccAuthorizationSubject()`. They are NOT the same question and both are kept:
60
+ * `describeTccAuthorizationSubject()` names the single bundle a TCC grant is being reported FOR
61
+ * (one path, or a statement that no bundle is installed), while `showGrantTargets()` enumerates
62
+ * every candidate an operator might have to grant — running instances first, falling back to
63
+ * installed copies, labelling which case it is reporting. Collapsing them would lose the
64
+ * multiple-candidate disclosure, which is the whole point of the readout. They now share the one
65
+ * identifier definition, which is what the ruling was protecting against.
66
+ */
67
+ export declare const RECORDINGS_BUNDLE_ID = "com.hasna.recordings";
68
+ /** Matches `userDefaultsPrefix` in KeyboardShortcuts.swift. */
69
+ export declare const SHORTCUT_USER_DEFAULTS_PREFIX = "KeyboardShortcuts_";
70
+ /** Matches `Self("toggleRecording")` in RecordingsLib/RecordingEngine.swift. */
71
+ export declare const TOGGLE_RECORDING_SHORTCUT_NAME = "toggleRecording";
72
+ /** Matches the `useFnKey` UserDefaults key read in RecordingsLib/RecordingEngine.swift. */
73
+ export declare const USE_FN_KEY_DEFAULTS_KEY = "useFnKey";
74
+ /** Matches the Swift declaration `default: .init(.f5)` in RecordingEngine.swift. */
75
+ export declare const DEFAULT_TOGGLE_RECORDING_CHORD = "f5";
76
+ export declare const TOGGLE_RECORDING_DEFAULTS_KEY = "KeyboardShortcuts_toggleRecording";
77
+ /**
78
+ * What each trigger costs in TCC grants, and why. Kept as data rather than prose baked
79
+ * into the command so the CLI, the tests, and any future surface all state the same
80
+ * thing — and so the claim can be pinned against the Swift source that implements it.
81
+ *
82
+ * Verified against the shipped bundle on 2026-07-27 with `nm -u` on
83
+ * Recordings.app/Contents/MacOS/Recordings, which lists `_RegisterEventHotKey` (the
84
+ * hotkey) and `_CGEventTapCreate` + `_AXIsProcessTrusted` (the fn monitor).
85
+ */
86
+ export interface TriggerGrantRequirement {
87
+ id: "hotkey" | "fn";
88
+ label: string;
89
+ /** How the trigger is implemented — this is what decides the grant. */
90
+ mechanism: string;
91
+ /** null when the trigger needs no TCC grant at all. */
92
+ tccService: string | null;
93
+ /** null when there is nothing for the owner to switch on. */
94
+ settingsPath: string | null;
95
+ }
96
+ export declare const TRIGGER_GRANT_REQUIREMENTS: readonly TriggerGrantRequirement[];
97
+ export interface Shortcut {
98
+ carbonKeyCode: number;
99
+ carbonModifiers: number;
100
+ }
101
+ export interface TriggerState {
102
+ /** null when no binding is stored — the app then writes its own default at launch. */
103
+ shortcut: Shortcut | null;
104
+ /** Raw stored string, kept for diagnostics when parsing fails. */
105
+ rawShortcut: string | null;
106
+ useFnKey: boolean;
107
+ }
108
+ export declare class ShortcutParseError extends Error {
109
+ }
110
+ export declare function listBindableKeys(): string[];
111
+ /**
112
+ * Parse a chord such as "f13", "ctrl+opt+r" or "⌘⇧Space" into its Carbon encoding.
113
+ * Modifier-only chords are rejected: Carbon's RegisterEventHotKey needs a real key.
114
+ */
115
+ export declare function parseShortcutChord(input: string): Shortcut;
116
+ /** Render a stored shortcut the way macOS would show it, e.g. "⌃⌥R" or "F13". */
117
+ export declare function formatShortcut(shortcut: Shortcut): string;
118
+ /** Injectable so the process scan can be tested without a running app. */
119
+ export type ProcessLister = () => string | null;
120
+ /** Reads a bundle's CFBundleIdentifier, or null when it is not a readable bundle. */
121
+ export type BundleIdentifierReader = (bundlePath: string) => string | null;
122
+ export interface BundleScanProbes {
123
+ listProcesses?: ProcessLister;
124
+ readBundleIdentifier?: BundleIdentifierReader;
125
+ }
126
+ /**
127
+ * Bundle paths of the Recordings.app instances currently running.
128
+ *
129
+ * TCC grants key to a specific bundle (and, for an unstably-signed build, to its cdhash),
130
+ * so "which bundle is running" is the only honest answer to "where does the Accessibility
131
+ * grant have to go". Reporting a nominal install path instead is how a permission readout
132
+ * ends up naming a bundle that is not the one being denied.
133
+ */
134
+ export declare function runningAppBundlePaths(probes?: BundleScanProbes): string[];
135
+ export declare function parseStoredShortcut(raw: string | null): Shortcut | null;
136
+ export declare function readTriggerState(): TriggerState;
137
+ export declare function writeShortcut(shortcut: Shortcut): void;
138
+ export declare function writeUseFnKey(enabled: boolean): void;
139
+ //# sourceMappingURL=macos-shortcut.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"macos-shortcut.d.ts","sourceRoot":"","sources":["../../src/cli/macos-shortcut.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAMH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,2BAA2B,EAAE,MAAM,GAAG,IAGU,CAAC;AAE9D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,oBAAoB,yBAA+B,CAAC;AAEjE,+DAA+D;AAC/D,eAAO,MAAM,6BAA6B,uBAAuB,CAAC;AAElE,gFAAgF;AAChF,eAAO,MAAM,8BAA8B,oBAAoB,CAAC;AAEhE,2FAA2F;AAC3F,eAAO,MAAM,uBAAuB,aAAa,CAAC;AAElD,oFAAoF;AACpF,eAAO,MAAM,8BAA8B,OAAO,CAAC;AAEnD,eAAO,MAAM,6BAA6B,sCAAsE,CAAC;AAEjH;;;;;;;;GAQG;AACH,MAAM,WAAW,uBAAuB;IACtC,EAAE,EAAE,QAAQ,GAAG,IAAI,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,uEAAuE;IACvE,SAAS,EAAE,MAAM,CAAC;IACl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,aAAa,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAMtD;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAgBpD"}
@@ -0,0 +1,172 @@
1
+ /**
2
+ * Whether a global recording trigger can actually fire, as a diagnosis rather than a dump.
3
+ *
4
+ * Why this exists: on 2026-07-27 the owner's fn key was dead for days with `useFnKey=0` in the
5
+ * `com.hasna.recordings` defaults domain, and every diagnostic reported green throughout —
6
+ * `recordings check` looked at sox and API keys, `app status` at the bundle, `app permissions`
7
+ * at TCC grants, and not one of them looked at the trigger. The machinery to read the trigger
8
+ * arrived with PR #26 (`readTriggerState`, `TRIGGER_GRANT_REQUIREMENTS` in
9
+ * `./macos-shortcut.ts`) but was wired only into the new `recordings shortcut` command, which
10
+ * is no use to the person who does not yet know what is wrong. This module turns those reads
11
+ * into a verdict the commands an operator already runs can report and fail on.
12
+ *
13
+ * Two rules shape everything below.
14
+ *
15
+ * 1. Conservative about failure. A false "your trigger is dead" on a working machine is worse
16
+ * than the silence being fixed, so each trigger is three-valued — `yes`, `no`, `unknown` —
17
+ * and the command only fails when EVERY trigger is a definite `no`. Anything undecidable
18
+ * is reported loudly and counted as usable.
19
+ * 2. Cheap. `runningAppBundlePaths()` in `./macos-shortcut.ts` walks `ps` and spawns a
20
+ * `defaults` read per path candidate; it was measured at ~11.6 s per call. Nothing here
21
+ * calls it. The storage read is two `defaults` reads of the app's own domain, and the
22
+ * runtime observation is a bounded tail of a log file. A `check` that takes 12 seconds is a
23
+ * `check` nobody runs, which would reintroduce the silence by another route.
24
+ */
25
+ import { type Shortcut, type TriggerState } from "./macos-shortcut.js";
26
+ /** Three-valued on purpose — see rule 1 in the module comment. */
27
+ export type TriggerCapability = "yes" | "no" | "unknown";
28
+ /**
29
+ * What the stored hotkey value means, which is three things and not two.
30
+ *
31
+ * KeyboardShortcuts 1.12.0 (pinned in src/native/Recordings/Package.swift) decides this, and
32
+ * the app inherits its decision:
33
+ *
34
+ * - key ABSENT -> `Name.init(_:default:)` applies the declared default, but only
35
+ * `if !userDefaultsContains(name:)` (Name.swift:39-45). So an absent key
36
+ * means the app registers F5 the next time it launches: a trigger
37
+ * exists, it is just not written down yet.
38
+ * - key = JSON -> that chord, decoded by `getShortcut` (KeyboardShortcuts.swift:293-301).
39
+ * - key = Bool false -> `setShortcut(nil, ...)` routes to `userDefaultsDisable`, which writes
40
+ * `false` rather than removing the key (KeyboardShortcuts.swift:279-289,
41
+ * 434-442). `userDefaultsContains` is then true, so the default is NOT
42
+ * applied and `getShortcut` returns nil: NOTHING is registered. This is
43
+ * the state a user reaches by clearing the shortcut in Settings, and it
44
+ * is the only state in which "no hotkey is bound" is literally true.
45
+ *
46
+ * `parseStoredShortcut` collapses the last two to null, and `recordings shortcut` renders the
47
+ * cleared case as "unreadable (0)" — accurate about the bytes, silent about the consequence.
48
+ */
49
+ export type HotkeyBindingState = "bound" | "default_pending" | "cleared" | "unreadable";
50
+ export interface HotkeyBinding {
51
+ state: HotkeyBindingState;
52
+ /** How the effective chord renders, or null when nothing will be registered. */
53
+ chord: string | null;
54
+ /** Only set for `bound` — a pending default is not a stored value and must not read as one. */
55
+ shortcut: Shortcut | null;
56
+ /** Kept verbatim: the raw value is the evidence when the state is `unreadable`. */
57
+ stored_raw: string | null;
58
+ can_fire: TriggerCapability;
59
+ defaults_key: string;
60
+ }
61
+ export interface FnTriggerState {
62
+ use_fn_key: boolean;
63
+ /** The TCC state as `getMacOSAppStatus()` resolved it, or null when it was not measured. */
64
+ accessibility_permission: string | null;
65
+ can_fire: TriggerCapability;
66
+ defaults_key: string;
67
+ }
68
+ /**
69
+ * The app's own last report of its trigger, parsed out of its diagnostic log.
70
+ *
71
+ * This is the only honest answer to "is the fn event tap actually running": the tap lives
72
+ * inside the app, `FnKeyMonitor.isRunning` asks `CGEvent.tapIsEnabled` about it, and a CLI in
73
+ * another process cannot observe it. `RecordingEngine.logResolvedTrigger()` writes exactly
74
+ * that, so reading it costs a file read instead of a process scan — and it carries the
75
+ * app-side blocked reason too, which the menu-bar status line can lose to an unrelated
76
+ * erasure bug.
77
+ *
78
+ * It is an OBSERVATION, not live state: the app logs this at init and whenever the trigger
79
+ * changes, so it can be arbitrarily old. Every consumer below says when it was made.
80
+ */
81
+ export interface AppTriggerObservation {
82
+ observed_at: string | null;
83
+ /** As the app resolved it, e.g. "carbonKeyCode=96 carbonModifiers=0" or "none". */
84
+ shortcut_stored: string | null;
85
+ use_fn_key: boolean;
86
+ fn_monitor_running: boolean;
87
+ microphone: string | null;
88
+ accessibility: string | null;
89
+ /** The app's own blocked reason, or null when it reported `blocked=none`. */
90
+ blocked: string | null;
91
+ }
92
+ export interface TriggerDiagnosis {
93
+ /** false only when every trigger is a definite `no`. This is what gates the exit code. */
94
+ can_fire: boolean;
95
+ /** One line, built once so text output and `--json` cannot drift apart. */
96
+ summary: string;
97
+ defaults_domain: string;
98
+ hotkey: HotkeyBinding;
99
+ fn: FnTriggerState;
100
+ app_observation: AppTriggerObservation | null;
101
+ /** Reasons the trigger provably cannot fire. Non-empty exactly when `can_fire` is false. */
102
+ failures: string[];
103
+ /** Real problems that do not prove nothing can fire. */
104
+ warnings: string[];
105
+ /** Context that is not a problem. */
106
+ notes: string[];
107
+ }
108
+ export declare function resolveHotkeyBinding(state: TriggerState): HotkeyBinding;
109
+ export declare function resolveFnTrigger(useFnKey: boolean, accessibilityPermission: string | null): FnTriggerState;
110
+ /**
111
+ * Parse the app's last resolved-trigger log line.
112
+ *
113
+ * Field extraction is anchored on the following field name rather than split on whitespace,
114
+ * because two values legitimately contain spaces: `shortcutStored=carbonKeyCode=96
115
+ * carbonModifiers=0` embeds both a space and a second `=`, and `blocked=` carries free prose.
116
+ * Order is fixed by the single `log()` statement that produces the line
117
+ * (`RecordingEngine.logResolvedTrigger()`), and
118
+ * src/__tests__/trigger-diagnosis.test.ts renders that statement's own format string through
119
+ * this parser so the two cannot drift apart silently.
120
+ *
121
+ * Returns null rather than a half-filled record when the two booleans that decide anything are
122
+ * missing: an unparseable line means the runtime state is unknown, which is a different claim
123
+ * from "the tap is not running".
124
+ */
125
+ export declare function parseTriggerBindingsLog(logText: string | null): AppTriggerObservation | null;
126
+ /**
127
+ * The tail of the app's diagnostic log, or null when there is nothing to read.
128
+ *
129
+ * Bounded because the log is append-only with no rotation. Reading all of it would make the
130
+ * cost of `check` a function of how long the app has been running, and the whole point of
131
+ * putting this in `check` is that it stays fast enough to be run. A trigger line older than
132
+ * the window reads as "no observation", which is reported as unknown — never as a failure.
133
+ */
134
+ export declare function readAppLogTail(logPath: string | null, maxBytes?: number): string | null;
135
+ export interface DiagnoseTriggerInput {
136
+ trigger: TriggerState;
137
+ accessibilityPermission: string | null;
138
+ observation: AppTriggerObservation | null;
139
+ }
140
+ export declare function diagnoseTrigger(input: DiagnoseTriggerInput): TriggerDiagnosis;
141
+ export interface ProbeTriggerInput {
142
+ /** As `getMacOSAppStatus()` resolved it, or null when it was not measured on this platform. */
143
+ accessibilityPermission: string | null;
144
+ /** `MacOSAppStatus.log_path`, which mirrors where the Swift `NativeAppLog` writes. */
145
+ appLogPath: string | null;
146
+ }
147
+ /**
148
+ * Read the trigger and diagnose it, or return null when this machine has no app UserDefaults
149
+ * to ask.
150
+ *
151
+ * Gated on the capability rather than on `process.platform`: what the diagnosis needs is a
152
+ * readable `defaults` domain, and off macOS `TRIGGER_DEFAULTS_EXECUTABLE` is null, so callers
153
+ * get null and report nothing rather than describing a machine with no app as one whose fn key
154
+ * is switched off.
155
+ */
156
+ export declare function probeTriggerDiagnostics(input: ProbeTriggerInput): TriggerDiagnosis | null;
157
+ export interface TriggerPickup {
158
+ /** Whether the value just written is the value that will actually fire. */
159
+ armed: boolean;
160
+ runningBundlePaths: string[];
161
+ }
162
+ /**
163
+ * Whether a trigger write took effect.
164
+ *
165
+ * A write lands in UserDefaults, which decides what the NEXT launch registers; a running
166
+ * instance keeps the binding it registered with. `recordings shortcut --fn on` printed that
167
+ * truthfully and then exited 0, so `recordings shortcut --fn on && echo armed` printed
168
+ * "armed" while the trigger was not armed — the same class of false green this whole surface
169
+ * exists to remove, just in an exit code instead of a status line.
170
+ */
171
+ export declare function describeTriggerPickup(runningBundlePaths: string[]): TriggerPickup;
172
+ //# sourceMappingURL=trigger-probe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trigger-probe.d.ts","sourceRoot":"","sources":["../../src/cli/trigger-probe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAIH,OAAO,EASL,KAAK,QAAQ,EACb,KAAK,YAAY,EAClB,MAAM,qBAAqB,CAAC;AAE7B,kEAAkE;AAClE,MAAM,MAAM,iBAAiB,GAAG,KAAK,GAAG,IAAI,GAAG,SAAS,CAAC;AAEzD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,iBAAiB,GAAG,SAAS,GAAG,YAAY,CAAC;AAExF,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,kBAAkB,CAAC;IAC1B,gFAAgF;IAChF,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,+FAA+F;IAC/F,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC1B,mFAAmF;IACnF,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,OAAO,CAAC;IACpB,4FAA4F;IAC5F,wBAAwB,EAAE,MAAM,GAAG,IAAI,CAAC;IACxC,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,mFAAmF;IACnF,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/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,EAAE,oBAAoB,GAAG,gBAAgB,CA8G7E;AAsBD,MAAM,WAAW,iBAAiB;IAChC,+FAA+F;IAC/F,uBAAuB,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,sFAAsF;IACtF,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,iBAAiB,GAAG,gBAAgB,GAAG,IAAI,CAOzF;AAED,MAAM,WAAW,aAAa;IAC5B,2EAA2E;IAC3E,KAAK,EAAE,OAAO,CAAC;IACf,kBAAkB,EAAE,MAAM,EAAE,CAAC;CAC9B;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,kBAAkB,EAAE,MAAM,EAAE,GAAG,aAAa,CAEjF"}
@@ -1,5 +1,14 @@
1
1
  import { Database } from "bun:sqlite";
2
2
  import { SqliteAdapter } from "./sqlite-adapter.js";
3
+ export declare const MIGRATIONS: string[];
4
+ /**
5
+ * Migration id a fully-migrated store carries in `_migrations`.
6
+ *
7
+ * Exposed so a diagnostic can tell a current store from a legacy one by reading
8
+ * it, rather than by opening it read-write — which is itself the act of
9
+ * migrating, and therefore the thing being checked for.
10
+ */
11
+ export declare const CURRENT_MIGRATION_LEVEL: number;
3
12
  export declare function getDatabase(dbPath?: string): Database;
4
13
  export declare function closeDatabase(): void;
5
14
  export declare function resetDatabase(): void;
@@ -1 +1 @@
1
- {"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../../src/db/database.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AA+FpD,wBAAgB,WAAW,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,QAAQ,CAiBrD;AAsED,wBAAgB,aAAa,IAAI,IAAI,CAMpC;AAED,wBAAgB,aAAa,IAAI,IAAI,CAGpC;AAED,oEAAoE;AACpE,wBAAgB,UAAU,IAAI,aAAa,CAK1C;AAED,wBAAgB,SAAS,IAAI,MAAM,CAElC;AAED,wBAAgB,SAAS,IAAI,MAAM,CAElC"}
1
+ {"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../../src/db/database.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAQpD,eAAO,MAAM,UAAU,UAqFtB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB,QAAwB,CAAC;AAE7D,wBAAgB,WAAW,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,QAAQ,CAiBrD;AA0ED,wBAAgB,aAAa,IAAI,IAAI,CAMpC;AAED,wBAAgB,aAAa,IAAI,IAAI,CAGpC;AAED,oEAAoE;AACpE,wBAAgB,UAAU,IAAI,aAAa,CAK1C;AAED,wBAAgB,SAAS,IAAI,MAAM,CAElC;AAED,wBAAgB,SAAS,IAAI,MAAM,CAElC"}
@@ -1,12 +1,24 @@
1
1
  export type Env = Record<string, string | undefined>;
2
- export type StorageMode = "local" | "cloud";
3
- export declare function defaultCloudBaseUrl(name: string): string;
2
+ /** Where a client reads and writes. Two arms, no third. */
3
+ export type ClientStore = "sqlite" | "http";
4
+ /**
5
+ * Fallback API base URL when the client store resolves to `http` and no
6
+ * `HASNA_<APP>_API_URL` is set. It points at the app's own server on the same
7
+ * machine (`recordings-serve`'s default port — see DEFAULT_PORT in
8
+ * src/server/index.ts). This default deliberately contains no internal-infra
9
+ * hostname: a remote deployment sets `HASNA_<APP>_API_URL` explicitly. The
10
+ * `name` argument is retained for signature compatibility with the public
11
+ * `@hasna/recordings/storage` surface; it no longer derives a hostname.
12
+ */
13
+ export declare function defaultApiBaseUrl(name: string): string;
4
14
  export declare function toV1BaseUrl(apiUrl: string): string;
5
- export type TransportKind = "local" | "cloud-http";
15
+ export type TransportKind = ClientStore;
6
16
  export interface TransportResolution {
17
+ /** The store actually in use. `sqlite` whenever routing to `http` was refused. */
7
18
  transport: TransportKind;
8
- mode: StorageMode;
9
- deprecatedAlias: string | null;
19
+ /** The store that was asked for. Differs from `transport` only when misconfigured. */
20
+ requested: ClientStore;
21
+ /** What decided it: an env var NAME, `auto:api-url+api-key`, or `default`. Never a value. */
10
22
  modeSource: string;
11
23
  baseUrl: string | null;
12
24
  apiKeyPresent: boolean;
@@ -64,11 +76,11 @@ export interface StorageClient {
64
76
  }
65
77
  export declare function createStorageClient(name: string, transport: HttpTransport): StorageClient;
66
78
  export type ResolveResult = {
67
- transport: "local";
79
+ transport: "sqlite";
68
80
  client: null;
69
81
  resolution: TransportResolution;
70
82
  } | {
71
- transport: "cloud-http";
83
+ transport: "http";
72
84
  client: StorageClient;
73
85
  resolution: TransportResolution;
74
86
  };
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/http/client.ts"],"names":[],"mappings":"AAgBA,MAAM,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;AACrD,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,OAAO,CAAC;AAkB5C,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAExD;AAyBD,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAWlD;AAED,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,YAAY,CAAC;AAEnD,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,aAAa,CAAC;IACzB,IAAI,EAAE,WAAW,CAAC;IAClB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,aAAa,EAAE,OAAO,CAAC;IACvB,aAAa,EAAE,OAAO,CAAC;IACvB,OAAO,EAAE,MAAM,GAAG,IAAI,CAA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,CAAC,CAAC;IAC1F,MAAM,CAAC,CAAC,GAAG,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACxG,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACrD;AAaD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,GAAG,aAAa,CAmCzF;AAED,MAAM,MAAM,aAAa,GACrB;IAAE,SAAS,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,IAAI,CAAC;IAAC,UAAU,EAAE,mBAAmB,CAAA;CAAE,GACtE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,aAAa,CAAC;IAAC,UAAU,EAAE,mBAAmB,CAAA;CAAE,CAAC;AAMlF,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,GAAE,GAAiB,EAAE,SAAS,CAAC,EAAE,SAAS,GAAG,aAAa,CAa/G"}
package/dist/index.d.ts CHANGED
@@ -3,11 +3,13 @@ export { RecordingNotFoundError, RecordingError, TranscriptionError, Enhancement
3
3
  export { getStore, __resetStore, APP } from "./store.js";
4
4
  export type { Store, RecordingStats, FeedbackInput } from "./store.js";
5
5
  export { resolveStorageClient, resolveTransport, createHttpTransport, createStorageClient, HasnaHttpError, } from "./http/client.js";
6
- export type { StorageClient, StorageMode, TransportResolution, HttpTransport, } from "./http/client.js";
6
+ export type { StorageClient, ClientStore, TransportResolution, HttpTransport, } from "./http/client.js";
7
7
  export { loadConfig, getDataDir, ensureDataDir, DEFAULT_CONFIG, DEFAULT_TRANSCRIPTION_MODEL, DEFAULT_REALTIME_SESSION_MODEL, DEFAULT_REALTIME_TRANSCRIPTION_MODEL, normalizeModelSlots, normalizePostProcessingConfig, normalizePostProcessingMode, } from "./lib/config.js";
8
8
  export { transcribeAudio, transcribeBuffer, resetClient, } from "./lib/transcriber.js";
9
9
  export { needsEnhancement, enhanceText, processText, resetEnhancementClient, } from "./lib/enhancer.js";
10
10
  export { startRecording, stopRecording, isRecording, getCurrentFile, checkRecordingDeps, recordDuration, } from "./lib/recorder.js";
11
+ export { probeMicrophoneCapture, captureProbePrecondition, captureProbeSubject, microphoneGrantInstruction, classifyPermissionState, readWavPeak, DEFAULT_PROBE_SECONDS, MAX_PROBE_SECONDS, SILENCE_PEAK_THRESHOLD, DEFAULT_RECORD_EXECUTABLE, RECORDINGS_BUNDLE_IDENTIFIER, TCC_UNREADABLE_STATE, type CaptureProbeResult, type CaptureProbeSubject, type MicrophoneGrantInstruction, type PermissionRequestState, type WavPeak, } from "./lib/capture-probe.js";
12
+ export { describeActiveStore, probeRecordingPersistence, safeBaseUrl, AUTO_FLIP_MODE_SOURCE, PERSISTENCE_PROBE_TAG, PERSISTENCE_PROBE_MARKER_PREFIX, type ActiveStoreDescription, type PersistenceProbeResult, } from "./lib/persistence-probe.js";
11
13
  export { RecordingsV1Client, RecordingsV1ApiError, } from "./sdk/index.js";
12
14
  export type { RecordingsV1ClientOptions, RecordingsV1Recording, RecordingsV1Agent, RecordingsV1Project, RecordingsV1CreateRecordingInput, RecordingsV1RegisterAgentInput, RecordingsV1RegisterProjectInput, } from "./sdk/index.js";
13
15
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,SAAS,EACT,oBAAoB,EACpB,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,KAAK,EACL,OAAO,EACP,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,sBAAsB,EACtB,cAAc,EACd,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACzD,YAAY,EAAE,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACvE,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,cAAc,GACf,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACV,aAAa,EACb,WAAW,EACX,mBAAmB,EACnB,aAAa,GACd,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACL,UAAU,EACV,UAAU,EACV,aAAa,EACb,cAAc,EACd,2BAA2B,EAC3B,8BAA8B,EAC9B,oCAAoC,EACpC,mBAAmB,EACnB,6BAA6B,EAC7B,2BAA2B,GAC5B,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,WAAW,GACZ,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,sBAAsB,GACvB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,cAAc,EACd,aAAa,EACb,WAAW,EACX,cAAc,EACd,kBAAkB,EAClB,cAAc,GACf,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,yBAAyB,EACzB,qBAAqB,EACrB,iBAAiB,EACjB,mBAAmB,EACnB,gCAAgC,EAChC,8BAA8B,EAC9B,gCAAgC,GACjC,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,SAAS,EACT,oBAAoB,EACpB,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,KAAK,EACL,OAAO,EACP,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM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