@team-agent/installer 0.5.59 → 0.5.60

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.
@@ -4,12 +4,40 @@ pub(super) fn parse_spawned_at(raw: &str) -> Option<std::time::SystemTime> {
4
4
  .map(|dt| std::time::SystemTime::from(dt.with_timezone(&chrono::Utc)))
5
5
  }
6
6
 
7
+ pub(super) fn truncate_to_uuid_precision(
8
+ timestamp: std::time::SystemTime,
9
+ ) -> Option<std::time::SystemTime> {
10
+ let since_epoch = timestamp
11
+ .duration_since(std::time::SystemTime::UNIX_EPOCH)
12
+ .ok()?;
13
+ std::time::SystemTime::UNIX_EPOCH.checked_add(std::time::Duration::from_millis(
14
+ u64::try_from(since_epoch.as_millis()).ok()?,
15
+ ))
16
+ }
17
+
7
18
  pub(super) fn rollout_created_at(path: &std::path::Path) -> Option<std::time::SystemTime> {
8
19
  created_at_from_rollout_uuid(path)
9
20
  .or_else(|| created_at_from_rollout_head(path))
10
21
  .or_else(|| created_at_from_rollout_filename(path))
11
22
  }
12
23
 
24
+ pub(super) fn apply_expected_session_filter(
25
+ context: &super::CaptureSessionContext,
26
+ mut out: Vec<super::CapturedSessionCandidate>,
27
+ ) -> Vec<super::CapturedSessionCandidate> {
28
+ let Some(expected) = context.expected_session_id.as_ref() else {
29
+ return out;
30
+ };
31
+ out.retain(|candidate| {
32
+ candidate
33
+ .captured
34
+ .session_id
35
+ .as_ref()
36
+ .is_some_and(|session| session.as_str() == expected.as_str())
37
+ });
38
+ out
39
+ }
40
+
13
41
  pub(super) fn retain_spawn_cwd(
14
42
  context: &super::CaptureSessionContext,
15
43
  out: &mut Vec<super::CapturedSessionCandidate>,
@@ -146,13 +146,23 @@ pub(super) fn apply_spawned_at_filter(
146
146
  out.clear();
147
147
  return;
148
148
  };
149
+ let codex_spawned_at =
150
+ if matches!(provider, Provider::Codex) && context.expected_session_id.is_some() {
151
+ let Some(timestamp) = super::codex::truncate_to_uuid_precision(spawned_at) else {
152
+ out.clear();
153
+ return;
154
+ };
155
+ timestamp
156
+ } else {
157
+ spawned_at
158
+ };
149
159
  out.retain(|candidate| {
150
160
  let Some(path) = candidate.captured.rollout_path.as_ref() else {
151
161
  return false;
152
162
  };
153
163
  if matches!(provider, Provider::Codex) {
154
164
  return super::codex::rollout_created_at(path.as_path())
155
- .is_some_and(|created_at| created_at >= spawned_at);
165
+ .is_some_and(|created_at| created_at >= codex_spawned_at);
156
166
  }
157
167
  candidate_mtime(path.as_path()).is_some_and(|mtime| mtime >= spawned_at)
158
168
  });
@@ -72,6 +72,9 @@ pub(crate) fn scan_session_candidates_once(
72
72
  if matches!(provider, Provider::Claude | Provider::ClaudeCode) {
73
73
  return claude::apply_expected_session_filter(context, out);
74
74
  }
75
+ if matches!(provider, Provider::Codex) {
76
+ out = codex::apply_expected_session_filter(context, out);
77
+ }
75
78
 
76
79
  common::apply_spawn_time_window_if_unique(provider, context, &mut out);
77
80
  common::sort_expected_first_if_needed(context, &mut out);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@team-agent/installer",
3
- "version": "0.5.59",
3
+ "version": "0.5.60",
4
4
  "description": "npx installer for Team Agent",
5
5
  "keywords": [
6
6
  "codex",
@@ -20,9 +20,9 @@
20
20
  "team-agent-installer": "npm/install.mjs"
21
21
  },
22
22
  "optionalDependencies": {
23
- "@team-agent/cli-darwin-arm64": "0.5.59",
24
- "@team-agent/cli-darwin-x64": "0.5.59",
25
- "@team-agent/cli-linux-x64": "0.5.59"
23
+ "@team-agent/cli-darwin-arm64": "0.5.60",
24
+ "@team-agent/cli-darwin-x64": "0.5.60",
25
+ "@team-agent/cli-linux-x64": "0.5.60"
26
26
  },
27
27
  "scripts": {
28
28
  "postinstall": "node npm/bincheck.mjs",