@agent-native/core 0.114.6 → 0.114.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. package/corpus/README.md +2 -2
  2. package/corpus/core/CHANGELOG.md +15 -0
  3. package/corpus/core/package.json +1 -1
  4. package/corpus/core/src/cli/mcp-config-writers.ts +6 -4
  5. package/corpus/core/src/cli/mcp.ts +124 -0
  6. package/corpus/core/src/cli/skills-content/help.ts +4 -3
  7. package/corpus/core/src/cli/skills-content/index.ts +1 -0
  8. package/corpus/core/src/cli/skills-content/rewind-skill.ts +52 -0
  9. package/corpus/core/src/cli/skills.ts +115 -13
  10. package/corpus/core/src/mcp/screen-memory-stdio.ts +1360 -104
  11. package/corpus/core/src/mcp-client/index.ts +9 -0
  12. package/corpus/core/src/mcp-client/screen-memory-local.ts +847 -13
  13. package/corpus/core/src/server/agent-chat-plugin.ts +16 -9
  14. package/corpus/templates/analytics/app/components/dashboard/SqlChart.tsx +19 -7
  15. package/corpus/templates/analytics/app/hooks/use-chart-tooltip-portal.ts +60 -0
  16. package/corpus/templates/analytics/app/routes/chart.tsx +1 -1
  17. package/corpus/templates/analytics/changelog/2026-07-20-dashboard-requests-no-longer-stall-without-progress.md +6 -0
  18. package/corpus/templates/analytics/server/plugins/agent-chat.ts +6 -0
  19. package/corpus/templates/clips/actions/apply-rewind-extension.ts +195 -0
  20. package/corpus/templates/clips/actions/delete-agent-recording-if-unpromoted.ts +64 -0
  21. package/corpus/templates/clips/actions/get-rewind-extension-request.ts +22 -0
  22. package/corpus/templates/clips/actions/get-screen-memory-status.ts +18 -2
  23. package/corpus/templates/clips/actions/list-rewind-extension-requests.ts +52 -0
  24. package/corpus/templates/clips/actions/make-recording-private-for-rewind.ts +55 -0
  25. package/corpus/templates/clips/actions/query-screen-memory-context.ts +4 -4
  26. package/corpus/templates/clips/actions/request-rewind-extension.ts +81 -0
  27. package/corpus/templates/clips/actions/update-rewind-extension-request.ts +47 -0
  28. package/corpus/templates/clips/app/components/editor/editor-layout.tsx +25 -0
  29. package/corpus/templates/clips/app/components/editor/editor-toolbar.tsx +36 -0
  30. package/corpus/templates/clips/app/components/editor/rewind-extension-dialog.tsx +338 -0
  31. package/corpus/templates/clips/app/components/editor/stitch-manager.tsx +1 -16
  32. package/corpus/templates/clips/app/components/editor/timeline.tsx +26 -0
  33. package/corpus/templates/clips/app/i18n/en-US.ts +18 -0
  34. package/corpus/templates/clips/app/lib/ffmpeg-export.ts +19 -12
  35. package/corpus/templates/clips/app/lib/rewind-visibility.ts +31 -0
  36. package/corpus/templates/clips/app/lib/timestamp-mapping.ts +7 -0
  37. package/corpus/templates/clips/app/lib/upload-file-client.ts +17 -0
  38. package/corpus/templates/clips/changelog/2026-07-14-rewind-keeps-recent-screen-context-local-and-turns-it-into-clips.md +6 -0
  39. package/corpus/templates/clips/changelog/2026-07-17-active-clips-keep-rewind-stable-and-settings-clear.md +12 -0
  40. package/corpus/templates/clips/changelog/2026-07-17-clicking-the-clips-icon-during-a-recording-now-opens-the-app.md +6 -0
  41. package/corpus/templates/clips/changelog/2026-07-17-default-mic-now-uses-the-mac-default-and-transcription-shares-one-capture.md +6 -0
  42. package/corpus/templates/clips/changelog/2026-07-17-full-screen-clips-finalize-even-when-screencapturekit-stop-hangs.md +6 -0
  43. package/corpus/templates/clips/changelog/2026-07-17-normal-full-screen-clips-no-longer-stop-immediately-after-th.md +6 -0
  44. package/corpus/templates/clips/changelog/2026-07-17-rewind-can-hand-one-bounded-private-clip-to-your-agent.md +12 -0
  45. package/corpus/templates/clips/changelog/2026-07-17-rewind-home-can-copy-a-local-agent-prompt.md +6 -0
  46. package/corpus/templates/clips/changelog/2026-07-17-rewind-now-has-a-calm-home-status-focused-first-run-consent-.md +6 -0
  47. package/corpus/templates/clips/changelog/2026-07-17-rewind-settings-are-smaller-clearer-and-agent-first.md +6 -0
  48. package/corpus/templates/clips/changelog/2026-07-17-the-full-clips-interface-stays-available-while-recording.md +6 -0
  49. package/corpus/templates/clips/changelog/2026-07-18-rewind-organizes-recent-work-into-local-searchable-chapters.md +8 -0
  50. package/corpus/templates/clips/changelog/2026-07-18-searchable-rewind-chapters.md +6 -0
  51. package/corpus/templates/clips/changelog/2026-07-19-rewind-backed-recordings-now-start-immediately-after-the-cou.md +6 -0
  52. package/corpus/templates/clips/changelog/2026-07-20-rewind-can-set-up-your-local-agent-once-so-future-requests-w.md +6 -0
  53. package/corpus/templates/clips/desktop/package.json +1 -0
  54. package/corpus/templates/clips/desktop/scripts/sign-macos-local.ts +12 -1
  55. package/corpus/templates/clips/desktop/src/app.tsx +2498 -239
  56. package/corpus/templates/clips/desktop/src/components/ReadinessPanel.tsx +21 -1
  57. package/corpus/templates/clips/desktop/src/components/Switch.tsx +3 -0
  58. package/corpus/templates/clips/desktop/src/hooks/useMeetingTranscription.ts +156 -24
  59. package/corpus/templates/clips/desktop/src/lib/native-recording-warm.ts +6 -7
  60. package/corpus/templates/clips/desktop/src/lib/recorder.ts +1763 -1160
  61. package/corpus/templates/clips/desktop/src/lib/rewind-agent-prompt.ts +9 -0
  62. package/corpus/templates/clips/desktop/src/lib/rewind-recording-start.ts +20 -0
  63. package/corpus/templates/clips/desktop/src/main.tsx +3 -0
  64. package/corpus/templates/clips/desktop/src/overlays/countdown.tsx +14 -14
  65. package/corpus/templates/clips/desktop/src/overlays/onboarding.tsx +4 -4
  66. package/corpus/templates/clips/desktop/src/overlays/preparing.tsx +13 -0
  67. package/corpus/templates/clips/desktop/src/overlays/toolbar.tsx +27 -2
  68. package/corpus/templates/clips/desktop/src/shared/config.ts +16 -0
  69. package/corpus/templates/clips/desktop/src/styles.css +956 -134
  70. package/corpus/templates/clips/desktop/src-tauri/Cargo.toml +5 -0
  71. package/corpus/templates/clips/desktop/src-tauri/build.rs +69 -1
  72. package/corpus/templates/clips/desktop/src-tauri/src/accessibility.rs +386 -12
  73. package/corpus/templates/clips/desktop/src-tauri/src/capture_audio_bus.rs +382 -0
  74. package/corpus/templates/clips/desktop/src-tauri/src/capture_graph.rs +777 -0
  75. package/corpus/templates/clips/desktop/src-tauri/src/clips/mod.rs +249 -22
  76. package/corpus/templates/clips/desktop/src-tauri/src/config.rs +148 -1
  77. package/corpus/templates/clips/desktop/src-tauri/src/lib.rs +58 -4
  78. package/corpus/templates/clips/desktop/src-tauri/src/logfile.rs +13 -1
  79. package/corpus/templates/clips/desktop/src-tauri/src/native_screen/custom_capture.rs +1505 -51
  80. package/corpus/templates/clips/desktop/src-tauri/src/native_screen/live_upload.rs +124 -0
  81. package/corpus/templates/clips/desktop/src-tauri/src/native_screen.rs +1006 -95
  82. package/corpus/templates/clips/desktop/src-tauri/src/rewind_capture_suspension.rs +165 -0
  83. package/corpus/templates/clips/desktop/src-tauri/src/rewind_chapters.rs +2434 -0
  84. package/corpus/templates/clips/desktop/src-tauri/src/rewind_clip.rs +1650 -0
  85. package/corpus/templates/clips/desktop/src-tauri/src/rewind_egress.rs +643 -0
  86. package/corpus/templates/clips/desktop/src-tauri/src/rewind_local_ask.rs +803 -0
  87. package/corpus/templates/clips/desktop/src-tauri/src/rewind_meeting_history.rs +595 -0
  88. package/corpus/templates/clips/desktop/src-tauri/src/screen_memory.rs +2900 -91
  89. package/corpus/templates/clips/desktop/src-tauri/src/screen_memory_ocr.rs +360 -0
  90. package/corpus/templates/clips/desktop/src-tauri/src/screen_memory_transcript.rs +408 -0
  91. package/corpus/templates/clips/desktop/src-tauri/src/shortcuts.rs +114 -33
  92. package/corpus/templates/clips/desktop/src-tauri/src/state.rs +2 -2
  93. package/corpus/templates/clips/desktop/src-tauri/src/system_audio.rs +13 -3
  94. package/corpus/templates/clips/desktop/src-tauri/src/tray.rs +4 -1
  95. package/corpus/templates/clips/desktop/src-tauri/src/util.rs +7 -13
  96. package/corpus/templates/clips/desktop/src-tauri/src/whisper_speech.rs +198 -11
  97. package/corpus/templates/clips/desktop/src-tauri/tauri.alpha.conf.json +17 -0
  98. package/corpus/toolkit/CHANGELOG.md +6 -0
  99. package/corpus/toolkit/package.json +1 -1
  100. package/dist/cli/mcp-config-writers.d.ts +2 -2
  101. package/dist/cli/mcp-config-writers.d.ts.map +1 -1
  102. package/dist/cli/mcp-config-writers.js +6 -6
  103. package/dist/cli/mcp-config-writers.js.map +1 -1
  104. package/dist/cli/mcp.d.ts +14 -0
  105. package/dist/cli/mcp.d.ts.map +1 -1
  106. package/dist/cli/mcp.js +79 -0
  107. package/dist/cli/mcp.js.map +1 -1
  108. package/dist/cli/skills-content/help.d.ts +1 -1
  109. package/dist/cli/skills-content/help.d.ts.map +1 -1
  110. package/dist/cli/skills-content/help.js +4 -3
  111. package/dist/cli/skills-content/help.js.map +1 -1
  112. package/dist/cli/skills-content/index.d.ts +1 -0
  113. package/dist/cli/skills-content/index.d.ts.map +1 -1
  114. package/dist/cli/skills-content/index.js +1 -0
  115. package/dist/cli/skills-content/index.js.map +1 -1
  116. package/dist/cli/skills-content/rewind-skill.d.ts +2 -0
  117. package/dist/cli/skills-content/rewind-skill.d.ts.map +1 -0
  118. package/dist/cli/skills-content/rewind-skill.js +53 -0
  119. package/dist/cli/skills-content/rewind-skill.js.map +1 -0
  120. package/dist/cli/skills.d.ts +6 -0
  121. package/dist/cli/skills.d.ts.map +1 -1
  122. package/dist/cli/skills.js +90 -14
  123. package/dist/cli/skills.js.map +1 -1
  124. package/dist/collab/struct-routes.d.ts +1 -1
  125. package/dist/mcp/screen-memory-stdio.d.ts +365 -0
  126. package/dist/mcp/screen-memory-stdio.d.ts.map +1 -1
  127. package/dist/mcp/screen-memory-stdio.js +1014 -91
  128. package/dist/mcp/screen-memory-stdio.js.map +1 -1
  129. package/dist/mcp-client/index.d.ts +1 -1
  130. package/dist/mcp-client/index.d.ts.map +1 -1
  131. package/dist/mcp-client/index.js +1 -1
  132. package/dist/mcp-client/index.js.map +1 -1
  133. package/dist/mcp-client/screen-memory-local.d.ts +90 -0
  134. package/dist/mcp-client/screen-memory-local.d.ts.map +1 -1
  135. package/dist/mcp-client/screen-memory-local.js +590 -12
  136. package/dist/mcp-client/screen-memory-local.js.map +1 -1
  137. package/dist/observability/routes.d.ts +1 -1
  138. package/dist/progress/routes.d.ts +1 -1
  139. package/dist/provider-api/actions/provider-api.d.ts +4 -4
  140. package/dist/resources/handlers.d.ts +1 -1
  141. package/dist/server/agent-chat-plugin.d.ts +5 -0
  142. package/dist/server/agent-chat-plugin.d.ts.map +1 -1
  143. package/dist/server/agent-chat-plugin.js +10 -9
  144. package/dist/server/agent-chat-plugin.js.map +1 -1
  145. package/package.json +2 -2
  146. package/src/cli/mcp-config-writers.ts +6 -4
  147. package/src/cli/mcp.ts +124 -0
  148. package/src/cli/skills-content/help.ts +4 -3
  149. package/src/cli/skills-content/index.ts +1 -0
  150. package/src/cli/skills-content/rewind-skill.ts +52 -0
  151. package/src/cli/skills.ts +115 -13
  152. package/src/mcp/screen-memory-stdio.ts +1360 -104
  153. package/src/mcp-client/index.ts +9 -0
  154. package/src/mcp-client/screen-memory-local.ts +847 -13
  155. package/src/server/agent-chat-plugin.ts +16 -9
@@ -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
+ }