qoder-agent-sdk 1.0.16__tar.gz → 1.0.17__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 (47) hide show
  1. {qoder_agent_sdk-1.0.16 → qoder_agent_sdk-1.0.17}/PKG-INFO +1 -1
  2. {qoder_agent_sdk-1.0.16 → qoder_agent_sdk-1.0.17}/pyproject.toml +1 -1
  3. {qoder_agent_sdk-1.0.16 → qoder_agent_sdk-1.0.17}/src/qoder_agent_sdk/__init__.py +101 -0
  4. {qoder_agent_sdk-1.0.16 → qoder_agent_sdk-1.0.17}/src/qoder_agent_sdk/_cli_version.py +1 -1
  5. {qoder_agent_sdk-1.0.16 → qoder_agent_sdk-1.0.17}/src/qoder_agent_sdk/_internal/client.py +59 -11
  6. qoder_agent_sdk-1.0.17/src/qoder_agent_sdk/_internal/daemon_connection.py +832 -0
  7. qoder_agent_sdk-1.0.17/src/qoder_agent_sdk/_internal/plugin_reports.py +116 -0
  8. {qoder_agent_sdk-1.0.16 → qoder_agent_sdk-1.0.17}/src/qoder_agent_sdk/_internal/query.py +403 -63
  9. {qoder_agent_sdk-1.0.16 → qoder_agent_sdk-1.0.17}/src/qoder_agent_sdk/_internal/transport/__init__.py +4 -0
  10. qoder_agent_sdk-1.0.17/src/qoder_agent_sdk/_internal/transport/daemon_process.py +222 -0
  11. qoder_agent_sdk-1.0.17/src/qoder_agent_sdk/_internal/transport/daemon_session.py +392 -0
  12. {qoder_agent_sdk-1.0.16 → qoder_agent_sdk-1.0.17}/src/qoder_agent_sdk/_internal/transport/subprocess_cli.py +89 -85
  13. {qoder_agent_sdk-1.0.16 → qoder_agent_sdk-1.0.17}/src/qoder_agent_sdk/_version.py +1 -1
  14. {qoder_agent_sdk-1.0.16 → qoder_agent_sdk-1.0.17}/src/qoder_agent_sdk/client.py +85 -9
  15. qoder_agent_sdk-1.0.17/src/qoder_agent_sdk/daemon.py +963 -0
  16. qoder_agent_sdk-1.0.17/src/qoder_agent_sdk/daemon_types.py +348 -0
  17. {qoder_agent_sdk-1.0.16 → qoder_agent_sdk-1.0.17}/src/qoder_agent_sdk/plugins.py +44 -110
  18. {qoder_agent_sdk-1.0.16 → qoder_agent_sdk-1.0.17}/src/qoder_agent_sdk/types.py +8 -1
  19. {qoder_agent_sdk-1.0.16 → qoder_agent_sdk-1.0.17}/.gitignore +0 -0
  20. {qoder_agent_sdk-1.0.16 → qoder_agent_sdk-1.0.17}/LICENSE +0 -0
  21. {qoder_agent_sdk-1.0.16 → qoder_agent_sdk-1.0.17}/README.md +0 -0
  22. {qoder_agent_sdk-1.0.16 → qoder_agent_sdk-1.0.17}/src/qoder_agent_sdk/_brand.py +0 -0
  23. {qoder_agent_sdk-1.0.16 → qoder_agent_sdk-1.0.17}/src/qoder_agent_sdk/_bundled/.gitignore +0 -0
  24. {qoder_agent_sdk-1.0.16 → qoder_agent_sdk-1.0.17}/src/qoder_agent_sdk/_errors.py +0 -0
  25. {qoder_agent_sdk-1.0.16 → qoder_agent_sdk-1.0.17}/src/qoder_agent_sdk/_internal/__init__.py +0 -0
  26. {qoder_agent_sdk-1.0.16 → qoder_agent_sdk-1.0.17}/src/qoder_agent_sdk/_internal/auth_helpers.py +0 -0
  27. {qoder_agent_sdk-1.0.16 → qoder_agent_sdk-1.0.17}/src/qoder_agent_sdk/_internal/cloud_agent.py +0 -0
  28. {qoder_agent_sdk-1.0.16 → qoder_agent_sdk-1.0.17}/src/qoder_agent_sdk/_internal/mcp_handler.py +0 -0
  29. {qoder_agent_sdk-1.0.16 → qoder_agent_sdk-1.0.17}/src/qoder_agent_sdk/_internal/mcp_serialize.py +0 -0
  30. {qoder_agent_sdk-1.0.16 → qoder_agent_sdk-1.0.17}/src/qoder_agent_sdk/_internal/memory.py +0 -0
  31. {qoder_agent_sdk-1.0.16 → qoder_agent_sdk-1.0.17}/src/qoder_agent_sdk/_internal/message_parser.py +0 -0
  32. {qoder_agent_sdk-1.0.16 → qoder_agent_sdk-1.0.17}/src/qoder_agent_sdk/_internal/sdk_mcp_transport.py +0 -0
  33. {qoder_agent_sdk-1.0.16 → qoder_agent_sdk-1.0.17}/src/qoder_agent_sdk/_internal/session_mutations.py +0 -0
  34. {qoder_agent_sdk-1.0.16 → qoder_agent_sdk-1.0.17}/src/qoder_agent_sdk/_internal/session_storage.py +0 -0
  35. {qoder_agent_sdk-1.0.16 → qoder_agent_sdk-1.0.17}/src/qoder_agent_sdk/_internal/sessions.py +0 -0
  36. {qoder_agent_sdk-1.0.16 → qoder_agent_sdk-1.0.17}/src/qoder_agent_sdk/_internal/skill_evolution.py +0 -0
  37. {qoder_agent_sdk-1.0.16 → qoder_agent_sdk-1.0.17}/src/qoder_agent_sdk/_tool_results.py +0 -0
  38. {qoder_agent_sdk-1.0.16 → qoder_agent_sdk-1.0.17}/src/qoder_agent_sdk/auth.py +0 -0
  39. {qoder_agent_sdk-1.0.16 → qoder_agent_sdk-1.0.17}/src/qoder_agent_sdk/memory.py +0 -0
  40. {qoder_agent_sdk-1.0.16 → qoder_agent_sdk-1.0.17}/src/qoder_agent_sdk/py.typed +0 -0
  41. {qoder_agent_sdk-1.0.16 → qoder_agent_sdk-1.0.17}/src/qoder_agent_sdk/query.py +0 -0
  42. {qoder_agent_sdk-1.0.16 → qoder_agent_sdk-1.0.17}/src/qoder_agent_sdk/session_import.py +0 -0
  43. {qoder_agent_sdk-1.0.16 → qoder_agent_sdk-1.0.17}/src/qoder_agent_sdk/session_store.py +0 -0
  44. {qoder_agent_sdk-1.0.16 → qoder_agent_sdk-1.0.17}/src/qoder_agent_sdk/settings.py +0 -0
  45. {qoder_agent_sdk-1.0.16 → qoder_agent_sdk-1.0.17}/src/qoder_agent_sdk/store_sessions.py +0 -0
  46. {qoder_agent_sdk-1.0.16 → qoder_agent_sdk-1.0.17}/src/qoder_agent_sdk/testing/__init__.py +0 -0
  47. {qoder_agent_sdk-1.0.16 → qoder_agent_sdk-1.0.17}/src/qoder_agent_sdk/testing/session_store_conformance.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: qoder-agent-sdk
3
- Version: 1.0.16
3
+ Version: 1.0.17
4
4
  Summary: Python SDK for Qoder Agent
5
5
  Author: Qoder
6
6
  License: Copyright (c) 2026 Qoder
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "qoder-agent-sdk"
7
- version = "1.0.16"
7
+ version = "1.0.17"
8
8
  description = "Python SDK for Qoder Agent"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -79,6 +79,58 @@ from .auth import (
79
79
  service_account_from_env,
80
80
  )
81
81
  from .client import QoderSDKClient
82
+ from .daemon import (
83
+ Daemon,
84
+ DaemonOptions,
85
+ init_daemon,
86
+ shutdown_daemon,
87
+ start_daemon,
88
+ )
89
+ from .daemon_types import (
90
+ DAEMON_HEARTBEAT_TIMEOUT_MS,
91
+ DAEMON_PROXY_CAPABILITY,
92
+ DAEMON_VALIDATE_PLUGINS_CAPABILITY,
93
+ AccountInfo,
94
+ ByokConfigCheckDetails,
95
+ ByokConfigCheckResult,
96
+ ByokConfigInfo,
97
+ ByokConfigReference,
98
+ ByokModelConfigInfo,
99
+ ByokModelConfigInput,
100
+ ByokModelConfigReference,
101
+ BYOKModelValidationInput,
102
+ ByokProtocol,
103
+ CheckByokConfigInput,
104
+ CreateByokConfigInput,
105
+ CustomByokProviderConfigInfo,
106
+ CustomByokProviderConfigInput,
107
+ CustomByokProviderConfigReference,
108
+ CustomByokProviderModelCapabilitiesInput,
109
+ CustomByokProviderModelConfigInfo,
110
+ CustomByokProviderModelInput,
111
+ CustomByokProviderReasoningEffortLevel,
112
+ CustomByokProviderThinkingCapabilitiesInput,
113
+ CustomByokProviderThinkingMode,
114
+ DaemonConfigurationConflictError,
115
+ DaemonDirectResult,
116
+ DaemonFallbackReason,
117
+ DaemonGetModelsParams,
118
+ DaemonHeartbeatTimeoutError,
119
+ DaemonInitResult,
120
+ DaemonProtocolError,
121
+ DaemonProtocolVersionMismatchError,
122
+ DaemonReadyResult,
123
+ DaemonRpcError,
124
+ DaemonSessionAlreadyOpenError,
125
+ DaemonSessionInfo,
126
+ DaemonState,
127
+ DaemonValidateByokModelParams,
128
+ DeleteByokConfigInput,
129
+ SessionRuntimeState,
130
+ UpdateByokConfigInput,
131
+ UpdateByokModelConfigInput,
132
+ UpdateCustomByokProviderConfigInput,
133
+ )
82
134
  from .memory import (
83
135
  EffectiveMemoryConfig,
84
136
  EffectiveMemoryRoot,
@@ -909,6 +961,55 @@ __all__ = [
909
961
  # Main exports
910
962
  "query",
911
963
  "__version__",
964
+ "Daemon",
965
+ "DaemonOptions",
966
+ "start_daemon",
967
+ "init_daemon",
968
+ "shutdown_daemon",
969
+ # daemon_types.__all__
970
+ "AccountInfo",
971
+ "DaemonState",
972
+ "SessionRuntimeState",
973
+ "DaemonFallbackReason",
974
+ "DaemonSessionInfo",
975
+ "DaemonReadyResult",
976
+ "DaemonDirectResult",
977
+ "DaemonInitResult",
978
+ "DaemonRpcError",
979
+ "DaemonProtocolError",
980
+ "DaemonProtocolVersionMismatchError",
981
+ "DaemonConfigurationConflictError",
982
+ "DaemonHeartbeatTimeoutError",
983
+ "DaemonSessionAlreadyOpenError",
984
+ "DAEMON_HEARTBEAT_TIMEOUT_MS",
985
+ "DAEMON_PROXY_CAPABILITY",
986
+ "DAEMON_VALIDATE_PLUGINS_CAPABILITY",
987
+ "DaemonGetModelsParams",
988
+ "BYOKModelValidationInput",
989
+ "DaemonValidateByokModelParams",
990
+ "ByokProtocol",
991
+ "ByokModelConfigInfo",
992
+ "CustomByokProviderConfigInfo",
993
+ "CustomByokProviderModelConfigInfo",
994
+ "CustomByokProviderThinkingMode",
995
+ "CustomByokProviderReasoningEffortLevel",
996
+ "ByokConfigInfo",
997
+ "ByokModelConfigInput",
998
+ "CustomByokProviderThinkingCapabilitiesInput",
999
+ "CustomByokProviderModelCapabilitiesInput",
1000
+ "CustomByokProviderModelInput",
1001
+ "CustomByokProviderConfigInput",
1002
+ "CreateByokConfigInput",
1003
+ "CheckByokConfigInput",
1004
+ "UpdateByokModelConfigInput",
1005
+ "UpdateCustomByokProviderConfigInput",
1006
+ "UpdateByokConfigInput",
1007
+ "ByokModelConfigReference",
1008
+ "CustomByokProviderConfigReference",
1009
+ "ByokConfigReference",
1010
+ "DeleteByokConfigInput",
1011
+ "ByokConfigCheckDetails",
1012
+ "ByokConfigCheckResult",
912
1013
  # Auth helpers
913
1014
  "DEFAULT_ACCESS_TOKEN_ENV_VAR",
914
1015
  "DEFAULT_SERVICE_ACCOUNT_ENV_VAR",
@@ -1,3 +1,3 @@
1
1
  """Bundled runtime CLI version."""
2
2
 
3
- __cli_version__ = "1.1.76"
3
+ __cli_version__ = "1.1.79"
@@ -27,6 +27,7 @@ from .skill_evolution import (
27
27
  prepare_evolution_options,
28
28
  )
29
29
  from .transport import Transport
30
+ from .transport.daemon_session import validate_daemon_session_options
30
31
  from .transport.subprocess_cli import SubprocessCLITransport
31
32
 
32
33
 
@@ -62,6 +63,14 @@ class InternalClient:
62
63
  ) -> AsyncIterator[Message]:
63
64
  """Process a query through transport and Query."""
64
65
 
66
+ if options.daemon is not None:
67
+ if transport is not None:
68
+ raise ValueError("daemon cannot be combined with a custom transport")
69
+ if options.experimental_cloud_agent is not None:
70
+ raise ValueError(
71
+ "daemon cannot be combined with experimental_cloud_agent"
72
+ )
73
+
65
74
  # Validate and configure permission settings (matching TypeScript SDK logic)
66
75
  configured_options = options
67
76
  normalized_evolution, normalized_skill_evolution = prepare_evolution_options(
@@ -94,7 +103,9 @@ class InternalClient:
94
103
  )
95
104
 
96
105
  # Automatically set permission_prompt_tool_name to "stdio" for control protocol
97
- configured_options = replace(options, permission_prompt_tool_name="stdio")
106
+ configured_options = replace(
107
+ configured_options, permission_prompt_tool_name="stdio"
108
+ )
98
109
 
99
110
  on_auth_expired = once_callback(configured_options.on_auth_expired)
100
111
  if on_auth_expired is not None:
@@ -102,6 +113,9 @@ class InternalClient:
102
113
  configured_options, on_auth_expired=on_auth_expired
103
114
  )
104
115
 
116
+ # Fail fast on invalid daemon session options before touching the Store.
117
+ if configured_options.daemon is not None:
118
+ validate_daemon_session_options(configured_options)
105
119
  prepared_memory = prepare_memory_options(configured_options.memory)
106
120
  requires_store_resume = configured_options.session_store is not None and (
107
121
  configured_options.resume is not None
@@ -120,18 +134,43 @@ class InternalClient:
120
134
  else None
121
135
  )
122
136
  if materialized_session is not None:
123
- configured_options = replace(
124
- configured_options,
125
- resume=materialized_session.session_id,
126
- continue_conversation=False,
127
- env={
137
+ updates: dict[str, Any] = {
138
+ "resume": materialized_session.session_id,
139
+ "continue_conversation": False,
140
+ }
141
+ if configured_options.daemon is None:
142
+ # Daemon sessions carry the config dir per session in
143
+ # open_session; a shared process env cannot express it.
144
+ updates["env"] = {
128
145
  **configured_options.env,
129
146
  CONFIG_DIR_ENV: str(materialized_session.config_dir),
130
- },
147
+ }
148
+ configured_options = replace(configured_options, **updates)
149
+ elif requires_store_resume and configured_options.continue_conversation:
150
+ # The Store resolved no restorable transcript: start fresh instead
151
+ # of consulting local continue history (explicit resume stays for
152
+ # the CLI's local-transcript fallback).
153
+ configured_options = replace(
154
+ configured_options, continue_conversation=False
155
+ )
156
+
157
+ daemon_transport = (
158
+ configured_options.daemon._create_transport(
159
+ configured_options,
160
+ config_dir=(
161
+ str(materialized_session.config_dir)
162
+ if materialized_session is not None
163
+ else None
164
+ ),
131
165
  )
166
+ if configured_options.daemon is not None
167
+ else None
168
+ )
132
169
 
133
- # Use provided transport or create subprocess transport
134
- if transport is not None:
170
+ # Use the selected daemon, custom, or legacy subprocess transport.
171
+ if daemon_transport is not None:
172
+ chosen_transport = daemon_transport
173
+ elif transport is not None:
135
174
  chosen_transport = transport
136
175
  else:
137
176
  chosen_transport = SubprocessCLITransport(
@@ -201,6 +240,7 @@ class InternalClient:
201
240
  session_store_flush=configured_options.session_store_flush,
202
241
  default_custom_context=configured_options.custom_context,
203
242
  skill_evolution=normalized_skill_evolution,
243
+ finite_input=True,
204
244
  )
205
245
  except BaseException:
206
246
  await chosen_transport.close()
@@ -226,10 +266,18 @@ class InternalClient:
226
266
  "parent_tool_use_id": None,
227
267
  }
228
268
  await query.write_user_message(user_message)
229
- query.spawn_task(query.wait_for_result_and_end_input())
269
+ if configured_options.daemon is not None:
270
+ query.spawn_task(
271
+ query.wait_for_result_and_end_input(), input_task=True
272
+ )
273
+ else:
274
+ query.spawn_task(query.wait_for_result_and_end_input())
230
275
  elif isinstance(prompt, AsyncIterable):
231
276
  # Stream input in background for async iterables
232
- query.spawn_task(query.stream_input(prompt))
277
+ if configured_options.daemon is not None:
278
+ query.spawn_task(query.stream_input(prompt), input_task=True)
279
+ else:
280
+ query.spawn_task(query.stream_input(prompt))
233
281
 
234
282
  # Yield parsed messages, skipping unknown message types
235
283
  async for data in query.receive_messages():