mirror of
https://github.com/Sea-Haven-Industries/open-swe.git
synced 2026-09-30 15:03:16 +00:00
* init repo-selector * add branch selector UI, extend GH hook w branch info * add reconnectOnMount: true resumeStream, remove repo description from selector, fix styling * styling repo + branch * udpate getBranch calls to include targetRepo arg * format * add search to repo + branch selectors * add settings icon link to /github for dev convenience * add default branch selection * format * minor cleanup * init task list UI demo * individual task component * tasks real data * task visual improvement * persisting tasks, navigate to thread onClick * task UI * TaskSidebar, Navigate to tasks * org tasks by thread * group by thread * improve sidebar, task-list, rm github modal on refresh * collapse sidebar works when viewing a thread * remove micro-tasks expansion from threads component, change taskId to taskIndex for persistence + simplicity * init config sidebar ui * open and close config sidebar * add ref for getAllTasks + add graph_id metadata * format * create threadItem component * format * add threadUtils * centralize + refactor types * format * improve thread status, realtime updates * fix scroll issue * remove temperature from config-sidebar * Change model via sidebar * fix flashing on updates * init plan UI * centralize types * self CR: refactoring, cleanup, remove comments, add todos * CR: clean comments + logs, fix repo selector bug * fix: Update example env file in web (#77) * disable auto scroll on pageload * reposelector: use default branch not main master * remove archived tab temp, default branch listed first in branchSelector dropdown * auto select first repo * improve status indicator * refactor status indicator * simplify status implementation to use Langgraph * util moved from provider to thread-utils * linting, improve task completion logic * feat: Support followup requests (#60) * feat: Support followup requests * cr * cr * fix * account for pr already exists * remove task provider * fix: Better prompting and context provided for codebase structure awareness (#85) * fix: Better prompting and context provided for codebase structure awareness * cr * linting + skeleton loader * fix: branch selector, add github api pagination * small branch update * update task completion status realtime * threadItem stream remove flashing/polling * feat: Create a shared package (#89) * feat: Create a shared package * formatting * fix: drop passing target repo to getBranchName * drop docs * use shared package for config fields in config sidebar * fix: styling and structure for repo/branch selectors * fix: use shared types/objects for config fields * default key for configs * fix: improved styling for threads * fix renering num tasks * disable repo branch selector when chat started * cr * cr * bump deps * fix: rendering plan in interrupt * cr * cr --------- Co-authored-by: Dylan Boudro <121908331+starmorph@users.noreply.github.com>
56 lines
1.4 KiB
TypeScript
56 lines
1.4 KiB
TypeScript
import { PlanItem } from "@open-swe/shared/open-swe/types";
|
|
import {
|
|
PLAN_INTERRUPT_ACTION_TITLE,
|
|
PLAN_INTERRUPT_DELIMITER,
|
|
} from "@open-swe/shared/constants";
|
|
|
|
/**
|
|
* Checks if the interrupt args contain plan data
|
|
*/
|
|
export function isPlanData(
|
|
args: Record<string, any>,
|
|
actionName: string,
|
|
): boolean {
|
|
return !!(
|
|
actionName === PLAN_INTERRUPT_ACTION_TITLE &&
|
|
args.plan &&
|
|
typeof args.plan === "string" &&
|
|
args.plan?.length > 0
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Parses plan data from interrupt args into PlanItem array
|
|
*/
|
|
export function parsePlanData(args: Record<string, any>): PlanItem[] {
|
|
if (!args.plan) return [];
|
|
if (typeof args.plan !== "string") return [];
|
|
if (!args.plan.includes(PLAN_INTERRUPT_DELIMITER)) {
|
|
// if args.plan is defined, but does not include the delimiter, it is a single plan item
|
|
return [
|
|
{
|
|
index: 0,
|
|
plan: args.plan,
|
|
completed: false,
|
|
summary: undefined,
|
|
},
|
|
];
|
|
}
|
|
const planItems = args.plan
|
|
.split(PLAN_INTERRUPT_DELIMITER)
|
|
.map((item: string, index: number) => ({
|
|
index,
|
|
plan: item,
|
|
completed: false,
|
|
summary: undefined,
|
|
}));
|
|
return planItems;
|
|
}
|
|
|
|
/**
|
|
* Gets the key name that contains plan data
|
|
*/
|
|
export function getPlanKey(args: Record<string, any>): string | null {
|
|
if (args.plan && typeof args.plan === "string") return "plan";
|
|
return null;
|
|
}
|