Repository navigation
Conversation
Vidoc security reviewTip Good to merge — no security issues found. Reviewed 209 changed files. 💬 Have questions? Tag @vidoc in a comment and I'll answer. |
|
@cubic-dev-ai review this PR |
@MDzaja I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
All reported issues were addressed across 50 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
|
@cubic-dev-ai review this PR |
@MDzaja I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
All reported issues were addressed across 50 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
|
@cubic-dev-ai review this PR |
@MDzaja I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
All reported issues were addressed across 50 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
|
On hold for now. The per-create |
There was a problem hiding this comment.
All reported issues were addressed
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 9 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 22 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
66abc38 to
fac741a
Compare
|
@cubic-dev-ai review this PR |
@MDzaja I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
All reported issues were addressed across 191 files
You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.
View guided diff | Turn on auto-fix | Re-trigger cubic
fac741a to
6e98cd0
Compare
There was a problem hiding this comment.
All reported issues were addressed across 22 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
Prepare SDK 1.x for SDK 2.x. In 2.x the root client exposes only .v1 / .v2, close() and the context manager. 1.x now has the same shape: the existing implementation becomes the v1 client, and the root client is a thin wrapper that owns one v1 instance and keeps every previous member as a deprecated forwarder, so existing code keeps working. Code written against daytona.v1 on 1.x runs unchanged on 2.x. - v1 client: daytona.v1.Daytona / AsyncDaytona (Python), Daytona from @daytona/sdk/v1 (TypeScript), ClientV1 via client.V1() (Go), Daytona::V1::Daytona (Ruby), DaytonaV1 via daytona.v1() (Java) - root members are marked deprecated and warn once per process on first use; close and the context manager are not deprecated; a parity test per SDK fails if the v1 client gains a member the root lacks - DaytonaConfig.target and DAYTONA_TARGET are deprecated in favour of per-call target / region_id, with a separate one-time warning - V1_API_URL, the 2.x shared error names, and V1-suffixed aliases (DaytonaV1, SandboxV1, ImageV1, ...) in the v1 namespace - READMEs, examples and reference docs use the .v1 form Signed-off-by: MDzaja <mirkodzaja0@gmail.com>
6e98cd0 to
2359f24
Compare
|
@cubic-dev-ai review this PR |
@MDzaja I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
1 existing issue remains and 1 new issue found across 207 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="artifacts/sdk-docs/typescript-sdk/root-daytona.mdx">
<violation number="1" location="artifacts/sdk-docs/typescript-sdk/root-daytona.mdx:212">
P3: The generated `create()` parameter lists render literal `######` markers in the options entries. Fix the typedoc hook for nested option objects rather than editing this generated file, since the same artifact appears in image.mdx.</violation>
</file>
Note: This PR contains a large number of files. cubic selects up to 200 of the highest-priority eligible files for this review, so some files may not have been reviewed.
Requires human review: Auto-approval blocked because this review re-detected 1 unresolved issue already reported by Cubic.
You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.
View guided diff | Turn on auto-fix | Re-trigger cubic
| **Parameters**: | ||
|
|
||
| - `params?` _CreateSandboxFromSnapshotParams_ | ||
| - `options?` _###### timeout?_ - `number` |
There was a problem hiding this comment.
P3: The generated create() parameter lists render literal ###### markers in the options entries. Fix the typedoc hook for nested option objects rather than editing this generated file, since the same artifact appears in image.mdx.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At artifacts/sdk-docs/typescript-sdk/root-daytona.mdx, line 212:
<comment>The generated `create()` parameter lists render literal `######` markers in the options entries. Fix the typedoc hook for nested option objects rather than editing this generated file, since the same artifact appears in image.mdx.</comment>
<file context>
@@ -0,0 +1,357 @@
+**Parameters**:
+
+- `params?` _CreateSandboxFromSnapshotParams_
+- `options?` _###### timeout?_ - `number`
+
+**Returns**:
</file context>
…root by sync/async, raise every time under error filters Signed-off-by: MDzaja <mirkodzaja0@gmail.com>
Signed-off-by: MDzaja <mirkodzaja0@gmail.com>
There was a problem hiding this comment.
5 issues found across 8 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="sdk-python/src/daytona/_root_sync.py">
<violation number="1" location="sdk-python/src/daytona/_root_sync.py:14">
P2: The new root wrappers import `typing_extensions.deprecated`, but the package only requires `typing-extensions>=4.0.0`; `deprecated` is available only from 4.5.0. Bump the dependency lower bound to `>=4.5.0` (or avoid this import), otherwise installs resolving 4.0–4.4.x fail when importing the root client.</violation>
<violation number="2" location="sdk-python/src/daytona/_root_sync.py:158">
P3: `getattr(self.v1, "create")` is equivalent to `self.v1.create` but returns `Any`, which hides this forwarding call from the type checker. Call `self.v1.create(...)` directly and resolve any overload mismatch explicitly, for example with a targeted `# type: ignore` and a comment.</violation>
</file>
<file name="artifacts/sdk-docs/python-sdk/root-daytona.mdx">
<violation number="1" location="artifacts/sdk-docs/python-sdk/root-daytona.mdx:6">
P3: This sentence says the sync root imports "only" the sync v1 chain, but `common/*` modules import the async generated clients (`daytona_api_client_async`, `daytona_toolbox_api_client_async`). Reword it to match what is true; update the module docstring too, since this mdx is regenerated from it.</violation>
</file>
<file name="sdk-python/src/daytona/_root_async.py">
<violation number="1" location="sdk-python/src/daytona/_root_async.py:6">
P3: This docstring says the module imports only the async v1 chain, but `common.daytona` pulls in `common.image`, which imports `daytona._sync.object_storage`. Reword it so it does not claim exclusive imports, for example: "built on the async v1 client (`daytona._async`)".</violation>
</file>
<file name="sdk-python/src/daytona/_versioning.py">
<violation number="1" location="sdk-python/src/daytona/_versioning.py:60">
P2: `warnings.warn` runs user-configurable warning handlers synchronously while `_lock` is held. A handler that touches another deprecated SDK path can then deadlock on this non-reentrant lock; keep the lock only around warning-state transitions and dispatch the warning outside it, resetting the state if an error filter raises.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
| from types import TracebackType | ||
| from typing import Callable, overload | ||
|
|
||
| from typing_extensions import deprecated |
There was a problem hiding this comment.
P2: The new root wrappers import typing_extensions.deprecated, but the package only requires typing-extensions>=4.0.0; deprecated is available only from 4.5.0. Bump the dependency lower bound to >=4.5.0 (or avoid this import), otherwise installs resolving 4.0–4.4.x fail when importing the root client.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At sdk-python/src/daytona/_root_sync.py, line 14:
<comment>The new root wrappers import `typing_extensions.deprecated`, but the package only requires `typing-extensions>=4.0.0`; `deprecated` is available only from 4.5.0. Bump the dependency lower bound to `>=4.5.0` (or avoid this import), otherwise installs resolving 4.0–4.4.x fail when importing the root client.</comment>
<file context>
@@ -0,0 +1,188 @@
+from types import TracebackType
+from typing import Callable, overload
+
+from typing_extensions import deprecated
+
+from ._sync.daytona import Daytona as _DaytonaV1
</file context>
| if _root_namespace_warning_emitted: | ||
| return | ||
| # Mark as emitted only once warn() returns: with warnings turned into errors, every call raises. | ||
| warnings.warn(root_namespace_message(member_name), DeprecationWarning, stacklevel=user_stacklevel()) |
There was a problem hiding this comment.
P2: warnings.warn runs user-configurable warning handlers synchronously while _lock is held. A handler that touches another deprecated SDK path can then deadlock on this non-reentrant lock; keep the lock only around warning-state transitions and dispatch the warning outside it, resetting the state if an error filter raises.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At sdk-python/src/daytona/_versioning.py, line 60:
<comment>`warnings.warn` runs user-configurable warning handlers synchronously while `_lock` is held. A handler that touches another deprecated SDK path can then deadlock on this non-reentrant lock; keep the lock only around warning-state transitions and dispatch the warning outside it, resetting the state if an error filter raises.</comment>
<file context>
@@ -56,8 +56,9 @@ def warn_root_namespace_once(member_name: str) -> None:
if _root_namespace_warning_emitted:
return
+ # Mark as emitted only once warn() returns: with warnings turned into errors, every call raises.
+ warnings.warn(root_namespace_message(member_name), DeprecationWarning, stacklevel=user_stacklevel())
_root_namespace_warning_emitted = True
- warnings.warn(root_namespace_message(member_name), DeprecationWarning, stacklevel=user_stacklevel())
</file context>
| create = getattr(self.v1, "create") | ||
| return create(params, timeout=timeout, on_snapshot_create_logs=on_snapshot_create_logs) |
There was a problem hiding this comment.
P3: getattr(self.v1, "create") is equivalent to self.v1.create but returns Any, which hides this forwarding call from the type checker. Call self.v1.create(...) directly and resolve any overload mismatch explicitly, for example with a targeted # type: ignore and a comment.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At sdk-python/src/daytona/_root_sync.py, line 158:
<comment>`getattr(self.v1, "create")` is equivalent to `self.v1.create` but returns `Any`, which hides this forwarding call from the type checker. Call `self.v1.create(...)` directly and resolve any overload mismatch explicitly, for example with a targeted `# type: ignore` and a comment.</comment>
<file context>
@@ -0,0 +1,188 @@
+ on_snapshot_create_logs: Callable[[str], None] | None = None,
+ ) -> Sandbox:
+ warn_root_namespace_once("create")
+ create = getattr(self.v1, "create")
+ return create(params, timeout=timeout, on_snapshot_create_logs=on_snapshot_create_logs)
+
</file context>
| create = getattr(self.v1, "create") | |
| return create(params, timeout=timeout, on_snapshot_create_logs=on_snapshot_create_logs) | |
| return self.v1.create(params, timeout=timeout, on_snapshot_create_logs=on_snapshot_create_logs) |
| hideTitleOnPage: true | ||
| --- | ||
|
|
||
| The deprecated SDK 1.x sync root client. Imports only the sync v1 client chain. |
There was a problem hiding this comment.
P3: This sentence says the sync root imports "only" the sync v1 chain, but common/* modules import the async generated clients (daytona_api_client_async, daytona_toolbox_api_client_async). Reword it to match what is true; update the module docstring too, since this mdx is regenerated from it.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At artifacts/sdk-docs/python-sdk/root-daytona.mdx, line 6:
<comment>This sentence says the sync root imports "only" the sync v1 chain, but `common/*` modules import the async generated clients (`daytona_api_client_async`, `daytona_toolbox_api_client_async`). Reword it to match what is true; update the module docstring too, since this mdx is regenerated from it.</comment>
<file context>
@@ -3,6 +3,8 @@ title: "RootDaytona"
hideTitleOnPage: true
---
+The deprecated SDK 1.x sync root client. Imports only the sync v1 client chain.
+
## Daytona
</file context>
| The deprecated SDK 1.x sync root client. Imports only the sync v1 client chain. | |
| The deprecated SDK 1.x sync root client. Imports the sync v1 client chain and the shared `common` modules. |
|
|
||
| # pylint: disable=protected-access | ||
|
|
||
| """The deprecated SDK 1.x async root client. Imports only the async v1 client chain.""" |
There was a problem hiding this comment.
P3: This docstring says the module imports only the async v1 chain, but common.daytona pulls in common.image, which imports daytona._sync.object_storage. Reword it so it does not claim exclusive imports, for example: "built on the async v1 client (daytona._async)".
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At sdk-python/src/daytona/_root_async.py, line 6:
<comment>This docstring says the module imports only the async v1 chain, but `common.daytona` pulls in `common.image`, which imports `daytona._sync.object_storage`. Reword it so it does not claim exclusive imports, for example: "built on the async v1 client (`daytona._async`)".</comment>
<file context>
@@ -3,9 +3,11 @@
# pylint: disable=protected-access
+"""The deprecated SDK 1.x async root client. Imports only the async v1 client chain."""
+
from __future__ import annotations
</file context>
| """The deprecated SDK 1.x async root client. Imports only the async v1 client chain.""" | |
| """The deprecated SDK 1.x async root client, built on the async v1 client (`daytona._async`).""" |
|
@cubic-dev-ai review this PR |
@MDzaja I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
1 existing issue remains and 2 new issues found across 209 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="sdk-python/src/daytona/_root_async.py">
<violation number="1" location="sdk-python/src/daytona/_root_async.py:158">
P3: `getattr(self.v1, "create")` with a literal name bypasses basedpyright for this call. `v1.create`'s overloads reject the union `params` type, so a direct call would fail type checking. Any future signature change in `v1.create` will not be caught here. Narrow `params` with `isinstance` before calling, or add a typed cast.</violation>
</file>
<file name="sdk-python/src/daytona/_versioning.py">
<violation number="1" location="sdk-python/src/daytona/_versioning.py:25">
P2: The once-only warning state is scoped to each package copy, not the process. Importing both supported package names (`daytona` and `daytona_sdk`) can therefore emit duplicate root or target deprecation warnings; store the state in a process-global registry shared by both package names.</violation>
</file>
Note: This PR contains a large number of files. cubic selects up to 200 of the highest-priority eligible files for this review, so some files may not have been reviewed.
Requires human review: Auto-approval blocked because this review re-detected 1 unresolved issue already reported by Cubic.
You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.
View guided diff | Turn on auto-fix | Re-trigger cubic
| + "(CreateSnapshotParams.region_id) instead." | ||
| ) | ||
|
|
||
| _root_namespace_warning_emitted = False |
There was a problem hiding this comment.
P2: The once-only warning state is scoped to each package copy, not the process. Importing both supported package names (daytona and daytona_sdk) can therefore emit duplicate root or target deprecation warnings; store the state in a process-global registry shared by both package names.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At sdk-python/src/daytona/_versioning.py, line 25:
<comment>The once-only warning state is scoped to each package copy, not the process. Importing both supported package names (`daytona` and `daytona_sdk`) can therefore emit duplicate root or target deprecation warnings; store the state in a process-global registry shared by both package names.</comment>
<file context>
@@ -0,0 +1,78 @@
+ + "(CreateSnapshotParams.region_id) instead."
+)
+
+_root_namespace_warning_emitted = False
+_target_warning_emitted = False
+_lock = threading.Lock()
</file context>
| on_snapshot_create_logs: Callable[[str], None] | None = None, | ||
| ) -> AsyncSandbox: | ||
| warn_root_namespace_once("create") | ||
| create = getattr(self.v1, "create") |
There was a problem hiding this comment.
P3: getattr(self.v1, "create") with a literal name bypasses basedpyright for this call. v1.create's overloads reject the union params type, so a direct call would fail type checking. Any future signature change in v1.create will not be caught here. Narrow params with isinstance before calling, or add a typed cast.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At sdk-python/src/daytona/_root_async.py, line 158:
<comment>`getattr(self.v1, "create")` with a literal name bypasses basedpyright for this call. `v1.create`'s overloads reject the union `params` type, so a direct call would fail type checking. Any future signature change in `v1.create` will not be caught here. Narrow `params` with `isinstance` before calling, or add a typed cast.</comment>
<file context>
@@ -0,0 +1,188 @@
+ on_snapshot_create_logs: Callable[[str], None] | None = None,
+ ) -> AsyncSandbox:
+ warn_root_namespace_once("create")
+ create = getattr(self.v1, "create")
+ return await create(params, timeout=timeout, on_snapshot_create_logs=on_snapshot_create_logs)
+
</file context>
Signed-off-by: MDzaja <mirkodzaja0@gmail.com>
Signed-off-by: MDzaja <mirkodzaja0@gmail.com>
Signed-off-by: MDzaja <mirkodzaja0@gmail.com>
|
@cubic-dev-ai review this PR |
@MDzaja I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
All reported issues were addressed across 209 files
Note: This PR contains a large number of files. cubic selects up to 200 of the highest-priority eligible files for this review, so some files may not have been reviewed.
You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.
View guided diff | Turn on auto-fix | Re-trigger cubic
Signed-off-by: MDzaja <mirkodzaja0@gmail.com>
|
@cubic-dev-ai review this PR |
@MDzaja I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
All reported issues were addressed across 209 files
Note: This PR contains a large number of files. cubic selects up to 200 of the highest-priority eligible files for this review, so some files may not have been reviewed.
You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.
View guided diff | Turn on auto-fix | Re-trigger cubic
…xample field name Signed-off-by: MDzaja <mirkodzaja0@gmail.com>
|
@cubic-dev-ai review this PR |
@MDzaja I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
No issues found across 209 files
Note: This PR contains a large number of files. cubic selects up to 200 of the highest-priority eligible files for this review, so some files may not have been reviewed.
You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.
View guided diff | Turn on auto-fix | Re-trigger cubic
Signed-off-by: MDzaja <mirkodzaja0@gmail.com>
|
@cubic-dev-ai review this PR |
@MDzaja I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
No issues found across 209 files
Note: This PR contains a large number of files. cubic selects up to 200 of the highest-priority eligible files for this review, so some files may not have been reviewed.
You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.
View guided diff | Turn on auto-fix | Re-trigger cubic
…mental_fork at v1.fork Signed-off-by: MDzaja <mirkodzaja0@gmail.com>
|
@cubic-dev-ai review this PR |
@MDzaja I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
4 existing issues remain and 1 new issue found across 209 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="sdk-typescript/src/RootDaytona.ts">
<violation number="1" location="sdk-typescript/src/RootDaytona.ts:34">
P1: The root constructor forwards endpoint configuration to v1, so `root.v1` can use `apiUrl`, `serverUrl`, or `DAYTONA_API_URL` instead of the fixed `V1_API_URL` promised for portable root clients. Force the root-owned v1 client to `V1_API_URL` and keep custom endpoints on `@daytona/sdk/v1`.</violation>
</file>
Note: This PR contains a large number of files. cubic selects up to 200 of the highest-priority eligible files for this review, so some files may not have been reviewed.
Requires human review: Auto-approval blocked because this review re-detected 4 unresolved issues already reported by Cubic.
You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.
View guided diff | Turn on auto-fix | Re-trigger cubic
|
|
||
| /** Creates the root client and its v1 client from `config` (or the environment). */ | ||
| constructor(config?: DaytonaConfig) { | ||
| this.client = new DaytonaV1(config) |
There was a problem hiding this comment.
P1: The root constructor forwards endpoint configuration to v1, so root.v1 can use apiUrl, serverUrl, or DAYTONA_API_URL instead of the fixed V1_API_URL promised for portable root clients. Force the root-owned v1 client to V1_API_URL and keep custom endpoints on @daytona/sdk/v1.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At sdk-typescript/src/RootDaytona.ts, line 34:
<comment>The root constructor forwards endpoint configuration to v1, so `root.v1` can use `apiUrl`, `serverUrl`, or `DAYTONA_API_URL` instead of the fixed `V1_API_URL` promised for portable root clients. Force the root-owned v1 client to `V1_API_URL` and keep custom endpoints on `@daytona/sdk/v1`.</comment>
<file context>
@@ -0,0 +1,157 @@
+
+ /** Creates the root client and its v1 client from `config` (or the environment). */
+ constructor(config?: DaytonaConfig) {
+ this.client = new DaytonaV1(config)
+ }
+
</file context>
Description
Prepares SDK 1.x for the move to SDK 2.x (rlp#3010). In 2.x the root client has no resource methods:
Daytona()exposes only.v1/.v2,close()and the context manager. 1.x now has the same shape, plus the old root members kept as deprecated forwarders so existing code keeps working. Code written againstdaytona.v1and thedaytona.v1namespace on 1.x runs unchanged on 2.x.Rebuilt on current
main. The per-createtargetfrom the earlier version of this PR already shipped in #355, so it is no longer part of the diff. The old alias-based approach (v1returningself) is replaced:v1is now a separate implementation object, so the root form can be deprecated without deprecating.v1.daytona.v1.Daytona/AsyncDaytona(the existing implementation);Daytona().v1daytona.Daytona/AsyncDaytonawrappers in_root_sync.py/_root_async.pyDaytonafrom@daytona/sdk/v1(ESM, CJS,moduleResolution: node);daytona.v1Daytonafrom@daytona/sdk(RootDaytona.ts)*daytona.V1Clientviaclient.V1()*daytona.ClientDaytona::V1::Daytona;daytona.v1Daytona::Daytonaio.daytona.sdk.DaytonaV1viadaytona.v1()io.daytona.sdk.DaytonaRoot client
v1every time.v1. Service accessors return the same objects asv1.<service>.closeand the context manager /await usingare not deprecated (the 2.x root has them).Runtime warning, once per process
.v1form. Construction and.v1usage never warn.targetin the client config orDAYTONA_TARGET: deprecated in favour of per-calltarget/region_id, with a separate one-time warning (also on later assignment in Python). Static markers in TypeScript, Go, Ruby and Java; in Python the field is documented as deprecated (a pydantic field marker would warn on every read, and typed constructor overloads would change type checking for existing callers). Behaviour is unchanged.DeprecationWarning(PEP 702@deprecatedfor type checkers), attributed to the first frame outside the SDK so Python's default filters show it in user scripts; TypeScriptprocess.emitWarningwith codesDAYTONA_ROOT_NAMESPACE/DAYTONA_CONFIG_TARGET, falling back toconsole.warn; Go stderr viasync.Once(silence withdaytona.SetDeprecationWarningWriter(io.Discard); root service fields carryDeprecated:comments but cannot warn at runtime); Rubywarn, attributed to the first frame outside the SDK; Javajava.util.logging.Shared with 2.x
V1_API_URL(GoV1APIURL), used as the default API URL.DaytonaValidationError/DaytonaAuthorizationError) from the root and fromv1; a test pins the list.…V1aliases for the names 2.x also exports from its v2 namespace (DaytonaV1,SandboxV1,ImageV1, …): in Python rlp'sSHARED_WITH_V1list; in TypeScript every 1.x root name that rlp's v2 entry also exports (what its bundler aliases). Go and Java have no namespaces: Go uses the prefixedV1Client(matching rlp's planned Go layout, D15) and Java the suffixedDaytonaV1, both in the root package.from daytona import Sandbox) keep working without a warning; READMEs point to thev1imports.Follow-up in rlp: the 2.x root warns on
targetitself and also forwards it to the bundled v1 client; once the pin moves to 1.x, v1 warns too, so rlp should stop one of the two (drop its own warning or stop forwardingtarget).Follow-up in rlp: once the bundled v1 SDK is pinned to a 1.x tag, the bundler should use 1.x's
daytona.v1module as the namespace entry instead of the whole root package, and can drop most of its error-class rewriting.Verification
Run locally in the Nix dev shells:
yarn lint:py(pylint, basedpyright) 0 errors / 0 warnings,pytest759 passed; a test type-checksdaytona.v1as an installed library, and mypy resolvesdaytona.v1.Daytonato the v1 clienttscclean,jest472 passed (22 suites),nx build+ attw cleangolangci-lint0 issues,go test -race ./...passed,examples/gobuildsrspec581 examples, 0 failures; RuboCop adds no offenses on changed filesgo vet./gradlew buildgreen.v1is the same instance.Documentation
READMEs and examples use the
.v1form, add a "Versioned namespace" section and drop the deprecatedtargetfrom config examples. Reference docs underartifacts/sdk-docs/are regenerated, keeping only hunks this change produces.Notes
release/v0frommainbefore merging this PR.