mirror of
https://github.com/Sea-Haven-Industries/open-swe.git
synced 2026-09-30 09:13:14 +00:00
fix: Rename from open-swe to openswe (#809)
* fix: Rename from open-swe to openswe * del tmp file, format and lint
This commit is contained in:
parent
46d795c41b
commit
504be7c563
168 changed files with 446 additions and 450 deletions
|
|
@ -2,7 +2,7 @@
|
|||
- Always use Yarn as the package manager - never use npm or other package managers
|
||||
- Run all general commands (e.g. not for starting a server) from the repository root using Turbo orchestration (yarn build, yarn lint, yarn format)
|
||||
- Before creating new utilities or shared functions, search in packages/shared/src to see if one already exists
|
||||
- When importing from the shared package, use the @open-swe/shared namespace with specific module paths
|
||||
- When importing from the shared package, use the @openswe/shared namespace with specific module paths
|
||||
- Follow strict TypeScript practices - the codebase uses strict mode across all packages
|
||||
- Use ESLint and Prettier for code quality - run yarn lint:fix and yarn format before committing
|
||||
- Console logging is prohibited in the open-swe app (ESLint error) - use the `createLogger` function to create a new logger instance instead
|
||||
|
|
@ -26,7 +26,7 @@ This is a Yarn workspace monorepo with Turbo build orchestration containing thre
|
|||
|
||||
**packages/shared**: Common utilities package
|
||||
- Central workspace dependency providing shared types, constants, and utilities
|
||||
- Exports modules via @open-swe/shared namespace (e.g., @open-swe/shared/open-swe/types)
|
||||
- Exports modules via @openswe/shared namespace (e.g., @openswe/shared/open-swe/types)
|
||||
- Must be built before other packages can import from it
|
||||
- Contains crypto utilities, GraphState types, and open-swe specific modules
|
||||
|
||||
|
|
@ -49,7 +49,7 @@ This is a Yarn workspace monorepo with Turbo build orchestration containing thre
|
|||
- TypeScript with strict mode across all packages
|
||||
- Jest with ts-jest for testing framework
|
||||
|
||||
**Workspace Structure**: Dependencies are managed on a per-package basis, meaning dependencies should only be installed in their specific app/package. Individual packages reference the shared package via @open-swe/shared workspace dependency.
|
||||
**Workspace Structure**: Dependencies are managed on a per-package basis, meaning dependencies should only be installed in their specific app/package. Individual packages reference the shared package via @openswe/shared workspace dependency.
|
||||
</dependencies_and_installation>
|
||||
|
||||
<testing_instructions>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name": "@open-swe/cli",
|
||||
"name": "@openswe/cli",
|
||||
"version": "0.0.0",
|
||||
"license": "MIT",
|
||||
"private": true,
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@langchain/langgraph-sdk": "^0.0.95",
|
||||
"@open-swe/shared": "*",
|
||||
"@openswe/shared": "*",
|
||||
"commander": "^12.0.0",
|
||||
"dotenv": "^16.6.1",
|
||||
"ink": "^6.0.1",
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ import {
|
|||
isToolMessage,
|
||||
} from "@langchain/core/messages";
|
||||
|
||||
import { getMessageContentString } from "@open-swe/shared/messages";
|
||||
import { createWriteTechnicalNotesToolFields } from "@open-swe/shared/open-swe/tools";
|
||||
import { getMessageContentString } from "@openswe/shared/messages";
|
||||
import { createWriteTechnicalNotesToolFields } from "@openswe/shared/open-swe/tools";
|
||||
|
||||
export type ToolCall = {
|
||||
name: string;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { Client, StreamMode } from "@langchain/langgraph-sdk";
|
||||
import { LOCAL_MODE_HEADER } from "@open-swe/shared/constants";
|
||||
import { LOCAL_MODE_HEADER } from "@openswe/shared/constants";
|
||||
import { formatDisplayLog } from "./logger.js";
|
||||
|
||||
const LANGGRAPH_URL = process.env.LANGGRAPH_URL || "http://localhost:2024";
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import {
|
|||
OPEN_SWE_STREAM_MODE,
|
||||
LOCAL_MODE_HEADER,
|
||||
OPEN_SWE_V2_GRAPH_ID,
|
||||
} from "@open-swe/shared/constants";
|
||||
} from "@openswe/shared/constants";
|
||||
import { formatDisplayLog } from "./logger.js";
|
||||
|
||||
const LANGGRAPH_URL = process.env.LANGGRAPH_URL || "http://localhost:2024";
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name": "@open-swe/docs",
|
||||
"name": "@openswe/docs",
|
||||
"author": "LangChain",
|
||||
"repository": "https://github.com/langchain-ai/open-swe",
|
||||
"private": true,
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ The monorepo is organized into two main directories:
|
|||
|
||||
- Centralized location for shared types, constants, and utilities
|
||||
- Used by both the agent and web applications
|
||||
- Exports modules via `@open-swe/shared` namespace
|
||||
- Exports modules via `@openswe/shared` namespace
|
||||
- Contains crypto utilities, GraphState types, and Open SWE specific modules
|
||||
|
||||
<Note>
|
||||
|
|
@ -134,7 +134,7 @@ The `apps/open-swe` package includes a critical `postinstall` hook:
|
|||
### Why This Matters
|
||||
|
||||
1. **Deployment Compatibility**: The LangGraph Platform needs all dependencies built and available
|
||||
2. **Shared Package Access**: The agent imports utilities from `@open-swe/shared` which must be compiled
|
||||
2. **Shared Package Access**: The agent imports utilities from `@openswe/shared` which must be compiled
|
||||
3. **Build Order**: Ensures the shared package is built before the agent attempts to use it
|
||||
|
||||
<Tip>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name": "@open-swe/agent-v2",
|
||||
"name": "@openswe/agent-v2",
|
||||
"homepage": "https://github.com/langchain-ai/open-swe/blob/main/README.md",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@langchain/core": "^0.3.65",
|
||||
"@open-swe/shared": "*",
|
||||
"@openswe/shared": "*",
|
||||
"deepagents": "0.0.0-rc.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import "@langchain/langgraph/zod";
|
|||
import { ChatAnthropic } from "@langchain/anthropic";
|
||||
import { z } from "zod";
|
||||
import { StructuredOutputParser } from "@langchain/core/output_parsers";
|
||||
import { getMessageContentString } from "@open-swe/shared/messages";
|
||||
import { getMessageContentString } from "@openswe/shared/messages";
|
||||
|
||||
export const CommandSafetyValidationSchema = z.object({
|
||||
is_safe: z.boolean().describe("Whether the command is safe to execute"),
|
||||
|
|
|
|||
|
|
@ -2,11 +2,11 @@ import "dotenv/config";
|
|||
import { OpenSWEInput, CodeTestDetails } from "./open-swe-types.js";
|
||||
import { Daytona, Sandbox } from "@daytonaio/sdk";
|
||||
import { createLogger, LogLevel } from "../src/utils/logger.js";
|
||||
import { TIMEOUT_SEC } from "@open-swe/shared/constants";
|
||||
import { TIMEOUT_SEC } from "@openswe/shared/constants";
|
||||
import { DEFAULT_SANDBOX_CREATE_PARAMS } from "../src/constants.js";
|
||||
import { TargetRepository } from "@open-swe/shared/open-swe/types";
|
||||
import { TargetRepository } from "@openswe/shared/open-swe/types";
|
||||
import { cloneRepo } from "../src/utils/github/git.js";
|
||||
import { getRepoAbsolutePath } from "@open-swe/shared/git";
|
||||
import { getRepoAbsolutePath } from "@openswe/shared/git";
|
||||
import { SimpleEvaluationResult } from "langsmith/vitest";
|
||||
import { runRuffLint, runMyPyTypeCheck } from "./tests.js";
|
||||
import { setupEnv, ENV_CONSTANTS } from "../src/utils/env-setup.js";
|
||||
|
|
|
|||
|
|
@ -5,12 +5,12 @@ import * as ls from "langsmith/vitest";
|
|||
import { formatInputs } from "./prompts.js";
|
||||
import { createLogger, LogLevel } from "../src/utils/logger.js";
|
||||
import { evaluator } from "./evaluator.js";
|
||||
import { MANAGER_GRAPH_ID, GITHUB_PAT } from "@open-swe/shared/constants";
|
||||
import { MANAGER_GRAPH_ID, GITHUB_PAT } from "@openswe/shared/constants";
|
||||
import { createLangGraphClient } from "../src/utils/langgraph-client.js";
|
||||
import { encryptSecret } from "@open-swe/shared/crypto";
|
||||
import { ManagerGraphState } from "@open-swe/shared/open-swe/manager/types";
|
||||
import { PlannerGraphState } from "@open-swe/shared/open-swe/planner/types";
|
||||
import { GraphState } from "@open-swe/shared/open-swe/types";
|
||||
import { encryptSecret } from "@openswe/shared/crypto";
|
||||
import { ManagerGraphState } from "@openswe/shared/open-swe/manager/types";
|
||||
import { PlannerGraphState } from "@openswe/shared/open-swe/planner/types";
|
||||
import { GraphState } from "@openswe/shared/open-swe/types";
|
||||
import { withRetry } from "./utils/retry.js";
|
||||
|
||||
const logger = createLogger(LogLevel.DEBUG, "Evaluator");
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { OpenSWEInput } from "./open-swe-types.js";
|
||||
import { TargetRepository } from "@open-swe/shared/open-swe/types";
|
||||
import { TargetRepository } from "@openswe/shared/open-swe/types";
|
||||
import { HumanMessage } from "@langchain/core/messages";
|
||||
import { Octokit } from "@octokit/rest";
|
||||
import { ManagerGraphUpdate } from "@open-swe/shared/open-swe/manager/types";
|
||||
import { ManagerGraphUpdate } from "@openswe/shared/open-swe/manager/types";
|
||||
|
||||
async function getRepoReadmeContents(
|
||||
targetRepository: TargetRepository,
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ import { createLogger, LogLevel } from "../src/utils/logger.js";
|
|||
import { DEFAULT_SANDBOX_CREATE_PARAMS } from "../src/constants.js";
|
||||
import { readFileSync } from "fs";
|
||||
import { cloneRepo, checkoutFilesFromCommit } from "../src/utils/github/git.js";
|
||||
import { TargetRepository } from "@open-swe/shared/open-swe/types";
|
||||
import { getRepoAbsolutePath } from "@open-swe/shared/git";
|
||||
import { TargetRepository } from "@openswe/shared/open-swe/types";
|
||||
import { getRepoAbsolutePath } from "@openswe/shared/git";
|
||||
import { setupEnv } from "../src/utils/env-setup.js";
|
||||
import { PRData, PRProcessResult } from "./types.js";
|
||||
import { runPytestOnFiles } from "./utils.js";
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name": "@open-swe/agent",
|
||||
"name": "@openswe/agent",
|
||||
"homepage": "https://github.com/langchain-ai/open-swe/blob/main/README.md",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
|
@ -38,7 +38,7 @@
|
|||
"@octokit/core": "^7.0.2",
|
||||
"@octokit/rest": "^22.0.0",
|
||||
"@octokit/webhooks": "^14.0.2",
|
||||
"@open-swe/shared": "*",
|
||||
"@openswe/shared": "*",
|
||||
"bcrypt": "^6.0.0",
|
||||
"diff": "^8.0.1",
|
||||
"hono": "^4.8.3",
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
/* eslint-disable no-console */
|
||||
import "dotenv/config";
|
||||
import { Client } from "@langchain/langgraph-sdk";
|
||||
import { ManagerGraphState } from "@open-swe/shared/open-swe/manager/types";
|
||||
import { PlannerGraphState } from "@open-swe/shared/open-swe/planner/types";
|
||||
import { ManagerGraphState } from "@openswe/shared/open-swe/manager/types";
|
||||
import { PlannerGraphState } from "@openswe/shared/open-swe/planner/types";
|
||||
|
||||
interface TraceUrls {
|
||||
managerTraceUrl: string;
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import {
|
|||
calculateConversationHistoryTokenCount,
|
||||
getMessagesSinceLastSummary,
|
||||
} from "../utils/tokens.js";
|
||||
import { GraphState } from "@open-swe/shared/open-swe/types";
|
||||
import { GraphState } from "@openswe/shared/open-swe/types";
|
||||
|
||||
describe("calculateConversationHistoryTokenCount", () => {
|
||||
it("should return 0 for empty messages array", async () => {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { DAYTONA_SNAPSHOT_NAME } from "@open-swe/shared/constants";
|
||||
import { DAYTONA_SNAPSHOT_NAME } from "@openswe/shared/constants";
|
||||
import { CreateSandboxFromSnapshotParams } from "@daytonaio/sdk";
|
||||
|
||||
export const DEFAULT_SANDBOX_CREATE_PARAMS: CreateSandboxFromSnapshotParams = {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { END, START, StateGraph } from "@langchain/langgraph";
|
||||
import { GraphConfiguration } from "@open-swe/shared/open-swe/types";
|
||||
import { ManagerGraphStateObj } from "@open-swe/shared/open-swe/manager/types";
|
||||
import { GraphConfiguration } from "@openswe/shared/open-swe/types";
|
||||
import { ManagerGraphStateObj } from "@openswe/shared/open-swe/manager/types";
|
||||
import {
|
||||
initializeGithubIssue,
|
||||
classifyMessage,
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { GraphConfig } from "@open-swe/shared/open-swe/types";
|
||||
import { GraphConfig } from "@openswe/shared/open-swe/types";
|
||||
import {
|
||||
ManagerGraphState,
|
||||
ManagerGraphUpdate,
|
||||
} from "@open-swe/shared/open-swe/manager/types";
|
||||
} from "@openswe/shared/open-swe/manager/types";
|
||||
import { createLangGraphClient } from "../../../../utils/langgraph-client.js";
|
||||
import {
|
||||
BaseMessage,
|
||||
|
|
@ -15,9 +15,9 @@ import {
|
|||
loadModel,
|
||||
supportsParallelToolCallsParam,
|
||||
} from "../../../../utils/llms/index.js";
|
||||
import { LLMTask } from "@open-swe/shared/open-swe/llm-task";
|
||||
import { LLMTask } from "@openswe/shared/open-swe/llm-task";
|
||||
import { Command, END } from "@langchain/langgraph";
|
||||
import { getMessageContentString } from "@open-swe/shared/messages";
|
||||
import { getMessageContentString } from "@openswe/shared/messages";
|
||||
import {
|
||||
createIssue,
|
||||
createIssueComment,
|
||||
|
|
@ -36,14 +36,14 @@ import { HumanResponse } from "@langchain/langgraph/prebuilt";
|
|||
import {
|
||||
OPEN_SWE_STREAM_MODE,
|
||||
PLANNER_GRAPH_ID,
|
||||
} from "@open-swe/shared/constants";
|
||||
} from "@openswe/shared/constants";
|
||||
import { createLogger, LogLevel } from "../../../../utils/logger.js";
|
||||
import { createClassificationPromptAndToolSchema } from "./utils.js";
|
||||
import { RequestSource } from "../../../../constants.js";
|
||||
import { StreamMode, Thread } from "@langchain/langgraph-sdk";
|
||||
import { isLocalMode } from "@open-swe/shared/open-swe/local-mode";
|
||||
import { PlannerGraphState } from "@open-swe/shared/open-swe/planner/types";
|
||||
import { GraphState } from "@open-swe/shared/open-swe/types";
|
||||
import { isLocalMode } from "@openswe/shared/open-swe/local-mode";
|
||||
import { PlannerGraphState } from "@openswe/shared/open-swe/planner/types";
|
||||
import { GraphState } from "@openswe/shared/open-swe/types";
|
||||
import { Client } from "@langchain/langgraph-sdk";
|
||||
import { shouldCreateIssue } from "../../../../utils/should-create-issue.js";
|
||||
const logger = createLogger(LogLevel.INFO, "ClassifyMessage");
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { TaskPlan } from "@open-swe/shared/open-swe/types";
|
||||
import { TaskPlan } from "@openswe/shared/open-swe/types";
|
||||
import {
|
||||
AIMessage,
|
||||
BaseMessage,
|
||||
|
|
@ -10,13 +10,13 @@ import {
|
|||
import { z } from "zod";
|
||||
import { removeLastHumanMessage } from "../../../../utils/message/modify-array.js";
|
||||
import { formatPlanPrompt } from "../../../../utils/plan-prompt.js";
|
||||
import { getActivePlanItems } from "@open-swe/shared/open-swe/tasks";
|
||||
import { getActivePlanItems } from "@openswe/shared/open-swe/tasks";
|
||||
import {
|
||||
getHumanMessageString,
|
||||
getToolMessageString,
|
||||
getUnknownMessageString,
|
||||
} from "../../../../utils/message/content.js";
|
||||
import { getMessageContentString } from "@open-swe/shared/messages";
|
||||
import { getMessageContentString } from "@openswe/shared/messages";
|
||||
import { ThreadStatus } from "@langchain/langgraph-sdk";
|
||||
import {
|
||||
CLASSIFICATION_SYSTEM_PROMPT,
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import { v4 as uuidv4 } from "uuid";
|
||||
import { GraphConfig } from "@open-swe/shared/open-swe/types";
|
||||
import { GraphConfig } from "@openswe/shared/open-swe/types";
|
||||
import {
|
||||
ManagerGraphState,
|
||||
ManagerGraphUpdate,
|
||||
} from "@open-swe/shared/open-swe/manager/types";
|
||||
} from "@openswe/shared/open-swe/manager/types";
|
||||
import { createIssueFieldsFromMessages } from "../utils/generate-issue-fields.js";
|
||||
import {
|
||||
GITHUB_INSTALLATION_ID,
|
||||
|
|
@ -12,7 +12,7 @@ import {
|
|||
LOCAL_MODE_HEADER,
|
||||
MANAGER_GRAPH_ID,
|
||||
OPEN_SWE_STREAM_MODE,
|
||||
} from "@open-swe/shared/constants";
|
||||
} from "@openswe/shared/constants";
|
||||
import { createLangGraphClient } from "../../../utils/langgraph-client.js";
|
||||
import { createIssue } from "../../../utils/github/api.js";
|
||||
import { getGitHubTokensFromConfig } from "../../../utils/github-tokens.js";
|
||||
|
|
@ -26,9 +26,9 @@ import {
|
|||
} from "../../../utils/github/issue-messages.js";
|
||||
import { getBranchName } from "../../../utils/github/git.js";
|
||||
import { getDefaultHeaders } from "../../../utils/default-headers.js";
|
||||
import { getCustomConfigurableFields } from "@open-swe/shared/open-swe/utils/config";
|
||||
import { getCustomConfigurableFields } from "@openswe/shared/open-swe/utils/config";
|
||||
import { StreamMode } from "@langchain/langgraph-sdk";
|
||||
import { isLocalMode } from "@open-swe/shared/open-swe/local-mode";
|
||||
import { isLocalMode } from "@openswe/shared/open-swe/local-mode";
|
||||
import { regenerateInstallationToken } from "../../../utils/github/regenerate-token.js";
|
||||
import { createLogger, LogLevel } from "../../../utils/logger.js";
|
||||
import { shouldCreateIssue } from "../../../utils/should-create-issue.js";
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
import { v4 as uuidv4 } from "uuid";
|
||||
import { GraphConfig } from "@open-swe/shared/open-swe/types";
|
||||
import { GraphConfig } from "@openswe/shared/open-swe/types";
|
||||
import {
|
||||
ManagerGraphState,
|
||||
ManagerGraphUpdate,
|
||||
} from "@open-swe/shared/open-swe/manager/types";
|
||||
} from "@openswe/shared/open-swe/manager/types";
|
||||
import { getGitHubTokensFromConfig } from "../../../utils/github-tokens.js";
|
||||
import { HumanMessage, isHumanMessage } from "@langchain/core/messages";
|
||||
import { getIssue } from "../../../utils/github/api.js";
|
||||
import { extractTasksFromIssueContent } from "../../../utils/github/issue-task.js";
|
||||
import { getMessageContentFromIssue } from "../../../utils/github/issue-messages.js";
|
||||
import { isLocalMode } from "@open-swe/shared/open-swe/local-mode";
|
||||
import { isLocalMode } from "@openswe/shared/open-swe/local-mode";
|
||||
|
||||
/**
|
||||
* The initialize function will do nothing if there's already a human message
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import { v4 as uuidv4 } from "uuid";
|
||||
import { GraphConfig } from "@open-swe/shared/open-swe/types";
|
||||
import { isLocalMode } from "@open-swe/shared/open-swe/local-mode";
|
||||
import { GraphConfig } from "@openswe/shared/open-swe/types";
|
||||
import { isLocalMode } from "@openswe/shared/open-swe/local-mode";
|
||||
import {
|
||||
ManagerGraphState,
|
||||
ManagerGraphUpdate,
|
||||
} from "@open-swe/shared/open-swe/manager/types";
|
||||
} from "@openswe/shared/open-swe/manager/types";
|
||||
import { createLangGraphClient } from "../../../utils/langgraph-client.js";
|
||||
import {
|
||||
OPEN_SWE_STREAM_MODE,
|
||||
|
|
@ -13,12 +13,12 @@ import {
|
|||
GITHUB_INSTALLATION_ID,
|
||||
GITHUB_INSTALLATION_TOKEN_COOKIE,
|
||||
GITHUB_PAT,
|
||||
} from "@open-swe/shared/constants";
|
||||
} from "@openswe/shared/constants";
|
||||
import { createLogger, LogLevel } from "../../../utils/logger.js";
|
||||
import { getBranchName } from "../../../utils/github/git.js";
|
||||
import { PlannerGraphUpdate } from "@open-swe/shared/open-swe/planner/types";
|
||||
import { PlannerGraphUpdate } from "@openswe/shared/open-swe/planner/types";
|
||||
import { getDefaultHeaders } from "../../../utils/default-headers.js";
|
||||
import { getCustomConfigurableFields } from "@open-swe/shared/open-swe/utils/config";
|
||||
import { getCustomConfigurableFields } from "@openswe/shared/open-swe/utils/config";
|
||||
import { getRecentUserRequest } from "../../../utils/user-request.js";
|
||||
import { StreamMode } from "@langchain/langgraph-sdk";
|
||||
import { regenerateInstallationToken } from "../../../utils/github/regenerate-token.js";
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
import { BaseMessage } from "@langchain/core/messages";
|
||||
import { GraphConfig } from "@open-swe/shared/open-swe/types";
|
||||
import { GraphConfig } from "@openswe/shared/open-swe/types";
|
||||
import { z } from "zod";
|
||||
import {
|
||||
loadModel,
|
||||
supportsParallelToolCallsParam,
|
||||
} from "../../../utils/llms/index.js";
|
||||
import { LLMTask } from "@open-swe/shared/open-swe/llm-task";
|
||||
import { LLMTask } from "@openswe/shared/open-swe/llm-task";
|
||||
import { getMessageString } from "../../../utils/message/content.js";
|
||||
|
||||
export async function createIssueFieldsFromMessages(
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ import { END, START, StateGraph } from "@langchain/langgraph";
|
|||
import {
|
||||
PlannerGraphState,
|
||||
PlannerGraphStateObj,
|
||||
} from "@open-swe/shared/open-swe/planner/types";
|
||||
import { GraphConfiguration } from "@open-swe/shared/open-swe/types";
|
||||
} from "@openswe/shared/open-swe/planner/types";
|
||||
import { GraphConfiguration } from "@openswe/shared/open-swe/types";
|
||||
import {
|
||||
generateAction,
|
||||
generatePlan,
|
||||
|
|
|
|||
|
|
@ -2,18 +2,18 @@ import { Command } from "@langchain/langgraph";
|
|||
import {
|
||||
PlannerGraphState,
|
||||
PlannerGraphUpdate,
|
||||
} from "@open-swe/shared/open-swe/planner/types";
|
||||
import { GraphConfig } from "@open-swe/shared/open-swe/types";
|
||||
} from "@openswe/shared/open-swe/planner/types";
|
||||
import { GraphConfig } from "@openswe/shared/open-swe/types";
|
||||
import { z } from "zod";
|
||||
import {
|
||||
loadModel,
|
||||
supportsParallelToolCallsParam,
|
||||
} from "../../../utils/llms/index.js";
|
||||
import { LLMTask } from "@open-swe/shared/open-swe/llm-task";
|
||||
import { LLMTask } from "@openswe/shared/open-swe/llm-task";
|
||||
import { getMissingMessages } from "../../../utils/github/issue-messages.js";
|
||||
import { getMessageString } from "../../../utils/message/content.js";
|
||||
import { isHumanMessage } from "@langchain/core/messages";
|
||||
import { getMessageContentString } from "@open-swe/shared/messages";
|
||||
import { getMessageContentString } from "@openswe/shared/messages";
|
||||
import { filterHiddenMessages } from "../../../utils/message/filter-hidden.js";
|
||||
import { createLogger, LogLevel } from "../../../utils/logger.js";
|
||||
import { trackCachePerformance } from "../../../utils/caching.js";
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import {
|
|||
loadModel,
|
||||
supportsParallelToolCallsParam,
|
||||
} from "../../../../utils/llms/index.js";
|
||||
import { LLMTask } from "@open-swe/shared/open-swe/llm-task";
|
||||
import { LLMTask } from "@openswe/shared/open-swe/llm-task";
|
||||
import {
|
||||
createGetURLContentTool,
|
||||
createShellTool,
|
||||
|
|
@ -12,20 +12,20 @@ import {
|
|||
import {
|
||||
PlannerGraphState,
|
||||
PlannerGraphUpdate,
|
||||
} from "@open-swe/shared/open-swe/planner/types";
|
||||
import { GraphConfig } from "@open-swe/shared/open-swe/types";
|
||||
} from "@openswe/shared/open-swe/planner/types";
|
||||
import { GraphConfig } from "@openswe/shared/open-swe/types";
|
||||
import { createLogger, LogLevel } from "../../../../utils/logger.js";
|
||||
import { getMessageContentString } from "@open-swe/shared/messages";
|
||||
import { getMessageContentString } from "@openswe/shared/messages";
|
||||
import {
|
||||
formatFollowupMessagePrompt,
|
||||
isFollowupRequest,
|
||||
} from "../../utils/followup.js";
|
||||
import { SYSTEM_PROMPT } from "./prompt.js";
|
||||
import { getRepoAbsolutePath } from "@open-swe/shared/git";
|
||||
import { getRepoAbsolutePath } from "@openswe/shared/git";
|
||||
import {
|
||||
isLocalMode,
|
||||
getLocalWorkingDirectory,
|
||||
} from "@open-swe/shared/open-swe/local-mode";
|
||||
} from "@openswe/shared/open-swe/local-mode";
|
||||
import { getMissingMessages } from "../../../../utils/github/issue-messages.js";
|
||||
import { getPlansFromIssue } from "../../../../utils/github/issue-task.js";
|
||||
import { createGrepTool } from "../../../../tools/grep.js";
|
||||
|
|
|
|||
|
|
@ -1,16 +1,16 @@
|
|||
import { v4 as uuidv4 } from "uuid";
|
||||
import { isAIMessage, ToolMessage } from "@langchain/core/messages";
|
||||
import { createSessionPlanToolFields } from "../../../../tools/index.js";
|
||||
import { GraphConfig } from "@open-swe/shared/open-swe/types";
|
||||
import { GraphConfig } from "@openswe/shared/open-swe/types";
|
||||
import {
|
||||
loadModel,
|
||||
supportsParallelToolCallsParam,
|
||||
} from "../../../../utils/llms/index.js";
|
||||
import { LLMTask } from "@open-swe/shared/open-swe/llm-task";
|
||||
import { LLMTask } from "@openswe/shared/open-swe/llm-task";
|
||||
import {
|
||||
PlannerGraphState,
|
||||
PlannerGraphUpdate,
|
||||
} from "@open-swe/shared/open-swe/planner/types";
|
||||
} from "@openswe/shared/open-swe/planner/types";
|
||||
import { formatUserRequestPrompt } from "../../../../utils/user-request.js";
|
||||
import {
|
||||
formatFollowupMessagePrompt,
|
||||
|
|
@ -21,11 +21,11 @@ import { z } from "zod";
|
|||
import { formatCustomRulesPrompt } from "../../../../utils/custom-rules.js";
|
||||
import { getScratchpad } from "../../utils/scratchpad-notes.js";
|
||||
import { SCRATCHPAD_PROMPT, SYSTEM_PROMPT } from "./prompt.js";
|
||||
import { DO_NOT_RENDER_ID_PREFIX } from "@open-swe/shared/constants";
|
||||
import { DO_NOT_RENDER_ID_PREFIX } from "@openswe/shared/constants";
|
||||
import { filterMessagesWithoutContent } from "../../../../utils/message/content.js";
|
||||
import { getModelManager } from "../../../../utils/llms/model-manager.js";
|
||||
import { trackCachePerformance } from "../../../../utils/caching.js";
|
||||
import { isLocalMode } from "@open-swe/shared/open-swe/local-mode";
|
||||
import { isLocalMode } from "@openswe/shared/open-swe/local-mode";
|
||||
|
||||
function formatSystemPrompt(state: PlannerGraphState): string {
|
||||
// It's a followup if there's more than one human message.
|
||||
|
|
|
|||
|
|
@ -1,22 +1,22 @@
|
|||
import { v4 as uuidv4 } from "uuid";
|
||||
import { z } from "zod";
|
||||
import { GraphConfig } from "@open-swe/shared/open-swe/types";
|
||||
import { GraphConfig } from "@openswe/shared/open-swe/types";
|
||||
import {
|
||||
PlannerGraphState,
|
||||
PlannerGraphUpdate,
|
||||
} from "@open-swe/shared/open-swe/planner/types";
|
||||
} from "@openswe/shared/open-swe/planner/types";
|
||||
import {
|
||||
loadModel,
|
||||
supportsParallelToolCallsParam,
|
||||
} from "../../../utils/llms/index.js";
|
||||
import { LLMTask } from "@open-swe/shared/open-swe/llm-task";
|
||||
import { LLMTask } from "@openswe/shared/open-swe/llm-task";
|
||||
import { getMessageString } from "../../../utils/message/content.js";
|
||||
import { formatUserRequestPrompt } from "../../../utils/user-request.js";
|
||||
import { formatCustomRulesPrompt } from "../../../utils/custom-rules.js";
|
||||
import { getScratchpad } from "../utils/scratchpad-notes.js";
|
||||
import { ToolMessage } from "@langchain/core/messages";
|
||||
import { DO_NOT_RENDER_ID_PREFIX } from "@open-swe/shared/constants";
|
||||
import { createWriteTechnicalNotesToolFields } from "@open-swe/shared/open-swe/tools";
|
||||
import { DO_NOT_RENDER_ID_PREFIX } from "@openswe/shared/constants";
|
||||
import { createWriteTechnicalNotesToolFields } from "@openswe/shared/open-swe/tools";
|
||||
import { trackCachePerformance } from "../../../utils/caching.js";
|
||||
import { getModelManager } from "../../../utils/llms/model-manager.js";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import {
|
||||
PlannerGraphState,
|
||||
PlannerGraphUpdate,
|
||||
} from "@open-swe/shared/open-swe/planner/types";
|
||||
} from "@openswe/shared/open-swe/planner/types";
|
||||
import { Command } from "@langchain/langgraph";
|
||||
import { getGitHubTokensFromConfig } from "../../../utils/github-tokens.js";
|
||||
import { getIssue, getIssueComments } from "../../../utils/github/api.js";
|
||||
|
|
@ -13,14 +13,14 @@ import {
|
|||
isHumanMessage,
|
||||
RemoveMessage,
|
||||
} from "@langchain/core/messages";
|
||||
import { GraphConfig } from "@open-swe/shared/open-swe/types";
|
||||
import { GraphConfig } from "@openswe/shared/open-swe/types";
|
||||
import {
|
||||
getMessageContentFromIssue,
|
||||
getUntrackedComments,
|
||||
} from "../../../utils/github/issue-messages.js";
|
||||
import { filterHiddenMessages } from "../../../utils/message/filter-hidden.js";
|
||||
import { DO_NOT_RENDER_ID_PREFIX } from "@open-swe/shared/constants";
|
||||
import { isLocalMode } from "@open-swe/shared/open-swe/local-mode";
|
||||
import { DO_NOT_RENDER_ID_PREFIX } from "@openswe/shared/constants";
|
||||
import { isLocalMode } from "@openswe/shared/open-swe/local-mode";
|
||||
import { shouldCreateIssue } from "../../../utils/should-create-issue.js";
|
||||
|
||||
export async function prepareGraphState(
|
||||
|
|
|
|||
|
|
@ -7,14 +7,14 @@ import {
|
|||
GraphConfig,
|
||||
TaskPlan,
|
||||
PlanItem,
|
||||
} from "@open-swe/shared/open-swe/types";
|
||||
} from "@openswe/shared/open-swe/types";
|
||||
import {
|
||||
ActionRequest,
|
||||
HumanInterrupt,
|
||||
HumanResponse,
|
||||
} from "@langchain/langgraph/prebuilt";
|
||||
import { getSandboxWithErrorHandling } from "../../../utils/sandbox.js";
|
||||
import { createNewTask } from "@open-swe/shared/open-swe/tasks";
|
||||
import { createNewTask } from "@openswe/shared/open-swe/tasks";
|
||||
import {
|
||||
getInitialUserRequest,
|
||||
getRecentUserRequest,
|
||||
|
|
@ -29,8 +29,8 @@ import {
|
|||
GITHUB_INSTALLATION_ID,
|
||||
GITHUB_INSTALLATION_TOKEN_COOKIE,
|
||||
GITHUB_PAT,
|
||||
} from "@open-swe/shared/constants";
|
||||
import { PlannerGraphState } from "@open-swe/shared/open-swe/planner/types";
|
||||
} from "@openswe/shared/constants";
|
||||
import { PlannerGraphState } from "@openswe/shared/open-swe/planner/types";
|
||||
import { createLangGraphClient } from "../../../utils/langgraph-client.js";
|
||||
import {
|
||||
addProposedPlanToIssue,
|
||||
|
|
@ -40,10 +40,10 @@ import { createLogger, LogLevel } from "../../../utils/logger.js";
|
|||
import {
|
||||
ACCEPTED_PLAN_NODE_ID,
|
||||
CustomNodeEvent,
|
||||
} from "@open-swe/shared/open-swe/custom-node-events";
|
||||
} from "@openswe/shared/open-swe/custom-node-events";
|
||||
import { getDefaultHeaders } from "../../../utils/default-headers.js";
|
||||
import { getCustomConfigurableFields } from "@open-swe/shared/open-swe/utils/config";
|
||||
import { isLocalMode } from "@open-swe/shared/open-swe/local-mode";
|
||||
import { getCustomConfigurableFields } from "@openswe/shared/open-swe/utils/config";
|
||||
import { isLocalMode } from "@openswe/shared/open-swe/local-mode";
|
||||
import {
|
||||
postGitHubIssueComment,
|
||||
cleanTaskItems,
|
||||
|
|
|
|||
|
|
@ -7,17 +7,17 @@ import {
|
|||
import {
|
||||
isLocalMode,
|
||||
getLocalWorkingDirectory,
|
||||
} from "@open-swe/shared/open-swe/local-mode";
|
||||
} from "@openswe/shared/open-swe/local-mode";
|
||||
import {
|
||||
createGetURLContentTool,
|
||||
createShellTool,
|
||||
createSearchDocumentForTool,
|
||||
} from "../../../tools/index.js";
|
||||
import { GraphConfig } from "@open-swe/shared/open-swe/types";
|
||||
import { GraphConfig } from "@openswe/shared/open-swe/types";
|
||||
import {
|
||||
PlannerGraphState,
|
||||
PlannerGraphUpdate,
|
||||
} from "@open-swe/shared/open-swe/planner/types";
|
||||
} from "@openswe/shared/open-swe/planner/types";
|
||||
import { createLogger, LogLevel } from "../../../utils/logger.js";
|
||||
import {
|
||||
safeSchemaToString,
|
||||
|
|
@ -29,14 +29,14 @@ import {
|
|||
getChangedFilesStatus,
|
||||
stashAndClearChanges,
|
||||
} from "../../../utils/github/git.js";
|
||||
import { getRepoAbsolutePath } from "@open-swe/shared/git";
|
||||
import { getRepoAbsolutePath } from "@openswe/shared/git";
|
||||
import { createScratchpadTool } from "../../../tools/scratchpad.js";
|
||||
import { getMcpTools } from "../../../utils/mcp-client.js";
|
||||
import { getSandboxWithErrorHandling } from "../../../utils/sandbox.js";
|
||||
import { shouldDiagnoseError } from "../../../utils/tool-message-error.js";
|
||||
import { Command } from "@langchain/langgraph";
|
||||
import { filterHiddenMessages } from "../../../utils/message/filter-hidden.js";
|
||||
import { DO_NOT_RENDER_ID_PREFIX } from "@open-swe/shared/constants";
|
||||
import { DO_NOT_RENDER_ID_PREFIX } from "@openswe/shared/constants";
|
||||
import { processToolCallContent } from "../../../utils/tool-output-processing.js";
|
||||
import { createViewTool } from "../../../tools/builtin-tools/view.js";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { getActivePlanItems } from "@open-swe/shared/open-swe/tasks";
|
||||
import { TaskPlan } from "@open-swe/shared/open-swe/types";
|
||||
import { getActivePlanItems } from "@openswe/shared/open-swe/tasks";
|
||||
import { TaskPlan } from "@openswe/shared/open-swe/types";
|
||||
|
||||
const previousCompletedPlanPrompt = `Here is the list of tasks from the previous session. You've already completed all of these tasks. Use the tasks, and task summaries as context when generating a new plan:
|
||||
{PREVIOUS_PLAN}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { BaseMessage, isAIMessage } from "@langchain/core/messages";
|
||||
import { createScratchpadFields } from "@open-swe/shared/open-swe/tools";
|
||||
import { createScratchpadFields } from "@openswe/shared/open-swe/tools";
|
||||
import z from "zod";
|
||||
|
||||
export function getScratchpad(messages: BaseMessage[]): string[] {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import {
|
|||
GraphConfig,
|
||||
GraphConfiguration,
|
||||
GraphState,
|
||||
} from "@open-swe/shared/open-swe/types";
|
||||
} from "@openswe/shared/open-swe/types";
|
||||
import {
|
||||
generateAction,
|
||||
takeAction,
|
||||
|
|
@ -20,8 +20,8 @@ import { BaseMessage, isAIMessage } from "@langchain/core/messages";
|
|||
import { initializeSandbox } from "../shared/initialize-sandbox.js";
|
||||
import { graph as reviewerGraph } from "../reviewer/index.js";
|
||||
import { getRemainingPlanItems } from "../../utils/current-task.js";
|
||||
import { getActivePlanItems } from "@open-swe/shared/open-swe/tasks";
|
||||
import { createMarkTaskCompletedToolFields } from "@open-swe/shared/open-swe/tools";
|
||||
import { getActivePlanItems } from "@openswe/shared/open-swe/tasks";
|
||||
import { createMarkTaskCompletedToolFields } from "@openswe/shared/open-swe/tools";
|
||||
|
||||
function lastMessagesMissingToolCalls(
|
||||
messages: BaseMessage[],
|
||||
|
|
|
|||
|
|
@ -9,23 +9,23 @@ import {
|
|||
GraphState,
|
||||
GraphUpdate,
|
||||
PlanItem,
|
||||
} from "@open-swe/shared/open-swe/types";
|
||||
import { createDiagnoseErrorToolFields } from "@open-swe/shared/open-swe/tools";
|
||||
} from "@openswe/shared/open-swe/types";
|
||||
import { createDiagnoseErrorToolFields } from "@openswe/shared/open-swe/tools";
|
||||
import { formatPlanPromptWithSummaries } from "../../../utils/plan-prompt.js";
|
||||
import { getMessageString } from "../../../utils/message/content.js";
|
||||
import { getMessageContentString } from "@open-swe/shared/messages";
|
||||
import { getMessageContentString } from "@openswe/shared/messages";
|
||||
import {
|
||||
loadModel,
|
||||
supportsParallelToolCallsParam,
|
||||
} from "../../../utils/llms/index.js";
|
||||
import { LLMTask } from "@open-swe/shared/open-swe/llm-task";
|
||||
import { LLMTask } from "@openswe/shared/open-swe/llm-task";
|
||||
import { z } from "zod";
|
||||
import { createLogger, LogLevel } from "../../../utils/logger.js";
|
||||
import {
|
||||
getCompletedPlanItems,
|
||||
getCurrentPlanItem,
|
||||
} from "../../../utils/current-task.js";
|
||||
import { getActivePlanItems } from "@open-swe/shared/open-swe/tasks";
|
||||
import { getActivePlanItems } from "@openswe/shared/open-swe/tasks";
|
||||
|
||||
const logger = createLogger(LogLevel.INFO, "DiagnoseError");
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@ import {
|
|||
GraphState,
|
||||
GraphUpdate,
|
||||
PlanItem,
|
||||
} from "@open-swe/shared/open-swe/types";
|
||||
} from "@openswe/shared/open-swe/types";
|
||||
import { loadModel } from "../../../utils/llms/index.js";
|
||||
import { LLMTask } from "@open-swe/shared/open-swe/llm-task";
|
||||
import { getMessageContentString } from "@open-swe/shared/messages";
|
||||
import { LLMTask } from "@openswe/shared/open-swe/llm-task";
|
||||
import { getMessageContentString } from "@openswe/shared/messages";
|
||||
import { getMessageString } from "../../../utils/message/content.js";
|
||||
import { createLogger, LogLevel } from "../../../utils/logger.js";
|
||||
import { formatUserRequestPrompt } from "../../../utils/user-request.js";
|
||||
|
|
@ -14,11 +14,11 @@ import {
|
|||
completeTask,
|
||||
getActivePlanItems,
|
||||
getActiveTask,
|
||||
} from "@open-swe/shared/open-swe/tasks";
|
||||
} from "@openswe/shared/open-swe/tasks";
|
||||
import { addTaskPlanToIssue } from "../../../utils/github/issue-task.js";
|
||||
import { trackCachePerformance } from "../../../utils/caching.js";
|
||||
import { getModelManager } from "../../../utils/llms/model-manager.js";
|
||||
import { isLocalMode } from "@open-swe/shared/open-swe/local-mode";
|
||||
import { isLocalMode } from "@openswe/shared/open-swe/local-mode";
|
||||
import { Command, END } from "@langchain/langgraph";
|
||||
|
||||
const logger = createLogger(LogLevel.INFO, "GenerateConclusionNode");
|
||||
|
|
|
|||
|
|
@ -4,14 +4,14 @@ import {
|
|||
GraphConfig,
|
||||
GraphUpdate,
|
||||
TaskPlan,
|
||||
} from "@open-swe/shared/open-swe/types";
|
||||
} from "@openswe/shared/open-swe/types";
|
||||
import {
|
||||
getModelManager,
|
||||
loadModel,
|
||||
Provider,
|
||||
supportsParallelToolCallsParam,
|
||||
} from "../../../../utils/llms/index.js";
|
||||
import { LLMTask } from "@open-swe/shared/open-swe/llm-task";
|
||||
import { LLMTask } from "@openswe/shared/open-swe/llm-task";
|
||||
import {
|
||||
createShellTool,
|
||||
createApplyPatchTool,
|
||||
|
|
@ -25,8 +25,8 @@ import { formatPlanPrompt } from "../../../../utils/plan-prompt.js";
|
|||
import { stopSandbox } from "../../../../utils/sandbox.js";
|
||||
import { createLogger, LogLevel } from "../../../../utils/logger.js";
|
||||
import { getCurrentPlanItem } from "../../../../utils/current-task.js";
|
||||
import { getMessageContentString } from "@open-swe/shared/messages";
|
||||
import { getActivePlanItems } from "@open-swe/shared/open-swe/tasks";
|
||||
import { getMessageContentString } from "@openswe/shared/messages";
|
||||
import { getActivePlanItems } from "@openswe/shared/open-swe/tasks";
|
||||
import {
|
||||
CODE_REVIEW_PROMPT,
|
||||
DEPENDENCIES_INSTALLED_PROMPT,
|
||||
|
|
@ -35,7 +35,7 @@ import {
|
|||
STATIC_ANTHROPIC_SYSTEM_INSTRUCTIONS,
|
||||
STATIC_SYSTEM_INSTRUCTIONS,
|
||||
} from "./prompt.js";
|
||||
import { getRepoAbsolutePath } from "@open-swe/shared/git";
|
||||
import { getRepoAbsolutePath } from "@openswe/shared/git";
|
||||
import { getMissingMessages } from "../../../../utils/github/issue-messages.js";
|
||||
import { getPlansFromIssue } from "../../../../utils/github/issue-task.js";
|
||||
import { createGrepTool } from "../../../../tools/grep.js";
|
||||
|
|
@ -52,7 +52,7 @@ import {
|
|||
convertMessagesToCacheControlledMessages,
|
||||
trackCachePerformance,
|
||||
} from "../../../../utils/caching.js";
|
||||
import { createMarkTaskCompletedToolFields } from "@open-swe/shared/open-swe/tools";
|
||||
import { createMarkTaskCompletedToolFields } from "@openswe/shared/open-swe/tools";
|
||||
import {
|
||||
BaseMessage,
|
||||
BaseMessageLike,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { createMarkTaskCompletedToolFields } from "@open-swe/shared/open-swe/tools";
|
||||
import { createMarkTaskCompletedToolFields } from "@openswe/shared/open-swe/tools";
|
||||
import { GITHUB_WORKFLOWS_PERMISSIONS_PROMPT } from "../../../shared/prompts.js";
|
||||
|
||||
const IDENTITY_PROMPT = `<identity>
|
||||
|
|
|
|||
|
|
@ -4,21 +4,21 @@ import {
|
|||
GraphConfig,
|
||||
GraphState,
|
||||
GraphUpdate,
|
||||
} from "@open-swe/shared/open-swe/types";
|
||||
} from "@openswe/shared/open-swe/types";
|
||||
import { Command } from "@langchain/langgraph";
|
||||
import { isLocalMode } from "@open-swe/shared/open-swe/local-mode";
|
||||
import { isLocalMode } from "@openswe/shared/open-swe/local-mode";
|
||||
import {
|
||||
completePlanItem,
|
||||
getActivePlanItems,
|
||||
getActiveTask,
|
||||
} from "@open-swe/shared/open-swe/tasks";
|
||||
} from "@openswe/shared/open-swe/tasks";
|
||||
import {
|
||||
getCurrentPlanItem,
|
||||
getRemainingPlanItems,
|
||||
} from "../../../utils/current-task.js";
|
||||
import { isAIMessage, ToolMessage } from "@langchain/core/messages";
|
||||
import { addTaskPlanToIssue } from "../../../utils/github/issue-task.js";
|
||||
import { createMarkTaskCompletedToolFields } from "@open-swe/shared/open-swe/tools";
|
||||
import { createMarkTaskCompletedToolFields } from "@openswe/shared/open-swe/tools";
|
||||
import {
|
||||
calculateConversationHistoryTokenCount,
|
||||
getMessagesSinceLastSummary,
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import {
|
|||
GraphUpdate,
|
||||
PlanItem,
|
||||
TaskPlan,
|
||||
} from "@open-swe/shared/open-swe/types";
|
||||
} from "@openswe/shared/open-swe/types";
|
||||
import {
|
||||
checkoutBranchAndCommit,
|
||||
getChangedFilesStatus,
|
||||
|
|
@ -22,7 +22,7 @@ import {
|
|||
loadModel,
|
||||
supportsParallelToolCallsParam,
|
||||
} from "../../../utils/llms/index.js";
|
||||
import { LLMTask } from "@open-swe/shared/open-swe/llm-task";
|
||||
import { LLMTask } from "@openswe/shared/open-swe/llm-task";
|
||||
import { formatPlanPromptWithSummaries } from "../../../utils/plan-prompt.js";
|
||||
import { formatUserRequestPrompt } from "../../../utils/user-request.js";
|
||||
import { AIMessage, BaseMessage, ToolMessage } from "@langchain/core/messages";
|
||||
|
|
@ -34,8 +34,8 @@ import { getGitHubTokensFromConfig } from "../../../utils/github-tokens.js";
|
|||
import {
|
||||
getActivePlanItems,
|
||||
getPullRequestNumberFromActiveTask,
|
||||
} from "@open-swe/shared/open-swe/tasks";
|
||||
import { createOpenPrToolFields } from "@open-swe/shared/open-swe/tools";
|
||||
} from "@openswe/shared/open-swe/tasks";
|
||||
import { createOpenPrToolFields } from "@openswe/shared/open-swe/tools";
|
||||
import { trackCachePerformance } from "../../../utils/caching.js";
|
||||
import { getModelManager } from "../../../utils/llms/model-manager.js";
|
||||
import {
|
||||
|
|
@ -43,8 +43,8 @@ import {
|
|||
GitHubPullRequestList,
|
||||
GitHubPullRequestUpdate,
|
||||
} from "../../../utils/github/types.js";
|
||||
import { getRepoAbsolutePath } from "@open-swe/shared/git";
|
||||
import { GITHUB_USER_LOGIN_HEADER } from "@open-swe/shared/constants";
|
||||
import { getRepoAbsolutePath } from "@openswe/shared/git";
|
||||
import { GITHUB_USER_LOGIN_HEADER } from "@openswe/shared/constants";
|
||||
import { shouldCreateIssue } from "../../../utils/should-create-issue.js";
|
||||
|
||||
const logger = createLogger(LogLevel.INFO, "Open PR");
|
||||
|
|
|
|||
|
|
@ -4,13 +4,13 @@ import {
|
|||
GraphConfig,
|
||||
GraphState,
|
||||
GraphUpdate,
|
||||
} from "@open-swe/shared/open-swe/types";
|
||||
} from "@openswe/shared/open-swe/types";
|
||||
import { HumanInterrupt, HumanResponse } from "@langchain/langgraph/prebuilt";
|
||||
import { END, interrupt, Command } from "@langchain/langgraph";
|
||||
import {
|
||||
DO_NOT_RENDER_ID_PREFIX,
|
||||
GITHUB_USER_LOGIN_HEADER,
|
||||
} from "@open-swe/shared/constants";
|
||||
} from "@openswe/shared/constants";
|
||||
import {
|
||||
getSandboxWithErrorHandling,
|
||||
stopSandbox,
|
||||
|
|
@ -19,10 +19,10 @@ import { getOpenSweAppUrl } from "../../../utils/url-helpers.js";
|
|||
import {
|
||||
CustomNodeEvent,
|
||||
REQUEST_HELP_NODE_ID,
|
||||
} from "@open-swe/shared/open-swe/custom-node-events";
|
||||
} from "@openswe/shared/open-swe/custom-node-events";
|
||||
import { postGitHubIssueComment } from "../../../utils/github/plan.js";
|
||||
import { shouldCreateIssue } from "../../../utils/should-create-issue.js";
|
||||
import { isLocalMode } from "@open-swe/shared/open-swe/local-mode";
|
||||
import { isLocalMode } from "@openswe/shared/open-swe/local-mode";
|
||||
|
||||
const constructDescription = (helpRequest: string): string => {
|
||||
return `The agent has requested help. Here is the help request:
|
||||
|
|
|
|||
|
|
@ -4,9 +4,9 @@ import {
|
|||
GraphState,
|
||||
GraphUpdate,
|
||||
PlanItem,
|
||||
} from "@open-swe/shared/open-swe/types";
|
||||
} from "@openswe/shared/open-swe/types";
|
||||
import { loadModel } from "../../../utils/llms/index.js";
|
||||
import { LLMTask } from "@open-swe/shared/open-swe/llm-task";
|
||||
import { LLMTask } from "@openswe/shared/open-swe/llm-task";
|
||||
import {
|
||||
AIMessage,
|
||||
BaseMessage,
|
||||
|
|
@ -15,10 +15,10 @@ import {
|
|||
} from "@langchain/core/messages";
|
||||
import { formatPlanPrompt } from "../../../utils/plan-prompt.js";
|
||||
import { createLogger, LogLevel } from "../../../utils/logger.js";
|
||||
import { getMessageContentString } from "@open-swe/shared/messages";
|
||||
import { getMessageContentString } from "@openswe/shared/messages";
|
||||
import { getMessageString } from "../../../utils/message/content.js";
|
||||
import { getActivePlanItems } from "@open-swe/shared/open-swe/tasks";
|
||||
import { createConversationHistorySummaryToolFields } from "@open-swe/shared/open-swe/tools";
|
||||
import { getActivePlanItems } from "@openswe/shared/open-swe/tasks";
|
||||
import { createConversationHistorySummaryToolFields } from "@openswe/shared/open-swe/tools";
|
||||
import { formatUserRequestPrompt } from "../../../utils/user-request.js";
|
||||
import { getMessagesSinceLastSummary } from "../../../utils/tokens.js";
|
||||
import { trackCachePerformance } from "../../../utils/caching.js";
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import {
|
|||
GraphConfig,
|
||||
GraphUpdate,
|
||||
TaskPlan,
|
||||
} from "@open-swe/shared/open-swe/types";
|
||||
} from "@openswe/shared/open-swe/types";
|
||||
import {
|
||||
checkoutBranchAndCommit,
|
||||
getChangedFilesStatus,
|
||||
|
|
@ -31,16 +31,16 @@ import {
|
|||
getCodebaseTree,
|
||||
} from "../../../utils/tree.js";
|
||||
import { createInstallDependenciesTool } from "../../../tools/install-dependencies.js";
|
||||
import { isLocalMode } from "@open-swe/shared/open-swe/local-mode";
|
||||
import { isLocalMode } from "@openswe/shared/open-swe/local-mode";
|
||||
import { createGrepTool } from "../../../tools/grep.js";
|
||||
import { getMcpTools } from "../../../utils/mcp-client.js";
|
||||
import { shouldDiagnoseError } from "../../../utils/tool-message-error.js";
|
||||
import { getGitHubTokensFromConfig } from "../../../utils/github-tokens.js";
|
||||
import { processToolCallContent } from "../../../utils/tool-output-processing.js";
|
||||
import { getActiveTask } from "@open-swe/shared/open-swe/tasks";
|
||||
import { getActiveTask } from "@openswe/shared/open-swe/tasks";
|
||||
import { createPullRequestToolCallMessage } from "../../../utils/message/create-pr-message.js";
|
||||
import { filterUnsafeCommands } from "../../../utils/command-evaluation.js";
|
||||
import { getRepoAbsolutePath } from "@open-swe/shared/git";
|
||||
import { getRepoAbsolutePath } from "@openswe/shared/git";
|
||||
import {
|
||||
createReplyToCommentTool,
|
||||
createReplyToReviewCommentTool,
|
||||
|
|
|
|||
|
|
@ -5,17 +5,17 @@ import {
|
|||
PlanItem,
|
||||
GraphUpdate,
|
||||
CustomRules,
|
||||
} from "@open-swe/shared/open-swe/types";
|
||||
} from "@openswe/shared/open-swe/types";
|
||||
import {
|
||||
loadModel,
|
||||
supportsParallelToolCallsParam,
|
||||
} from "../../../utils/llms/index.js";
|
||||
import { LLMTask } from "@open-swe/shared/open-swe/llm-task";
|
||||
import { LLMTask } from "@openswe/shared/open-swe/llm-task";
|
||||
import { z } from "zod";
|
||||
import {
|
||||
getActiveTask,
|
||||
updateTaskPlanItems,
|
||||
} from "@open-swe/shared/open-swe/tasks";
|
||||
} from "@openswe/shared/open-swe/tasks";
|
||||
import {
|
||||
AIMessage,
|
||||
BaseMessage,
|
||||
|
|
@ -25,13 +25,13 @@ import {
|
|||
import { getMessageString } from "../../../utils/message/content.js";
|
||||
import { formatPlanPrompt } from "../../../utils/plan-prompt.js";
|
||||
import { createLogger, LogLevel } from "../../../utils/logger.js";
|
||||
import { createUpdatePlanToolFields } from "@open-swe/shared/open-swe/tools";
|
||||
import { createUpdatePlanToolFields } from "@openswe/shared/open-swe/tools";
|
||||
import { formatCustomRulesPrompt } from "../../../utils/custom-rules.js";
|
||||
import { trackCachePerformance } from "../../../utils/caching.js";
|
||||
import { getModelManager } from "../../../utils/llms/model-manager.js";
|
||||
import { addTaskPlanToIssue } from "../../../utils/github/issue-task.js";
|
||||
import { shouldCreateIssue } from "../../../utils/should-create-issue.js";
|
||||
import { isLocalMode } from "@open-swe/shared/open-swe/local-mode";
|
||||
import { isLocalMode } from "@openswe/shared/open-swe/local-mode";
|
||||
|
||||
const logger = createLogger(LogLevel.INFO, "UpdatePlanNode");
|
||||
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ import { END, START, StateGraph } from "@langchain/langgraph";
|
|||
import {
|
||||
ReviewerGraphState,
|
||||
ReviewerGraphStateObj,
|
||||
} from "@open-swe/shared/open-swe/reviewer/types";
|
||||
import { GraphConfiguration } from "@open-swe/shared/open-swe/types";
|
||||
} from "@openswe/shared/open-swe/reviewer/types";
|
||||
import { GraphConfiguration } from "@openswe/shared/open-swe/types";
|
||||
import {
|
||||
finalReview,
|
||||
generateReviewActions,
|
||||
|
|
|
|||
|
|
@ -2,27 +2,27 @@ import { v4 as uuidv4 } from "uuid";
|
|||
import {
|
||||
ReviewerGraphState,
|
||||
ReviewerGraphUpdate,
|
||||
} from "@open-swe/shared/open-swe/reviewer/types";
|
||||
} from "@openswe/shared/open-swe/reviewer/types";
|
||||
import { formatUserRequestPrompt } from "../../../utils/user-request.js";
|
||||
import { formatPlanPromptWithSummaries } from "../../../utils/plan-prompt.js";
|
||||
import {
|
||||
getActivePlanItems,
|
||||
getActiveTask,
|
||||
updateTaskPlanItems,
|
||||
} from "@open-swe/shared/open-swe/tasks";
|
||||
} from "@openswe/shared/open-swe/tasks";
|
||||
import {
|
||||
createCodeReviewMarkTaskCompletedFields,
|
||||
createCodeReviewMarkTaskNotCompleteFields,
|
||||
} from "@open-swe/shared/open-swe/tools";
|
||||
import { isLocalMode } from "@open-swe/shared/open-swe/local-mode";
|
||||
} from "@openswe/shared/open-swe/tools";
|
||||
import { isLocalMode } from "@openswe/shared/open-swe/local-mode";
|
||||
import { createLogger, LogLevel } from "../../../utils/logger.js";
|
||||
|
||||
import {
|
||||
loadModel,
|
||||
supportsParallelToolCallsParam,
|
||||
} from "../../../utils/llms/index.js";
|
||||
import { LLMTask } from "@open-swe/shared/open-swe/llm-task";
|
||||
import { GraphConfig, PlanItem } from "@open-swe/shared/open-swe/types";
|
||||
import { LLMTask } from "@openswe/shared/open-swe/llm-task";
|
||||
import { GraphConfig, PlanItem } from "@openswe/shared/open-swe/types";
|
||||
import { z } from "zod";
|
||||
import { addTaskPlanToIssue } from "../../../utils/github/issue-task.js";
|
||||
import { getMessageString } from "../../../utils/message/content.js";
|
||||
|
|
|
|||
|
|
@ -4,16 +4,16 @@ import {
|
|||
Provider,
|
||||
supportsParallelToolCallsParam,
|
||||
} from "../../../../utils/llms/index.js";
|
||||
import { LLMTask } from "@open-swe/shared/open-swe/llm-task";
|
||||
import { LLMTask } from "@openswe/shared/open-swe/llm-task";
|
||||
import {
|
||||
ReviewerGraphState,
|
||||
ReviewerGraphUpdate,
|
||||
} from "@open-swe/shared/open-swe/reviewer/types";
|
||||
import { GraphConfig } from "@open-swe/shared/open-swe/types";
|
||||
} from "@openswe/shared/open-swe/reviewer/types";
|
||||
import { GraphConfig } from "@openswe/shared/open-swe/types";
|
||||
import { createLogger, LogLevel } from "../../../../utils/logger.js";
|
||||
import { getMessageContentString } from "@open-swe/shared/messages";
|
||||
import { getMessageContentString } from "@openswe/shared/messages";
|
||||
import { PREVIOUS_REVIEW_PROMPT, SYSTEM_PROMPT } from "./prompt.js";
|
||||
import { getRepoAbsolutePath } from "@open-swe/shared/git";
|
||||
import { getRepoAbsolutePath } from "@openswe/shared/git";
|
||||
import {
|
||||
createGrepTool,
|
||||
createShellTool,
|
||||
|
|
@ -21,7 +21,7 @@ import {
|
|||
} from "../../../../tools/index.js";
|
||||
import { formatCustomRulesPrompt } from "../../../../utils/custom-rules.js";
|
||||
import { formatUserRequestPrompt } from "../../../../utils/user-request.js";
|
||||
import { getActivePlanItems } from "@open-swe/shared/open-swe/tasks";
|
||||
import { getActivePlanItems } from "@openswe/shared/open-swe/tasks";
|
||||
import { formatPlanPromptWithSummaries } from "../../../../utils/plan-prompt.js";
|
||||
import {
|
||||
formatCodeReviewPrompt,
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
import {
|
||||
ReviewerGraphState,
|
||||
ReviewerGraphUpdate,
|
||||
} from "@open-swe/shared/open-swe/reviewer/types";
|
||||
} from "@openswe/shared/open-swe/reviewer/types";
|
||||
import { getSandboxWithErrorHandling } from "../../../utils/sandbox.js";
|
||||
import { getRepoAbsolutePath } from "@open-swe/shared/git";
|
||||
import { getRepoAbsolutePath } from "@openswe/shared/git";
|
||||
import { createLogger, LogLevel } from "../../../utils/logger.js";
|
||||
import { GraphConfig } from "@open-swe/shared/open-swe/types";
|
||||
import { GraphConfig } from "@openswe/shared/open-swe/types";
|
||||
import { AIMessage, ToolMessage } from "@langchain/core/messages";
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
import { createReviewStartedToolFields } from "@open-swe/shared/open-swe/tools";
|
||||
import { createReviewStartedToolFields } from "@openswe/shared/open-swe/tools";
|
||||
import { getSandboxErrorFields } from "../../../utils/sandbox-error-fields.js";
|
||||
import { Sandbox } from "@daytonaio/sdk";
|
||||
import { createShellExecutor } from "../../../utils/shell-executor/index.js";
|
||||
|
|
|
|||
|
|
@ -9,11 +9,11 @@ import {
|
|||
createInstallDependenciesTool,
|
||||
createShellTool,
|
||||
} from "../../../tools/index.js";
|
||||
import { GraphConfig, TaskPlan } from "@open-swe/shared/open-swe/types";
|
||||
import { GraphConfig, TaskPlan } from "@openswe/shared/open-swe/types";
|
||||
import {
|
||||
ReviewerGraphState,
|
||||
ReviewerGraphUpdate,
|
||||
} from "@open-swe/shared/open-swe/reviewer/types";
|
||||
} from "@openswe/shared/open-swe/reviewer/types";
|
||||
import { createLogger, LogLevel } from "../../../utils/logger.js";
|
||||
import { zodSchemaToString } from "../../../utils/zod-to-string.js";
|
||||
import { formatBadArgsError } from "../../../utils/zod-to-string.js";
|
||||
|
|
@ -24,17 +24,17 @@ import {
|
|||
getChangedFilesStatus,
|
||||
} from "../../../utils/github/git.js";
|
||||
import { getSandboxWithErrorHandling } from "../../../utils/sandbox.js";
|
||||
import { isLocalMode } from "@open-swe/shared/open-swe/local-mode";
|
||||
import { isLocalMode } from "@openswe/shared/open-swe/local-mode";
|
||||
import { Command } from "@langchain/langgraph";
|
||||
import { shouldDiagnoseError } from "../../../utils/tool-message-error.js";
|
||||
import { filterHiddenMessages } from "../../../utils/message/filter-hidden.js";
|
||||
import { getGitHubTokensFromConfig } from "../../../utils/github-tokens.js";
|
||||
import { createScratchpadTool } from "../../../tools/scratchpad.js";
|
||||
import { getActiveTask } from "@open-swe/shared/open-swe/tasks";
|
||||
import { getActiveTask } from "@openswe/shared/open-swe/tasks";
|
||||
import { createPullRequestToolCallMessage } from "../../../utils/message/create-pr-message.js";
|
||||
import { createViewTool } from "../../../tools/builtin-tools/view.js";
|
||||
import { filterUnsafeCommands } from "../../../utils/command-evaluation.js";
|
||||
import { getRepoAbsolutePath } from "@open-swe/shared/git";
|
||||
import { getRepoAbsolutePath } from "@openswe/shared/git";
|
||||
|
||||
const logger = createLogger(LogLevel.INFO, "TakeReviewAction");
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ import {
|
|||
isToolMessage,
|
||||
ToolMessage,
|
||||
} from "@langchain/core/messages";
|
||||
import { createDiagnoseErrorToolFields } from "@open-swe/shared/open-swe/tools";
|
||||
import { createDiagnoseErrorToolFields } from "@openswe/shared/open-swe/tools";
|
||||
|
||||
import { z } from "zod";
|
||||
import { ModelTokenData, GraphConfig } from "@open-swe/shared/open-swe/types";
|
||||
import { ModelTokenData, GraphConfig } from "@openswe/shared/open-swe/types";
|
||||
import { createLogger, LogLevel } from "../../utils/logger.js";
|
||||
import { getAllLastFailedActions } from "../../utils/tool-message-error.js";
|
||||
import { getMessageString } from "../../utils/message/content.js";
|
||||
|
|
@ -15,7 +15,7 @@ import {
|
|||
loadModel,
|
||||
supportsParallelToolCallsParam,
|
||||
} from "../../utils/llms/index.js";
|
||||
import { LLMTask } from "@open-swe/shared/open-swe/llm-task";
|
||||
import { LLMTask } from "@openswe/shared/open-swe/llm-task";
|
||||
import { trackCachePerformance } from "../../utils/caching.js";
|
||||
import { getModelManager } from "../../utils/llms/model-manager.js";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
import { v4 as uuidv4 } from "uuid";
|
||||
import * as crypto from "crypto";
|
||||
import { getRepoAbsolutePath } from "@open-swe/shared/git";
|
||||
import { getRepoAbsolutePath } from "@openswe/shared/git";
|
||||
import { getGitHubTokensFromConfig } from "../../utils/github-tokens.js";
|
||||
import {
|
||||
CustomRules,
|
||||
GraphConfig,
|
||||
TargetRepository,
|
||||
} from "@open-swe/shared/open-swe/types";
|
||||
} from "@openswe/shared/open-swe/types";
|
||||
import { createLogger, LogLevel } from "../../utils/logger.js";
|
||||
import { daytonaClient } from "../../utils/sandbox.js";
|
||||
import { cloneRepo, pullLatestChanges } from "../../utils/github/git.js";
|
||||
|
|
@ -14,11 +14,11 @@ import {
|
|||
FAILED_TO_GENERATE_TREE_MESSAGE,
|
||||
getCodebaseTree,
|
||||
} from "../../utils/tree.js";
|
||||
import { DO_NOT_RENDER_ID_PREFIX } from "@open-swe/shared/constants";
|
||||
import { DO_NOT_RENDER_ID_PREFIX } from "@openswe/shared/constants";
|
||||
import {
|
||||
CustomNodeEvent,
|
||||
INITIALIZE_NODE_ID,
|
||||
} from "@open-swe/shared/open-swe/custom-node-events";
|
||||
} from "@openswe/shared/open-swe/custom-node-events";
|
||||
import { Sandbox } from "@daytonaio/sdk";
|
||||
import { AIMessage, BaseMessage } from "@langchain/core/messages";
|
||||
import { DEFAULT_SANDBOX_CREATE_PARAMS } from "../../constants.js";
|
||||
|
|
@ -27,7 +27,7 @@ import { withRetry } from "../../utils/retry.js";
|
|||
import {
|
||||
isLocalMode,
|
||||
getLocalWorkingDirectory,
|
||||
} from "@open-swe/shared/open-swe/local-mode";
|
||||
} from "@openswe/shared/open-swe/local-mode";
|
||||
|
||||
const logger = createLogger(LogLevel.INFO, "InitializeSandbox");
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import {
|
|||
getOpenSWEMaxAutoAcceptLabel,
|
||||
} from "../../utils/github/label.js";
|
||||
import { RequestSource } from "../../constants.js";
|
||||
import { GraphConfig } from "@open-swe/shared/open-swe/types";
|
||||
import { GraphConfig } from "@openswe/shared/open-swe/types";
|
||||
|
||||
class IssueWebhookHandler extends WebhookHandlerBase {
|
||||
constructor() {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import {
|
|||
WebhookHandlerContext,
|
||||
} from "./webhook-handler-base.js";
|
||||
import { RequestSource } from "../../constants.js";
|
||||
import { ManagerGraphUpdate } from "@open-swe/shared/open-swe/manager/types";
|
||||
import { ManagerGraphUpdate } from "@openswe/shared/open-swe/manager/types";
|
||||
import {
|
||||
mentionsGitHubUserForTrigger,
|
||||
extractLinkedIssues,
|
||||
|
|
@ -18,7 +18,7 @@ import {
|
|||
SimpleTriggerComment,
|
||||
} from "./types.js";
|
||||
import { GitHubPullRequestGet } from "../../utils/github/types.js";
|
||||
import { GraphConfig } from "@open-swe/shared/open-swe/types";
|
||||
import { GraphConfig } from "@openswe/shared/open-swe/types";
|
||||
import { GITHUB_TRIGGER_USERNAME } from "./constants.js";
|
||||
|
||||
export interface PRWebhookContext extends WebhookHandlerContext {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import {
|
|||
createReplyToCommentToolFields,
|
||||
createReplyToReviewCommentToolFields,
|
||||
createReplyToReviewToolFields,
|
||||
} from "@open-swe/shared/open-swe/tools";
|
||||
} from "@openswe/shared/open-swe/tools";
|
||||
import {
|
||||
PullRequestReviewTriggerData,
|
||||
SimpleIssue,
|
||||
|
|
|
|||
|
|
@ -16,10 +16,10 @@ import {
|
|||
GITHUB_INSTALLATION_ID,
|
||||
MANAGER_GRAPH_ID,
|
||||
OPEN_SWE_STREAM_MODE,
|
||||
} from "@open-swe/shared/constants";
|
||||
import { encryptSecret } from "@open-swe/shared/crypto";
|
||||
import { GraphConfig } from "@open-swe/shared/open-swe/types";
|
||||
import { ManagerGraphUpdate } from "@open-swe/shared/open-swe/manager/types";
|
||||
} from "@openswe/shared/constants";
|
||||
import { encryptSecret } from "@openswe/shared/crypto";
|
||||
import { GraphConfig } from "@openswe/shared/open-swe/types";
|
||||
import { ManagerGraphUpdate } from "@openswe/shared/open-swe/manager/types";
|
||||
import { StreamMode } from "@langchain/langgraph-sdk";
|
||||
import { extractContentWithoutDetailsFromIssueBody } from "../../utils/github/issue-messages.js";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
import { v4 as uuidv4 } from "uuid";
|
||||
import { createLogger, LogLevel } from "../../utils/logger.js";
|
||||
import { GitHubApp } from "../../utils/github-app.js";
|
||||
import { isAllowedUser } from "@open-swe/shared/github/allowed-users";
|
||||
import { isAllowedUser } from "@openswe/shared/github/allowed-users";
|
||||
import { HumanMessage } from "@langchain/core/messages";
|
||||
import { ManagerGraphUpdate } from "@open-swe/shared/open-swe/manager/types";
|
||||
import { ManagerGraphUpdate } from "@openswe/shared/open-swe/manager/types";
|
||||
import { RequestSource } from "../../constants.js";
|
||||
import { getOpenSweAppUrl } from "../../utils/url-helpers.js";
|
||||
import { createRunFromWebhook, createDevMetadataComment } from "./utils.js";
|
||||
import { GraphConfig } from "@open-swe/shared/open-swe/types";
|
||||
import { GraphConfig } from "@openswe/shared/open-swe/types";
|
||||
import { Octokit } from "@octokit/core";
|
||||
|
||||
export interface WebhookHandlerContext {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import {
|
|||
verifyGithubUser,
|
||||
GithubUser,
|
||||
verifyGithubUserId,
|
||||
} from "@open-swe/shared/github/verify-user";
|
||||
} from "@openswe/shared/github/verify-user";
|
||||
import {
|
||||
GITHUB_INSTALLATION_ID,
|
||||
GITHUB_INSTALLATION_NAME,
|
||||
|
|
@ -12,8 +12,8 @@ import {
|
|||
GITHUB_USER_ID_HEADER,
|
||||
GITHUB_USER_LOGIN_HEADER,
|
||||
LOCAL_MODE_HEADER,
|
||||
} from "@open-swe/shared/constants";
|
||||
import { decryptSecret } from "@open-swe/shared/crypto";
|
||||
} from "@openswe/shared/constants";
|
||||
import { decryptSecret } from "@openswe/shared/crypto";
|
||||
import { verifyGitHubWebhookOrThrow } from "./github.js";
|
||||
import { createWithOwnerMetadata, createOwnerFilter } from "./utils.js";
|
||||
import { LANGGRAPH_USER_PERMISSIONS } from "../constants.js";
|
||||
|
|
|
|||
|
|
@ -1,17 +1,17 @@
|
|||
import { tool } from "@langchain/core/tools";
|
||||
import { applyPatch } from "diff";
|
||||
import { GraphState, GraphConfig } from "@open-swe/shared/open-swe/types";
|
||||
import { GraphState, GraphConfig } from "@openswe/shared/open-swe/types";
|
||||
import { readFile, writeFile } from "../utils/read-write.js";
|
||||
import { fixGitPatch } from "../utils/diff.js";
|
||||
import { createLogger, LogLevel } from "../utils/logger.js";
|
||||
import { createApplyPatchToolFields } from "@open-swe/shared/open-swe/tools";
|
||||
import { getRepoAbsolutePath } from "@open-swe/shared/git";
|
||||
import { createApplyPatchToolFields } from "@openswe/shared/open-swe/tools";
|
||||
import { getRepoAbsolutePath } from "@openswe/shared/git";
|
||||
import { getSandboxSessionOrThrow } from "./utils/get-sandbox-id.js";
|
||||
import { Sandbox } from "@daytonaio/sdk";
|
||||
import {
|
||||
isLocalMode,
|
||||
getLocalWorkingDirectory,
|
||||
} from "@open-swe/shared/open-swe/local-mode";
|
||||
} from "@openswe/shared/open-swe/local-mode";
|
||||
import { createShellExecutor } from "../utils/shell-executor/shell-executor.js";
|
||||
import { join } from "path";
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { Sandbox } from "@daytonaio/sdk";
|
||||
import { readFile, writeFile } from "../../utils/read-write.js";
|
||||
import { getSandboxErrorFields } from "../../utils/sandbox-error-fields.js";
|
||||
import { GraphConfig } from "@open-swe/shared/open-swe/types";
|
||||
import { GraphConfig } from "@openswe/shared/open-swe/types";
|
||||
import { createShellExecutor } from "../../utils/shell-executor/index.js";
|
||||
|
||||
interface ViewCommandInputs {
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import { join } from "path";
|
||||
import { tool } from "@langchain/core/tools";
|
||||
import { GraphState, GraphConfig } from "@open-swe/shared/open-swe/types";
|
||||
import { GraphState, GraphConfig } from "@openswe/shared/open-swe/types";
|
||||
import { createLogger, LogLevel } from "../../utils/logger.js";
|
||||
import { getRepoAbsolutePath } from "@open-swe/shared/git";
|
||||
import { getRepoAbsolutePath } from "@openswe/shared/git";
|
||||
import { getSandboxSessionOrThrow } from "../utils/get-sandbox-id.js";
|
||||
import { createTextEditorToolFields } from "@open-swe/shared/open-swe/tools";
|
||||
import { createTextEditorToolFields } from "@openswe/shared/open-swe/tools";
|
||||
import {
|
||||
handleViewCommand,
|
||||
handleStrReplaceCommand,
|
||||
|
|
@ -14,8 +14,8 @@ import {
|
|||
import {
|
||||
isLocalMode,
|
||||
getLocalWorkingDirectory,
|
||||
} from "@open-swe/shared/open-swe/local-mode";
|
||||
import { TIMEOUT_SEC } from "@open-swe/shared/constants";
|
||||
} from "@openswe/shared/open-swe/local-mode";
|
||||
import { TIMEOUT_SEC } from "@openswe/shared/constants";
|
||||
import { getLocalShellExecutor } from "../../utils/shell-executor/index.js";
|
||||
|
||||
const logger = createLogger(LogLevel.INFO, "TextEditorTool");
|
||||
|
|
|
|||
|
|
@ -1,16 +1,16 @@
|
|||
import { join } from "path";
|
||||
import { tool } from "@langchain/core/tools";
|
||||
import { GraphState, GraphConfig } from "@open-swe/shared/open-swe/types";
|
||||
import { GraphState, GraphConfig } from "@openswe/shared/open-swe/types";
|
||||
import { createLogger, LogLevel } from "../../utils/logger.js";
|
||||
import { getRepoAbsolutePath } from "@open-swe/shared/git";
|
||||
import { getRepoAbsolutePath } from "@openswe/shared/git";
|
||||
import { getSandboxSessionOrThrow } from "../utils/get-sandbox-id.js";
|
||||
import { createViewToolFields } from "@open-swe/shared/open-swe/tools";
|
||||
import { createViewToolFields } from "@openswe/shared/open-swe/tools";
|
||||
import { handleViewCommand } from "./handlers.js";
|
||||
import {
|
||||
isLocalMode,
|
||||
getLocalWorkingDirectory,
|
||||
} from "@open-swe/shared/open-swe/local-mode";
|
||||
import { TIMEOUT_SEC } from "@open-swe/shared/constants";
|
||||
} from "@openswe/shared/open-swe/local-mode";
|
||||
import { TIMEOUT_SEC } from "@openswe/shared/constants";
|
||||
import { createShellExecutor } from "../../utils/shell-executor/index.js";
|
||||
|
||||
const logger = createLogger(LogLevel.INFO, "ViewTool");
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import { tool } from "@langchain/core/tools";
|
||||
import { z } from "zod";
|
||||
import { loadModel } from "../utils/llms/index.js";
|
||||
import { GraphConfig } from "@open-swe/shared/open-swe/types";
|
||||
import { GraphConfig } from "@openswe/shared/open-swe/types";
|
||||
import { createLogger, LogLevel } from "../utils/logger.js";
|
||||
import { LLMTask } from "@open-swe/shared/open-swe/llm-task";
|
||||
import { LLMTask } from "@openswe/shared/open-swe/llm-task";
|
||||
|
||||
const logger = createLogger(LogLevel.INFO, "CommandSafetyEvaluator");
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import path from "path";
|
||||
import { tool } from "@langchain/core/tools";
|
||||
import { createWriteDefaultTsConfigToolFields } from "@open-swe/shared/open-swe/tools";
|
||||
import { GraphConfig, GraphState } from "@open-swe/shared/open-swe/types";
|
||||
import { createWriteDefaultTsConfigToolFields } from "@openswe/shared/open-swe/tools";
|
||||
import { GraphConfig, GraphState } from "@openswe/shared/open-swe/types";
|
||||
import { createShellExecutor } from "../utils/shell-executor/index.js";
|
||||
import { TIMEOUT_SEC } from "@open-swe/shared/constants";
|
||||
import { TIMEOUT_SEC } from "@openswe/shared/constants";
|
||||
import { getSandboxErrorFields } from "../utils/sandbox-error-fields.js";
|
||||
|
||||
const DEFAULT_TS_CONFIG = {
|
||||
|
|
|
|||
|
|
@ -1,17 +1,17 @@
|
|||
import { tool } from "@langchain/core/tools";
|
||||
import { GraphState, GraphConfig } from "@open-swe/shared/open-swe/types";
|
||||
import { GraphState, GraphConfig } from "@openswe/shared/open-swe/types";
|
||||
import { getSandboxErrorFields } from "../utils/sandbox-error-fields.js";
|
||||
import { createLogger, LogLevel } from "../utils/logger.js";
|
||||
import { TIMEOUT_SEC } from "@open-swe/shared/constants";
|
||||
import { getRepoAbsolutePath } from "@open-swe/shared/git";
|
||||
import { TIMEOUT_SEC } from "@openswe/shared/constants";
|
||||
import { getRepoAbsolutePath } from "@openswe/shared/git";
|
||||
import {
|
||||
isLocalMode,
|
||||
getLocalWorkingDirectory,
|
||||
} from "@open-swe/shared/open-swe/local-mode";
|
||||
} from "@openswe/shared/open-swe/local-mode";
|
||||
import {
|
||||
createGrepToolFields,
|
||||
formatGrepCommand,
|
||||
} from "@open-swe/shared/open-swe/tools";
|
||||
} from "@openswe/shared/open-swe/tools";
|
||||
import { createShellExecutor } from "../utils/shell-executor/index.js";
|
||||
import { wrapScript } from "../utils/wrap-script.js";
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ export {
|
|||
createUpdatePlanToolFields,
|
||||
createSessionPlanToolFields,
|
||||
createRequestHumanHelpToolFields,
|
||||
} from "@open-swe/shared/open-swe/tools";
|
||||
} from "@openswe/shared/open-swe/tools";
|
||||
export * from "./grep.js";
|
||||
export * from "./install-dependencies.js";
|
||||
export * from "./default-tsconfig.js";
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
import { tool } from "@langchain/core/tools";
|
||||
import { GraphState, GraphConfig } from "@open-swe/shared/open-swe/types";
|
||||
import { GraphState, GraphConfig } from "@openswe/shared/open-swe/types";
|
||||
import { getSandboxErrorFields } from "../utils/sandbox-error-fields.js";
|
||||
import { createLogger, LogLevel } from "../utils/logger.js";
|
||||
import { TIMEOUT_SEC } from "@open-swe/shared/constants";
|
||||
import { createInstallDependenciesToolFields } from "@open-swe/shared/open-swe/tools";
|
||||
import { getRepoAbsolutePath } from "@open-swe/shared/git";
|
||||
import { TIMEOUT_SEC } from "@openswe/shared/constants";
|
||||
import { createInstallDependenciesToolFields } from "@openswe/shared/open-swe/tools";
|
||||
import { getRepoAbsolutePath } from "@openswe/shared/git";
|
||||
import { getSandboxSessionOrThrow } from "./utils/get-sandbox-id.js";
|
||||
import { createShellExecutor } from "../utils/shell-executor/index.js";
|
||||
import { isLocalMode } from "@open-swe/shared/open-swe/local-mode";
|
||||
import { isLocalMode } from "@openswe/shared/open-swe/local-mode";
|
||||
|
||||
const logger = createLogger(LogLevel.INFO, "InstallDependenciesTool");
|
||||
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@ import {
|
|||
createReplyToCommentToolFields,
|
||||
createReplyToReviewCommentToolFields,
|
||||
createReplyToReviewToolFields,
|
||||
} from "@open-swe/shared/open-swe/tools";
|
||||
} from "@openswe/shared/open-swe/tools";
|
||||
import { getGitHubTokensFromConfig } from "../utils/github-tokens.js";
|
||||
import { GraphConfig, GraphState } from "@open-swe/shared/open-swe/types";
|
||||
import { GraphConfig, GraphState } from "@openswe/shared/open-swe/types";
|
||||
import {
|
||||
quoteReplyToPullRequestComment,
|
||||
quoteReplyToReview,
|
||||
|
|
@ -13,7 +13,7 @@ import {
|
|||
} from "../utils/github/api.js";
|
||||
import { getRecentUserRequest } from "../utils/user-request.js";
|
||||
import { RequestSource } from "../constants.js";
|
||||
import { GITHUB_USER_LOGIN_HEADER } from "@open-swe/shared/constants";
|
||||
import { GITHUB_USER_LOGIN_HEADER } from "@openswe/shared/constants";
|
||||
|
||||
export function shouldIncludeReviewCommentTool(
|
||||
state: GraphState,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { tool } from "@langchain/core/tools";
|
||||
import { createScratchpadFields } from "@open-swe/shared/open-swe/tools";
|
||||
import { createScratchpadFields } from "@openswe/shared/open-swe/tools";
|
||||
|
||||
export function createScratchpadTool(whenMessage: string) {
|
||||
const scratchpadTool = tool(
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
import { tool } from "@langchain/core/tools";
|
||||
import { createLogger, LogLevel } from "../../utils/logger.js";
|
||||
import { createSearchDocumentForToolFields } from "@open-swe/shared/open-swe/tools";
|
||||
import { createSearchDocumentForToolFields } from "@openswe/shared/open-swe/tools";
|
||||
import { FireCrawlLoader } from "@langchain/community/document_loaders/web/firecrawl";
|
||||
import { loadModel } from "../../utils/llms/index.js";
|
||||
import { LLMTask } from "@open-swe/shared/open-swe/llm-task";
|
||||
import { GraphConfig, GraphState } from "@open-swe/shared/open-swe/types";
|
||||
import { getMessageContentString } from "@open-swe/shared/messages";
|
||||
import { LLMTask } from "@openswe/shared/open-swe/llm-task";
|
||||
import { GraphConfig, GraphState } from "@openswe/shared/open-swe/types";
|
||||
import { getMessageContentString } from "@openswe/shared/messages";
|
||||
import { DOCUMENT_SEARCH_PROMPT } from "./prompt.js";
|
||||
import { parseUrl } from "../../utils/url-parser.js";
|
||||
import { z } from "zod";
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { tool } from "@langchain/core/tools";
|
||||
import { GraphState, GraphConfig } from "@open-swe/shared/open-swe/types";
|
||||
import { GraphState, GraphConfig } from "@openswe/shared/open-swe/types";
|
||||
import { getSandboxErrorFields } from "../utils/sandbox-error-fields.js";
|
||||
import { TIMEOUT_SEC } from "@open-swe/shared/constants";
|
||||
import { createShellToolFields } from "@open-swe/shared/open-swe/tools";
|
||||
import { TIMEOUT_SEC } from "@openswe/shared/constants";
|
||||
import { createShellToolFields } from "@openswe/shared/open-swe/tools";
|
||||
import { createShellExecutor } from "../utils/shell-executor/index.js";
|
||||
|
||||
const DEFAULT_ENV = {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { tool } from "@langchain/core/tools";
|
||||
import { createLogger, LogLevel } from "../utils/logger.js";
|
||||
import { createGetURLContentToolFields } from "@open-swe/shared/open-swe/tools";
|
||||
import { createGetURLContentToolFields } from "@openswe/shared/open-swe/tools";
|
||||
import { FireCrawlLoader } from "@langchain/community/document_loaders/web/firecrawl";
|
||||
import { GraphState } from "@open-swe/shared/open-swe/types";
|
||||
import { GraphState } from "@openswe/shared/open-swe/types";
|
||||
import { parseUrl } from "../utils/url-parser.js";
|
||||
|
||||
const logger = createLogger(LogLevel.INFO, "GetURLContentTool");
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { getCurrentTaskInput } from "@langchain/langgraph";
|
||||
import { GraphState } from "@open-swe/shared/open-swe/types";
|
||||
import { GraphState } from "@openswe/shared/open-swe/types";
|
||||
import { createLogger, LogLevel } from "../../utils/logger.js";
|
||||
import { daytonaClient } from "../../utils/sandbox.js";
|
||||
import { Sandbox } from "@daytonaio/sdk";
|
||||
|
|
|
|||
|
|
@ -9,9 +9,9 @@ import {
|
|||
MessageContent,
|
||||
ToolMessage,
|
||||
} from "@langchain/core/messages";
|
||||
import { CacheMetrics, ModelTokenData } from "@open-swe/shared/open-swe/types";
|
||||
import { CacheMetrics, ModelTokenData } from "@openswe/shared/open-swe/types";
|
||||
import { createLogger, LogLevel } from "./logger.js";
|
||||
import { calculateCostSavings } from "@open-swe/shared/caching";
|
||||
import { calculateCostSavings } from "@openswe/shared/caching";
|
||||
|
||||
const logger = createLogger(LogLevel.INFO, "Caching");
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { createLogger, LogLevel } from "./logger.js";
|
||||
import { createCommandSafetyEvaluator } from "../tools/command-safety-evaluator.js";
|
||||
import { GraphConfig } from "@open-swe/shared/open-swe/types";
|
||||
import { GraphConfig } from "@openswe/shared/open-swe/types";
|
||||
import {
|
||||
formatGrepCommand,
|
||||
formatShellCommand,
|
||||
|
|
@ -14,7 +14,7 @@ import {
|
|||
createSearchDocumentForToolFields,
|
||||
createGetURLContentToolFields,
|
||||
createTextEditorToolFields,
|
||||
} from "@open-swe/shared/open-swe/tools";
|
||||
} from "@openswe/shared/open-swe/tools";
|
||||
import { ToolCall } from "@langchain/core/messages/tool";
|
||||
import { z } from "zod";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { PlanItem } from "@open-swe/shared/open-swe/types";
|
||||
import { PlanItem } from "@openswe/shared/open-swe/types";
|
||||
|
||||
export function getCurrentPlanItem(plan: PlanItem[]): PlanItem {
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
import { CustomRules } from "@open-swe/shared/open-swe/types";
|
||||
import { CustomRules } from "@openswe/shared/open-swe/types";
|
||||
import { Sandbox } from "@daytonaio/sdk";
|
||||
import { createLogger, LogLevel } from "./logger.js";
|
||||
import { getSandboxErrorFields } from "./sandbox-error-fields.js";
|
||||
import {
|
||||
isLocalMode,
|
||||
getLocalWorkingDirectory,
|
||||
} from "@open-swe/shared/open-swe/local-mode";
|
||||
} from "@openswe/shared/open-swe/local-mode";
|
||||
import { promises as fs } from "fs";
|
||||
import { join } from "path";
|
||||
import { GraphConfig } from "@open-swe/shared/open-swe/types";
|
||||
import { GraphConfig } from "@openswe/shared/open-swe/types";
|
||||
import { createShellExecutor } from "./shell-executor/shell-executor.js";
|
||||
|
||||
const logger = createLogger(LogLevel.INFO, "CustomRules");
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { GraphConfig } from "@open-swe/shared/open-swe/types";
|
||||
import { GraphConfig } from "@openswe/shared/open-swe/types";
|
||||
import {
|
||||
GITHUB_INSTALLATION_TOKEN_COOKIE,
|
||||
GITHUB_TOKEN_COOKIE,
|
||||
|
|
@ -7,7 +7,7 @@ import {
|
|||
GITHUB_INSTALLATION_NAME,
|
||||
GITHUB_PAT,
|
||||
GITHUB_INSTALLATION_ID,
|
||||
} from "@open-swe/shared/constants";
|
||||
} from "@openswe/shared/constants";
|
||||
|
||||
export function getDefaultHeaders(config: GraphConfig): Record<string, string> {
|
||||
const githubPat = config.configurable?.[GITHUB_PAT];
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { Sandbox } from "@daytonaio/sdk";
|
||||
import { createLogger, LogLevel } from "./logger.js";
|
||||
import { TIMEOUT_SEC } from "@open-swe/shared/constants";
|
||||
import { TIMEOUT_SEC } from "@openswe/shared/constants";
|
||||
|
||||
const logger = createLogger(LogLevel.INFO, "EnvSetup");
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { GITHUB_PAT } from "@open-swe/shared/constants";
|
||||
import { decryptSecret } from "@open-swe/shared/crypto";
|
||||
import { GITHUB_PAT } from "@openswe/shared/constants";
|
||||
import { decryptSecret } from "@openswe/shared/crypto";
|
||||
|
||||
/**
|
||||
* Simple helper to check if request has GitHub PAT and return decrypted value
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@ import {
|
|||
GITHUB_TOKEN_COOKIE,
|
||||
GITHUB_INSTALLATION_TOKEN_COOKIE,
|
||||
GITHUB_INSTALLATION_ID,
|
||||
} from "@open-swe/shared/constants";
|
||||
import { GraphConfig } from "@open-swe/shared/open-swe/types";
|
||||
import { decryptSecret } from "@open-swe/shared/crypto";
|
||||
} from "@openswe/shared/constants";
|
||||
import { GraphConfig } from "@openswe/shared/open-swe/types";
|
||||
import { decryptSecret } from "@openswe/shared/crypto";
|
||||
import { getGitHubPatFromConfig } from "./github-pat.js";
|
||||
|
||||
export function getGitHubTokensFromConfig(config: GraphConfig): {
|
||||
|
|
|
|||
|
|
@ -10,11 +10,11 @@ import {
|
|||
GitHubReviewComment,
|
||||
} from "./types.js";
|
||||
import { getOpenSWELabel } from "./label.js";
|
||||
import { getInstallationToken } from "@open-swe/shared/github/auth";
|
||||
import { getInstallationToken } from "@openswe/shared/github/auth";
|
||||
import { getConfig } from "@langchain/langgraph";
|
||||
import { GITHUB_INSTALLATION_ID } from "@open-swe/shared/constants";
|
||||
import { GITHUB_INSTALLATION_ID } from "@openswe/shared/constants";
|
||||
import { updateConfig } from "../update-config.js";
|
||||
import { encryptSecret } from "@open-swe/shared/crypto";
|
||||
import { encryptSecret } from "@openswe/shared/crypto";
|
||||
|
||||
const logger = createLogger(LogLevel.INFO, "GitHub-API");
|
||||
|
||||
|
|
|
|||
|
|
@ -4,22 +4,22 @@ import {
|
|||
GraphConfig,
|
||||
TargetRepository,
|
||||
TaskPlan,
|
||||
} from "@open-swe/shared/open-swe/types";
|
||||
import { TIMEOUT_SEC } from "@open-swe/shared/constants";
|
||||
} from "@openswe/shared/open-swe/types";
|
||||
import { TIMEOUT_SEC } from "@openswe/shared/constants";
|
||||
import { getSandboxErrorFields } from "../sandbox-error-fields.js";
|
||||
import { getRepoAbsolutePath } from "@open-swe/shared/git";
|
||||
import { getRepoAbsolutePath } from "@openswe/shared/git";
|
||||
import { ExecuteResponse } from "@daytonaio/sdk/src/types/ExecuteResponse.js";
|
||||
import { withRetry } from "../retry.js";
|
||||
import {
|
||||
addPullRequestNumberToActiveTask,
|
||||
getActiveTask,
|
||||
getPullRequestNumberFromActiveTask,
|
||||
} from "@open-swe/shared/open-swe/tasks";
|
||||
} from "@openswe/shared/open-swe/tasks";
|
||||
import { createPullRequest, getBranch } from "./api.js";
|
||||
import { addTaskPlanToIssue } from "./issue-task.js";
|
||||
import { DEFAULT_EXCLUDED_PATTERNS } from "./constants.js";
|
||||
import { escapeRegExp } from "../string-utils.js";
|
||||
import { isLocalMode } from "@open-swe/shared/open-swe/local-mode";
|
||||
import { isLocalMode } from "@openswe/shared/open-swe/local-mode";
|
||||
import { createShellExecutor } from "../shell-executor/index.js";
|
||||
import { shouldCreateIssue } from "../should-create-issue.js";
|
||||
|
||||
|
|
|
|||
|
|
@ -6,10 +6,10 @@ import {
|
|||
} from "@langchain/core/messages";
|
||||
import { GitHubIssue, GitHubIssueComment } from "./types.js";
|
||||
import { getIssue, getIssueComments } from "./api.js";
|
||||
import { GraphConfig, TargetRepository } from "@open-swe/shared/open-swe/types";
|
||||
import { GraphConfig, TargetRepository } from "@openswe/shared/open-swe/types";
|
||||
import { getGitHubTokensFromConfig } from "../github-tokens.js";
|
||||
import { DETAILS_CLOSE_TAG, DETAILS_OPEN_TAG } from "./issue-task.js";
|
||||
import { isLocalMode } from "@open-swe/shared/open-swe/local-mode";
|
||||
import { isLocalMode } from "@openswe/shared/open-swe/local-mode";
|
||||
|
||||
export function getUntrackedComments(
|
||||
existingMessages: BaseMessage[],
|
||||
|
|
|
|||
|
|
@ -2,11 +2,11 @@ import {
|
|||
GraphConfig,
|
||||
TargetRepository,
|
||||
TaskPlan,
|
||||
} from "@open-swe/shared/open-swe/types";
|
||||
} from "@openswe/shared/open-swe/types";
|
||||
import { getIssue, updateIssue } from "./api.js";
|
||||
import { getGitHubTokensFromConfig } from "../github-tokens.js";
|
||||
import { createLogger, LogLevel } from "../logger.js";
|
||||
import { isLocalMode } from "@open-swe/shared/open-swe/local-mode";
|
||||
import { isLocalMode } from "@openswe/shared/open-swe/local-mode";
|
||||
const logger = createLogger(LogLevel.INFO, "IssueTaskString");
|
||||
|
||||
export const TASK_OPEN_TAG = "<open-swe-do-not-edit-task-plan>";
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { GraphConfig } from "@open-swe/shared/open-swe/types";
|
||||
import { GraphConfig } from "@openswe/shared/open-swe/types";
|
||||
import { getGitHubTokensFromConfig } from "../github-tokens.js";
|
||||
import {
|
||||
createIssueComment,
|
||||
|
|
@ -6,7 +6,7 @@ import {
|
|||
updateIssueComment,
|
||||
} from "./api.js";
|
||||
import { createLogger, LogLevel } from "../logger.js";
|
||||
import { isLocalMode } from "@open-swe/shared/open-swe/local-mode";
|
||||
import { isLocalMode } from "@openswe/shared/open-swe/local-mode";
|
||||
|
||||
const logger = createLogger(LogLevel.INFO, "GitHubPlan");
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { encryptSecret } from "@open-swe/shared/crypto";
|
||||
import { getInstallationToken } from "@open-swe/shared/github/auth";
|
||||
import { encryptSecret } from "@openswe/shared/crypto";
|
||||
import { getInstallationToken } from "@openswe/shared/github/auth";
|
||||
|
||||
export async function regenerateInstallationToken(
|
||||
installationId: string | undefined,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { GraphConfig } from "@open-swe/shared/open-swe/types";
|
||||
import { GraphConfig } from "@openswe/shared/open-swe/types";
|
||||
import { getModelManager, Provider } from "./model-manager.js";
|
||||
import { FallbackRunnable } from "../runtime-fallback.js";
|
||||
import { BindToolsInput } from "@langchain/core/language_models/chat_models";
|
||||
|
|
@ -6,7 +6,7 @@ import { BaseMessageLike } from "@langchain/core/messages";
|
|||
import {
|
||||
LLMTask,
|
||||
TASK_TO_CONFIG_DEFAULTS_MAP,
|
||||
} from "@open-swe/shared/open-swe/llm-task";
|
||||
} from "@openswe/shared/open-swe/llm-task";
|
||||
|
||||
export async function loadModel(
|
||||
config: GraphConfig,
|
||||
|
|
|
|||
|
|
@ -2,15 +2,15 @@ import {
|
|||
ConfigurableModel,
|
||||
initChatModel,
|
||||
} from "langchain/chat_models/universal";
|
||||
import { GraphConfig } from "@open-swe/shared/open-swe/types";
|
||||
import { GraphConfig } from "@openswe/shared/open-swe/types";
|
||||
import { createLogger, LogLevel } from "../logger.js";
|
||||
import {
|
||||
LLMTask,
|
||||
TASK_TO_CONFIG_DEFAULTS_MAP,
|
||||
} from "@open-swe/shared/open-swe/llm-task";
|
||||
import { isAllowedUser } from "@open-swe/shared/github/allowed-users";
|
||||
import { decryptSecret } from "@open-swe/shared/crypto";
|
||||
import { API_KEY_REQUIRED_MESSAGE } from "@open-swe/shared/constants";
|
||||
} from "@openswe/shared/open-swe/llm-task";
|
||||
import { isAllowedUser } from "@openswe/shared/github/allowed-users";
|
||||
import { decryptSecret } from "@openswe/shared/crypto";
|
||||
import { API_KEY_REQUIRED_MESSAGE } from "@openswe/shared/constants";
|
||||
|
||||
const logger = createLogger(LogLevel.INFO, "ModelManager");
|
||||
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
import { MultiServerMCPClient } from "@langchain/mcp-adapters";
|
||||
import type { StructuredToolInterface } from "@langchain/core/tools";
|
||||
import { GraphConfig } from "@open-swe/shared/open-swe/types";
|
||||
import { GraphConfig } from "@openswe/shared/open-swe/types";
|
||||
import {
|
||||
McpServerConfig,
|
||||
McpServerConfigSchema,
|
||||
McpServers,
|
||||
} from "@open-swe/shared/open-swe/mcp";
|
||||
} from "@openswe/shared/open-swe/mcp";
|
||||
import { createLogger, LogLevel } from "./logger.js";
|
||||
import { DEFAULT_MCP_SERVERS } from "@open-swe/shared/constants";
|
||||
import { DEFAULT_MCP_SERVERS } from "@openswe/shared/constants";
|
||||
|
||||
const logger = createLogger(LogLevel.INFO, "MCP Client");
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import { GraphConfig } from "@open-swe/shared/open-swe/types";
|
||||
import { GraphConfig } from "@openswe/shared/open-swe/types";
|
||||
import { loadModel } from "../llms/index.js";
|
||||
import { LLMTask } from "@open-swe/shared/open-swe/llm-task";
|
||||
import { LLMTask } from "@openswe/shared/open-swe/llm-task";
|
||||
import { createLogger, LogLevel } from "../logger.js";
|
||||
import { DOCUMENT_TOC_GENERATION_PROMPT } from "./prompt.js";
|
||||
import { getMessageContentString } from "@open-swe/shared/messages";
|
||||
import { getMessageContentString } from "@openswe/shared/messages";
|
||||
import { truncateOutput } from "../truncate-outputs.js";
|
||||
|
||||
const logger = createLogger(LogLevel.INFO, "McpOutputHandler");
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import {
|
|||
ToolMessage,
|
||||
} from "@langchain/core/messages";
|
||||
import { ToolCall } from "@langchain/core/messages/tool";
|
||||
import { getMessageContentString } from "@open-swe/shared/messages";
|
||||
import { getMessageContentString } from "@openswe/shared/messages";
|
||||
|
||||
export function getToolCallsString(toolCalls: ToolCall[] | undefined): string {
|
||||
if (!toolCalls?.length) return "";
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { v4 as uuidv4 } from "uuid";
|
||||
import { AIMessage, BaseMessage, ToolMessage } from "@langchain/core/messages";
|
||||
import { createOpenPrToolFields } from "@open-swe/shared/open-swe/tools";
|
||||
import { createOpenPrToolFields } from "@openswe/shared/open-swe/tools";
|
||||
import { z } from "zod";
|
||||
import { TargetRepository } from "@open-swe/shared/open-swe/types";
|
||||
import { TargetRepository } from "@openswe/shared/open-swe/types";
|
||||
|
||||
function constructPullRequestUrl(
|
||||
targetRepository: TargetRepository,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { PlanItem } from "@open-swe/shared/open-swe/types";
|
||||
import { PlanItem } from "@openswe/shared/open-swe/types";
|
||||
|
||||
export const PLAN_PROMPT = `<completed_tasks>
|
||||
{COMPLETED_TASKS}
|
||||
|
|
|
|||
|
|
@ -5,10 +5,10 @@ import { traceable } from "langsmith/traceable";
|
|||
import {
|
||||
isLocalMode,
|
||||
getLocalWorkingDirectory,
|
||||
} from "@open-swe/shared/open-swe/local-mode";
|
||||
} from "@openswe/shared/open-swe/local-mode";
|
||||
import { promises as fs } from "fs";
|
||||
import { join, isAbsolute } from "path";
|
||||
import { GraphConfig } from "@open-swe/shared/open-swe/types";
|
||||
import { GraphConfig } from "@openswe/shared/open-swe/types";
|
||||
import { createShellExecutor } from "./shell-executor/shell-executor.js";
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { BaseMessage, isAIMessage } from "@langchain/core/messages";
|
||||
import { createCodeReviewMarkTaskNotCompleteFields } from "@open-swe/shared/open-swe/tools";
|
||||
import { createCodeReviewMarkTaskNotCompleteFields } from "@openswe/shared/open-swe/tools";
|
||||
import { z } from "zod";
|
||||
|
||||
export function getCodeReviewFields(
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { GraphConfig } from "@open-swe/shared/open-swe/types";
|
||||
import { LLMTask } from "@open-swe/shared/open-swe/llm-task";
|
||||
import { GraphConfig } from "@openswe/shared/open-swe/types";
|
||||
import { LLMTask } from "@openswe/shared/open-swe/llm-task";
|
||||
import { ModelManager, Provider } from "./llms/model-manager.js";
|
||||
import { createLogger, LogLevel } from "./logger.js";
|
||||
import { Runnable, RunnableConfig } from "@langchain/core/runnables";
|
||||
|
|
@ -16,7 +16,7 @@ import {
|
|||
import { ChatResult, ChatGeneration } from "@langchain/core/outputs";
|
||||
import { BaseLanguageModelInput } from "@langchain/core/language_models/base";
|
||||
import { BindToolsInput } from "@langchain/core/language_models/chat_models";
|
||||
import { getMessageContentString } from "@open-swe/shared/messages";
|
||||
import { getMessageContentString } from "@openswe/shared/messages";
|
||||
import { getConfig } from "@langchain/langgraph";
|
||||
import { MODELS_NO_PARALLEL_TOOL_CALLING } from "./llms/load-model.js";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
import { Daytona, Sandbox, SandboxState } from "@daytonaio/sdk";
|
||||
import { createLogger, LogLevel } from "./logger.js";
|
||||
import { GraphConfig, TargetRepository } from "@open-swe/shared/open-swe/types";
|
||||
import { GraphConfig, TargetRepository } from "@openswe/shared/open-swe/types";
|
||||
import { DEFAULT_SANDBOX_CREATE_PARAMS } from "../constants.js";
|
||||
import { getGitHubTokensFromConfig } from "./github-tokens.js";
|
||||
import { cloneRepo } from "./github/git.js";
|
||||
import { FAILED_TO_GENERATE_TREE_MESSAGE, getCodebaseTree } from "./tree.js";
|
||||
import { isLocalMode } from "@open-swe/shared/open-swe/local-mode";
|
||||
import { isLocalMode } from "@openswe/shared/open-swe/local-mode";
|
||||
|
||||
const logger = createLogger(LogLevel.INFO, "Sandbox");
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import { Sandbox } from "@daytonaio/sdk";
|
||||
import { GraphConfig } from "@open-swe/shared/open-swe/types";
|
||||
import { TIMEOUT_SEC } from "@open-swe/shared/constants";
|
||||
import { GraphConfig } from "@openswe/shared/open-swe/types";
|
||||
import { TIMEOUT_SEC } from "@openswe/shared/constants";
|
||||
import {
|
||||
isLocalMode,
|
||||
getLocalWorkingDirectory,
|
||||
} from "@open-swe/shared/open-swe/local-mode";
|
||||
} from "@openswe/shared/open-swe/local-mode";
|
||||
import { getLocalShellExecutor } from "./local-shell-executor.js";
|
||||
import { createLogger, LogLevel } from "../logger.js";
|
||||
import { ExecuteCommandOptions, LocalExecuteResponse } from "./types.js";
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { GraphConfig } from "@open-swe/shared/open-swe/types";
|
||||
import { GraphConfig } from "@openswe/shared/open-swe/types";
|
||||
|
||||
export function shouldCreateIssue(config: GraphConfig): boolean {
|
||||
return config.configurable?.shouldCreateIssue !== false;
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue