MCPcopy Create free account
hub / github.com/HKUDS/OpenOPC / _progress_callback

Function _progress_callback

opc/cli/app.py:167–190  ·  view source on GitHub ↗

Create an async progress callback for streaming agent output.

()

Source from the content-addressed store, hash-verified

165 border_style="yellow",
166 ))
167 if not typer.confirm("Trust this workspace and load its OpenOPC configuration?", default=False):
168 console.print("[warning]Workspace was not trusted; configuration was not loaded.[/warning]")
169 raise typer.Exit(code=2) from exc
170 # Parsing is allowed only after the explicit decision. Trust is bound
171 # to both the post-migration source bytes and normalized authority.
172 config = OPCConfig.load(config_dir, trusted_source=True)
173 WorkspaceTrustStore().trust(exc.workspace, config_dir, config)
174 config.bind_workspace_trust(exc.workspace, config_dir)
175 config.require_workspace_trust(include_effective=True)
176 console.print(f"[success]Trusted workspace:[/success] {exc.workspace}")
177 return config
178
179
180def _channel_runtime_pid_path() -> Path:
181 from opc.core.config import get_opc_home
182
183 return get_opc_home() / "run" / "channels.pid"
184
185
186def _read_channel_runtime_state() -> dict | None:
187 path = _channel_runtime_pid_path()
188 if not path.exists():
189 return None
190 try:
191 return json.loads(path.read_text())
192 except Exception:
193 return None

Callers 3

_runMethod · 0.90
process_messageMethod · 0.90
_create_cli_engineFunction · 0.85

Calls

no outgoing calls

Tested by 2

_runMethod · 0.72
process_messageMethod · 0.72