mirror of
https://github.com/Sea-Haven-Industries/open-swe.git
synced 2026-10-07 13:59:05 +00:00
chore: Bump daytona dep (#423)
* chore: Bump daytona dep * cr * cr * feat: missing deps
This commit is contained in:
parent
d51af805e2
commit
d2e981e219
6 changed files with 1409 additions and 124 deletions
|
|
@ -23,7 +23,9 @@
|
||||||
"postinstall": "turbo build"
|
"postinstall": "turbo build"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@daytonaio/sdk": "^0.18.1",
|
"@aws-sdk/client-s3": "^3.845.0",
|
||||||
|
"@aws-sdk/lib-storage": "^3.845.0",
|
||||||
|
"@daytonaio/sdk": "^0.23.0",
|
||||||
"@langchain/anthropic": "^0.3.20",
|
"@langchain/anthropic": "^0.3.20",
|
||||||
"@langchain/community": "^0.3.47",
|
"@langchain/community": "^0.3.47",
|
||||||
"@langchain/core": "^0.3.56",
|
"@langchain/core": "^0.3.56",
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { SNAPSHOT_NAME } from "@open-swe/shared/constants";
|
import { SNAPSHOT_NAME } from "@open-swe/shared/constants";
|
||||||
import { CreateSandboxParams } from "@daytonaio/sdk";
|
import { CreateSandboxFromImageParams } from "@daytonaio/sdk";
|
||||||
|
|
||||||
export const DEFAULT_SANDBOX_CREATE_PARAMS: CreateSandboxParams = {
|
export const DEFAULT_SANDBOX_CREATE_PARAMS: CreateSandboxFromImageParams = {
|
||||||
resources: {
|
resources: {
|
||||||
cpu: 2,
|
cpu: 2,
|
||||||
memory: 4,
|
memory: 4,
|
||||||
|
|
@ -9,6 +9,7 @@ export const DEFAULT_SANDBOX_CREATE_PARAMS: CreateSandboxParams = {
|
||||||
},
|
},
|
||||||
user: "daytona",
|
user: "daytona",
|
||||||
image: SNAPSHOT_NAME,
|
image: SNAPSHOT_NAME,
|
||||||
|
autoDeleteInterval: 15, // delete after 15 minutes
|
||||||
};
|
};
|
||||||
|
|
||||||
export const LANGGRAPH_USER_PERMISSIONS = [
|
export const LANGGRAPH_USER_PERMISSIONS = [
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@ import { createLogger, LogLevel } from "../logger.js";
|
||||||
import { GraphConfig, TargetRepository } from "@open-swe/shared/open-swe/types";
|
import { GraphConfig, TargetRepository } from "@open-swe/shared/open-swe/types";
|
||||||
import { TIMEOUT_SEC } from "@open-swe/shared/constants";
|
import { TIMEOUT_SEC } from "@open-swe/shared/constants";
|
||||||
import { getSandboxErrorFields } from "../sandbox-error-fields.js";
|
import { getSandboxErrorFields } from "../sandbox-error-fields.js";
|
||||||
import { ExecuteResponse } from "@daytonaio/sdk/dist/types/ExecuteResponse.js";
|
|
||||||
import { getRepoAbsolutePath } from "@open-swe/shared/git";
|
import { getRepoAbsolutePath } from "@open-swe/shared/git";
|
||||||
|
import { ExecuteResponse } from "@daytonaio/sdk/src/types/ExecuteResponse.js";
|
||||||
|
|
||||||
class ExecuteCommandError extends Error {
|
class ExecuteCommandError extends Error {
|
||||||
command: string;
|
command: string;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { ExecuteResponse } from "@daytonaio/sdk/dist/types/ExecuteResponse.js";
|
import { ExecuteResponse } from "@daytonaio/sdk/src/types/ExecuteResponse.js";
|
||||||
|
|
||||||
export function getSandboxErrorFields(
|
export function getSandboxErrorFields(
|
||||||
error: unknown,
|
error: unknown,
|
||||||
|
|
|
||||||
|
|
@ -33,11 +33,11 @@ export function daytonaClient(): Daytona {
|
||||||
export async function stopSandbox(sandboxSessionId: string): Promise<string> {
|
export async function stopSandbox(sandboxSessionId: string): Promise<string> {
|
||||||
const sandbox = await daytonaClient().get(sandboxSessionId);
|
const sandbox = await daytonaClient().get(sandboxSessionId);
|
||||||
if (
|
if (
|
||||||
sandbox.instance.state == SandboxState.STOPPED ||
|
sandbox.state === SandboxState.STOPPED ||
|
||||||
sandbox.instance.state == SandboxState.ARCHIVED
|
sandbox.state === SandboxState.ARCHIVED
|
||||||
) {
|
) {
|
||||||
return sandboxSessionId;
|
return sandboxSessionId;
|
||||||
} else if (sandbox.instance.state == "started") {
|
} else if (sandbox.state === "started") {
|
||||||
await daytonaClient().stop(sandbox);
|
await daytonaClient().stop(sandbox);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -85,8 +85,7 @@ export async function getSandboxWithErrorHandling(
|
||||||
const sandbox = await daytonaClient().get(sandboxSessionId);
|
const sandbox = await daytonaClient().get(sandboxSessionId);
|
||||||
|
|
||||||
// Check sandbox state
|
// Check sandbox state
|
||||||
const sandboxInfo = await sandbox.info();
|
const state = sandbox.state;
|
||||||
const state = sandboxInfo.state;
|
|
||||||
|
|
||||||
if (state === "started") {
|
if (state === "started") {
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue