deepctl-cmd-ffprobe 0.0.3__tar.gz → 0.0.4__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: deepctl-cmd-ffprobe
3
- Version: 0.0.3
3
+ Version: 0.0.4
4
4
  Summary: FFprobe configuration command for deepctl
5
5
  Author-email: Deepgram <devrel@deepgram.com>
6
6
  Maintainer-email: Deepgram <devrel@deepgram.com>
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "deepctl-cmd-ffprobe"
7
- version = "0.0.3" # x-release-please-version
7
+ version = "0.0.4" # x-release-please-version
8
8
  description = "FFprobe configuration command for deepctl"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -3,7 +3,6 @@
3
3
  from __future__ import annotations
4
4
 
5
5
  import os
6
- import shutil
7
6
  import subprocess
8
7
  from typing import Any
9
8
 
@@ -11,12 +10,17 @@ from deepctl_core import (
11
10
  AuthManager,
12
11
  BaseCommand,
13
12
  BaseResult,
13
+ CodedErrorResult,
14
14
  Config,
15
15
  DeepgramClient,
16
16
  get_console,
17
17
  get_output_format,
18
18
  get_status_console,
19
+ is_ai_agent,
19
20
  )
21
+ from deepctl_core import messages as msg
22
+ from deepctl_core.output import print_error, print_hint
23
+ from deepctl_core.tools import find_executable
20
24
  from deepctl_shared_utils import (
21
25
  get_ffprobe_path,
22
26
  print_ffprobe_install_instructions,
@@ -87,7 +91,7 @@ class FfprobeCommand(BaseCommand):
87
91
  auth_manager: AuthManager,
88
92
  client: DeepgramClient,
89
93
  **kwargs: Any,
90
- ) -> BaseResult:
94
+ ) -> BaseResult | CodedErrorResult:
91
95
  """Handle ffprobe command."""
92
96
  path = kwargs.get("path")
93
97
  reset = kwargs.get("reset", False)
@@ -105,6 +109,17 @@ class FfprobeCommand(BaseCommand):
105
109
  return self._handle_reset(config)
106
110
 
107
111
  if path:
112
+ # A stored tool path is run by later commands: an AI agent
113
+ # session never sets it. Scripts and CI without an agent marker
114
+ # still can.
115
+ if is_ai_agent():
116
+ print_error(msg.E_TOOL_PATH_AGENT)
117
+ print_hint(msg.E_PERSON_ONLY_AGENT_HINT)
118
+ return CodedErrorResult(
119
+ error=msg.E_TOOL_PATH_AGENT,
120
+ code=msg.CODE_CONFIRMATION_REQUIRED,
121
+ hint=msg.E_PERSON_ONLY_AGENT_HINT,
122
+ )
108
123
  return self._handle_set_path(config, path)
109
124
 
110
125
  return self._handle_status(config)
@@ -120,7 +135,8 @@ class FfprobeCommand(BaseCommand):
120
135
  status_console.print(f"[red]Error:[/red] File is not executable: {path}")
121
136
  return BaseResult(status="error", message=f"File is not executable: {path}")
122
137
 
123
- # Store in config
138
+ # Store in config. Only absolute paths are used, so resolve it now.
139
+ path = os.path.abspath(path)
124
140
  config._config.tools.ffprobe_path = path
125
141
  config.save()
126
142
 
@@ -144,7 +160,7 @@ class FfprobeCommand(BaseCommand):
144
160
  config.save()
145
161
 
146
162
  # Show auto-detected path
147
- auto_path = shutil.which("ffprobe")
163
+ auto_path = find_executable("ffprobe")
148
164
  if _human_output():
149
165
  console.print("[green]✓[/green] Stored ffprobe path cleared")
150
166
  if auto_path:
@@ -162,7 +178,7 @@ class FfprobeCommand(BaseCommand):
162
178
  def _handle_status(self, config: Config) -> BaseResult:
163
179
  """Show ffprobe status."""
164
180
  stored_path = config.get("tools.ffprobe_path")
165
- auto_path = shutil.which("ffprobe")
181
+ auto_path = find_executable("ffprobe")
166
182
  effective_path = get_ffprobe_path(config)
167
183
 
168
184
  if _human_output():
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: deepctl-cmd-ffprobe
3
- Version: 0.0.3
3
+ Version: 0.0.4
4
4
  Summary: FFprobe configuration command for deepctl
5
5
  Author-email: Deepgram <devrel@deepgram.com>
6
6
  Maintainer-email: Deepgram <devrel@deepgram.com>