Repository navigation
feat(workflows): add built-in chat tools for Workflows - #52
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
요약
채팅 봇이 사용자의 Workflows(사이드바 Workflows UI와 동일한
store/runner공유)를 조회·생성·수정·실행·취소·삭제할 수 있도록 내장 에이전트 도구 3개를 추가했습니다.workflow_info: 워크플로우 목록, 특정 워크플로우의 설정·그래프·검증 문제·최근 실행 목록, 특정 실행의 스텝별 상태·출력(4,000자 클립) 조회 (READ_ONLY_AGENT_TOOL_NAMES등록)workflow:create/update/run/cancel수행delete_workflow: 워크플로우 및 실행 이력 삭제설계 및 보안 경계
server/workflows/graph-spec.ts): 봇은 캔버스 좌표(x,y)·number·connectionid없이{ nodes, connections }형태로 읽고 씁니다.update시 기존id를 유지한 노드·연결은 위치·번호·ID를 보존하고, 새 노드만 depth별 열로 자동 배치합니다. 저장 전checkWorkflowGraph검증 실패 시 400 거부합니다.server/routes/internal-workflows.ts):guestDriven) 및 Team Cloud 비관리자(actsForAdmin === false)는 3개 엔드포인트 모두 403 거부(REST/api/workflows*의 admin-only 경계와 일치).create/update/run/cancel/delete_workflow모두 호출 봇의approvalLevel이내(levelWithin,custom은 fail-closed)일 때만 허용.update는 기존 권한과 병합 후 권한을 모두 검사해 하위 권한 봇의 변조·다운그레이드를 차단.create에서permission생략 시 호출 봇 권한에 맞춘 보수적 기본값(full→full,edits→edits, 그 외→ask) 적용.folder는""(워크플로우 전용 폴더) 또는realpathSync기준으로 호출 봇의 허용 작업 폴더(ctx.folders().roots) 내부 실존 디렉토리만 허용(심볼릭 링크 탈출 및~/.openmausbot임의 경로 지정 차단).run,update,delete_workflow는 409 거부,run시작 전assertWithinBudget검사.approval/decision대기 상태 응답 도구는 제공하지 않아 사람만 Workflows UI에서 승인/선택.server/workflows/store.ts):saveRun이 삭제된 워크플로우의 고아runs/<workflowId>디렉토리를 재생성하지 않도록 가드 추가.Before / After 증적
CORE_TOOLS)와 내부 도구 라우트에 워크플로우 도구가 없어 채팅에서 워크플로우 조회·생성·수정·실행·삭제가 불가능했고, UI(/api/workflows*)로만 조작 가능했습니다.pnpm -s typecheck통과pnpm -s lint(oxlint --deny-warnings) 통과pnpm -s vitest run server/agent-tool-policy.test.ts server/drivers/agents-bridge-wire.test.ts server/drivers/agents-catalog-wire.test.ts server/drivers/agents-claude-defer.test.ts server/drivers/agents-proxy.test.ts→ 5 test files, 325 passed (카탈로그 골든 스냅샷 갱신 포함)/tmp실시간 검증 스크립트(node --experimental-strip-types /tmp/verify-workflow-chat-tools.ts) 실행 결과ALL_SECURITY_AND_RACE_CHECKS_PASSED:WORKFLOWS_GUEST)·비관리자(WORKFLOWS_ADMIN) 403 차단dataDir·심볼릭 링크 탈출 400 차단, 허용 루트 내부 생성 200text→decision→approval→text) 생성·자동 배치 및update시 기존 노드 좌표/번호/연결 ID 보존edits봇의full워크플로우update(다운그레이드 포함)·delete·cancel403 차단,auto봇create기본값ask확인assertWithinBudget) 402 차단run→approval대기 → 중복run/실행 중update/delete409 →cancel→delete→ 삭제 후saveRun고아 디렉토리 미생성 확인