@agent-native/core 0.114.5 → 0.114.7
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/corpus/README.md +2 -2
- package/corpus/core/CHANGELOG.md +14 -0
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/cli/mcp-config-writers.ts +6 -4
- package/corpus/core/src/cli/mcp.ts +124 -0
- package/corpus/core/src/cli/skills-content/help.ts +4 -3
- package/corpus/core/src/cli/skills-content/index.ts +1 -0
- package/corpus/core/src/cli/skills-content/rewind-skill.ts +52 -0
- package/corpus/core/src/cli/skills.ts +115 -13
- package/corpus/core/src/client/resources/ResourceTree.tsx +11 -5
- package/corpus/core/src/client/resources/ResourcesPanel.tsx +141 -18
- package/corpus/core/src/mcp/screen-memory-stdio.ts +1360 -104
- package/corpus/core/src/mcp-client/index.ts +9 -0
- package/corpus/core/src/mcp-client/screen-memory-local.ts +847 -13
- package/corpus/templates/clips/actions/apply-rewind-extension.ts +195 -0
- package/corpus/templates/clips/actions/delete-agent-recording-if-unpromoted.ts +64 -0
- package/corpus/templates/clips/actions/get-rewind-extension-request.ts +22 -0
- package/corpus/templates/clips/actions/get-screen-memory-status.ts +18 -2
- package/corpus/templates/clips/actions/list-rewind-extension-requests.ts +52 -0
- package/corpus/templates/clips/actions/make-recording-private-for-rewind.ts +55 -0
- package/corpus/templates/clips/actions/query-screen-memory-context.ts +4 -4
- package/corpus/templates/clips/actions/request-rewind-extension.ts +81 -0
- package/corpus/templates/clips/actions/update-rewind-extension-request.ts +47 -0
- package/corpus/templates/clips/app/components/editor/editor-layout.tsx +25 -0
- package/corpus/templates/clips/app/components/editor/editor-toolbar.tsx +36 -0
- package/corpus/templates/clips/app/components/editor/rewind-extension-dialog.tsx +338 -0
- package/corpus/templates/clips/app/components/editor/stitch-manager.tsx +1 -16
- package/corpus/templates/clips/app/components/editor/timeline.tsx +26 -0
- package/corpus/templates/clips/app/components/meetings/meeting-card.tsx +1 -2
- package/corpus/templates/clips/app/i18n/en-US.ts +18 -0
- package/corpus/templates/clips/app/lib/ffmpeg-export.ts +19 -12
- package/corpus/templates/clips/app/lib/rewind-visibility.ts +31 -0
- package/corpus/templates/clips/app/lib/timestamp-mapping.ts +7 -0
- package/corpus/templates/clips/app/lib/upload-file-client.ts +17 -0
- package/corpus/templates/clips/changelog/2026-07-14-rewind-keeps-recent-screen-context-local-and-turns-it-into-clips.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-17-active-clips-keep-rewind-stable-and-settings-clear.md +12 -0
- package/corpus/templates/clips/changelog/2026-07-17-clicking-the-clips-icon-during-a-recording-now-opens-the-app.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-17-default-mic-now-uses-the-mac-default-and-transcription-shares-one-capture.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-17-full-screen-clips-finalize-even-when-screencapturekit-stop-hangs.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-17-normal-full-screen-clips-no-longer-stop-immediately-after-th.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-17-rewind-can-hand-one-bounded-private-clip-to-your-agent.md +12 -0
- package/corpus/templates/clips/changelog/2026-07-17-rewind-home-can-copy-a-local-agent-prompt.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-17-rewind-now-has-a-calm-home-status-focused-first-run-consent-.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-17-rewind-settings-are-smaller-clearer-and-agent-first.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-17-the-full-clips-interface-stays-available-while-recording.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-18-rewind-organizes-recent-work-into-local-searchable-chapters.md +8 -0
- package/corpus/templates/clips/changelog/2026-07-18-searchable-rewind-chapters.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-19-rewind-backed-recordings-now-start-immediately-after-the-cou.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-20-opening-zoom-meeting-launches-native-app.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-20-rewind-can-set-up-your-local-agent-once-so-future-requests-w.md +6 -0
- package/corpus/templates/clips/desktop/package.json +1 -0
- package/corpus/templates/clips/desktop/scripts/sign-macos-local.ts +12 -1
- package/corpus/templates/clips/desktop/src/app.tsx +2478 -223
- package/corpus/templates/clips/desktop/src/components/ReadinessPanel.tsx +21 -1
- package/corpus/templates/clips/desktop/src/components/Switch.tsx +3 -0
- package/corpus/templates/clips/desktop/src/hooks/useMeetingTranscription.ts +156 -24
- package/corpus/templates/clips/desktop/src/lib/native-recording-warm.ts +6 -7
- package/corpus/templates/clips/desktop/src/lib/open-meeting-join-url.ts +22 -0
- package/corpus/templates/clips/desktop/src/lib/recorder.ts +1763 -1160
- package/corpus/templates/clips/desktop/src/lib/rewind-agent-prompt.ts +9 -0
- package/corpus/templates/clips/desktop/src/lib/rewind-recording-start.ts +20 -0
- package/corpus/templates/clips/desktop/src/main.tsx +3 -0
- package/corpus/templates/clips/desktop/src/overlays/countdown.tsx +14 -14
- package/corpus/templates/clips/desktop/src/overlays/meeting-notification.tsx +2 -3
- package/corpus/templates/clips/desktop/src/overlays/onboarding.tsx +4 -4
- package/corpus/templates/clips/desktop/src/overlays/preparing.tsx +13 -0
- package/corpus/templates/clips/desktop/src/overlays/toolbar.tsx +27 -2
- package/corpus/templates/clips/desktop/src/shared/config.ts +16 -0
- package/corpus/templates/clips/desktop/src/styles.css +956 -134
- package/corpus/templates/clips/desktop/src-tauri/Cargo.toml +5 -0
- package/corpus/templates/clips/desktop/src-tauri/build.rs +69 -1
- package/corpus/templates/clips/desktop/src-tauri/src/accessibility.rs +386 -12
- package/corpus/templates/clips/desktop/src-tauri/src/capture_audio_bus.rs +382 -0
- package/corpus/templates/clips/desktop/src-tauri/src/capture_graph.rs +777 -0
- package/corpus/templates/clips/desktop/src-tauri/src/clips/mod.rs +249 -22
- package/corpus/templates/clips/desktop/src-tauri/src/config.rs +148 -1
- package/corpus/templates/clips/desktop/src-tauri/src/lib.rs +58 -4
- package/corpus/templates/clips/desktop/src-tauri/src/logfile.rs +13 -1
- package/corpus/templates/clips/desktop/src-tauri/src/native_screen/custom_capture.rs +1505 -51
- package/corpus/templates/clips/desktop/src-tauri/src/native_screen/live_upload.rs +124 -0
- package/corpus/templates/clips/desktop/src-tauri/src/native_screen.rs +1006 -95
- package/corpus/templates/clips/desktop/src-tauri/src/rewind_capture_suspension.rs +165 -0
- package/corpus/templates/clips/desktop/src-tauri/src/rewind_chapters.rs +2434 -0
- package/corpus/templates/clips/desktop/src-tauri/src/rewind_clip.rs +1650 -0
- package/corpus/templates/clips/desktop/src-tauri/src/rewind_egress.rs +643 -0
- package/corpus/templates/clips/desktop/src-tauri/src/rewind_local_ask.rs +803 -0
- package/corpus/templates/clips/desktop/src-tauri/src/rewind_meeting_history.rs +595 -0
- package/corpus/templates/clips/desktop/src-tauri/src/screen_memory.rs +2900 -91
- package/corpus/templates/clips/desktop/src-tauri/src/screen_memory_ocr.rs +360 -0
- package/corpus/templates/clips/desktop/src-tauri/src/screen_memory_transcript.rs +408 -0
- package/corpus/templates/clips/desktop/src-tauri/src/shortcuts.rs +114 -33
- package/corpus/templates/clips/desktop/src-tauri/src/state.rs +2 -2
- package/corpus/templates/clips/desktop/src-tauri/src/system_audio.rs +13 -3
- package/corpus/templates/clips/desktop/src-tauri/src/tray.rs +4 -1
- package/corpus/templates/clips/desktop/src-tauri/src/util.rs +7 -13
- package/corpus/templates/clips/desktop/src-tauri/src/whisper_speech.rs +198 -11
- package/corpus/templates/clips/desktop/src-tauri/tauri.alpha.conf.json +17 -0
- package/corpus/templates/clips/shared/meeting-join-url.ts +0 -5
- package/corpus/templates/content/.agents/skills/document-editing/SKILL.md +9 -1
- package/corpus/templates/content/AGENTS.md +4 -1
- package/corpus/templates/content/actions/_content-spaces.ts +6 -1
- package/corpus/templates/content/actions/_database-row-batch.ts +15 -2
- package/corpus/templates/content/actions/_database-utils.ts +83 -15
- package/corpus/templates/content/actions/add-database-item.ts +3 -0
- package/corpus/templates/content/actions/connect-local-folder-source.ts +2 -1
- package/corpus/templates/content/actions/delete-content-database.ts +12 -9
- package/corpus/templates/content/actions/delete-database-items.ts +3 -2
- package/corpus/templates/content/actions/delete-document.ts +233 -6
- package/corpus/templates/content/actions/duplicate-database-item.ts +1 -0
- package/corpus/templates/content/actions/get-document.ts +4 -1
- package/corpus/templates/content/actions/list-content-databases.ts +1 -0
- package/corpus/templates/content/actions/list-documents.ts +1 -0
- package/corpus/templates/content/actions/list-trashed-content-databases.ts +8 -2
- package/corpus/templates/content/actions/list-trashed-documents.ts +50 -0
- package/corpus/templates/content/actions/permanently-delete-document.ts +28 -0
- package/corpus/templates/content/actions/pull-document.ts +15 -2
- package/corpus/templates/content/actions/restore-content-database.ts +48 -11
- package/corpus/templates/content/actions/restore-document.ts +28 -0
- package/corpus/templates/content/actions/search-documents.ts +2 -1
- package/corpus/templates/content/actions/view-screen.ts +2 -1
- package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +149 -55
- package/corpus/templates/content/app/components/editor/database/GalleryView.tsx +7 -2
- package/corpus/templates/content/app/components/editor/database/ListView.tsx +7 -2
- package/corpus/templates/content/app/components/editor/database/TimelineView.tsx +3 -0
- package/corpus/templates/content/app/components/editor/database/sidebar.tsx +26 -5
- package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +243 -163
- package/corpus/templates/content/app/components/sidebar/WorkspaceSourceMenu.tsx +154 -0
- package/corpus/templates/content/app/components/sidebar/select-content-space.ts +11 -0
- package/corpus/templates/content/app/hooks/use-content-database.ts +6 -0
- package/corpus/templates/content/app/hooks/use-documents.ts +57 -0
- package/corpus/templates/content/app/i18n-data.ts +83 -2
- package/corpus/templates/content/app/routes/_app.local-files.tsx +8 -1
- package/corpus/templates/content/changelog/2026-07-19-pages-now-move-to-a-reversible-trash-and-the-organization-pi.md +6 -0
- package/corpus/templates/content/changelog/2026-07-20-trash-actions-now-preserve-independent-archived-pages-enforc.md +6 -0
- package/corpus/templates/content/changelog/2026-07-20-workspace-toggles-now-stay-independently-open-or-closed-and-.md +6 -0
- package/corpus/templates/content/changelog/2026-07-20-workspaces-can-be-added-from-a-blank-workspace-or-a-connecte.md +6 -0
- package/corpus/templates/content/parity/matrix.md +1 -1
- package/corpus/templates/content/parity/matrix.ts +3 -0
- package/corpus/templates/content/server/db/schema.ts +2 -0
- package/corpus/templates/content/server/lib/public-documents.ts +8 -2
- package/corpus/templates/content/server/plugins/db.ts +52 -0
- package/corpus/templates/content/server/routes/api/document-agent-context.json.get.ts +2 -2
- package/corpus/templates/content/shared/api.ts +10 -0
- package/corpus/toolkit/CHANGELOG.md +6 -0
- package/corpus/toolkit/package.json +1 -1
- package/corpus/toolkit/src/ui/progress.tsx +3 -2
- package/dist/cli/mcp-config-writers.d.ts +2 -2
- package/dist/cli/mcp-config-writers.d.ts.map +1 -1
- package/dist/cli/mcp-config-writers.js +6 -6
- package/dist/cli/mcp-config-writers.js.map +1 -1
- package/dist/cli/mcp.d.ts +14 -0
- package/dist/cli/mcp.d.ts.map +1 -1
- package/dist/cli/mcp.js +79 -0
- package/dist/cli/mcp.js.map +1 -1
- package/dist/cli/skills-content/help.d.ts +1 -1
- package/dist/cli/skills-content/help.d.ts.map +1 -1
- package/dist/cli/skills-content/help.js +4 -3
- package/dist/cli/skills-content/help.js.map +1 -1
- package/dist/cli/skills-content/index.d.ts +1 -0
- package/dist/cli/skills-content/index.d.ts.map +1 -1
- package/dist/cli/skills-content/index.js +1 -0
- package/dist/cli/skills-content/index.js.map +1 -1
- package/dist/cli/skills-content/rewind-skill.d.ts +2 -0
- package/dist/cli/skills-content/rewind-skill.d.ts.map +1 -0
- package/dist/cli/skills-content/rewind-skill.js +53 -0
- package/dist/cli/skills-content/rewind-skill.js.map +1 -0
- package/dist/cli/skills.d.ts +6 -0
- package/dist/cli/skills.d.ts.map +1 -1
- package/dist/cli/skills.js +90 -14
- package/dist/cli/skills.js.map +1 -1
- package/dist/client/resources/ResourceTree.d.ts +3 -1
- package/dist/client/resources/ResourceTree.d.ts.map +1 -1
- package/dist/client/resources/ResourceTree.js +4 -4
- package/dist/client/resources/ResourceTree.js.map +1 -1
- package/dist/client/resources/ResourcesPanel.d.ts.map +1 -1
- package/dist/client/resources/ResourcesPanel.js +55 -6
- package/dist/client/resources/ResourcesPanel.js.map +1 -1
- package/dist/collab/routes.d.ts +1 -1
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/mcp/screen-memory-stdio.d.ts +365 -0
- package/dist/mcp/screen-memory-stdio.d.ts.map +1 -1
- package/dist/mcp/screen-memory-stdio.js +1014 -91
- package/dist/mcp/screen-memory-stdio.js.map +1 -1
- package/dist/mcp-client/index.d.ts +1 -1
- package/dist/mcp-client/index.d.ts.map +1 -1
- package/dist/mcp-client/index.js +1 -1
- package/dist/mcp-client/index.js.map +1 -1
- package/dist/mcp-client/screen-memory-local.d.ts +90 -0
- package/dist/mcp-client/screen-memory-local.d.ts.map +1 -1
- package/dist/mcp-client/screen-memory-local.js +590 -12
- package/dist/mcp-client/screen-memory-local.js.map +1 -1
- package/dist/notifications/routes.d.ts +2 -2
- package/dist/observability/routes.d.ts +5 -5
- package/dist/progress/routes.d.ts +1 -1
- package/dist/provider-api/actions/provider-api.d.ts +4 -4
- package/dist/resources/handlers.d.ts +1 -1
- package/dist/secrets/routes.d.ts +9 -9
- package/dist/server/transcribe-voice.d.ts +1 -1
- package/package.json +2 -2
- package/src/cli/mcp-config-writers.ts +6 -4
- package/src/cli/mcp.ts +124 -0
- package/src/cli/skills-content/help.ts +4 -3
- package/src/cli/skills-content/index.ts +1 -0
- package/src/cli/skills-content/rewind-skill.ts +52 -0
- package/src/cli/skills.ts +115 -13
- package/src/client/resources/ResourceTree.tsx +11 -5
- package/src/client/resources/ResourcesPanel.tsx +141 -18
- package/src/mcp/screen-memory-stdio.ts +1360 -104
- package/src/mcp-client/index.ts +9 -0
- package/src/mcp-client/screen-memory-local.ts +847 -13
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
use crate::capture_graph::CaptureSource;
|
|
2
|
+
use serde::Serialize;
|
|
3
|
+
use std::collections::BTreeSet;
|
|
4
|
+
use std::sync::atomic::{AtomicBool, AtomicU64, Ordering};
|
|
5
|
+
use std::sync::Mutex;
|
|
6
|
+
use tauri::{AppHandle, Manager};
|
|
7
|
+
|
|
8
|
+
static LEASE_COUNTER: AtomicU64 = AtomicU64::new(0);
|
|
9
|
+
static SUSPENSION_ACTIVE: AtomicBool = AtomicBool::new(false);
|
|
10
|
+
|
|
11
|
+
#[derive(Default)]
|
|
12
|
+
pub struct RewindCaptureSuspensionState {
|
|
13
|
+
inner: Mutex<RewindCaptureSuspensionRuntime>,
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
#[derive(Default)]
|
|
17
|
+
struct RewindCaptureSuspensionRuntime {
|
|
18
|
+
leases: BTreeSet<String>,
|
|
19
|
+
suspended_rewind: bool,
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
impl RewindCaptureSuspensionRuntime {
|
|
23
|
+
/// True only when this release removed the final live owner.
|
|
24
|
+
fn release_lease(&mut self, lease_id: &str) -> bool {
|
|
25
|
+
self.leases.remove(lease_id) && self.leases.is_empty()
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
#[derive(Debug, Serialize)]
|
|
30
|
+
#[serde(rename_all = "camelCase")]
|
|
31
|
+
pub struct RewindCaptureSuspensionLease {
|
|
32
|
+
lease_id: Option<String>,
|
|
33
|
+
suspended_rewind: bool,
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
fn next_lease_id() -> String {
|
|
37
|
+
let sequence = LEASE_COUNTER.fetch_add(1, Ordering::Relaxed);
|
|
38
|
+
format!("ordinary-capture-{sequence}")
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
fn capture_conflicts(
|
|
42
|
+
requires_screen: bool,
|
|
43
|
+
requires_microphone: bool,
|
|
44
|
+
sources: &[CaptureSource],
|
|
45
|
+
) -> bool {
|
|
46
|
+
requires_screen
|
|
47
|
+
|| (requires_microphone
|
|
48
|
+
&& sources
|
|
49
|
+
.iter()
|
|
50
|
+
.any(|source| *source == CaptureSource::Microphone))
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
pub(crate) fn is_active(app: &AppHandle) -> bool {
|
|
54
|
+
let _ = app;
|
|
55
|
+
SUSPENSION_ACTIVE.load(Ordering::Acquire)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/// Hands the one physical capture graph to an ordinary Clip that cannot reuse
|
|
59
|
+
/// Rewind. The first lease stops Rewind; nested leases keep it stopped until
|
|
60
|
+
/// the final owner releases. Persisted enable/pause/mode settings are untouched.
|
|
61
|
+
#[tauri::command]
|
|
62
|
+
pub async fn rewind_capture_suspension_acquire(
|
|
63
|
+
app: AppHandle,
|
|
64
|
+
requires_screen: bool,
|
|
65
|
+
requires_microphone: bool,
|
|
66
|
+
) -> Result<RewindCaptureSuspensionLease, String> {
|
|
67
|
+
let state = app.state::<RewindCaptureSuspensionState>();
|
|
68
|
+
let mut runtime = state.inner.lock().map_err(|error| error.to_string())?;
|
|
69
|
+
|
|
70
|
+
if runtime.leases.is_empty() {
|
|
71
|
+
let sources = crate::screen_memory::rewind_clip_sources(&app);
|
|
72
|
+
let conflicts = capture_conflicts(requires_screen, requires_microphone, &sources);
|
|
73
|
+
let rewind_config = crate::config::feature_config(&app).screen_memory;
|
|
74
|
+
// Enabled, unpaused Rewind may currently be stopped for a privacy
|
|
75
|
+
// exclusion or transient producer transition. Lease the handoff based
|
|
76
|
+
// on its durable ownership intent so its worker cannot resume halfway
|
|
77
|
+
// through an ordinary recording.
|
|
78
|
+
if !conflicts || !rewind_config.enabled || rewind_config.paused {
|
|
79
|
+
return Ok(RewindCaptureSuspensionLease {
|
|
80
|
+
lease_id: None,
|
|
81
|
+
suspended_rewind: false,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
// Publish the reservation before entering the Screen Memory transition
|
|
85
|
+
// lock. Config sync and temporary audio demand can then observe the
|
|
86
|
+
// handoff without taking this module's mutex (avoiding lock inversion).
|
|
87
|
+
SUSPENSION_ACTIVE.store(true, Ordering::Release);
|
|
88
|
+
if let Err(error) = crate::screen_memory::suspend_physical_capture(&app) {
|
|
89
|
+
SUSPENSION_ACTIVE.store(false, Ordering::Release);
|
|
90
|
+
return Err(error);
|
|
91
|
+
}
|
|
92
|
+
runtime.suspended_rewind = true;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
let lease_id = next_lease_id();
|
|
96
|
+
runtime.leases.insert(lease_id.clone());
|
|
97
|
+
Ok(RewindCaptureSuspensionLease {
|
|
98
|
+
lease_id: Some(lease_id),
|
|
99
|
+
suspended_rewind: runtime.suspended_rewind,
|
|
100
|
+
})
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/// Idempotent release: stale duplicate cleanup cannot resume Rewind while a
|
|
104
|
+
/// second logical owner still holds the physical capture handoff.
|
|
105
|
+
#[tauri::command]
|
|
106
|
+
pub async fn rewind_capture_suspension_release(
|
|
107
|
+
app: AppHandle,
|
|
108
|
+
lease_id: String,
|
|
109
|
+
) -> Result<(), String> {
|
|
110
|
+
let should_resume = {
|
|
111
|
+
let state = app.state::<RewindCaptureSuspensionState>();
|
|
112
|
+
let mut runtime = state.inner.lock().map_err(|error| error.to_string())?;
|
|
113
|
+
if !runtime.release_lease(lease_id.trim()) {
|
|
114
|
+
return Ok(());
|
|
115
|
+
}
|
|
116
|
+
let should_resume = std::mem::take(&mut runtime.suspended_rewind);
|
|
117
|
+
SUSPENSION_ACTIVE.store(false, Ordering::Release);
|
|
118
|
+
should_resume
|
|
119
|
+
};
|
|
120
|
+
if should_resume {
|
|
121
|
+
crate::screen_memory::resume_physical_capture(&app)?;
|
|
122
|
+
}
|
|
123
|
+
Ok(())
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
#[cfg(test)]
|
|
127
|
+
mod tests {
|
|
128
|
+
use super::*;
|
|
129
|
+
|
|
130
|
+
#[test]
|
|
131
|
+
fn screen_capture_always_conflicts_with_rewind() {
|
|
132
|
+
assert!(capture_conflicts(true, false, &[CaptureSource::Screen]));
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
#[test]
|
|
136
|
+
fn camera_only_mic_conflicts_only_when_rewind_owns_the_mic() {
|
|
137
|
+
assert!(!capture_conflicts(false, true, &[CaptureSource::Screen]));
|
|
138
|
+
assert!(capture_conflicts(
|
|
139
|
+
false,
|
|
140
|
+
true,
|
|
141
|
+
&[CaptureSource::Screen, CaptureSource::Microphone]
|
|
142
|
+
));
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
#[test]
|
|
146
|
+
fn camera_without_mic_never_suspends_screen_memory() {
|
|
147
|
+
assert!(!capture_conflicts(
|
|
148
|
+
false,
|
|
149
|
+
false,
|
|
150
|
+
&[CaptureSource::Screen, CaptureSource::Microphone]
|
|
151
|
+
));
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
#[test]
|
|
155
|
+
fn nested_leases_resume_only_after_the_final_unique_release() {
|
|
156
|
+
let mut runtime = RewindCaptureSuspensionRuntime {
|
|
157
|
+
leases: BTreeSet::from(["first".to_string(), "second".to_string()]),
|
|
158
|
+
suspended_rewind: true,
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
assert!(!runtime.release_lease("first"));
|
|
162
|
+
assert!(!runtime.release_lease("first"));
|
|
163
|
+
assert!(runtime.release_lease("second"));
|
|
164
|
+
}
|
|
165
|
+
}
|