optio-opencode 0.3.0__tar.gz → 0.3.1__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.
Files changed (57) hide show
  1. {optio_opencode-0.3.0 → optio_opencode-0.3.1}/PKG-INFO +1 -1
  2. {optio_opencode-0.3.0 → optio_opencode-0.3.1}/pyproject.toml +1 -1
  3. {optio_opencode-0.3.0 → optio_opencode-0.3.1}/src/optio_opencode/__init__.py +2 -0
  4. {optio_opencode-0.3.0 → optio_opencode-0.3.1}/src/optio_opencode/conversation.py +4 -0
  5. {optio_opencode-0.3.0 → optio_opencode-0.3.1}/src/optio_opencode/host_actions.py +4 -2
  6. optio_opencode-0.3.1/src/optio_opencode/info.py +7 -0
  7. {optio_opencode-0.3.0 → optio_opencode-0.3.1}/src/optio_opencode/session.py +4 -3
  8. {optio_opencode-0.3.0 → optio_opencode-0.3.1}/src/optio_opencode.egg-info/PKG-INFO +1 -1
  9. {optio_opencode-0.3.0 → optio_opencode-0.3.1}/src/optio_opencode.egg-info/SOURCES.txt +2 -0
  10. optio_opencode-0.3.1/tests/test_agent_info.py +14 -0
  11. {optio_opencode-0.3.0 → optio_opencode-0.3.1}/README.md +0 -0
  12. {optio_opencode-0.3.0 → optio_opencode-0.3.1}/setup.cfg +0 -0
  13. {optio_opencode-0.3.0 → optio_opencode-0.3.1}/src/optio_opencode/cred_watcher.py +0 -0
  14. {optio_opencode-0.3.0 → optio_opencode-0.3.1}/src/optio_opencode/model_probe.py +0 -0
  15. {optio_opencode-0.3.0 → optio_opencode-0.3.1}/src/optio_opencode/prompt.py +0 -0
  16. {optio_opencode-0.3.0 → optio_opencode-0.3.1}/src/optio_opencode/seed_manifest.py +0 -0
  17. {optio_opencode-0.3.0 → optio_opencode-0.3.1}/src/optio_opencode/snapshots.py +0 -0
  18. {optio_opencode-0.3.0 → optio_opencode-0.3.1}/src/optio_opencode/types.py +0 -0
  19. {optio_opencode-0.3.0 → optio_opencode-0.3.1}/src/optio_opencode/verify.py +0 -0
  20. {optio_opencode-0.3.0 → optio_opencode-0.3.1}/src/optio_opencode.egg-info/dependency_links.txt +0 -0
  21. {optio_opencode-0.3.0 → optio_opencode-0.3.1}/src/optio_opencode.egg-info/requires.txt +0 -0
  22. {optio_opencode-0.3.0 → optio_opencode-0.3.1}/src/optio_opencode.egg-info/top_level.txt +0 -0
  23. {optio_opencode-0.3.0 → optio_opencode-0.3.1}/tests/test_agent_sender_opencode.py +0 -0
  24. {optio_opencode-0.3.0 → optio_opencode-0.3.1}/tests/test_config_harmonization.py +0 -0
  25. {optio_opencode-0.3.0 → optio_opencode-0.3.1}/tests/test_conversation_config.py +0 -0
  26. {optio_opencode-0.3.0 → optio_opencode-0.3.1}/tests/test_conversation_driver.py +0 -0
  27. {optio_opencode-0.3.0 → optio_opencode-0.3.1}/tests/test_conversation_session.py +0 -0
  28. {optio_opencode-0.3.0 → optio_opencode-0.3.1}/tests/test_conversation_ui_model.py +0 -0
  29. {optio_opencode-0.3.0 → optio_opencode-0.3.1}/tests/test_conversation_ui_session.py +0 -0
  30. {optio_opencode-0.3.0 → optio_opencode-0.3.1}/tests/test_conversation_upload.py +0 -0
  31. {optio_opencode-0.3.0 → optio_opencode-0.3.1}/tests/test_cred_watcher.py +0 -0
  32. {optio_opencode-0.3.0 → optio_opencode-0.3.1}/tests/test_file_download.py +0 -0
  33. {optio_opencode-0.3.0 → optio_opencode-0.3.1}/tests/test_file_upload.py +0 -0
  34. {optio_opencode-0.3.0 → optio_opencode-0.3.1}/tests/test_host_actions.py +0 -0
  35. {optio_opencode-0.3.0 → optio_opencode-0.3.1}/tests/test_host_local.py +0 -0
  36. {optio_opencode-0.3.0 → optio_opencode-0.3.1}/tests/test_host_primitives_local.py +0 -0
  37. {optio_opencode-0.3.0 → optio_opencode-0.3.1}/tests/test_host_primitives_remote.py +0 -0
  38. {optio_opencode-0.3.0 → optio_opencode-0.3.1}/tests/test_host_remote_resume.py +0 -0
  39. {optio_opencode-0.3.0 → optio_opencode-0.3.1}/tests/test_host_resume.py +0 -0
  40. {optio_opencode-0.3.0 → optio_opencode-0.3.1}/tests/test_model_probe.py +0 -0
  41. {optio_opencode-0.3.0 → optio_opencode-0.3.1}/tests/test_model_probe_wiring.py +0 -0
  42. {optio_opencode-0.3.0 → optio_opencode-0.3.1}/tests/test_prompt.py +0 -0
  43. {optio_opencode-0.3.0 → optio_opencode-0.3.1}/tests/test_purge_seed.py +0 -0
  44. {optio_opencode-0.3.0 → optio_opencode-0.3.1}/tests/test_resume_sentence_opencode.py +0 -0
  45. {optio_opencode-0.3.0 → optio_opencode-0.3.1}/tests/test_sanity.py +0 -0
  46. {optio_opencode-0.3.0 → optio_opencode-0.3.1}/tests/test_seed_config.py +0 -0
  47. {optio_opencode-0.3.0 → optio_opencode-0.3.1}/tests/test_session_blob_hooks.py +0 -0
  48. {optio_opencode-0.3.0 → optio_opencode-0.3.1}/tests/test_session_hooks.py +0 -0
  49. {optio_opencode-0.3.0 → optio_opencode-0.3.1}/tests/test_session_local.py +0 -0
  50. {optio_opencode-0.3.0 → optio_opencode-0.3.1}/tests/test_session_remote.py +0 -0
  51. {optio_opencode-0.3.0 → optio_opencode-0.3.1}/tests/test_session_resume.py +0 -0
  52. {optio_opencode-0.3.0 → optio_opencode-0.3.1}/tests/test_session_seed.py +0 -0
  53. {optio_opencode-0.3.0 → optio_opencode-0.3.1}/tests/test_session_seed_saveback.py +0 -0
  54. {optio_opencode-0.3.0 → optio_opencode-0.3.1}/tests/test_smart_install.py +0 -0
  55. {optio_opencode-0.3.0 → optio_opencode-0.3.1}/tests/test_snapshots.py +0 -0
  56. {optio_opencode-0.3.0 → optio_opencode-0.3.1}/tests/test_types.py +0 -0
  57. {optio_opencode-0.3.0 → optio_opencode-0.3.1}/tests/test_verify_seed.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: optio-opencode
3
- Version: 0.3.0
3
+ Version: 0.3.1
4
4
  Summary: Run opencode web as an optio task; local subprocess or remote via SSH.
5
5
  Author-email: Kristof Csillag <kristof.csillag@deai-labs.com>
6
6
  License-Expression: Apache-2.0
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "optio-opencode"
7
- version = "0.3.0"
7
+ version = "0.3.1"
8
8
  description = "Run opencode web as an optio task; local subprocess or remote via SSH."
9
9
  readme = "README.md"
10
10
  license = "Apache-2.0"
@@ -8,6 +8,7 @@ from optio_host import (
8
8
  RunResult,
9
9
  SSHConfig,
10
10
  )
11
+ from optio_opencode.info import AGENT_INFO
11
12
  from optio_opencode.session import create_opencode_task, run_opencode_session
12
13
  from optio_opencode.types import (
13
14
  ConversationMode,
@@ -36,6 +37,7 @@ from optio_opencode.verify import verify_and_refresh_seed
36
37
  _logging.getLogger("asyncssh").setLevel(_logging.WARNING)
37
38
 
38
39
  __all__ = [
40
+ "AGENT_INFO",
39
41
  "create_opencode_task",
40
42
  "run_opencode_session",
41
43
  "DeliverableCallback",
@@ -37,6 +37,8 @@ from optio_agents.conversation import (
37
37
  PermissionRequest,
38
38
  )
39
39
 
40
+ from .info import AGENT_INFO
41
+
40
42
  _LOG = logging.getLogger(__name__)
41
43
 
42
44
  # Reconnect backoff for the SSE reader (capped; the session body cancels the
@@ -49,7 +51,9 @@ class OpencodeConversation:
49
51
 
50
52
  def __init__(
51
53
  self, *, port: int, password: str, session_id: str, directory: str,
54
+ agent_label: str = AGENT_INFO.slug,
52
55
  ) -> None:
56
+ self._agent_label = agent_label
53
57
  self._base = f"http://127.0.0.1:{port}"
54
58
  self._auth = aiohttp.BasicAuth("opencode", password)
55
59
  self._session_id = session_id
@@ -28,6 +28,8 @@ from typing import TYPE_CHECKING, Callable
28
28
 
29
29
  from optio_host.host import ProcessHandle
30
30
 
31
+ from optio_opencode.info import AGENT_INFO
32
+
31
33
  if TYPE_CHECKING:
32
34
  from optio_host.host import Host
33
35
 
@@ -259,7 +261,7 @@ async def ensure_opencode_installed(
259
261
  # dashboard shows it working rather than stuck at 0% while the install
260
262
  # check (and any subsequent download child task) runs.
261
263
  if report_progress is not None:
262
- report_progress(None, "Checking opencode installation…")
264
+ report_progress(None, f"Checking {AGENT_INFO.name} installation…")
263
265
  kind, url = await _smart_install_check(host, install_dir=resolved_install_dir)
264
266
  if kind == "ok":
265
267
  # Resolve the on-PATH path. Login shell so ``$HOME``-relative
@@ -286,7 +288,7 @@ async def ensure_opencode_installed(
286
288
  )
287
289
  assert url is not None # _smart_install_check guarantees
288
290
  if report_progress is not None:
289
- report_progress(None, "Installing opencode…")
291
+ report_progress(None, f"Installing {AGENT_INFO.name}…")
290
292
  return await _install_opencode_from_zip(
291
293
  host, download, url, install_dir=resolved_install_dir,
292
294
  )
@@ -0,0 +1,7 @@
1
+ from optio_agents import AgentInfo
2
+
3
+ AGENT_INFO = AgentInfo(
4
+ slug="opencode",
5
+ name="OpenCode",
6
+ url="https://opencode.ai",
7
+ )
@@ -39,6 +39,7 @@ from optio_agents.uploads import materialize, upload_url_token
39
39
  from optio_agents import seeds as _seeds
40
40
  from optio_opencode import cred_watcher, host_actions
41
41
  from optio_opencode import model_probe
42
+ from optio_opencode.info import AGENT_INFO
42
43
  from optio_opencode.conversation import OpencodeConversation
43
44
  from optio_opencode.prompt import DEFAULT_CONVERSATION_INSTRUCTIONS, compose_agents_md
44
45
  from optio_opencode.seed_manifest import (
@@ -392,7 +393,7 @@ async def run_opencode_session(ctx: ProcessContext, config: OpencodeTaskConfig)
392
393
  opencode_hostname = bind_addr if isinstance(host, LocalHost) else "127.0.0.1"
393
394
 
394
395
  _warn_if_fs_isolation_unenforced(config)
395
- ctx.report_progress(None, f"Launching opencode{version_suffix}…")
396
+ ctx.report_progress(None, f"Launching {AGENT_INFO.name}{version_suffix}…")
396
397
  handle, opencode_port = await host_actions.launch_opencode(
397
398
  host, password,
398
399
  ready_timeout_s=READY_TIMEOUT_S,
@@ -453,7 +454,7 @@ async def run_opencode_session(ctx: ProcessContext, config: OpencodeTaskConfig)
453
454
  "opencode.global.dat:layout": '{"review": {"panelOpened": false}}',
454
455
  },
455
456
  })
456
- ctx.report_progress(None, "opencode is live")
457
+ ctx.report_progress(None, f"{AGENT_INFO.name} is live")
457
458
  elif config.conversation_ui:
458
459
  # Conversation widget: the opencode server itself is the upstream
459
460
  # (same proxy + inner-auth model as iframe mode); the widget talks
@@ -574,7 +575,7 @@ async def run_opencode_session(ctx: ProcessContext, config: OpencodeTaskConfig)
574
575
  )
575
576
  reader_task = asyncio.create_task(conversation.run_reader())
576
577
  ctx.publish_result(conversation)
577
- ctx.report_progress(None, "opencode conversation is live")
578
+ ctx.report_progress(None, f"{AGENT_INFO.name} conversation is live")
578
579
 
579
580
  proc = launched_handle.pid_like
580
581
  wait_task = asyncio.create_task(proc.wait()) # type: ignore[union-attr]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: optio-opencode
3
- Version: 0.3.0
3
+ Version: 0.3.1
4
4
  Summary: Run opencode web as an optio task; local subprocess or remote via SSH.
5
5
  Author-email: Kristof Csillag <kristof.csillag@deai-labs.com>
6
6
  License-Expression: Apache-2.0
@@ -4,6 +4,7 @@ src/optio_opencode/__init__.py
4
4
  src/optio_opencode/conversation.py
5
5
  src/optio_opencode/cred_watcher.py
6
6
  src/optio_opencode/host_actions.py
7
+ src/optio_opencode/info.py
7
8
  src/optio_opencode/model_probe.py
8
9
  src/optio_opencode/prompt.py
9
10
  src/optio_opencode/seed_manifest.py
@@ -16,6 +17,7 @@ src/optio_opencode.egg-info/SOURCES.txt
16
17
  src/optio_opencode.egg-info/dependency_links.txt
17
18
  src/optio_opencode.egg-info/requires.txt
18
19
  src/optio_opencode.egg-info/top_level.txt
20
+ tests/test_agent_info.py
19
21
  tests/test_agent_sender_opencode.py
20
22
  tests/test_config_harmonization.py
21
23
  tests/test_conversation_config.py
@@ -0,0 +1,14 @@
1
+ from optio_opencode import AGENT_INFO
2
+ from optio_opencode.types import OpencodeTaskConfig
3
+
4
+
5
+ def test_agent_info_values():
6
+ assert AGENT_INFO.slug == "opencode"
7
+ assert AGENT_INFO.name == "OpenCode"
8
+ assert AGENT_INFO.url == "https://opencode.ai"
9
+
10
+
11
+ def test_agent_info_slug_matches_agent_type():
12
+ import dataclasses
13
+ fields = {f.name: f for f in dataclasses.fields(OpencodeTaskConfig)}
14
+ assert fields["agent_type"].default == AGENT_INFO.slug
File without changes
File without changes